Showing 19 changed files with 26228 additions and 0 deletions
+2
css/bundle-dark-theme-f217d64d.css
... ...
@@ -0,0 +1,2 @@
1
+@font-face{font-family:icons;src:url(icons.eot-mfxpn4);src:url(icons.eot-iefix-mfxpn4) format("embedded-opentype"),url(icons.woff-mfxpn4) format("woff"),url(icons.ttf-mfxpn4) format("truetype"),url(icons.svg-mfxpn4) format("svg");font-weight:400;font-style:normal}.icon-fullscreen,.icon-settings,.icon-sync-scroll{display:inline-block;font-family:icons;speak:none;font-style:normal;font-weight:400;-webkit-font-feature-settings:normal;-moz-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-sync-scroll:before{content:"\e600"}.icon-fullscreen:before{content:"\e601"}.icon-settings:before{content:"\e602"}
2
+body,html{height:100%}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}div.full-height{overflow:auto}.fullscreen .hidden-when-fullscreen,.visible-when-fullscreen{display:none}.fullscreen .visible-when-fullscreen,.hidden-when-fullscreen{display:block}body{width:100%;margin:0;padding:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#ced0c2;overflow:hidden;background:#222}a{color:#ced0c2}h1,h2,h3,h4,h5,h6{line-height:1em}code,kbd,pre{background:#4b4b4b}code,kbd{padding:1px 5px}pre{padding:5px;overflow-x:auto;word-wrap:normal}pre .highlight{background:#5b5b5b}pre code{padding:0}blockquote{border-left:5px solid #4b4b4b;margin:1em 0;padding-left:10px}hr{border:0;border-top:1px solid #4b4b4b}table{border-collapse:collapse;border-spacing:0}table thead{border-bottom:2px solid #4b4b4b}table tbody tr:nth-child(2n){background-color:#333}table td,table th{padding:6px 13px;border:1px solid #4b4b4b}table th{font-weight:700}li p{margin:.5em 0}#left-column,#right-column{float:left;width:50%;height:100%}.wrapper{position:relative;padding:22px 0 20px 10px}#left-column .wrapper{border-right:1px solid #424241}#right-column .wrapper{padding-left:9px;border-left:1px solid #424241}.bottom-bar,.topbar{position:absolute;top:0;right:0;left:0}.bottom-bar{top:auto;bottom:0;padding-right:5px}.topbar .buttons-container{float:right}.topbar .buttons-container .button,.topbar .buttons-container .button-group{float:left}.topbar .buttons-container .button{height:18px;padding:2px 6px 0;line-height:18px;color:#ababab;text-decoration:none;font-size:11px;border-bottom:2px solid transparent;background:#424241}.topbar .buttons-container .button:active{background:#4b4b4b}.topbar .buttons-container .button.active{border-bottom-color:#5e5e5e}.topbar .buttons-container .button-group .button.switch{padding-left:3px;padding-right:3px}.topbar .buttons-container .button-group .button.switch:first-child{padding-left:6px}.topbar .buttons-container .button-group .button.switch:last-child{padding-right:6px}.topbar .buttons-container .button-group .button.switch:after{content:"/";position:relative;right:-4px}.topbar .buttons-container .button-group .button.switch:last-child:after{content:none}.topbar .buttons-container .button.icon-fullscreen,.topbar .buttons-container .button.icon-sync-scroll{width:22px;padding-left:0;padding-right:0;text-align:center}.topbar .buttons-container .button.icon-sync-scroll{width:18px}.topbar .buttons-container .button.icon-sync-scroll:before{display:inline-block;margin-top:1px}.topbar .buttons-container .button.icon-fullscreen{font-size:16px}.topbar .buttons-container .button.icon-settings{font-size:14px}.bottom-bar .word-count{float:right;height:20px;line-height:20px;font-size:11px;color:#ababab}#preview{word-wrap:break-word;line-height:normal}#html,#markdown{display:block;box-sizing:border-box;width:100%;resize:none;margin:0;padding:5px 0 0;border:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;color:#dee0d2;background-color:transparent}#html:focus,#markdown:focus{outline:0}#top_panels_container{max-height:100%;overflow-y:auto;overflow-x:hidden}#top_panels_container .top_panel{display:none;position:relative;padding:10px 20px;background:#424241;border-bottom:2px solid #424241}#top_panels_container .top_panel a{color:#ced0c2}#top_panels_container .top_panel .close{position:absolute;top:15px;right:15px;width:14px;height:14px;line-height:14px;font-size:14px;text-align:center;color:#aaa;cursor:pointer;border-radius:7px}#top_panels_container .top_panel .close:hover{color:#bbb;background:#5b5b5b}.top_panel .button{padding:5px 12px;background:#525251;border-radius:3px;cursor:pointer;text-decoration:none}.top_panel .button:active{background:#626261}.top_panel .button.is-disabled{background:#626261;opacity:.5;cursor:not-allowed}#quick-reference table,#quick-reference>p{font-size:12px;line-height:1.25em}#quick-reference table tr{background:0 0}#quick-reference table td{padding:1px 0;border:0}#quick-reference table td:first-child{cursor:pointer}#quick-reference table td:last-child{padding-left:20px}#quick-reference table td p,#quick-reference table td pre{margin:0}#quick-reference p{margin-bottom:0}#settings #decrease-font-size,#settings #increase-font-size{position:relative;padding:5px 9px 5px 19px;line-height:16px}#settings #decrease-font-size:before,#settings #increase-font-size:before{content:"A";position:absolute;top:5px;left:9px;height:16px;line-height:16px;font-family:monospace}#settings #decrease-font-size:before{font-size:13px}#settings #increase-font-size:before{font-size:17px}#settings #decrease-font-size:after{content:"-"}#settings #increase-font-size:after{content:"+"}#settings .theme-control .button{margin-left:10px;padding-left:5px;padding-right:5px}#settings .theme-control.theme-control-light{display:inline}#settings .theme-control.theme-control-dark{display:none}#settings label{padding-right:20px}.fullscreen #left-column,.fullscreen #right-column{float:none;width:100%}.fullscreen #left-column .wrapper{border-right-color:transparent}.fullscreen #right-column .wrapper{border-left-color:transparent}.fullscreen #html,.fullscreen #markdown{max-width:800px;margin:0 auto}::-webkit-scrollbar{width:16px;height:16px}::-webkit-scrollbar-button{width:0;height:0;display:none}::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-track{background-color:#424241}::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-track:vertical{border-left:2px solid transparent}::-webkit-scrollbar-thumb:horizontal,::-webkit-scrollbar-track:horizontal{border-top:2px solid transparent;border-bottom:2px solid transparent}::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#9e9e9e}::-webkit-scrollbar-thumb:vertical{min-height:28px}::-webkit-scrollbar-thumb:horizontal{min-width:28px}::-webkit-scrollbar-thumb:hover{background-color:#bababa}::-webkit-scrollbar-thumb:active{background-color:#c4c4c4}
+2
css/bundle-dark-theme-f217d64d.css.org
... ...
@@ -0,0 +1,2 @@
1
+@font-face{font-family:icons;src:url(../app-shared/fonts/icons/icons.eot?-mfxpn4);src:url(../app-shared/fonts/icons/icons.eot?#iefix-mfxpn4) format("embedded-opentype"),url(../app-shared/fonts/icons/icons.woff?-mfxpn4) format("woff"),url(../app-shared/fonts/icons/icons.ttf?-mfxpn4) format("truetype"),url(../app-shared/fonts/icons/icons.svg?-mfxpn4#icons) format("svg");font-weight:400;font-style:normal}.icon-fullscreen,.icon-settings,.icon-sync-scroll{display:inline-block;font-family:icons;speak:none;font-style:normal;font-weight:400;-webkit-font-feature-settings:normal;-moz-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-sync-scroll:before{content:"\e600"}.icon-fullscreen:before{content:"\e601"}.icon-settings:before{content:"\e602"}
2
+body,html{height:100%}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}div.full-height{overflow:auto}.fullscreen .hidden-when-fullscreen,.visible-when-fullscreen{display:none}.fullscreen .visible-when-fullscreen,.hidden-when-fullscreen{display:block}body{width:100%;margin:0;padding:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#ced0c2;overflow:hidden;background:#222}a{color:#ced0c2}h1,h2,h3,h4,h5,h6{line-height:1em}code,kbd,pre{background:#4b4b4b}code,kbd{padding:1px 5px}pre{padding:5px;overflow-x:auto;word-wrap:normal}pre .highlight{background:#5b5b5b}pre code{padding:0}blockquote{border-left:5px solid #4b4b4b;margin:1em 0;padding-left:10px}hr{border:0;border-top:1px solid #4b4b4b}table{border-collapse:collapse;border-spacing:0}table thead{border-bottom:2px solid #4b4b4b}table tbody tr:nth-child(2n){background-color:#333}table td,table th{padding:6px 13px;border:1px solid #4b4b4b}table th{font-weight:700}li p{margin:.5em 0}#left-column,#right-column{float:left;width:50%;height:100%}.wrapper{position:relative;padding:22px 0 20px 10px}#left-column .wrapper{border-right:1px solid #424241}#right-column .wrapper{padding-left:9px;border-left:1px solid #424241}.bottom-bar,.topbar{position:absolute;top:0;right:0;left:0}.bottom-bar{top:auto;bottom:0;padding-right:5px}.topbar .buttons-container{float:right}.topbar .buttons-container .button,.topbar .buttons-container .button-group{float:left}.topbar .buttons-container .button{height:18px;padding:2px 6px 0;line-height:18px;color:#ababab;text-decoration:none;font-size:11px;border-bottom:2px solid transparent;background:#424241}.topbar .buttons-container .button:active{background:#4b4b4b}.topbar .buttons-container .button.active{border-bottom-color:#5e5e5e}.topbar .buttons-container .button-group .button.switch{padding-left:3px;padding-right:3px}.topbar .buttons-container .button-group .button.switch:first-child{padding-left:6px}.topbar .buttons-container .button-group .button.switch:last-child{padding-right:6px}.topbar .buttons-container .button-group .button.switch:after{content:"/";position:relative;right:-4px}.topbar .buttons-container .button-group .button.switch:last-child:after{content:none}.topbar .buttons-container .button.icon-fullscreen,.topbar .buttons-container .button.icon-sync-scroll{width:22px;padding-left:0;padding-right:0;text-align:center}.topbar .buttons-container .button.icon-sync-scroll{width:18px}.topbar .buttons-container .button.icon-sync-scroll:before{display:inline-block;margin-top:1px}.topbar .buttons-container .button.icon-fullscreen{font-size:16px}.topbar .buttons-container .button.icon-settings{font-size:14px}.bottom-bar .word-count{float:right;height:20px;line-height:20px;font-size:11px;color:#ababab}#preview{word-wrap:break-word;line-height:normal}#html,#markdown{display:block;box-sizing:border-box;width:100%;resize:none;margin:0;padding:5px 0 0;border:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;color:#dee0d2;background-color:transparent}#html:focus,#markdown:focus{outline:0}#top_panels_container{max-height:100%;overflow-y:auto;overflow-x:hidden}#top_panels_container .top_panel{display:none;position:relative;padding:10px 20px;background:#424241;border-bottom:2px solid #424241}#top_panels_container .top_panel a{color:#ced0c2}#top_panels_container .top_panel .close{position:absolute;top:15px;right:15px;width:14px;height:14px;line-height:14px;font-size:14px;text-align:center;color:#aaa;cursor:pointer;border-radius:7px}#top_panels_container .top_panel .close:hover{color:#bbb;background:#5b5b5b}.top_panel .button{padding:5px 12px;background:#525251;border-radius:3px;cursor:pointer;text-decoration:none}.top_panel .button:active{background:#626261}.top_panel .button.is-disabled{background:#626261;opacity:.5;cursor:not-allowed}#quick-reference table,#quick-reference>p{font-size:12px;line-height:1.25em}#quick-reference table tr{background:0 0}#quick-reference table td{padding:1px 0;border:0}#quick-reference table td:first-child{cursor:pointer}#quick-reference table td:last-child{padding-left:20px}#quick-reference table td p,#quick-reference table td pre{margin:0}#quick-reference p{margin-bottom:0}#settings #decrease-font-size,#settings #increase-font-size{position:relative;padding:5px 9px 5px 19px;line-height:16px}#settings #decrease-font-size:before,#settings #increase-font-size:before{content:"A";position:absolute;top:5px;left:9px;height:16px;line-height:16px;font-family:monospace}#settings #decrease-font-size:before{font-size:13px}#settings #increase-font-size:before{font-size:17px}#settings #decrease-font-size:after{content:"-"}#settings #increase-font-size:after{content:"+"}#settings .theme-control .button{margin-left:10px;padding-left:5px;padding-right:5px}#settings .theme-control.theme-control-light{display:inline}#settings .theme-control.theme-control-dark{display:none}#settings label{padding-right:20px}.fullscreen #left-column,.fullscreen #right-column{float:none;width:100%}.fullscreen #left-column .wrapper{border-right-color:transparent}.fullscreen #right-column .wrapper{border-left-color:transparent}.fullscreen #html,.fullscreen #markdown{max-width:800px;margin:0 auto}::-webkit-scrollbar{width:16px;height:16px}::-webkit-scrollbar-button{width:0;height:0;display:none}::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-track{background-color:#424241}::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-track:vertical{border-left:2px solid transparent}::-webkit-scrollbar-thumb:horizontal,::-webkit-scrollbar-track:horizontal{border-top:2px solid transparent;border-bottom:2px solid transparent}::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#9e9e9e}::-webkit-scrollbar-thumb:vertical{min-height:28px}::-webkit-scrollbar-thumb:horizontal{min-width:28px}::-webkit-scrollbar-thumb:hover{background-color:#bababa}::-webkit-scrollbar-thumb:active{background-color:#c4c4c4}
+2
css/bundle-light-theme-a23557fd.css
... ...
@@ -0,0 +1,2 @@
1
+@font-face{font-family:icons;src:url(icons.eot-mfxpn4);src:url(icons.eot-iefix-mfxpn4) format("embedded-opentype"),url(icons.woff-mfxpn4) format("woff"),url(icons.ttf-mfxpn4) format("truetype"),url(icons.svg-mfxpn4) format("svg");font-weight:400;font-style:normal}.icon-fullscreen,.icon-settings,.icon-sync-scroll{display:inline-block;font-family:icons;speak:none;font-style:normal;font-weight:400;-webkit-font-feature-settings:normal;-moz-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-sync-scroll:before{content:"\e600"}.icon-fullscreen:before{content:"\e601"}.icon-settings:before{content:"\e602"}
2
+body,html{height:100%}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}div.full-height{overflow:auto}.fullscreen .hidden-when-fullscreen,.visible-when-fullscreen{display:none}.fullscreen .visible-when-fullscreen,.hidden-when-fullscreen{display:block}body{width:100%;margin:0;padding:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;overflow:hidden;background:#fff}a{color:null}h1,h2,h3,h4,h5,h6{line-height:1em}code,kbd,pre{background:#e7e7e7}code,kbd{padding:1px 5px}pre{padding:5px;overflow-x:auto;word-wrap:normal}pre .highlight{background:#d7d7d7}pre code{padding:0}blockquote{border-left:5px solid #e7e7e7;margin:1em 0;padding-left:10px}hr{border:0;border-top:1px solid #e7e7e7}table{border-collapse:collapse;border-spacing:0}table thead{border-bottom:2px solid #e7e7e7}table tbody tr:nth-child(2n){background-color:#f8f8f8}table td,table th{padding:6px 13px;border:1px solid #e7e7e7}table th{font-weight:700}li p{margin:.5em 0}#left-column,#right-column{float:left;width:50%;height:100%}.wrapper{position:relative;padding:22px 0 20px 10px}#left-column .wrapper{border-right:1px solid #f0f0f0}#right-column .wrapper{padding-left:9px;border-left:1px solid #f0f0f0}.bottom-bar,.topbar{position:absolute;top:0;right:0;left:0}.bottom-bar{top:auto;bottom:0;padding-right:5px}.topbar .buttons-container{float:right}.topbar .buttons-container .button,.topbar .buttons-container .button-group{float:left}.topbar .buttons-container .button{height:18px;padding:2px 6px 0;line-height:18px;color:#888;text-decoration:none;font-size:11px;border-bottom:2px solid transparent;background:#f0f0f0}.topbar .buttons-container .button:active{background:#e7e7e7}.topbar .buttons-container .button.active{border-bottom-color:#b5b5b5}.topbar .buttons-container .button-group .button.switch{padding-left:3px;padding-right:3px}.topbar .buttons-container .button-group .button.switch:first-child{padding-left:6px}.topbar .buttons-container .button-group .button.switch:last-child{padding-right:6px}.topbar .buttons-container .button-group .button.switch:after{content:"/";position:relative;right:-4px}.topbar .buttons-container .button-group .button.switch:last-child:after{content:none}.topbar .buttons-container .button.icon-fullscreen,.topbar .buttons-container .button.icon-sync-scroll{width:22px;padding-left:0;padding-right:0;text-align:center}.topbar .buttons-container .button.icon-sync-scroll{width:18px}.topbar .buttons-container .button.icon-sync-scroll:before{display:inline-block;margin-top:1px}.topbar .buttons-container .button.icon-fullscreen{font-size:16px}.topbar .buttons-container .button.icon-settings{font-size:14px}.bottom-bar .word-count{float:right;height:20px;line-height:20px;font-size:11px;color:#888}#preview{word-wrap:break-word;line-height:normal}#html,#markdown{display:block;box-sizing:border-box;width:100%;resize:none;margin:0;padding:5px 0 0;border:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;color:#111;background-color:transparent}#html:focus,#markdown:focus{outline:0}#top_panels_container{max-height:100%;overflow-y:auto;overflow-x:hidden}#top_panels_container .top_panel{display:none;position:relative;padding:10px 20px;background:#f0f0f0;border-bottom:2px solid #f0f0f0}#top_panels_container .top_panel a{color:#333}#top_panels_container .top_panel .close{position:absolute;top:15px;right:15px;width:14px;height:14px;line-height:14px;font-size:14px;text-align:center;color:#999;cursor:pointer;border-radius:7px}#top_panels_container .top_panel .close:hover{color:#777;background:#d7d7d7}.top_panel .button{padding:5px 12px;background:#e0e0e0;border-radius:3px;cursor:pointer;text-decoration:none}.top_panel .button:active{background:#d0d0d0}.top_panel .button.is-disabled{background:#d0d0d0;opacity:.5;cursor:not-allowed}#quick-reference table,#quick-reference>p{font-size:12px;line-height:1.25em}#quick-reference table tr{background:0 0}#quick-reference table td{padding:1px 0;border:0}#quick-reference table td:first-child{cursor:pointer}#quick-reference table td:last-child{padding-left:20px}#quick-reference table td p,#quick-reference table td pre{margin:0}#quick-reference p{margin-bottom:0}#settings #decrease-font-size,#settings #increase-font-size{position:relative;padding:5px 9px 5px 19px;line-height:16px}#settings #decrease-font-size:before,#settings #increase-font-size:before{content:"A";position:absolute;top:5px;left:9px;height:16px;line-height:16px;font-family:monospace}#settings #decrease-font-size:before{font-size:13px}#settings #increase-font-size:before{font-size:17px}#settings #decrease-font-size:after{content:"-"}#settings #increase-font-size:after{content:"+"}#settings .theme-control .button{margin-left:10px;padding-left:5px;padding-right:5px}#settings .theme-control.theme-control-light{display:none}#settings .theme-control.theme-control-dark{display:inline}#settings label{padding-right:20px}.fullscreen #left-column,.fullscreen #right-column{float:none;width:100%}.fullscreen #left-column .wrapper{border-right-color:transparent}.fullscreen #right-column .wrapper{border-left-color:transparent}.fullscreen #html,.fullscreen #markdown{max-width:800px;margin:0 auto}::-webkit-scrollbar{width:null;height:null}::-webkit-scrollbar-button{width:null;height:null;display:null}::-webkit-scrollbar-corner{background-color:null}::-webkit-scrollbar-track{background-color:null}::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-track:vertical{border-left:null}::-webkit-scrollbar-thumb:horizontal,::-webkit-scrollbar-track:horizontal{border-top:null;border-bottom:null}::-webkit-scrollbar-thumb{background-clip:null;background-color:null}::-webkit-scrollbar-thumb:vertical{min-height:null}::-webkit-scrollbar-thumb:horizontal{min-width:null}::-webkit-scrollbar-thumb:hover{background-color:null}::-webkit-scrollbar-thumb:active{background-color:null}
+2
css/bundle-light-theme-a23557fd.css.org
... ...
@@ -0,0 +1,2 @@
1
+@font-face{font-family:icons;src:url(../app-shared/fonts/icons/icons.eot?-mfxpn4);src:url(../app-shared/fonts/icons/icons.eot?#iefix-mfxpn4) format("embedded-opentype"),url(../app-shared/fonts/icons/icons.woff?-mfxpn4) format("woff"),url(../app-shared/fonts/icons/icons.ttf?-mfxpn4) format("truetype"),url(../app-shared/fonts/icons/icons.svg?-mfxpn4#icons) format("svg");font-weight:400;font-style:normal}.icon-fullscreen,.icon-settings,.icon-sync-scroll{display:inline-block;font-family:icons;speak:none;font-style:normal;font-weight:400;-webkit-font-feature-settings:normal;-moz-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-sync-scroll:before{content:"\e600"}.icon-fullscreen:before{content:"\e601"}.icon-settings:before{content:"\e602"}
2
+body,html{height:100%}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}div.full-height{overflow:auto}.fullscreen .hidden-when-fullscreen,.visible-when-fullscreen{display:none}.fullscreen .visible-when-fullscreen,.hidden-when-fullscreen{display:block}body{width:100%;margin:0;padding:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;overflow:hidden;background:#fff}a{color:null}h1,h2,h3,h4,h5,h6{line-height:1em}code,kbd,pre{background:#e7e7e7}code,kbd{padding:1px 5px}pre{padding:5px;overflow-x:auto;word-wrap:normal}pre .highlight{background:#d7d7d7}pre code{padding:0}blockquote{border-left:5px solid #e7e7e7;margin:1em 0;padding-left:10px}hr{border:0;border-top:1px solid #e7e7e7}table{border-collapse:collapse;border-spacing:0}table thead{border-bottom:2px solid #e7e7e7}table tbody tr:nth-child(2n){background-color:#f8f8f8}table td,table th{padding:6px 13px;border:1px solid #e7e7e7}table th{font-weight:700}li p{margin:.5em 0}#left-column,#right-column{float:left;width:50%;height:100%}.wrapper{position:relative;padding:22px 0 20px 10px}#left-column .wrapper{border-right:1px solid #f0f0f0}#right-column .wrapper{padding-left:9px;border-left:1px solid #f0f0f0}.bottom-bar,.topbar{position:absolute;top:0;right:0;left:0}.bottom-bar{top:auto;bottom:0;padding-right:5px}.topbar .buttons-container{float:right}.topbar .buttons-container .button,.topbar .buttons-container .button-group{float:left}.topbar .buttons-container .button{height:18px;padding:2px 6px 0;line-height:18px;color:#888;text-decoration:none;font-size:11px;border-bottom:2px solid transparent;background:#f0f0f0}.topbar .buttons-container .button:active{background:#e7e7e7}.topbar .buttons-container .button.active{border-bottom-color:#b5b5b5}.topbar .buttons-container .button-group .button.switch{padding-left:3px;padding-right:3px}.topbar .buttons-container .button-group .button.switch:first-child{padding-left:6px}.topbar .buttons-container .button-group .button.switch:last-child{padding-right:6px}.topbar .buttons-container .button-group .button.switch:after{content:"/";position:relative;right:-4px}.topbar .buttons-container .button-group .button.switch:last-child:after{content:none}.topbar .buttons-container .button.icon-fullscreen,.topbar .buttons-container .button.icon-sync-scroll{width:22px;padding-left:0;padding-right:0;text-align:center}.topbar .buttons-container .button.icon-sync-scroll{width:18px}.topbar .buttons-container .button.icon-sync-scroll:before{display:inline-block;margin-top:1px}.topbar .buttons-container .button.icon-fullscreen{font-size:16px}.topbar .buttons-container .button.icon-settings{font-size:14px}.bottom-bar .word-count{float:right;height:20px;line-height:20px;font-size:11px;color:#888}#preview{word-wrap:break-word;line-height:normal}#html,#markdown{display:block;box-sizing:border-box;width:100%;resize:none;margin:0;padding:5px 0 0;border:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;color:#111;background-color:transparent}#html:focus,#markdown:focus{outline:0}#top_panels_container{max-height:100%;overflow-y:auto;overflow-x:hidden}#top_panels_container .top_panel{display:none;position:relative;padding:10px 20px;background:#f0f0f0;border-bottom:2px solid #f0f0f0}#top_panels_container .top_panel a{color:#333}#top_panels_container .top_panel .close{position:absolute;top:15px;right:15px;width:14px;height:14px;line-height:14px;font-size:14px;text-align:center;color:#999;cursor:pointer;border-radius:7px}#top_panels_container .top_panel .close:hover{color:#777;background:#d7d7d7}.top_panel .button{padding:5px 12px;background:#e0e0e0;border-radius:3px;cursor:pointer;text-decoration:none}.top_panel .button:active{background:#d0d0d0}.top_panel .button.is-disabled{background:#d0d0d0;opacity:.5;cursor:not-allowed}#quick-reference table,#quick-reference>p{font-size:12px;line-height:1.25em}#quick-reference table tr{background:0 0}#quick-reference table td{padding:1px 0;border:0}#quick-reference table td:first-child{cursor:pointer}#quick-reference table td:last-child{padding-left:20px}#quick-reference table td p,#quick-reference table td pre{margin:0}#quick-reference p{margin-bottom:0}#settings #decrease-font-size,#settings #increase-font-size{position:relative;padding:5px 9px 5px 19px;line-height:16px}#settings #decrease-font-size:before,#settings #increase-font-size:before{content:"A";position:absolute;top:5px;left:9px;height:16px;line-height:16px;font-family:monospace}#settings #decrease-font-size:before{font-size:13px}#settings #increase-font-size:before{font-size:17px}#settings #decrease-font-size:after{content:"-"}#settings #increase-font-size:after{content:"+"}#settings .theme-control .button{margin-left:10px;padding-left:5px;padding-right:5px}#settings .theme-control.theme-control-light{display:none}#settings .theme-control.theme-control-dark{display:inline}#settings label{padding-right:20px}.fullscreen #left-column,.fullscreen #right-column{float:none;width:100%}.fullscreen #left-column .wrapper{border-right-color:transparent}.fullscreen #right-column .wrapper{border-left-color:transparent}.fullscreen #html,.fullscreen #markdown{max-width:800px;margin:0 auto}::-webkit-scrollbar{width:null;height:null}::-webkit-scrollbar-button{width:null;height:null;display:null}::-webkit-scrollbar-corner{background-color:null}::-webkit-scrollbar-track{background-color:null}::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-track:vertical{border-left:null}::-webkit-scrollbar-thumb:horizontal,::-webkit-scrollbar-track:horizontal{border-top:null;border-bottom:null}::-webkit-scrollbar-thumb{background-clip:null;background-color:null}::-webkit-scrollbar-thumb:vertical{min-height:null}::-webkit-scrollbar-thumb:horizontal{min-width:null}::-webkit-scrollbar-thumb:hover{background-color:null}::-webkit-scrollbar-thumb:active{background-color:null}
BIN
css/icons.eot-iefix-mfxpn4
Binary file not shown.
BIN
css/icons.eot-mfxpn4
Binary file not shown.
+13
css/icons.svg-mfxpn4
... ...
@@ -0,0 +1,13 @@
1
+<?xml version="1.0" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+<svg xmlns="http://www.w3.org/2000/svg">
4
+<metadata>Generated by IcoMoon</metadata>
5
+<defs>
6
+<font id="icons" horiz-adv-x="1024">
7
+<font-face units-per-em="1024" ascent="960" descent="-64" />
8
+<missing-glyph horiz-adv-x="1024" />
9
+<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
10
+<glyph unicode="&#xe600;" d="M512 921.6l-256-358.4h512l-256 358.4zM512 0l256 358.4h-512l256-358.4z" />
11
+<glyph unicode="&#xe601;" d="M548 553.4l127.8 127.6-99.8 99.8h256v-256l-99.8 99.8-127.6-127.8zM548 368.2l127.8-127.6-99.8-99.8h256v256l-99.8-99.8-127.6 127.8zM476 368.2l-127.8-127.6 99.8-99.8h-256v256l99.8-99.8 127.6 127.8zM476 553.4l-127.8 127.6 99.8 99.8h-256v-256l99.8 99.8 127.6-127.8z" />
12
+<glyph unicode="&#xe602;" d="M512 276.667q62 0 106 44t44 106-44 106-106 44-106-44-44-106 44-106 106-44zM830 384.667l90-70q14-10 4-28l-86-148q-8-14-26-8l-106 42q-42-30-72-42l-16-112q-4-18-20-18h-172q-16 0-20 18l-16 112q-38 16-72 42l-106-42q-18-6-26 8l-86 148q-10 18 4 28l90 70q-2 14-2 42t2 42l-90 70q-14 10-4 28l86 148q8 14 26 8l106-42q42 30 72 42l16 112q4 18 20 18h172q16 0 20-18l16-112q38-16 72-42l106 42q18 6 26-8l86-148q10-18-4-28l-90-70q2-14 2-42t-2-42z" />
13
+</font></defs></svg>
BIN
css/icons.ttf-mfxpn4
Binary file not shown.
BIN
css/icons.woff-mfxpn4
Binary file not shown.
BIN
favicon.ico
Binary file not shown.
BIN
img/html5.png
BIN
img/md.png
BIN
img/pdf.png
+245
index.html
... ...
@@ -0,0 +1,245 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+	<head>
4
+		<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
5
+		<meta http-equiv="X-UA-Compatible" content="IE=EDGE"/>
6
+		<title>Minimalist Online Markdown Editor</title>
7
+		<meta name="description" content="This is the simplest and slickest online Markdown editor. Just write Markdown and see what it looks like as you type. And convert it to HTML in one click."/>
8
+		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
9
+		<meta property="og:image" content="http://markdown.pioul.fr/images/markdown.png"/>
10
+
11
+		<link id="theme-default" href="css/bundle-light-theme-a23557fd.css" rel="stylesheet" type="text/css"/>
12
+		<link id="theme" href="" rel="stylesheet" type="text/css"/>
13
+		<link id="theme-light-ref" data-href="css/bundle-light-theme-a23557fd.css" rel="stylesheet" type="text/css"/>
14
+		<link id="theme-dark-ref" data-href="css/bundle-dark-theme-f217d64d.css" rel="stylesheet" type="text/css"/>
15
+
16
+
17
+		<script src="jquery.min.js"></script>
18
+		<script src="js/all-fecafa1e.js"></script>
19
+	</head>
20
+	<body class="clearfix">
21
+		<div id="left-column">
22
+			<div id="top_panels_container">
23
+				<div class="top_panel" id="quick-reference">
24
+					<div class="close">×</div>
25
+
26
+					<h2>Quick Reference</h2>
27
+
28
+					<table>
29
+						<tr>
30
+							<td>
31
+								<pre><code><span class="highlight">*</span>This is italicized<span class="highlight">*</span>, <wbr/>and <span class="highlight">**</span>this is bold<span class="highlight">**</span>.</code></pre>
32
+							</td>
33
+							<td><p>Use <code>*</code> or <code>_</code> for emphasis.</p></td>
34
+						</tr>
35
+						<tr>
36
+							<td>
37
+								<pre><code><span class="highlight">#</span> This is a first level header</code></pre>
38
+							</td>
39
+							<td><p>Use one or more hash marks for headers: <code>#&nbsp;H1</code>, <code>##&nbsp;H2</code>, <code>###&nbsp;H3</code>…</p></td>
40
+						</tr>
41
+						<tr>
42
+							<td>
43
+								<pre><code>This is a link to <wbr/><span class="highlight">[Google](http://www.google.com)</span></code></pre>
44
+							</td>
45
+							<td><p></p></td>
46
+						</tr>
47
+						<tr>
48
+							<td>
49
+								<pre><code>First line.<span class="highlight">  </span>
50
+Second line.</code></pre>
51
+							</td>
52
+							<td><p>End a line with two spaces for a linebreak.</p></td>
53
+						</tr>
54
+						<tr>
55
+							<td>
56
+								<pre><code><span class="highlight">- </span>Unordered list item
57
+<span class="highlight">- </span>Unordered list item</code></pre>
58
+							</td>
59
+							<td><p>Unordered (bulleted) lists use asterisks, pluses, or hyphens (<code>*</code>, <code>+</code>, or <code>-</code>) as list markers.</p></td>
60
+						</tr>
61
+						<tr>
62
+							<td>
63
+								<pre><code><span class="highlight">1. </span>Ordered list item
64
+<span class="highlight">2. </span>Ordered list item</code></pre>
65
+							</td>
66
+							<td><p>Ordered (numbered) lists use regular numbers, followed by periods, as list markers.</p></td>
67
+						</tr>
68
+						<tr>
69
+							<td><pre><code><span class="highlight">    </span>/* This is a code block */</code></pre></td>
70
+							<td><p>Indent four spaces for a preformatted block.</p></td>
71
+						</tr>
72
+						<tr>
73
+							<td><pre><code>Let's talk about <span class="highlight">`</span>&lt;html&gt;<span class="highlight">`</span>!</code></pre></td>
74
+							<td><p>Use backticks for inline code.</p></td>
75
+						</tr>
76
+						<tr>
77
+							<td>
78
+								<pre><code><span class="highlight">![](http://w3.org/Icons/valid-xhtml10)</span></code></pre>
79
+							</td>
80
+							<td><p>Images are exactly like links, with an exclamation mark in front of them.</p></td>
81
+						</tr>
82
+					</table>
83
+
84
+					<p><a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Full Markdown documentation</a></p>
85
+				</div>
86
+
87
+				<div class="top_panel" id="about">
88
+					<div class="close">×</div>
89
+
90
+					<h2>About MME</h2>
91
+
92
+					<p>Hi, I'm <a href="http://pioul.fr/a-propos/" target="_blank">Philippe Masset</a>.</p>
93
+					<p>I made the Minimalist Online Markdown Editor because I love Markdown and simple things.<br/>
94
+						The whole source code is on <a href="https://github.com/pioul/Minimalist-Online-Markdown-Editor" target="_blank">GitHub</a>, and this editor is also available offline and with file support as a <a href="https://chrome.google.com/webstore/detail/minimalist-markdown-edito/pghodfjepegmciihfhdipmimghiakcjf" target="_blank">Chrome app</a>.</p>
95
+					<p>If you have any suggestions or remarks whatsoever, just click on my name above and you'll have plenty of ways of contacting me.</p>
96
+
97
+					<h3>Privacy</h3>
98
+
99
+					<ul>
100
+						<li>No data is sent to any server – everything you type stays inside your browser</li>
101
+						<li>The editor automatically saves what you write locally for future use.<br/>
102
+							If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode</li>
103
+					</ul>
104
+				</div>
105
+
106
+				<div class="top_panel" id="settings">
107
+					<div class="close">×</div>
108
+
109
+					<h2>Settings</h2>
110
+
111
+					<p>
112
+						<label>Text size</label>
113
+						<a href="#" class="button" id="decrease-font-size"></a>
114
+						<a href="#" class="button" id="increase-font-size"></a>
115
+					</p>
116
+
117
+					<p>
118
+						<label>Theme</label>
119
+						<span class="theme-control theme-control-dark">
120
+							Light
121
+							<a href="#" class="button" id="use-dark-theme">Change to Dark Theme</a>
122
+						</span>
123
+						<span class="theme-control theme-control-light">
124
+							Dark
125
+							<a href="#" class="button" id="use-light-theme">Change to Light Theme</a>
126
+						</span>
127
+					</p>
128
+
129
+					<h2>Shortcuts</h2>
130
+
131
+					<ul>
132
+						<li><kbd>Ctrl</kbd> + <kbd>+</kbd> to increase the text size</li>
133
+						<li><kbd>Ctrl</kbd> + <kbd>-</kbd> to decrease the text size</li>
134
+					</ul>
135
+
136
+					<h3>Shortcuts on Mac</h3>
137
+
138
+					<p>On Mac, replace <kbd>Ctrl</kbd> with <kbd>&#8984;</kbd> (the command key) in the shortcuts above.</p>
139
+				</div>
140
+			</div>
141
+			<div class="wrapper">
142
+				<div class="topbar hidden-when-fullscreen">
143
+					<div class="buttons-container clearfix">
144
+						<a href="#" class="button toppanel" data-toppanel="quick-reference">Quick Reference</a>
145
+						<a href="#" class="button toppanel" data-toppanel="about">About</a>
146
+						<a href="#" class="button icon-settings toppanel" data-toppanel="settings"></a>
147
+						<a href="#" class="button icon-fullscreen feature" data-feature="fullscreen" data-tofocus="markdown" title="Go fullscreen"></a>
148
+					</div>
149
+				</div>
150
+        <a href="#" id="downloadMD"><img src="img/md.png" width="24px" height="24px"></img></a>
151
+				<textarea id="markdown" class="full-height" placeholder="Write Markdown"># Minimalist Online Markdown Editor
152
+
153
+This is the **simplest** and **slickest** online Markdown editor.  
154
+Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.
155
+
156
+## Getting started
157
+
158
+### How?
159
+
160
+Just start typing in the left panel.
161
+
162
+### Buttons you might want to use
163
+
164
+- **Quick Reference**: that's a reminder of the most basic rules of Markdown
165
+- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like
166
+
167
+### Privacy
168
+
169
+- No data is sent to any server – everything you type stays inside your browser
170
+- The editor automatically saves what you write locally for future use.  
171
+  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode</textarea>
172
+			</div>
173
+		</div>
174
+		<div id="right-column">
175
+			<div class="wrapper">
176
+				<div class="topbar hidden-when-fullscreen">
177
+					<div class="buttons-container clearfix">
178
+						<div class="button-group">
179
+							<a href="#" class="button switch" data-switchto="html">HTML</a>
180
+							<a href="#" class="button switch" data-switchto="preview">Preview</a>
181
+						</div>
182
+						<a href="#" class="button icon-sync-scroll feature" data-feature="sync-scroll" title="Toggle sync-scrolling (when enabled, the preview panel will automatically scroll with the left panel)"></a>
183
+						<a href="#" class="button icon-fullscreen feature" data-feature="fullscreen" data-tofocus="" title="Go fullscreen"></a><!-- data-tofocus is set dynamically by the HTML/preview switch -->
184
+					</div>
185
+				</div>
186
+				<div class="bottom-bar hidden-when-fullscreen clearfix">
187
+					<div class="word-count"></div>
188
+				</div>
189
+        <a href="#" id="downloadHTML"><img src="img/html5.png" width="24px" height="24px"></img></a>
190
+        <a href="#" id="downloadPDF" style="display: inline"><img src="img/pdf.png" width="24px" height="24px"></a>
191
+				<textarea id="html" class="full-height"></textarea>
192
+				<div id="preview" class="full-height"></div>
193
+			</div>
194
+		</div>
195
+		<div class="topbar visible-when-fullscreen">
196
+			<div class="buttons-container clearfix">
197
+				<div class="button-group">
198
+					<a href="#" class="button switch" data-switchto="markdown">Markdown</a>
199
+					<a href="#" class="button switch" data-switchto="html">HTML</a>
200
+					<a href="#" class="button switch" data-switchto="preview">Preview</a>
201
+				</div>
202
+				<a href="#" class="button icon-fullscreen feature" data-feature="fullscreen" title="Exit fullscreen"></a>
203
+			</div>
204
+		</div>
205
+		<div class="bottom-bar visible-when-fullscreen clearfix">
206
+			<div class="word-count"></div>
207
+		</div>
208
+	</body>
209
+	<script src="js/jspdf.min.js"></script>
210
+  <script>
211
+    function downloadInnerHtml(filename, elId, mimeType) {
212
+        var elHtml = document.getElementById(elId).innerHTML;
213
+        var link = document.createElement('a');
214
+        mimeType = mimeType || 'text/plain';
215
+
216
+        link.setAttribute('download', filename);
217
+        link.setAttribute('href', 'data:' + mimeType  +  ';charset=utf-8,' + encodeURIComponent(elHtml));
218
+        link.click(); 
219
+    }
220
+
221
+    var fileNameMD =  'myfile.md';
222
+    $('#downloadMD').click(function(){
223
+      downloadInnerHtml(fileNameMD, 'markdown','text/html');
224
+    });
225
+    var fileNameHTML =  'myfile.html';
226
+    $('#downloadHTML').click(function(){
227
+      downloadInnerHtml(fileNameHTML, 'preview','text/html');
228
+    });
229
+
230
+    //jsPDF test
231
+    var fileNamePDF =  'myfile.pdf';
232
+    function printPDF() {
233
+      var printDoc = new jsPDF();
234
+      printDoc.fromHTML($('#preview').get(0), 10, 10, {'width': 180});
235
+      printDoc.output("dataurlnewwindow"); // this opens a new popup,  after this the PDF opens the print window view but there are browser inconsistencies with how this is handled
236
+      //printDoc.autoPrint()
237
+      printDoc.save(fileNamePDF)
238
+    }
239
+    $('#downloadPDF').click(function(){
240
+      printPDF();
241
+    });
242
+
243
+  </script>
244
+</html>
245
+
+6
jquery.min.1.10.2.js
... ...
@@ -0,0 +1,6 @@
1
+/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
2
+//@ sourceMappingURL=jquery.min.map
3
+*/
4
+(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
5
+}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
6
+u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
+1
jquery.min.js
... ...
@@ -0,0 +1 @@
1
+jquery.min.1.10.2.js
+5
js/all-fecafa1e.js
... ...
@@ -0,0 +1,5 @@
1
+"use strict";!function e(t,r,n){function o(s,a){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return o(r?r:e)},u,u.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t,r){(function(r){function n(e){return e&&e.__esModule?e:{"default":e}}var o=e("./tools/protect.js"),i=n(o);if(e("core-js/shim"),e("regenerator/runtime"),i["default"](t),r._babelPolyfill)throw new Error("only one instance of babel/polyfill is allowed");r._babelPolyfill=!0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./tools/protect.js":2,"core-js/shim":93,"regenerator/runtime":94}],2:[function(e,t,r){(function(n){function o(e){return e&&e.__esModule?e:{"default":e}}r.__esModule=!0;var i=e("path"),s=o(i),a=s["default"].resolve(n,"../../../");r["default"]=function(e){if(e.parent&&0!==e.parent.filename.indexOf(a))throw new Error("Don't hotlink internal Babel files.")},t.exports=r["default"]}).call(this,"/lib/babel/tools")},{path:3}],3:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return o.exec(e).slice(1)};r.resolve=function(){for(var r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,o="/"===s.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+r||"."},r.normalize=function(e){var o=r.isAbsolute(e),i="/"===s(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var o=n(e.split("/")),i=n(t.split("/")),s=Math.min(o.length,i.length),a=s,c=0;s>c;c++)if(o[c]!==i[c]){a=c;break}for(var l=[],c=a;c<o.length;c++)l.push("..");return l=l.concat(i.slice(a)),l.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){var t=i(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(e,t){var r=i(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return 0>t&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:4}],4:[function(e,t,r){function n(){if(!a){a=!0;for(var e,t=s.length;t;){e=s,s=[];for(var r=-1;++r<t;)e[r]();t=s.length}a=!1}}function o(){}var i=t.exports={},s=[],a=!1;i.nextTick=function(e){s.push(e),a||setTimeout(n,0)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=o,i.addListener=o,i.once=o,i.off=o,i.removeListener=o,i.removeAllListeners=o,i.emit=o,i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],5:[function(e,t,r){var n=e("./$");t.exports=function(e){return function(t,r,o){var i,s=n.toObject(t),a=n.toLength(s.length),c=n.toIndex(o,a);if(e&&r!=r){for(;a>c;)if(i=s[c++],i!=i)return!0}else for(;a>c;c++)if((e||c in s)&&s[c]===r)return e||c;return!e&&-1}}},{"./$":26}],6:[function(e,t,r){var n=e("./$"),o=e("./$.ctx");t.exports=function(e){var t=1==e,r=2==e,i=3==e,s=4==e,a=6==e,c=5==e||a;return function(l,u,f){for(var p,h,d=Object(n.assertDefined(l)),g=n.ES5Object(d),m=o(u,f,3),v=n.toLength(g.length),b=0,y=t?Array(v):r?[]:void 0;v>b;b++)if((c||b in g)&&(p=g[b],h=m(p,b,d),e))if(t)y[b]=h;else if(h)switch(e){case 3:return!0;case 5:return p;case 6:return b;case 2:y.push(p)}else if(s)return!1;return a?-1:i||s?s:y}}},{"./$":26,"./$.ctx":14}],7:[function(e,t,r){function n(e,t,r){if(!e)throw TypeError(r?t+r:t)}var o=e("./$");n.def=o.assertDefined,n.fn=function(e){if(!o.isFunction(e))throw TypeError(e+" is not a function!");return e},n.obj=function(e){if(!o.isObject(e))throw TypeError(e+" is not an object!");return e},n.inst=function(e,t,r){if(!(e instanceof t))throw TypeError(r+": use the 'new' operator!");return e},t.exports=n},{"./$":26}],8:[function(e,t,r){var n=e("./$"),o=e("./$.enum-keys");t.exports=Object.assign||function(e,t){for(var r=Object(n.assertDefined(e)),i=arguments.length,s=1;i>s;)for(var a,c=n.ES5Object(arguments[s++]),l=o(c),u=l.length,f=0;u>f;)r[a=l[f++]]=c[a];return r}},{"./$":26,"./$.enum-keys":17}],9:[function(e,t,r){function n(e){return s.call(e).slice(8,-1)}var o=e("./$"),i=e("./$.wks")("toStringTag"),s={}.toString;n.classof=function(e){var t,r;return void 0==e?void 0===e?"Undefined":"Null":"string"==typeof(r=(t=Object(e))[i])?r:n(t)},n.set=function(e,t,r){e&&!o.has(e=r?e:e.prototype,i)&&o.hide(e,i,t)},t.exports=n},{"./$":26,"./$.wks":44}],10:[function(e,t,r){function n(e,t){if(!h(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!f(e,m)){if(!g(e))return"F";if(!t)return"E";d(e,m,++$)}return"O"+e[m]}function o(e,t){var r,o=n(t);if("F"!==o)return e[v][o];for(r=e[y];r;r=r.n)if(r.k==t)return r}var i=e("./$"),s=e("./$.ctx"),a=e("./$.uid").safe,c=e("./$.assert"),l=e("./$.for-of"),u=e("./$.iter").step,f=i.has,p=i.set,h=i.isObject,d=i.hide,g=Object.isExtensible||h,m=a("id"),v=a("O1"),b=a("last"),y=a("first"),k=a("iter"),w=i.DESC?a("size"):"size",$=0;t.exports={getConstructor:function(t,r,n,a){var u=t(function(e,t){c.inst(e,u,r),p(e,v,i.create(null)),p(e,w,0),p(e,b,void 0),p(e,y,void 0),void 0!=t&&l(t,n,e[a],e)});return e("./$.mix")(u.prototype,{clear:function(){for(var e=this,t=e[v],r=e[y];r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e[y]=e[b]=void 0,e[w]=0},"delete":function(e){var t=this,r=o(t,e);if(r){var n=r.n,i=r.p;delete t[v][r.i],r.r=!0,i&&(i.n=n),n&&(n.p=i),t[y]==r&&(t[y]=n),t[b]==r&&(t[b]=i),t[w]--}return!!r},forEach:function(e){for(var t,r=s(e,arguments[1],3);t=t?t.n:this[y];)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!o(this,e)}}),i.DESC&&i.setDesc(u.prototype,"size",{get:function(){return c.def(this[w])}}),u},def:function(e,t,r){var i,s,a=o(e,t);return a?a.v=r:(e[b]=a={i:s=n(t,!0),k:t,v:r,p:i=e[b],n:void 0,r:!1},e[y]||(e[y]=a),i&&(i.n=a),e[w]++,"F"!==s&&(e[v][s]=a)),e},getEntry:o,setIter:function(t,r,n){e("./$.iter-define")(t,r,function(e,t){p(this,k,{o:e,k:t})},function(){for(var e=this[k],t=e.k,r=e.l;r&&r.r;)r=r.p;return e.o&&(e.l=r=r?r.n:e.o[y])?"keys"==t?u(0,r.k):"values"==t?u(0,r.v):u(0,[r.k,r.v]):(e.o=void 0,u(1))},n?"entries":"values",!n,!0)}}},{"./$":26,"./$.assert":7,"./$.ctx":14,"./$.for-of":18,"./$.iter":25,"./$.iter-define":23,"./$.mix":28,"./$.uid":42}],11:[function(e,t,r){var n=e("./$.def"),o=e("./$.for-of");t.exports=function(e){n(n.P,e,{toJSON:function(){var e=[];return o(this,!1,e.push,e),e}})}},{"./$.def":15,"./$.for-of":18}],12:[function(e,t,r){function n(e,t){return b(e.array,function(e){return e[0]===t})}function o(e){return e[m]||f(e,m,{array:[],get:function(e){var t=n(this,e);return t?t[1]:void 0},has:function(e){return!!n(this,e)},set:function(e,t){var r=n(this,e);r?r[1]=t:this.array.push([e,t])},"delete":function(e){var t=y(this.array,function(t){return t[0]===e});return~t&&this.array.splice(t,1),!!~t}})[m]}var i=e("./$"),s=e("./$.uid").safe,a=e("./$.assert"),c=e("./$.for-of"),l=i.has,u=i.isObject,f=i.hide,p=Object.isExtensible||u,h=0,d=s("id"),g=s("weak"),m=s("leak"),v=e("./$.array-methods"),b=v(5),y=v(6);t.exports={getConstructor:function(t,r,n,s){var f=t(function(e,t){i.set(a.inst(e,f,r),d,h++),void 0!=t&&c(t,n,e[s],e)});return e("./$.mix")(f.prototype,{"delete":function(e){return u(e)?p(e)?l(e,g)&&l(e[g],this[d])&&delete e[g][this[d]]:o(this)["delete"](e):!1},has:function(e){return u(e)?p(e)?l(e,g)&&l(e[g],this[d]):o(this).has(e):!1}}),f},def:function(e,t,r){return p(a.obj(t))?(l(t,g)||f(t,g,{}),t[g][e[d]]=r):o(e).set(t,r),e},leakStore:o,WEAK:g,ID:d}},{"./$":26,"./$.array-methods":6,"./$.assert":7,"./$.for-of":18,"./$.mix":28,"./$.uid":42}],13:[function(e,t,r){var n=e("./$"),o=e("./$.def"),i=e("./$.iter").BUGGY,s=e("./$.for-of"),a=e("./$.species"),c=e("./$.assert").inst;t.exports=function(t,r,l,u,f,p){function h(t){var r=v[t];e("./$.redef")(v,t,"delete"==t?function(e){return r.call(this,0===e?0:e)}:"has"==t?function(e){return r.call(this,0===e?0:e)}:"get"==t?function(e){return r.call(this,0===e?0:e)}:"add"==t?function(e){return r.call(this,0===e?0:e),this}:function(e,t){return r.call(this,0===e?0:e,t),this})}var d=n.g[t],g=d,m=f?"set":"add",v=g&&g.prototype,b={};if(n.isFunction(g)&&(p||!i&&v.forEach&&v.entries)){var y,k=new g,w=k[m](p?{}:-0,1);e("./$.iter-detect")(function(e){new g(e)})||(g=r(function(e,r){c(e,g,t);var n=new d;return void 0!=r&&s(r,f,n[m],n),n}),g.prototype=v,v.constructor=g),p||k.forEach(function(e,t){y=1/t===-(1/0)}),y&&(h("delete"),h("has"),f&&h("get")),(y||w!==k)&&h(m)}else g=u.getConstructor(r,t,f,m),e("./$.mix")(g.prototype,l);return e("./$.cof").set(g,t),b[t]=g,o(o.G+o.W+o.F*(g!=d),b),a(g),a(n.core[t]),p||u.setIter(g,t,f),g}},{"./$":26,"./$.assert":7,"./$.cof":9,"./$.def":15,"./$.for-of":18,"./$.iter":25,"./$.iter-detect":24,"./$.mix":28,"./$.redef":31,"./$.species":36}],14:[function(e,t,r){var n=e("./$.assert").fn;t.exports=function(e,t,r){if(n(e),~r&&void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},{"./$.assert":7}],15:[function(e,t,r){function n(e,t){return function(){return e.apply(t,arguments)}}function o(e,t,r){var u,f,p,h,d=e&o.G,g=e&o.P,m=d?s:e&o.S?s[t]:(s[t]||{}).prototype,v=d?a:a[t]||(a[t]={});d&&(r=t);for(u in r)f=!(e&o.F)&&m&&u in m,p=(f?m:r)[u],h=e&o.B&&f?n(p,s):g&&c(p)?n(Function.call,p):p,m&&!f&&l(m,u,p),v[u]!=p&&i.hide(v,u,h),g&&((v.prototype||(v.prototype={}))[u]=p)}var i=e("./$"),s=i.g,a=i.core,c=i.isFunction,l=e("./$.redef");s.core=a,o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,t.exports=o},{"./$":26,"./$.redef":31}],16:[function(e,t,r){var n=e("./$"),o=n.g.document,i=n.isObject,s=i(o)&&i(o.createElement);t.exports=function(e){return s?o.createElement(e):{}}},{"./$":26}],17:[function(e,t,r){var n=e("./$");t.exports=function(e){var t=n.getKeys(e),r=n.getDesc,o=n.getSymbols;return o&&n.each.call(o(e),function(n){r(e,n).enumerable&&t.push(n)}),t}},{"./$":26}],18:[function(e,t,r){var n=e("./$.ctx"),o=e("./$.iter").get,i=e("./$.iter-call");t.exports=function(e,t,r,s){for(var a,c=o(e),l=n(r,s,t?2:1);!(a=c.next()).done;)if(i(c,l,a.value,t)===!1)return i.close(c)}},{"./$.ctx":14,"./$.iter":25,"./$.iter-call":22}],19:[function(e,t,r){t.exports=function(e){return e.FW=!0,e.path=e.g,e}},{}],20:[function(e,t,r){function n(e){try{return s(e)}catch(t){return a.slice()}}var o=e("./$"),i={}.toString,s=o.getNames,a="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.get=function(e){return a&&"[object Window]"==i.call(e)?n(e):s(o.toObject(e))}},{"./$":26}],21:[function(e,t,r){t.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3]);case 5:return n?e(t[0],t[1],t[2],t[3],t[4]):e.call(r,t[0],t[1],t[2],t[3],t[4])}return e.apply(r,t)}},{}],22:[function(e,t,r){function n(e){var t=e["return"];void 0!==t&&i(t.call(e))}function o(e,t,r,o){try{return o?t(i(r)[0],r[1]):t(r)}catch(s){throw n(e),s}}var i=e("./$.assert").obj;o.close=n,t.exports=o},{"./$.assert":7}],23:[function(e,t,r){var n=e("./$.def"),o=e("./$.redef"),i=e("./$"),s=e("./$.cof"),a=e("./$.iter"),c=e("./$.wks")("iterator"),l="@@iterator",u="keys",f="values",p=a.Iterators;t.exports=function(e,t,r,h,d,g,m){function v(e){function t(t){return new r(t,e)}switch(e){case u:return function(){return t(this)};case f:return function(){return t(this)}}return function(){return t(this)}}a.create(r,t,h);var b,y,k=t+" Iterator",w=e.prototype,$=w[c]||w[l]||d&&w[d],x=$||v(d);if($){var S=i.getProto(x.call(new e));s.set(S,k,!0),i.FW&&i.has(w,l)&&a.set(S,i.that)}if((i.FW||m)&&a.set(w,x),p[t]=x,p[k]=i.that,d)if(b={keys:g?x:v(u),values:d==f?x:v(f),entries:d!=f?x:v("entries")},m)for(y in b)y in w||o(w,y,b[y]);else n(n.P+n.F*a.BUGGY,t,b)}},{"./$":26,"./$.cof":9,"./$.def":15,"./$.iter":25,"./$.redef":31,"./$.wks":44}],24:[function(e,t,r){var n=e("./$.wks")("iterator"),o=!1;try{var i=[7][n]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(s){}t.exports=function(e){if(!o)return!1;var t=!1;try{var r=[7],i=r[n]();i.next=function(){t=!0},r[n]=function(){return i},e(r)}catch(s){}return t}},{"./$.wks":44}],25:[function(e,t,r){function n(e,t){o.hide(e,l,t),u in[]&&o.hide(e,u,t)}var o=e("./$"),i=e("./$.cof"),s=i.classof,a=e("./$.assert"),c=a.obj,l=e("./$.wks")("iterator"),u="@@iterator",f=e("./$.shared")("iterators"),p={};n(p,o.that),t.exports={BUGGY:"keys"in[]&&!("next"in[].keys()),Iterators:f,step:function(e,t){return{value:t,done:!!e}},is:function(e){var t=Object(e),r=o.g.Symbol;return(r&&r.iterator||u)in t||l in t||o.has(f,s(t))},get:function(e){var t,r=o.g.Symbol;return void 0!=e&&(t=e[r&&r.iterator||u]||e[l]||f[s(e)]),a(o.isFunction(t),e," is not iterable!"),c(t.call(e))},set:n,create:function(e,t,r,n){e.prototype=o.create(n||p,{next:o.desc(1,r)}),i.set(e,t+" Iterator")}}},{"./$":26,"./$.assert":7,"./$.cof":9,"./$.shared":35,"./$.wks":44}],26:[function(e,t,r){function n(e){return isNaN(e=+e)?0:(e>0?g:d)(e)}function o(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function i(e,t,r){return e[t]=r,e}function s(e){return b?function(t,r,n){return k.setDesc(t,r,o(e,n))}:i}function a(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function c(e){return"function"==typeof e}function l(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}var u="undefined"!=typeof self?self:Function("return this")(),f={},p=Object.defineProperty,h={}.hasOwnProperty,d=Math.ceil,g=Math.floor,m=Math.max,v=Math.min,b=!!function(){try{return 2==p({},"a",{get:function(){return 2}}).a}catch(e){}}(),y=s(1),k=t.exports=e("./$.fw")({g:u,core:f,html:u.document&&document.documentElement,isObject:a,isFunction:c,that:function(){return this},toInteger:n,toLength:function(e){return e>0?v(n(e),9007199254740991):0},toIndex:function(e,t){return e=n(e),0>e?m(e+t,0):v(e,t)},has:function(e,t){return h.call(e,t)},create:Object.create,getProto:Object.getPrototypeOf,DESC:b,desc:o,getDesc:Object.getOwnPropertyDescriptor,setDesc:p,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:l,ES5Object:Object,toObject:function(e){return k.ES5Object(l(e))},hide:y,def:s(0),set:u.Symbol?i:y,each:[].forEach});"undefined"!=typeof __e&&(__e=f),"undefined"!=typeof __g&&(__g=u)},{"./$.fw":19}],27:[function(e,t,r){var n=e("./$");t.exports=function(e,t){for(var r,o=n.toObject(e),i=n.getKeys(o),s=i.length,a=0;s>a;)if(o[r=i[a++]]===t)return r}},{"./$":26}],28:[function(e,t,r){var n=e("./$.redef");t.exports=function(e,t){for(var r in t)n(e,r,t[r]);return e}},{"./$.redef":31}],29:[function(e,t,r){var n=e("./$"),o=e("./$.assert").obj;t.exports=function(e){o(e);var t=n.getNames(e),r=n.getSymbols;return r?t.concat(r(e)):t}},{"./$":26,"./$.assert":7}],30:[function(e,t,r){var n=e("./$"),o=e("./$.invoke"),i=e("./$.assert").fn;t.exports=function(){for(var e=i(this),t=arguments.length,r=Array(t),s=0,a=n.path._,c=!1;t>s;)(r[s]=arguments[s++])===a&&(c=!0);return function(){var n,i=this,s=arguments.length,l=0,u=0;if(!c&&!s)return o(e,r,i);if(n=r.slice(),c)for(;t>l;l++)n[l]===a&&(n[l]=arguments[u++]);for(;s>u;)n.push(arguments[u++]);return o(e,n,i)}}},{"./$":26,"./$.assert":7,"./$.invoke":21}],31:[function(e,t,r){function n(e,t,r,n){if(o.isFunction(r)){var a=e[t];o.hide(r,s,a?String(a):i.replace(/hasOwnProperty/,String(t))),"name"in r||(r.name=t)}e===o.g?e[t]=r:(n||delete e[t],o.hide(e,t,r))}var o=e("./$"),i=String({}.hasOwnProperty),s=e("./$.uid").safe("src"),a=Function.toString;n(Function.prototype,"toString",function(){return o.has(this,s)?this[s]:a.call(this)}),o.core.inspectSource=function(e){return a.call(e)},t.exports=n},{"./$":26,"./$.uid":42}],32:[function(e,t,r){t.exports=function(e,t,r){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(r?t:this).replace(e,n)}}},{}],33:[function(e,t,r){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},{}],34:[function(e,t,r){function n(e,t){i.obj(e),i(null===t||o.isObject(t),t,": can't set as prototype!")}var o=e("./$"),i=e("./$.assert");t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r){try{r=e("./$.ctx")(Function.call,o.getDesc(Object.prototype,"__proto__").set,2),r({},[])}catch(i){t=!0}return function(e,o){return n(e,o),t?e.__proto__=o:r(e,o),e}}():void 0),check:n}},{"./$":26,"./$.assert":7,"./$.ctx":14}],35:[function(e,t,r){var n=e("./$"),o="__core-js_shared__",i=n.g[o]||(n.g[o]={});t.exports=function(e){return i[e]||(i[e]={})}},{"./$":26}],36:[function(e,t,r){var n=e("./$"),o=e("./$.wks")("species");t.exports=function(e){!n.DESC||o in e||n.setDesc(e,o,{configurable:!0,get:n.that})}},{"./$":26,"./$.wks":44}],37:[function(e,t,r){var n=e("./$");t.exports=function(e){return function(t,r){var o,i,s=String(n.assertDefined(t)),a=n.toInteger(r),c=s.length;return 0>a||a>=c?e?"":void 0:(o=s.charCodeAt(a),55296>o||o>56319||a+1===c||(i=s.charCodeAt(a+1))<56320||i>57343?e?s.charAt(a):o:e?s.slice(a,a+2):(o-55296<<10)+(i-56320)+65536)}}},{"./$":26}],38:[function(e,t,r){var n=e("./$"),o=e("./$.string-repeat");t.exports=function(e,t,r,i){var s=String(n.assertDefined(e));if(void 0===t)return s;var a=n.toInteger(t),c=a-s.length;if(0>c||c===1/0)throw new RangeError("Cannot satisfy string length "+t+" for string: "+s);var l=void 0===r?" ":String(r),u=o.call(l,Math.ceil(c/l.length));return u.length>c&&(u=i?u.slice(u.length-c):u.slice(0,c)),i?u.concat(s):s.concat(u)}},{"./$":26,"./$.string-repeat":39}],39:[function(e,t,r){var n=e("./$");t.exports=function(e){var t=String(n.assertDefined(this)),r="",o=n.toInteger(e);if(0>o||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"./$":26}],40:[function(e,t,r){function n(){var e=+this;if(c.has(w,e)){var t=w[e];delete w[e],t()}}function o(e){n.call(e.data)}var i,s,a,c=e("./$"),l=e("./$.ctx"),u=e("./$.cof"),f=e("./$.invoke"),p=e("./$.dom-create"),h=c.g,d=c.isFunction,g=c.html,m=h.process,v=h.setImmediate,b=h.clearImmediate,y=h.MessageChannel,k=0,w={},$="onreadystatechange";d(v)&&d(b)||(v=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return w[++k]=function(){f(d(e)?e:Function(e),t)},i(k),k},b=function(e){delete w[e]},"process"==u(m)?i=function(e){m.nextTick(l(n,e,1))}:h.addEventListener&&d(h.postMessage)&&!h.importScripts?(i=function(e){h.postMessage(e,"*")},h.addEventListener("message",o,!1)):d(y)?(s=new y,a=s.port2,s.port1.onmessage=o,i=l(a.postMessage,a,1)):i=$ in p("script")?function(e){g.appendChild(p("script"))[$]=function(){g.removeChild(this),n.call(e)}}:function(e){setTimeout(l(n,e,1),0)}),t.exports={set:v,clear:b}},{"./$":26,"./$.cof":9,"./$.ctx":14,"./$.dom-create":16,"./$.invoke":21}],41:[function(e,t,r){t.exports=function(e){try{return e(),!1}catch(t){return!0}}},{}],42:[function(e,t,r){function n(e){return"Symbol(".concat(void 0===e?"":e,")_",(++o+Math.random()).toString(36))}var o=0;n.safe=e("./$").g.Symbol||n,t.exports=n},{"./$":26}],43:[function(e,t,r){var n=e("./$.wks")("unscopables");n in[]||e("./$").hide(Array.prototype,n,{}),t.exports=function(e){[][n][e]=!0}},{"./$":26,"./$.wks":44}],44:[function(e,t,r){var n=e("./$").g,o=e("./$.shared")("wks");t.exports=function(t){return o[t]||(o[t]=n.Symbol&&n.Symbol[t]||e("./$.uid").safe("Symbol."+t))}},{"./$":26,"./$.shared":35,"./$.uid":42}],45:[function(e,t,r){function n(e,t){return function(r){var n,o=C(r),i=0,s=[];for(n in o)n!=h&&$(o,n)&&s.push(n);for(;t>i;)$(o,n=e[i++])&&(~M(s,n)||s.push(n));return s}}function o(){}function i(e){return function(t,r){d.fn(t);var n=C(this),o=q(n.length),i=e?o-1:0,s=e?-1:1;if(arguments.length<2)for(;;){if(i in n){r=n[i],i+=s;break}i+=s,d(e?i>=0:o>i,"Reduce of empty array with no initial value")}for(;e?i>=0:o>i;i+=s)i in n&&(r=t(r,n[i],i,this));return r}}function s(e){return e>9?e:"0"+e}var a=e("./$"),c=e("./$.dom-create"),l=e("./$.cof"),u=e("./$.def"),f=e("./$.invoke"),p=e("./$.array-methods"),h=e("./$.uid").safe("__proto__"),d=e("./$.assert"),g=d.obj,m=Object.prototype,v=a.html,b=[],y=b.slice,k=b.join,w=l.classof,$=a.has,x=a.setDesc,S=a.getDesc,_=a.setDescs,A=a.isFunction,E=a.isObject,C=a.toObject,q=a.toLength,F=a.toIndex,T=!1,M=e("./$.array-includes")(!1),D=p(0),P=p(1),L=p(2),O=p(3),j=p(4);if(!a.DESC){try{T=8==x(c("div"),"x",{get:function(){return 8}}).x}catch(I){}a.setDesc=function(e,t,r){if(T)try{return x(e,t,r)}catch(n){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(g(e)[t]=r.value),e},a.getDesc=function(e,t){if(T)try{return S(e,t)}catch(r){}return $(e,t)?a.desc(!m.propertyIsEnumerable.call(e,t),e[t]):void 0},a.setDescs=_=function(e,t){g(e);for(var r,n=a.getKeys(t),o=n.length,i=0;o>i;)a.setDesc(e,r=n[i++],t[r]);return e}}u(u.S+u.F*!a.DESC,"Object",{getOwnPropertyDescriptor:a.getDesc,defineProperty:a.setDesc,defineProperties:_});var R="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),N=R.concat("length","prototype"),z=R.length,U=function(){var e,t=c("iframe"),r=z,n=">";for(t.style.display="none",v.appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object</script"+n),e.close(),U=e.F;r--;)delete U.prototype[R[r]];return U()};u(u.S,"Object",{getPrototypeOf:a.getProto=a.getProto||function(e){return e=Object(d.def(e)),$(e,h)?e[h]:A(e.constructor)&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?m:null},getOwnPropertyNames:a.getNames=a.getNames||n(N,N.length,!0),create:a.create=a.create||function(e,t){var r;return null!==e?(o.prototype=g(e),r=new o,o.prototype=null,r[h]=e):r=U(),void 0===t?r:_(r,t)},keys:a.getKeys=a.getKeys||n(R,z,!1),seal:function(e){return e},freeze:function(e){return e},preventExtensions:function(e){return e},isSealed:function(e){return!E(e)},isFrozen:function(e){return!E(e)},isExtensible:function(e){return E(e)}}),u(u.P,"Function",{bind:function(e){function t(){var o=n.concat(y.call(arguments)),i=this instanceof t,s=i?a.create(r.prototype):e,c=f(r,o,s);return i?s:c}var r=d.fn(this),n=y.call(arguments,1);return r.prototype&&(t.prototype=r.prototype),t}}),0 in Object("z")&&"z"=="z"[0]||(a.ES5Object=function(e){return"String"==l(e)?e.split(""):Object(e)});var B=!0;try{v&&y.call(v),B=!1}catch(I){}u(u.P+u.F*B,"Array",{slice:function(e,t){var r=q(this.length),n=l(this);if(t=void 0===t?r:t,"Array"==n)return y.call(this,e,t);for(var o=F(e,r),i=F(t,r),s=q(i-o),a=Array(s),c=0;s>c;c++)a[c]="String"==n?this.charAt(o+c):this[o+c];return a}}),u(u.P+u.F*(a.ES5Object!=Object),"Array",{join:function(){return k.apply(a.ES5Object(this),arguments)}}),u(u.S,"Array",{isArray:function(e){return"Array"==l(e)}}),u(u.P,"Array",{forEach:a.each=a.each||function(e){return D(this,e,arguments[1])},map:function(e){return P(this,e,arguments[1])},filter:function(e){return L(this,e,arguments[1])},some:function(e){return O(this,e,arguments[1])},every:function(e){return j(this,e,arguments[1])},reduce:i(!1),reduceRight:i(!0),indexOf:function(e){return M(this,e,arguments[1])},lastIndexOf:function(e,t){var r=C(this),n=q(r.length),o=n-1;for(arguments.length>1&&(o=Math.min(o,a.toInteger(t))),0>o&&(o=q(n+o));o>=0;o--)if(o in r&&r[o]===e)return o;return-1}}),u(u.P,"String",{trim:e("./$.replacer")(/^\s*([\s\S]*\S)?\s*$/,"$1")}),u(u.S,"Date",{now:function(){return+new Date}});var H=new Date(-5e13-1),V=!(H.toISOString&&"0385-07-25T07:06:39.999Z"==H.toISOString()&&e("./$.throws")(function(){new Date(NaN).toISOString()}));u(u.P+u.F*V,"Date",{toISOString:function(){if(!isFinite(this))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=0>t?"-":t>9999?"+":"";return n+("00000"+Math.abs(t)).slice(n?-6:-4)+"-"+s(e.getUTCMonth()+1)+"-"+s(e.getUTCDate())+"T"+s(e.getUTCHours())+":"+s(e.getUTCMinutes())+":"+s(e.getUTCSeconds())+"."+(r>99?r:"0"+s(r))+"Z"}}),"Object"==w(function(){return arguments}())&&(l.classof=function(e){var t=w(e);return"Object"==t&&A(e.callee)?"Arguments":t})},{"./$":26,"./$.array-includes":5,"./$.array-methods":6,"./$.assert":7,"./$.cof":9,"./$.def":15,"./$.dom-create":16,"./$.invoke":21,"./$.replacer":32,"./$.throws":41,"./$.uid":42}],46:[function(e,t,r){var n=e("./$"),o=e("./$.def"),i=n.toIndex;o(o.P,"Array",{copyWithin:function(e,t){var r=Object(n.assertDefined(this)),o=n.toLength(r.length),s=i(e,o),a=i(t,o),c=arguments[2],l=void 0===c?o:i(c,o),u=Math.min(l-a,o-s),f=1;for(s>a&&a+u>s&&(f=-1,a=a+u-1,s=s+u-1);u-->0;)a in r?r[s]=r[a]:delete r[s],s+=f,a+=f;return r}}),e("./$.unscope")("copyWithin")},{"./$":26,"./$.def":15,"./$.unscope":43}],47:[function(e,t,r){var n=e("./$"),o=e("./$.def"),i=n.toIndex;o(o.P,"Array",{fill:function(e){for(var t=Object(n.assertDefined(this)),r=n.toLength(t.length),o=i(arguments[1],r),s=arguments[2],a=void 0===s?r:i(s,r);a>o;)t[o++]=e;return t}}),e("./$.unscope")("fill")},{"./$":26,"./$.def":15,"./$.unscope":43}],48:[function(e,t,r){var n="findIndex",o=e("./$.def"),i=!0,s=e("./$.array-methods")(6);n in[]&&Array(1)[n](function(){i=!1}),o(o.P+o.F*i,"Array",{findIndex:function(e){return s(this,e,arguments[1])}}),e("./$.unscope")(n)},{"./$.array-methods":6,"./$.def":15,"./$.unscope":43}],49:[function(e,t,r){var n="find",o=e("./$.def"),i=!0,s=e("./$.array-methods")(5);n in[]&&Array(1)[n](function(){i=!1}),o(o.P+o.F*i,"Array",{find:function(e){return s(this,e,arguments[1])}}),e("./$.unscope")(n)},{"./$.array-methods":6,"./$.def":15,"./$.unscope":43}],50:[function(e,t,r){var n=e("./$"),o=e("./$.ctx"),i=e("./$.def"),s=e("./$.iter"),a=e("./$.iter-call");i(i.S+i.F*!e("./$.iter-detect")(function(e){Array.from(e)}),"Array",{from:function(e){var t,r,i,c,l=Object(n.assertDefined(e)),u=arguments[1],f=void 0!==u,p=f?o(u,arguments[2],2):void 0,h=0;if(s.is(l))for(c=s.get(l),r=new("function"==typeof this?this:Array);!(i=c.next()).done;h++)r[h]=f?a(c,p,[i.value,h],!0):i.value;else for(r=new("function"==typeof this?this:Array)(t=n.toLength(l.length));t>h;h++)r[h]=f?p(l[h],h):l[h];return r.length=h,r}})},{"./$":26,"./$.ctx":14,"./$.def":15,"./$.iter":25,"./$.iter-call":22,"./$.iter-detect":24}],51:[function(e,t,r){var n=e("./$"),o=e("./$.unscope"),i=e("./$.uid").safe("iter"),s=e("./$.iter"),a=s.step,c=s.Iterators;e("./$.iter-define")(Array,"Array",function(e,t){n.set(this,i,{o:n.toObject(e),i:0,k:t})},function(){var e=this[i],t=e.o,r=e.k,n=e.i++;return!t||n>=t.length?(e.o=void 0,a(1)):"keys"==r?a(0,n):"values"==r?a(0,t[n]):a(0,[n,t[n]])},"values"),c.Arguments=c.Array,o("keys"),o("values"),o("entries")},{"./$":26,"./$.iter":25,"./$.iter-define":23,"./$.uid":42,"./$.unscope":43}],52:[function(e,t,r){var n=e("./$.def");n(n.S,"Array",{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)r[e]=arguments[e++];return r.length=t,r}})},{"./$.def":15}],53:[function(e,t,r){e("./$.species")(Array)},{"./$.species":36}],54:[function(e,t,r){var n=e("./$"),o=e("./$.wks")("hasInstance"),i=Function.prototype;o in i||n.setDesc(i,o,{value:function(e){if(!n.isFunction(this)||!n.isObject(e))return!1;if(!n.isObject(this.prototype))return e instanceof this;for(;e=n.getProto(e);)if(this.prototype===e)return!0;return!1}})},{"./$":26,"./$.wks":44}],55:[function(e,t,r){var n=e("./$"),o="name",i=n.setDesc,s=Function.prototype;o in s||n.FW&&n.DESC&&i(s,o,{configurable:!0,get:function(){var e=String(this).match(/^\s*function ([^ (]*)/),t=e?e[1]:"";return n.has(this,o)||i(this,o,n.desc(5,t)),t},set:function(e){n.has(this,o)||i(this,o,n.desc(0,e))}})},{"./$":26}],56:[function(e,t,r){var n=e("./$.collection-strong");e("./$.collection")("Map",function(e){return function(){return e(this,arguments[0])}},{get:function(e){var t=n.getEntry(this,e);return t&&t.v},set:function(e,t){return n.def(this,0===e?0:e,t)}},n,!0)},{"./$.collection":13,"./$.collection-strong":10}],57:[function(e,t,r){function n(e){return e+1/v-1/v}function o(e){return 0==(e=+e)||e!=e?e:0>e?-1:1}function i(e){return isFinite(e=+e)&&0!=e?0>e?-i(-e):h(e+d(e*e+1)):e}function s(e){return 0==(e=+e)?e:e>-1e-6&&1e-6>e?e+e*e/2:p(e)-1}var a=1/0,c=e("./$.def"),l=Math.E,u=Math.pow,f=Math.abs,p=Math.exp,h=Math.log,d=Math.sqrt,g=Math.ceil,m=Math.floor,v=u(2,-52),b=u(2,-23),y=u(2,127)*(2-b),k=u(2,-126);c(c.S,"Math",{acosh:function(e){return(e=+e)<1?NaN:isFinite(e)?h(e/l+d(e+1)*d(e-1)/l)+1:e},asinh:i,atanh:function(e){return 0==(e=+e)?e:h((1+e)/(1-e))/2},cbrt:function(e){return o(e=+e)*u(f(e),1/3)},clz32:function(e){return(e>>>=0)?31-m(h(e+.5)*Math.LOG2E):32},cosh:function(e){return(p(e=+e)+p(-e))/2},expm1:s,fround:function(e){var t,r,i=f(e),s=o(e);return k>i?s*n(i/k/b)*k*b:(t=(1+b/v)*i,r=t-(t-i),r>y||r!=r?s*a:s*r)},hypot:function(e,t){for(var r,n,o=0,i=0,s=arguments.length,c=0;s>i;)r=f(arguments[i++]),r>c?(n=c/r,o=o*n*n+1,c=r):r>0?(n=r/c,o+=n*n):o+=r;return c===a?a:c*d(o)},imul:function(e,t){var r=65535,n=+e,o=+t,i=r&n,s=r&o;return 0|i*s+((r&n>>>16)*s+i*(r&o>>>16)<<16>>>0)},log1p:function(e){return(e=+e)>-1e-8&&1e-8>e?e-e*e/2:h(1+e)},log10:function(e){return h(e)/Math.LN10},log2:function(e){return h(e)/Math.LN2},sign:o,sinh:function(e){return f(e=+e)<1?(s(e)-s(-e))/2:(p(e-1)-p(-e-1))*(l/2)},tanh:function(e){var t=s(e=+e),r=s(-e);return t==a?1:r==a?-1:(t-r)/(p(e)+p(-e))},trunc:function(e){return(e>0?m:g)(e)}})},{"./$.def":15}],58:[function(e,t,r){function n(e){var t,r;if(a(t=e.valueOf)&&!s(r=t.call(e)))return r;if(a(t=e.toString)&&!s(r=t.call(e)))return r;throw TypeError("Can't convert object to number")}function o(e){if(s(e)&&(e=n(e)),"string"==typeof e&&e.length>2&&48==e.charCodeAt(0)){var t=!1;switch(e.charCodeAt(1)){case 66:case 98:t=!0;case 79:case 111:return parseInt(e.slice(2),t?2:8)}}return+e}var i=e("./$"),s=i.isObject,a=i.isFunction,c="Number",l=i.g[c],u=l,f=l.prototype;!i.FW||l("0o1")&&l("0b1")||(l=function(e){return this instanceof l?new u(o(e)):o(e)},i.each.call(i.DESC?i.getNames(u):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),function(e){i.has(u,e)&&!i.has(l,e)&&i.setDesc(l,e,i.getDesc(u,e))}),l.prototype=f,f.constructor=l,e("./$.redef")(i.g,c,l))},{"./$":26,"./$.redef":31}],59:[function(e,t,r){function n(e){return!o.isObject(e)&&c(e)&&a(e)===e}var o=e("./$"),i=e("./$.def"),s=Math.abs,a=Math.floor,c=o.g.isFinite,l=9007199254740991;i(i.S,"Number",{EPSILON:Math.pow(2,-52),isFinite:function(e){return"number"==typeof e&&c(e)},isInteger:n,isNaN:function(e){return e!=e},isSafeInteger:function(e){return n(e)&&s(e)<=l},MAX_SAFE_INTEGER:l,MIN_SAFE_INTEGER:-l,parseFloat:parseFloat,parseInt:parseInt
2
+})},{"./$":26,"./$.def":15}],60:[function(e,t,r){var n=e("./$.def");n(n.S,"Object",{assign:e("./$.assign")})},{"./$.assign":8,"./$.def":15}],61:[function(e,t,r){var n=e("./$.def");n(n.S,"Object",{is:e("./$.same")})},{"./$.def":15,"./$.same":33}],62:[function(e,t,r){var n=e("./$.def");n(n.S,"Object",{setPrototypeOf:e("./$.set-proto").set})},{"./$.def":15,"./$.set-proto":34}],63:[function(e,t,r){var n=e("./$"),o=e("./$.def"),i=n.isObject,s=n.toObject;n.each.call("freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames".split(","),function(t,r){var a=(n.core.Object||{})[t]||Object[t],c=0,l={};l[t]=0==r?function(e){return i(e)?a(e):e}:1==r?function(e){return i(e)?a(e):e}:2==r?function(e){return i(e)?a(e):e}:3==r?function(e){return i(e)?a(e):!0}:4==r?function(e){return i(e)?a(e):!0}:5==r?function(e){return i(e)?a(e):!1}:6==r?function(e,t){return a(s(e),t)}:7==r?function(e){return a(Object(n.assertDefined(e)))}:8==r?function(e){return a(s(e))}:e("./$.get-names").get;try{a("z")}catch(u){c=1}o(o.S+o.F*c,"Object",l)})},{"./$":26,"./$.def":15,"./$.get-names":20}],64:[function(e,t,r){var n=e("./$.cof"),o={};o[e("./$.wks")("toStringTag")]="z",e("./$").FW&&"z"!=n(o)&&e("./$.redef")(Object.prototype,"toString",function(){return"[object "+n.classof(this)+"]"},!0)},{"./$":26,"./$.cof":9,"./$.redef":31,"./$.wks":44}],65:[function(e,t,r){function n(e){var t=new q(function(){});return e&&(t.constructor=Object),q.resolve(t)===t}function o(e){return T(e)&&(P?"Promise"==g.classof(e):x in e)}function i(e,t){return h.FW||e!==q||t!==p?k(e,t):!0}function s(e){var t=D(e)[$];return void 0!=t?t:e}function a(e){var t;return T(e)&&(t=e.then),F(t)?t:!1}function c(e){var t=e.c;t.length&&C.call(_,function(){function r(t){var r,i,s=o?t.ok:t.fail;try{s?(o||(e.h=!0),r=s===!0?n:s(n),r===t.P?t.rej(TypeError("Promise-chain cycle")):(i=a(r))?i.call(r,t.res,t.rej):t.res(r)):t.rej(n)}catch(c){t.rej(c)}}for(var n=e.v,o=1==e.s,i=0;t.length>i;)r(t[i++]);t.length=0})}function l(e){var t,r=e[x],n=r.a||r.c,o=0;if(r.h)return!1;for(;n.length>o;)if(t=n[o++],t.fail||!l(t.P))return!1;return!0}function u(e){var t,r=this;r.d||(r.d=!0,r=r.r||r,r.v=e,r.s=2,r.a=r.c.slice(),setTimeout(function(){C.call(_,function(){l(t=r.p)&&(E?A.emit("unhandledRejection",e,t):_.console&&console.error&&console.error("Unhandled promise rejection",e)),r.a=void 0})},1),c(r))}function f(e){var t,r=this;if(!r.d){r.d=!0,r=r.r||r;try{(t=a(e))?C.call(_,function(){var n={r:r,d:!1};try{t.call(e,d(f,n,1),d(u,n,1))}catch(o){u.call(n,o)}}):(r.v=e,r.s=1,c(r))}catch(n){u.call({r:r,d:!1},n)}}}var p,h=e("./$"),d=e("./$.ctx"),g=e("./$.cof"),m=e("./$.def"),v=e("./$.assert"),b=e("./$.for-of"),y=e("./$.set-proto").set,k=e("./$.same"),w=e("./$.species"),$=e("./$.wks")("species"),x=e("./$.uid").safe("record"),S="Promise",_=h.g,A=_.process,E="process"==g(A),C=A&&A.nextTick||e("./$.task").set,q=_[S],F=h.isFunction,T=h.isObject,M=v.fn,D=v.obj,P=function(){function e(t){var r=new q(t);return y(r,e.prototype),r}var t=!1;try{if(t=F(q)&&F(q.resolve)&&n(),y(e,q),e.prototype=h.create(q.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(t=!1),t&&h.DESC){var r=!1;q.resolve(h.setDesc({},"then",{get:function(){r=!0}})),t=r}}catch(o){t=!1}return t}();P||(q=function(e){M(e);var t={p:v.inst(this,q,S),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1};h.hide(this,x,t);try{e(d(f,t,1),d(u,t,1))}catch(r){u.call(t,r)}},e("./$.mix")(q.prototype,{then:function(e,t){var r=D(D(this).constructor)[$],n={ok:F(e)?e:!0,fail:F(t)?t:!1},o=n.P=new(void 0!=r?r:q)(function(e,t){n.res=M(e),n.rej=M(t)}),i=this[x];return i.c.push(n),i.a&&i.a.push(n),i.s&&c(i),o},"catch":function(e){return this.then(void 0,e)}})),m(m.G+m.W+m.F*!P,{Promise:q}),g.set(q,S),w(q),w(p=h.core[S]),m(m.S+m.F*!P,S,{reject:function(e){return new(s(this))(function(t,r){r(e)})}}),m(m.S+m.F*(!P||n(!0)),S,{resolve:function(e){return o(e)&&i(e.constructor,this)?e:new this(function(t){t(e)})}}),m(m.S+m.F*!(P&&e("./$.iter-detect")(function(e){q.all(e)["catch"](function(){})})),S,{all:function(e){var t=s(this),r=[];return new t(function(n,o){b(e,!1,r.push,r);var i=r.length,s=Array(i);i?h.each.call(r,function(e,r){t.resolve(e).then(function(e){s[r]=e,--i||n(s)},o)}):n(s)})},race:function(e){var t=s(this);return new t(function(r,n){b(e,!1,function(e){t.resolve(e).then(r,n)})})}})},{"./$":26,"./$.assert":7,"./$.cof":9,"./$.ctx":14,"./$.def":15,"./$.for-of":18,"./$.iter-detect":24,"./$.mix":28,"./$.same":33,"./$.set-proto":34,"./$.species":36,"./$.task":40,"./$.uid":42,"./$.wks":44}],66:[function(e,t,r){function n(e){o.set(this,l,{o:e,k:void 0,i:0})}var o=e("./$"),i=e("./$.def"),s=e("./$.set-proto"),a=e("./$.iter"),c=e("./$.wks")("iterator"),l=e("./$.uid").safe("iter"),u=a.step,f=e("./$.assert"),p=o.isObject,h=o.getProto,d=o.g.Reflect,g=Function.apply,m=f.obj,v=Object.isExtensible||p,b=Object.preventExtensions,y=!(d&&d.enumerate&&c in d.enumerate({}));a.create(n,"Object",function(){var e,t=this[l],r=t.k;if(void 0==r){t.k=r=[];for(e in t.o)r.push(e)}do if(t.i>=r.length)return u(1);while(!((e=r[t.i++])in t.o));return u(0,e)});var k={apply:function(e,t,r){return g.call(e,t,r)},construct:function(e,t){var r=f.fn(arguments.length<3?e:arguments[2]).prototype,n=o.create(p(r)?r:Object.prototype),i=g.call(e,n,t);return p(i)?i:n},defineProperty:function(e,t,r){m(e);try{return o.setDesc(e,t,r),!0}catch(n){return!1}},deleteProperty:function(e,t){var r=o.getDesc(m(e),t);return r&&!r.configurable?!1:delete e[t]},get:function(e,t){for(var r=arguments,n=!0;n;){var i=e,s=t;c=l=a=void 0,n=!1;var a,c=r.length<3?i:r[2],l=o.getDesc(m(i),s);if(l)return o.has(l,"value")?l.value:void 0===l.get?void 0:l.get.call(c);if(!p(a=h(i)))return void 0;r=[e=a,t=s,c],n=!0}},getOwnPropertyDescriptor:function(e,t){return o.getDesc(m(e),t)},getPrototypeOf:function(e){return h(m(e))},has:function(e,t){return t in e},isExtensible:function(e){return v(m(e))},ownKeys:e("./$.own-keys"),preventExtensions:function(e){m(e);try{return b&&b(e),!0}catch(t){return!1}},set:function(e,t,r){var n=arguments,i=!0;e:for(;i;){var s=e,a=t,c=r;f=d=l=u=void 0,i=!1;var l,u,f=n.length<4?s:n[3],d=o.getDesc(m(s),a);if(!d){if(p(u=h(s))){n=[e=u,t=a,r=c,f],i=!0;continue e}d=o.desc(0)}return o.has(d,"value")?d.writable!==!1&&p(f)?(l=o.getDesc(f,a)||o.desc(0),l.value=c,o.setDesc(f,a,l),!0):!1:void 0===d.set?!1:(d.set.call(f,c),!0)}}};s&&(k.setPrototypeOf=function(e,t){s.check(e,t);try{return s.set(e,t),!0}catch(r){return!1}}),i(i.G,{Reflect:{}}),i(i.S+i.F*y,"Reflect",{enumerate:function(e){return new n(m(e))}}),i(i.S,"Reflect",k)},{"./$":26,"./$.assert":7,"./$.def":15,"./$.iter":25,"./$.own-keys":29,"./$.set-proto":34,"./$.uid":42,"./$.wks":44}],67:[function(e,t,r){var n=e("./$"),o=e("./$.cof"),i=n.g.RegExp,s=i,a=i.prototype,c=/a/g,l=new i(c)!==c,u=function(){try{return"/a/i"==i(c,"i")}catch(e){}}();n.FW&&n.DESC&&(l&&u||(i=function(e,t){var r="RegExp"==o(e),n=void 0===t;return this instanceof i||!r||!n?l?new s(r&&!n?e.source:e,t):new s(r?e.source:e,r&&n?e.flags:t):e},n.each.call(n.getNames(s),function(e){e in i||n.setDesc(i,e,{configurable:!0,get:function(){return s[e]},set:function(t){s[e]=t}})}),a.constructor=i,i.prototype=a,e("./$.redef")(n.g,"RegExp",i)),"g"!=/./g.flags&&n.setDesc(a,"flags",{configurable:!0,get:e("./$.replacer")(/^.*\/(\w*)$/,"$1")})),e("./$.species")(i)},{"./$":26,"./$.cof":9,"./$.redef":31,"./$.replacer":32,"./$.species":36}],68:[function(e,t,r){var n=e("./$.collection-strong");e("./$.collection")("Set",function(e){return function(){return e(this,arguments[0])}},{add:function(e){return n.def(this,e=0===e?0:e,e)}},n)},{"./$.collection":13,"./$.collection-strong":10}],69:[function(e,t,r){var n=e("./$.def"),o=e("./$.string-at")(!1);n(n.P,"String",{codePointAt:function(e){return o(this,e)}})},{"./$.def":15,"./$.string-at":37}],70:[function(e,t,r){var n=e("./$"),o=e("./$.cof"),i=e("./$.def"),s=n.toLength;i(i.P+i.F*!e("./$.throws")(function(){"q".endsWith(/./)}),"String",{endsWith:function(e){if("RegExp"==o(e))throw TypeError();var t=String(n.assertDefined(this)),r=arguments[1],i=s(t.length),a=void 0===r?i:Math.min(s(r),i);return e+="",t.slice(a-e.length,a)===e}})},{"./$":26,"./$.cof":9,"./$.def":15,"./$.throws":41}],71:[function(e,t,r){var n=e("./$.def"),o=e("./$").toIndex,i=String.fromCharCode,s=String.fromCodePoint;n(n.S+n.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,s=0;n>s;){if(t=+arguments[s++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(65536>t?i(t):i(((t-=65536)>>10)+55296,t%1024+56320))}return r.join("")}})},{"./$":26,"./$.def":15}],72:[function(e,t,r){var n=e("./$"),o=e("./$.cof"),i=e("./$.def");i(i.P,"String",{includes:function(e){if("RegExp"==o(e))throw TypeError();return!!~String(n.assertDefined(this)).indexOf(e,arguments[1])}})},{"./$":26,"./$.cof":9,"./$.def":15}],73:[function(e,t,r){var n=e("./$").set,o=e("./$.string-at")(!0),i=e("./$.uid").safe("iter"),s=e("./$.iter"),a=s.step;e("./$.iter-define")(String,"String",function(e){n(this,i,{o:String(e),i:0})},function(){var e,t=this[i],r=t.o,n=t.i;return n>=r.length?a(1):(e=o(r,n),t.i+=e.length,a(0,e))})},{"./$":26,"./$.iter":25,"./$.iter-define":23,"./$.string-at":37,"./$.uid":42}],74:[function(e,t,r){var n=e("./$"),o=e("./$.def");o(o.S,"String",{raw:function(e){for(var t=n.toObject(e.raw),r=n.toLength(t.length),o=arguments.length,i=[],s=0;r>s;)i.push(String(t[s++])),o>s&&i.push(String(arguments[s]));return i.join("")}})},{"./$":26,"./$.def":15}],75:[function(e,t,r){var n=e("./$.def");n(n.P,"String",{repeat:e("./$.string-repeat")})},{"./$.def":15,"./$.string-repeat":39}],76:[function(e,t,r){var n=e("./$"),o=e("./$.cof"),i=e("./$.def");i(i.P+i.F*!e("./$.throws")(function(){"q".startsWith(/./)}),"String",{startsWith:function(e){if("RegExp"==o(e))throw TypeError();var t=String(n.assertDefined(this)),r=n.toLength(Math.min(arguments[1],t.length));return e+="",t.slice(r,r+e.length)===e}})},{"./$":26,"./$.cof":9,"./$.def":15,"./$.throws":41}],77:[function(e,t,r){function n(e){var t=O[e]=f.set(x(F.prototype),M,e);return w&&T&&I(k,e,{configurable:!0,set:function(t){$(this,D)&&$(this[D],e)&&(this[D][e]=!1),I(this,e,A(1,t))}}),t}function o(e,t,r){return r&&$(O,t)?(r.enumerable?($(e,D)&&e[D][t]&&(e[D][t]=!1),r=x(r,{enumerable:A(0,!1)})):($(e,D)||_(e,D,A(1,{})),e[D][t]=!0),I(e,t,r)):_(e,t,r)}function i(e,t){y(e);for(var r,n=b(t=q(t)),i=0,s=n.length;s>i;)o(e,r=n[i++],t[r]);return e}function s(e,t){return void 0===t?x(e):i(x(e),t)}function a(e){var t=P.call(this,e);return t||!$(this,e)||!$(O,e)||$(this,D)&&this[D][e]?t:!0}function c(e,t){var r=S(e=q(e),t);return!r||!$(O,t)||$(e,D)&&e[D][t]||(r.enumerable=!0),r}function l(e){for(var t,r=C(q(e)),n=[],o=0;r.length>o;)$(O,t=r[o++])||t==D||n.push(t);return n}function u(e){for(var t,r=C(q(e)),n=[],o=0;r.length>o;)$(O,t=r[o++])&&n.push(O[t]);return n}var f=e("./$"),p=e("./$.cof").set,h=e("./$.uid"),d=e("./$.shared"),g=e("./$.def"),m=e("./$.redef"),v=e("./$.keyof"),b=e("./$.enum-keys"),y=e("./$.assert").obj,k=Object.prototype,w=f.DESC,$=f.has,x=f.create,S=f.getDesc,_=f.setDesc,A=f.desc,E=e("./$.get-names"),C=E.get,q=f.toObject,F=f.g.Symbol,T=!1,M=h("tag"),D=h("hidden"),P={}.propertyIsEnumerable,L=d("symbol-registry"),O=d("symbols"),j=f.isFunction(F),I=w?function(){try{return x(_({},D,{get:function(){return _(this,D,{value:!1})[D]}}))[D]||_}catch(e){return function(e,t,r){var n=S(k,t);n&&delete k[t],_(e,t,r),n&&e!==k&&_(k,t,n)}}}():_;j||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor");return n(h(arguments[0]))},m(F.prototype,"toString",function(){return this[M]}),f.create=s,f.setDesc=o,f.getDesc=c,f.setDescs=i,f.getNames=E.get=l,f.getSymbols=u,f.DESC&&f.FW&&m(k,"propertyIsEnumerable",a,!0));var R={"for":function(e){return $(L,e+="")?L[e]:L[e]=F(e)},keyFor:function(e){return v(L,e)},useSetter:function(){T=!0},useSimple:function(){T=!1}};f.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(t){var r=e("./$.wks")(t);R[t]=j?r:n(r)}),T=!0,g(g.G+g.W,{Symbol:F}),g(g.S,"Symbol",R),g(g.S+g.F*!j,"Object",{create:s,defineProperty:o,defineProperties:i,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:u}),p(F,"Symbol"),p(Math,"Math",!0),p(f.g.JSON,"JSON",!0)},{"./$":26,"./$.assert":7,"./$.cof":9,"./$.def":15,"./$.enum-keys":17,"./$.get-names":20,"./$.keyof":27,"./$.redef":31,"./$.shared":35,"./$.uid":42,"./$.wks":44}],78:[function(e,t,r){var n=e("./$"),o=e("./$.collection-weak"),i=o.leakStore,s=o.ID,a=o.WEAK,c=n.has,l=n.isObject,u=Object.isExtensible||l,f={},p=e("./$.collection")("WeakMap",function(e){return function(){return e(this,arguments[0])}},{get:function(e){if(l(e)){if(!u(e))return i(this).get(e);if(c(e,a))return e[a][this[s]]}},set:function(e,t){return o.def(this,e,t)}},o,!0,!0);7!=(new p).set((Object.freeze||Object)(f),7).get(f)&&n.each.call(["delete","has","get","set"],function(t){var r=p.prototype,n=r[t];e("./$.redef")(r,t,function(e,r){if(l(e)&&!u(e)){var o=i(this)[t](e,r);return"set"==t?this:o}return n.call(this,e,r)})})},{"./$":26,"./$.collection":13,"./$.collection-weak":12,"./$.redef":31}],79:[function(e,t,r){var n=e("./$.collection-weak");e("./$.collection")("WeakSet",function(e){return function(){return e(this,arguments[0])}},{add:function(e){return n.def(this,e,!0)}},n,!1,!0)},{"./$.collection":13,"./$.collection-weak":12}],80:[function(e,t,r){var n=e("./$.def"),o=e("./$.array-includes")(!0);n(n.P,"Array",{includes:function(e){return o(this,e,arguments[1])}}),e("./$.unscope")("includes")},{"./$.array-includes":5,"./$.def":15,"./$.unscope":43}],81:[function(e,t,r){e("./$.collection-to-json")("Map")},{"./$.collection-to-json":11}],82:[function(e,t,r){var n=e("./$"),o=e("./$.def"),i=e("./$.own-keys");o(o.S,"Object",{getOwnPropertyDescriptors:function(e){var t=n.toObject(e),r={};return n.each.call(i(t),function(e){n.setDesc(r,e,n.desc(0,n.getDesc(t,e)))}),r}})},{"./$":26,"./$.def":15,"./$.own-keys":29}],83:[function(e,t,r){function n(e){return function(t){var r,n=o.toObject(t),i=o.getKeys(n),s=i.length,a=0,c=Array(s);if(e)for(;s>a;)c[a]=[r=i[a++],n[r]];else for(;s>a;)c[a]=n[i[a++]];return c}}var o=e("./$"),i=e("./$.def");i(i.S,"Object",{values:n(!1),entries:n(!0)})},{"./$":26,"./$.def":15}],84:[function(e,t,r){var n=e("./$.def");n(n.S,"RegExp",{escape:e("./$.replacer")(/[\\^$*+?.()|[\]{}]/g,"\\$&",!0)})},{"./$.def":15,"./$.replacer":32}],85:[function(e,t,r){e("./$.collection-to-json")("Set")},{"./$.collection-to-json":11}],86:[function(e,t,r){var n=e("./$.def"),o=e("./$.string-at")(!0);n(n.P,"String",{at:function(e){return o(this,e)}})},{"./$.def":15,"./$.string-at":37}],87:[function(e,t,r){var n=e("./$.def"),o=e("./$.string-pad");n(n.P,"String",{lpad:function(e){return o(this,e,arguments[1],!0)}})},{"./$.def":15,"./$.string-pad":38}],88:[function(e,t,r){var n=e("./$.def"),o=e("./$.string-pad");n(n.P,"String",{rpad:function(e){return o(this,e,arguments[1],!1)}})},{"./$.def":15,"./$.string-pad":38}],89:[function(e,t,r){function n(t,r){o.each.call(t.split(","),function(t){void 0==r&&t in s?a[t]=s[t]:t in[]&&(a[t]=e("./$.ctx")(Function.call,[][t],r))})}var o=e("./$"),i=e("./$.def"),s=o.core.Array||Array,a={};n("pop,reverse,shift,keys,values,entries",1),n("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),n("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill,turn"),i(i.S,"Array",a)},{"./$":26,"./$.ctx":14,"./$.def":15}],90:[function(e,t,r){e("./es6.array.iterator");var n=e("./$"),o=e("./$.iter").Iterators,i=e("./$.wks")("iterator"),s=o.Array,a=n.g.NodeList,c=n.g.HTMLCollection,l=a&&a.prototype,u=c&&c.prototype;n.FW&&(!a||i in l||n.hide(l,i,s),!c||i in u||n.hide(u,i,s)),o.NodeList=o.HTMLCollection=s},{"./$":26,"./$.iter":25,"./$.wks":44,"./es6.array.iterator":51}],91:[function(e,t,r){var n=e("./$.def"),o=e("./$.task");n(n.G+n.B,{setImmediate:o.set,clearImmediate:o.clear})},{"./$.def":15,"./$.task":40}],92:[function(e,t,r){function n(e){return l?function(t,r){return e(s(a,[].slice.call(arguments,2),o.isFunction(t)?t:Function(t)),r)}:e}var o=e("./$"),i=e("./$.def"),s=e("./$.invoke"),a=e("./$.partial"),c=o.g.navigator,l=!!c&&/MSIE .\./.test(c.userAgent);i(i.G+i.B+i.F*l,{setTimeout:n(o.g.setTimeout),setInterval:n(o.g.setInterval)})},{"./$":26,"./$.def":15,"./$.invoke":21,"./$.partial":30}],93:[function(e,t,r){e("./modules/es5"),e("./modules/es6.symbol"),e("./modules/es6.object.assign"),e("./modules/es6.object.is"),e("./modules/es6.object.set-prototype-of"),e("./modules/es6.object.to-string"),e("./modules/es6.object.statics-accept-primitives"),e("./modules/es6.function.name"),e("./modules/es6.function.has-instance"),e("./modules/es6.number.constructor"),e("./modules/es6.number.statics"),e("./modules/es6.math"),e("./modules/es6.string.from-code-point"),e("./modules/es6.string.raw"),e("./modules/es6.string.iterator"),e("./modules/es6.string.code-point-at"),e("./modules/es6.string.ends-with"),e("./modules/es6.string.includes"),e("./modules/es6.string.repeat"),e("./modules/es6.string.starts-with"),e("./modules/es6.array.from"),e("./modules/es6.array.of"),e("./modules/es6.array.iterator"),e("./modules/es6.array.species"),e("./modules/es6.array.copy-within"),e("./modules/es6.array.fill"),e("./modules/es6.array.find"),e("./modules/es6.array.find-index"),e("./modules/es6.regexp"),e("./modules/es6.promise"),e("./modules/es6.map"),e("./modules/es6.set"),e("./modules/es6.weak-map"),e("./modules/es6.weak-set"),e("./modules/es6.reflect"),e("./modules/es7.array.includes"),e("./modules/es7.string.at"),e("./modules/es7.string.lpad"),e("./modules/es7.string.rpad"),e("./modules/es7.regexp.escape"),e("./modules/es7.object.get-own-property-descriptors"),e("./modules/es7.object.to-array"),e("./modules/es7.map.to-json"),e("./modules/es7.set.to-json"),e("./modules/js.array.statics"),e("./modules/web.timers"),e("./modules/web.immediate"),e("./modules/web.dom.iterable"),t.exports=e("./modules/$").core},{"./modules/$":26,"./modules/es5":45,"./modules/es6.array.copy-within":46,"./modules/es6.array.fill":47,"./modules/es6.array.find":49,"./modules/es6.array.find-index":48,"./modules/es6.array.from":50,"./modules/es6.array.iterator":51,"./modules/es6.array.of":52,"./modules/es6.array.species":53,"./modules/es6.function.has-instance":54,"./modules/es6.function.name":55,"./modules/es6.map":56,"./modules/es6.math":57,"./modules/es6.number.constructor":58,"./modules/es6.number.statics":59,"./modules/es6.object.assign":60,"./modules/es6.object.is":61,"./modules/es6.object.set-prototype-of":62,"./modules/es6.object.statics-accept-primitives":63,"./modules/es6.object.to-string":64,"./modules/es6.promise":65,"./modules/es6.reflect":66,"./modules/es6.regexp":67,"./modules/es6.set":68,"./modules/es6.string.code-point-at":69,"./modules/es6.string.ends-with":70,"./modules/es6.string.from-code-point":71,"./modules/es6.string.includes":72,"./modules/es6.string.iterator":73,"./modules/es6.string.raw":74,"./modules/es6.string.repeat":75,"./modules/es6.string.starts-with":76,"./modules/es6.symbol":77,"./modules/es6.weak-map":78,"./modules/es6.weak-set":79,"./modules/es7.array.includes":80,"./modules/es7.map.to-json":81,"./modules/es7.object.get-own-property-descriptors":82,"./modules/es7.object.to-array":83,"./modules/es7.regexp.escape":84,"./modules/es7.set.to-json":85,"./modules/es7.string.at":86,"./modules/es7.string.lpad":87,"./modules/es7.string.rpad":88,"./modules/js.array.statics":89,"./modules/web.dom.iterable":90,"./modules/web.immediate":91,"./modules/web.timers":92}],94:[function(e,t,r){(function(e,r){!function(r){function n(e,t,r,n){var o=Object.create((t||i).prototype);return o._invoke=f(e,r||null,new d(n||[])),o}function o(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}function i(){}function s(){}function a(){}function c(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){this.arg=e}function u(t){function r(e,r){var n=t[e](r),o=n.value;return o instanceof l?Promise.resolve(o.arg).then(i,s):Promise.resolve(o).then(function(e){return n.value=e,n},s)}function n(e,t){var n=o?o.then(function(){return r(e,t)}):new Promise(function(n){n(r(e,t))});return o=n["catch"](a),n}"object"==typeof e&&e.domain&&(r=e.domain.bind(r));var o,i=r.bind(t,"next"),s=r.bind(t,"throw"),a=r.bind(t,"return");this._invoke=n}function f(e,t,r){var n=$;return function(i,s){if(n===S)throw new Error("Generator is already running");if(n===_)return m();for(;;){var a=r.delegate;if(a){if("return"===i||"throw"===i&&a.iterator[i]===v){r.delegate=null;var c=a.iterator["return"];if(c){var l=o(c,a.iterator,s);if("throw"===l.type){i="throw",s=l.arg;continue}}if("return"===i)continue}var l=o(a.iterator[i],a.iterator,s);if("throw"===l.type){r.delegate=null,i="throw",s=l.arg;continue}i="next",s=v;var u=l.arg;if(!u.done)return n=x,u;r[a.resultName]=u.value,r.next=a.nextLoc,r.delegate=null}if("next"===i)n===x?r.sent=s:delete r.sent;else if("throw"===i){if(n===$)throw n=_,s;r.dispatchException(s)&&(i="next",s=v)}else"return"===i&&r.abrupt("return",s);n=S;var l=o(e,t,r);if("normal"===l.type){n=r.done?_:x;var u={value:l.arg,done:r.done};if(l.arg!==A)return u;r.delegate&&"next"===i&&(s=v)}else"throw"===l.type&&(n=_,i="throw",s=l.arg)}}}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function h(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset()}function g(e){if(e){var t=e[y];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function o(){for(;++r<e.length;)if(b.call(e,r))return o.value=e[r],o.done=!1,o;return o.value=v,o.done=!0,o};return n.next=n}}return{next:m}}function m(){return{value:v,done:!0}}var v,b=Object.prototype.hasOwnProperty,y="function"==typeof Symbol&&Symbol.iterator||"@@iterator",k="object"==typeof t,w=r.regeneratorRuntime;if(w)return void(k&&(t.exports=w));w=r.regeneratorRuntime=k?t.exports:{},w.wrap=n;var $="suspendedStart",x="suspendedYield",S="executing",_="completed",A={},E=a.prototype=i.prototype;s.prototype=E.constructor=a,a.constructor=s,s.displayName="GeneratorFunction",w.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return t?t===s||"GeneratorFunction"===(t.displayName||t.name):!1},w.mark=function(e){return e.__proto__=a,e.prototype=Object.create(E),e},w.awrap=function(e){return new l(e)},c(u.prototype),w.async=function(e,t,r,o){var i=new u(n(e,t,r,o));return w.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},c(E),E[y]=function(){return this},E.toString=function(){return"[object Generator]"},w.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},w.values=g,d.prototype={constructor:d,reset:function(){this.prev=0,this.next=0,this.sent=v,this.done=!1,this.delegate=null,this.tryEntries.forEach(h);for(var e,t=0;b.call(this,e="t"+t)||20>t;++t)this[e]=null},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,n){return i.type="throw",i.arg=e,r.next=t,!!n}if(this.done)throw e;for(var r=this,n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var s=b.call(o,"catchLoc"),a=b.call(o,"finallyLoc");if(s&&a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?this.next=o.finallyLoc:this.complete(i),A},complete:function(e,t){if("throw"===e.type)throw e.arg;"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=e.arg,this.next="end"):"normal"===e.type&&t&&(this.next=t)},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),h(r),A}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;h(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:g(e),resultName:t,nextLoc:r},A}}}("object"==typeof r?r:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:4}]},{},[1]),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.markdownit=e()}}(function(){var e;return function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return o(r?r:t)},u,u.exports,t,e,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t){t.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",
3
+equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒","in":"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬","int":"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"	",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},{}],2:[function(e,t){var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),t.exports=r},{}],3:[function(e,t){function r(e,t){return e=e.source,t=t||"",function r(n,o){return n?(o=o.source,e=e.replace(n,o),r):new RegExp(e,t)}}var n=/[a-zA-Z_:][a-zA-Z0-9:._-]*/,o=/[^"'=<>`\x00-\x20]+/,i=/'[^']*'/,s=/"[^"]*"/,a=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",o)("single_quoted",i)("double_quoted",s)(),c=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",n)("attr_value",a)(),l=r(/<[A-Za-z][A-Za-z0-9\-]*attribute*\s*\/?>/)("attribute",c)(),u=/<\/[A-Za-z][A-Za-z0-9\-]*\s*>/,f=/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,p=/<[?].*?[?]>/,h=/<![A-Z]+\s+[^>]*>/,d=/<!\[CDATA\[[\s\S]*?\]\]>/,g=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",l)("close_tag",u)("comment",f)("processing",p)("declaration",h)("cdata",d)();t.exports.HTML_TAG_RE=g},{}],4:[function(e,t){t.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},{}],5:[function(e,t,r){function n(e){return Object.prototype.toString.call(e)}function o(e){return"[object String]"===n(e)}function i(e,t){return $.call(e,t)}function s(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function a(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))}function c(e){return e.indexOf("\\")<0?e:e.replace(x,"$1")}function l(e){return e>=55296&&57343>=e?!1:e>=64976&&65007>=e?!1:65535===(65535&e)||65534===(65535&e)?!1:e>=0&&8>=e?!1:11===e?!1:e>=14&&31>=e?!1:e>=127&&159>=e?!1:e>1114111?!1:!0}function u(e){if(e>65535){e-=65536;var t=55296+(e>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function f(e,t){var r=0;return i(A,t)?A[t]:35===t.charCodeAt(0)&&_.test(t)&&(r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),l(r))?u(r):e}function p(e){return e.indexOf("&")<0?e:e.replace(S,f)}function h(e){return q[e]}function d(e){return E.test(e)?e.replace(C,h):e}function g(e,t,r){var n=e.charCodeAt(0);return n>=55296&&56319>=n?t>=r.length-1?"�":(n=r.charCodeAt(t+1),56320>n||n>57343?"�":e):0===t?"�":(n=r.charCodeAt(t-1),55296>n||n>56319?"�":e)}function m(e){return F.test(e)?e.replace(T,g):e}function v(e){var t=p(e);try{t=decodeURI(t)}catch(r){}try{return encodeURI(m(t))}catch(r){return""}}function b(e){return e.replace(M,"\\$&")}function y(e){if(e>=8192&&8202>=e)return!0;switch(e){case 9:case 10:case 13:case 12:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function k(e){return D.test(e)}function w(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}var $=Object.prototype.hasOwnProperty,x=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,S=/&([a-z#][a-z0-9]{1,31});/gi,_=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,A=e("./entities"),E=/[&<>"]/,C=/[&<>"]/g,q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},F=/[\uD800-\uDFFF]/,T=/[\uD800-\uDFFF]/g,M=/[.?*+^$[\]\\(){}|-]/g,D=/[\x21-\x23\x25-\x2A\x2C-\x2F\x3A\x3B\x3F\x40\x5B-\x5D\x5F\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/;r.assign=s,r.isString=o,r.has=i,r.unescapeMd=c,r.isValidEntityCode=l,r.fromCodePoint=u,r.replaceEntities=p,r.escapeHtml=d,r.arrayReplaceAt=a,r.normalizeLink=v,r.isWhiteSpace=y,r.isMdAsciiPunct=w,r.isPunctChar=k,r.escapeRE=b,r.fixBrokenSurrogates=m},{"./entities":1}],6:[function(e,t,r){r.parseLinkLabel=e("./parse_link_label"),r.parseLinkDestination=e("./parse_link_destination"),r.parseLinkTitle=e("./parse_link_title")},{"./parse_link_destination":8,"./parse_link_label":9,"./parse_link_title":10}],7:[function(e,t){t.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},{}],8:[function(e,t){var r=e("../common/utils").normalizeLink,n=e("../common/utils").unescapeMd;t.exports=function(e,t,o){var i,s,a=0,c=t,l={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;o>t;){if(i=e.charCodeAt(t),10===i)return l;if(62===i)return l.pos=t+1,l.str=r(n(e.slice(c+1,t))),l.ok=!0,l;92===i&&o>t+1?t+=2:t++}return l}for(s=0;o>t&&(i=e.charCodeAt(t),32!==i)&&!(32>i||127===i);)if(92===i&&o>t+1)t+=2;else{if(40===i&&(s++,s>1))break;if(41===i&&(s--,0>s))break;t++}return c===t?l:(l.str=r(n(e.slice(c,t))),l.lines=a,l.pos=t,l.ok=!0,l)}},{"../common/utils":5}],9:[function(e,t){t.exports=function(e,t,r){var n,o,i,s,a=-1,c=e.posMax,l=e.pos;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,n=1;e.pos<c;){if(i=e.src.charCodeAt(e.pos),93===i&&(n--,0===n)){o=!0;break}if(s=e.pos,e.md.inline.skipToken(e),91===i)if(s===e.pos-1)n++;else if(r)return e.pos=l,-1}return o?(a=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=l,a}},{}],10:[function(e,t){var r=e("../common/utils").unescapeMd;t.exports=function(e,t,n){var o,i,s=0,a=t,c={ok:!1,pos:0,lines:0,str:""};if(t>=n)return c;if(i=e.charCodeAt(t),34!==i&&39!==i&&40!==i)return c;for(t++,40===i&&(i=41);n>t;){if(o=e.charCodeAt(t),o===i)return c.pos=t+1,c.lines=s,c.str=r(e.slice(a+1,t)),c.ok=!0,c;10===o?s++:92===o&&n>t+1&&(t++,10===e.charCodeAt(t)&&s++),t++}return c}},{"../common/utils":5}],11:[function(e,t){function r(e,t){return this instanceof r?(t||n.isString(e)||(t=e||{},e="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new i,this.utils=n,this.helpers=o,this.options={},this.configure(e),void(t&&this.set(t))):new r(e,t)}var n=e("./common/utils"),o=e("./helpers"),i=e("./renderer"),s=e("./parser_core"),a=e("./parser_block"),c=e("./parser_inline"),l={"default":e("./presets/default"),zero:e("./presets/zero"),commonmark:e("./presets/commonmark")};r.prototype.set=function(e){return n.assign(this.options,e),this},r.prototype.configure=function(e){var t,r=this;if(n.isString(e)&&(t=e,e=l[t],!e))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&r.set(e.options),e.components&&Object.keys(e.components).forEach(function(t){e.components[t].rules&&r[t].ruler.enableOnly(e.components[t].rules)}),this},r.prototype.enable=function(e,t){var r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.enable(e,!0))},this);var n=e.filter(function(e){return r.indexOf(e)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},r.prototype.disable=function(e,t){var r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.disable(e,!0))},this);var n=e.filter(function(e){return r.indexOf(e)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},r.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},r.prototype.parse=function(e,t){var r=new this.core.State(e,this,t);return this.core.process(r),r.tokens},r.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},r.prototype.parseInline=function(e,t){var r=new this.core.State(e,this,t);return r.inlineMode=!0,this.core.process(r),r.tokens},r.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},t.exports=r},{"./common/utils":5,"./helpers":6,"./parser_block":12,"./parser_core":13,"./parser_inline":14,"./presets/commonmark":15,"./presets/default":16,"./presets/zero":17,"./renderer":18}],12:[function(e,t){function r(){this.ruler=new n;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1],{alt:(o[e][2]||[]).slice()})}var n=e("./ruler"),o=[["code",e("./rules_block/code")],["fence",e("./rules_block/fence"),["paragraph","reference","blockquote","list"]],["blockquote",e("./rules_block/blockquote"),["paragraph","reference","blockquote","list"]],["hr",e("./rules_block/hr"),["paragraph","reference","blockquote","list"]],["list",e("./rules_block/list"),["paragraph","reference","blockquote"]],["reference",e("./rules_block/reference"),["reference"]],["heading",e("./rules_block/heading"),["paragraph","reference","blockquote"]],["lheading",e("./rules_block/lheading")],["html_block",e("./rules_block/html_block"),["paragraph","reference","blockquote"]],["table",e("./rules_block/table"),["paragraph","reference"]],["paragraph",e("./rules_block/paragraph")]];r.prototype.tokenize=function(e,t,r){for(var n,o,i=this.ruler.getRules(""),s=i.length,a=t,c=!1,l=e.md.options.maxNesting;r>a&&(e.line=a=e.skipEmptyLines(a),!(a>=r))&&!(e.tShift[a]<e.blkIndent);){if(e.level>=l){e.line=r;break}for(o=0;s>o&&!(n=i[o](e,a,r,!1));o++);if(e.tight=!c,e.isEmpty(e.line-1)&&(c=!0),a=e.line,r>a&&e.isEmpty(a)){if(c=!0,a++,r>a&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}},r.prototype.parse=function(e,t,r,n){var o;return e?(o=new this.State(e,t,r,n),void this.tokenize(o,o.line,o.lineMax)):[]},r.prototype.State=e("./rules_block/state_block"),t.exports=r},{"./ruler":19,"./rules_block/blockquote":20,"./rules_block/code":21,"./rules_block/fence":22,"./rules_block/heading":23,"./rules_block/hr":24,"./rules_block/html_block":25,"./rules_block/lheading":26,"./rules_block/list":27,"./rules_block/paragraph":28,"./rules_block/reference":29,"./rules_block/state_block":30,"./rules_block/table":31}],13:[function(e,t){function r(){this.ruler=new n;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}var n=e("./ruler"),o=[["normalize",e("./rules_core/normalize")],["block",e("./rules_core/block")],["inline",e("./rules_core/inline")],["replacements",e("./rules_core/replacements")],["smartquotes",e("./rules_core/smartquotes")],["linkify",e("./rules_core/linkify")]];r.prototype.process=function(e){var t,r,n;for(n=this.ruler.getRules(""),t=0,r=n.length;r>t;t++)n[t](e)},r.prototype.State=e("./rules_core/state_core"),t.exports=r},{"./ruler":19,"./rules_core/block":32,"./rules_core/inline":33,"./rules_core/linkify":34,"./rules_core/normalize":35,"./rules_core/replacements":36,"./rules_core/smartquotes":37,"./rules_core/state_core":38}],14:[function(e,t){function r(e){var t=e.trim().toLowerCase();return t=i(t),t.indexOf(":")>=0&&a.indexOf(t.split(":")[0])>=0?!1:!0;
4
+}function n(){this.validateLink=r,this.ruler=new o;for(var e=0;e<s.length;e++)this.ruler.push(s[e][0],s[e][1])}var o=e("./ruler"),i=e("./common/utils").replaceEntities,s=[["text",e("./rules_inline/text")],["newline",e("./rules_inline/newline")],["escape",e("./rules_inline/escape")],["backticks",e("./rules_inline/backticks")],["strikethrough",e("./rules_inline/strikethrough")],["emphasis",e("./rules_inline/emphasis")],["link",e("./rules_inline/link")],["image",e("./rules_inline/image")],["autolink",e("./rules_inline/autolink")],["html_inline",e("./rules_inline/html_inline")],["entity",e("./rules_inline/entity")]],a=["vbscript","javascript","file"];n.prototype.skipToken=function(e){var t,r,n=e.pos,o=this.ruler.getRules(""),i=o.length,s=e.md.options.maxNesting;if((r=e.cacheGet(n))>0)return void(e.pos=r);if(e.level<s)for(t=0;i>t;t++)if(o[t](e,!0))return void e.cacheSet(n,e.pos);e.pos++,e.cacheSet(n,e.pos)},n.prototype.tokenize=function(e){for(var t,r,n=this.ruler.getRules(""),o=n.length,i=e.posMax,s=e.md.options.maxNesting;e.pos<i;){if(e.level<s)for(r=0;o>r&&!(t=n[r](e,!1));r++);if(t){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},n.prototype.parse=function(e,t,r,n){var o=new this.State(e,t,r,n);this.tokenize(o)},n.prototype.State=e("./rules_inline/state_inline"),t.exports=n},{"./common/utils":5,"./ruler":19,"./rules_inline/autolink":39,"./rules_inline/backticks":40,"./rules_inline/emphasis":41,"./rules_inline/entity":42,"./rules_inline/escape":43,"./rules_inline/html_inline":44,"./rules_inline/image":45,"./rules_inline/link":46,"./rules_inline/newline":47,"./rules_inline/state_inline":48,"./rules_inline/strikethrough":49,"./rules_inline/text":50}],15:[function(e,t){t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]}}}},{}],16:[function(e,t){t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},{}],17:[function(e,t){t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"]}}}},{}],18:[function(e,t){function r(){this.rules=n({},a)}var n=e("./common/utils").assign,o=e("./common/utils").unescapeMd,i=e("./common/utils").replaceEntities,s=e("./common/utils").escapeHtml,a={};a.blockquote_open=function(){return"<blockquote>\n"},a.blockquote_close=function(){return"</blockquote>\n"},a.code_block=function(e,t){return"<pre><code>"+s(e[t].content)+"</code></pre>\n"},a.code_inline=function(e,t){return"<code>"+s(e[t].content)+"</code>"},a.fence=function(e,t,r){var n,a=e[t],c="",l=r.langPrefix,u="";return a.params&&(u=s(i(o(a.params.split(/\s+/g)[0]))),c=' class="'+l+u+'"'),n=r.highlight?r.highlight(a.content,u)||s(a.content):s(a.content),"<pre><code"+c+">"+n+"</code></pre>\n"},a.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},a.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},a.hr=function(e,t,r){return r.xhtmlOut?"<hr />\n":"<hr>\n"},a.bullet_list_open=function(){return"<ul>\n"},a.bullet_list_close=function(){return"</ul>\n"},a.list_item_open=function(e,t){var r=e[t+1];return"list_item_close"===r.type||"paragraph_open"===r.type&&r.tight?"<li>":"<li>\n"},a.list_item_close=function(){return"</li>\n"},a.ordered_list_open=function(e,t){return e[t].order>1?'<ol start="'+e[t].order+'">\n':"<ol>\n"},a.ordered_list_close=function(){return"</ol>\n"},a.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},a.paragraph_close=function(e,t){return e[t].tight===!0?"close"===e[t+1].type.slice(-5)?"":"\n":"</p>\n"},a.link_open=function(e,t){var r=e[t].title?' title="'+s(i(e[t].title))+'"':"",n=e[t].target?' target="'+s(e[t].target)+'"':"";return'<a href="'+s(e[t].href)+'"'+r+n+">"},a.link_close=function(){return"</a>"},a.image=function(e,t,r,n,o){var a=' src="'+s(e[t].src)+'"',c=e[t].title?' title="'+s(i(e[t].title))+'"':"",l=' alt="'+o.renderInlineAsText(e[t].tokens,r,n)+'"',u=r.xhtmlOut?" /":"";return"<img"+a+l+c+u+">"},a.table_open=function(){return"<table>\n"},a.table_close=function(){return"</table>\n"},a.thead_open=function(){return"<thead>\n"},a.thead_close=function(){return"</thead>\n"},a.tbody_open=function(){return"<tbody>\n"},a.tbody_close=function(){return"</tbody>\n"},a.tr_open=function(){return"<tr>"},a.tr_close=function(){return"</tr>\n"},a.th_open=function(e,t){return e[t].align?'<th style="text-align:'+e[t].align+'">':"<th>"},a.th_close=function(){return"</th>"},a.td_open=function(e,t){return e[t].align?'<td style="text-align:'+e[t].align+'">':"<td>"},a.td_close=function(){return"</td>"},a.strong_open=function(){return"<strong>"},a.strong_close=function(){return"</strong>"},a.em_open=function(){return"<em>"},a.em_close=function(){return"</em>"},a.s_open=function(){return"<s>"},a.s_close=function(){return"</s>"},a.hardbreak=function(e,t,r){return r.xhtmlOut?"<br />\n":"<br>\n"},a.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"<br />\n":"<br>\n":"\n"},a.text=function(e,t){return s(e[t].content)},a.html_block=function(e,t){return e[t].content},a.html_inline=function(e,t){return e[t].content},r.prototype.renderInline=function(e,t,r){for(var n="",o=this.rules,i=0,s=e.length;s>i;i++)n+=o[e[i].type](e,i,t,r,this);return n},r.prototype.renderInlineAsText=function(e,t,r){for(var n="",o=this.rules,i=0,s=e.length;s>i;i++)"text"===e[i].type?n+=o.text(e,i,t,r,this):"image"===e[i].type&&(n+=this.renderInlineAsText(e[i].tokens,t,r));return n},r.prototype.render=function(e,t,r){var n,o,i="",s=this.rules;for(n=0,o=e.length;o>n;n++)i+="inline"===e[n].type?this.renderInline(e[n].children,t,r):s[e[n].type](e,n,t,r,this);return i},t.exports=r},{"./common/utils":5}],19:[function(e,t){function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||e.__cache__[t].push(r.fn))})})},r.prototype.at=function(e,t,r){var n=this.__find__(e),o=r||{};if(-1===n)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=o.alt||[],this.__cache__=null},r.prototype.before=function(e,t,r,n){var o=this.__find__(e),i=n||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:r,alt:i.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,r,n){var o=this.__find__(e),i=n||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:r,alt:i.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,r){var n=r||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var r=[];return e.forEach(function(e){var n=this.__find__(e);if(0>n){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[n].enabled=!0,r.push(e)},this),this.__cache__=null,r},r.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},r.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var r=[];return e.forEach(function(e){var n=this.__find__(e);if(0>n){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[n].enabled=!1,r.push(e)},this),this.__cache__=null,r},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},t.exports=r},{}],20:[function(e,t){t.exports=function(e,t,r,n){var o,i,s,a,c,l,u,f,p,h,d,g=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(g>m)return!1;if(62!==e.src.charCodeAt(g++))return!1;if(n)return!0;for(32===e.src.charCodeAt(g)&&g++,c=e.blkIndent,e.blkIndent=0,a=[e.bMarks[t]],e.bMarks[t]=g,g=m>g?e.skipSpaces(g):g,i=g>=m,s=[e.tShift[t]],e.tShift[t]=g-e.bMarks[t],f=e.md.block.ruler.getRules("blockquote"),o=t+1;r>o&&(g=e.bMarks[o]+e.tShift[o],m=e.eMarks[o],!(g>=m));o++)if(62!==e.src.charCodeAt(g++)){if(i)break;for(d=!1,p=0,h=f.length;h>p;p++)if(f[p](e,o,r,!0)){d=!0;break}if(d)break;a.push(e.bMarks[o]),s.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(g)&&g++,a.push(e.bMarks[o]),e.bMarks[o]=g,g=m>g?e.skipSpaces(g):g,i=g>=m,s.push(e.tShift[o]),e.tShift[o]=g-e.bMarks[o];for(l=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:u=[t,0],level:e.level++}),e.md.block.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=l,u[1]=e.line,p=0;p<s.length;p++)e.bMarks[p+t]=a[p],e.tShift[p+t]=s[p];return e.blkIndent=c,!0}},{}],21:[function(e,t){t.exports=function(e,t,r){var n,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=n=t+1;r>n;)if(e.isEmpty(n))n++;else{if(!(e.tShift[n]-e.blkIndent>=4))break;n++,o=n}return e.line=n,e.tokens.push({type:"code_block",content:e.getLines(t,o,4+e.blkIndent,!0),lines:[t,e.line],level:e.level}),!0}},{}],22:[function(e,t){t.exports=function(e,t,r,n){var o,i,s,a,c,l=!1,u=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(u+3>f)return!1;if(o=e.src.charCodeAt(u),126!==o&&96!==o)return!1;if(c=u,u=e.skipChars(u,o),i=u-c,3>i)return!1;if(s=e.src.slice(u,f).trim(),s.indexOf("`")>=0)return!1;if(n)return!0;for(a=t;a++,!(a>=r||(u=c=e.bMarks[a]+e.tShift[a],f=e.eMarks[a],f>u&&e.tShift[a]<e.blkIndent));)if(e.src.charCodeAt(u)===o&&!(e.tShift[a]-e.blkIndent>=4||(u=e.skipChars(u,o),i>u-c||(u=e.skipSpaces(u),f>u)))){l=!0;break}return i=e.tShift[t],e.line=a+(l?1:0),e.tokens.push({type:"fence",params:s,content:e.getLines(t+1,a,i,!0),lines:[t,e.line],level:e.level}),!0}},{}],23:[function(e,t){t.exports=function(e,t,r,n){var o,i,s,a=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(a>=c)return!1;if(o=e.src.charCodeAt(a),35!==o||a>=c)return!1;for(i=1,o=e.src.charCodeAt(++a);35===o&&c>a&&6>=i;)i++,o=e.src.charCodeAt(++a);return i>6||c>a&&32!==o?!1:n?!0:(c=e.skipCharsBack(c,32,a),s=e.skipCharsBack(c,35,a),s>a&&32===e.src.charCodeAt(s-1)&&(c=s),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:i,lines:[t,e.line],level:e.level}),c>a&&e.tokens.push({type:"inline",content:e.src.slice(a,c).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:i,level:e.level}),!0)}},{}],24:[function(e,t){t.exports=function(e,t,r,n){var o,i,s,a=e.bMarks[t],c=e.eMarks[t];if(a+=e.tShift[t],a>c)return!1;if(o=e.src.charCodeAt(a++),42!==o&&45!==o&&95!==o)return!1;for(i=1;c>a;){if(s=e.src.charCodeAt(a++),s!==o&&32!==s)return!1;s===o&&i++}return 3>i?!1:n?!0:(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0)}},{}],25:[function(e,t){function r(e){var t=32|e;return t>=97&&122>=t}var n=e("../common/html_blocks"),o=/^<([a-zA-Z]{1,15})[\s\/>]/,i=/^<\/([a-zA-Z]{1,15})[\s>]/;t.exports=function(e,t,s,a){var c,l,u,f=e.bMarks[t],p=e.eMarks[t],h=e.tShift[t];if(f+=h,!e.md.options.html)return!1;if(h>3||f+2>=p)return!1;if(60!==e.src.charCodeAt(f))return!1;if(c=e.src.charCodeAt(f+1),33===c||63===c){if(a)return!0}else{if(47!==c&&!r(c))return!1;if(47===c){if(l=e.src.slice(f,p).match(i),!l)return!1}else if(l=e.src.slice(f,p).match(o),!l)return!1;if(n[l[1].toLowerCase()]!==!0)return!1;if(a)return!0}for(u=t+1;u<e.lineMax&&!e.isEmpty(u);)u++;return e.line=u,e.tokens.push({type:"html_block",level:e.level,lines:[t,e.line],content:e.getLines(t,u,0,!0)}),!0}},{"../common/html_blocks":2}],26:[function(e,t){t.exports=function(e,t,r){var n,o,i,s=t+1;return s>=r?!1:e.tShift[s]<e.blkIndent?!1:e.tShift[s]-e.blkIndent>3?!1:(o=e.bMarks[s]+e.tShift[s],i=e.eMarks[s],o>=i?!1:(n=e.src.charCodeAt(o),45!==n&&61!==n?!1:(o=e.skipChars(o,n),o=e.skipSpaces(o),i>o?!1:(o=e.bMarks[t]+e.tShift[t],e.line=s+1,e.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:e.level}),!0))))}},{}],27:[function(e,t){function r(e,t){var r,n,o;return n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],n>=o?-1:(r=e.src.charCodeAt(n++),42!==r&&45!==r&&43!==r?-1:o>n&&32!==e.src.charCodeAt(n)?-1:n)}function n(e,t){var r,n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(n+1>=o)return-1;if(r=e.src.charCodeAt(n++),48>r||r>57)return-1;for(;;){if(n>=o)return-1;if(r=e.src.charCodeAt(n++),!(r>=48&&57>=r)){if(41===r||46===r)break;return-1}}return o>n&&32!==e.src.charCodeAt(n)?-1:n}function o(e,t){var r,n,o=e.level+2;for(r=t+2,n=e.tokens.length-2;n>r;r++)e.tokens[r].level===o&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].tight=!0,e.tokens[r].tight=!0,r+=2)}t.exports=function(e,t,i,s){var a,c,l,u,f,p,h,d,g,m,v,b,y,k,w,$,x,S,_,A,E,C,q=!0;if((d=n(e,t))>=0)y=!0;else{if(!((d=r(e,t))>=0))return!1;y=!1}if(b=e.src.charCodeAt(d-1),s)return!0;for(w=e.tokens.length,y?(h=e.bMarks[t]+e.tShift[t],v=Number(e.src.substr(h,d-h-1)),e.tokens.push({type:"ordered_list_open",order:v,lines:x=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:x=[t,0],level:e.level++}),a=t,$=!1,_=e.md.block.ruler.getRules("list");!(!(i>a)||(k=e.skipSpaces(d),g=e.eMarks[a],m=k>=g?1:k-d,m>4&&(m=1),1>m&&(m=1),c=d-e.bMarks[a]+m,e.tokens.push({type:"list_item_open",lines:S=[t,0],level:e.level++}),u=e.blkIndent,f=e.tight,l=e.tShift[t],p=e.parentType,e.tShift[t]=k-e.bMarks[t],e.blkIndent=c,e.tight=!0,e.parentType="list",e.md.block.tokenize(e,t,i,!0),(!e.tight||$)&&(q=!1),$=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=u,e.tShift[t]=l,e.tight=f,e.parentType=p,e.tokens.push({type:"list_item_close",level:--e.level}),a=t=e.line,S[1]=a,k=e.bMarks[t],a>=i)||e.isEmpty(a)||e.tShift[a]<e.blkIndent);){for(C=!1,A=0,E=_.length;E>A;A++)if(_[A](e,a,i,!0)){C=!0;break}if(C)break;if(y){if(d=n(e,a),0>d)break}else if(d=r(e,a),0>d)break;if(b!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:y?"ordered_list_close":"bullet_list_close",level:--e.level}),x[1]=a,e.line=a,q&&o(e,w),!0}},{}],28:[function(e,t){t.exports=function(e,t){var r,n,o,i,s,a,c=t+1;if(r=e.lineMax,r>c&&!e.isEmpty(c))for(a=e.md.block.ruler.getRules("paragraph");r>c&&!e.isEmpty(c);c++)if(!(e.tShift[c]-e.blkIndent>3)){for(o=!1,i=0,s=a.length;s>i;i++)if(a[i](e,c,r,!0)){o=!0;break}if(o)break}return n=e.getLines(t,c,e.blkIndent,!1).trim(),e.line=c,n.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:n,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},{}],29:[function(e,t){var r=e("../helpers/parse_link_destination"),n=e("../helpers/parse_link_title"),o=e("../helpers/normalize_reference");t.exports=function(e,t,i,s){var a,c,l,u,f,p,h,d,g,m,v,b,y,k,w,$=0,x=e.bMarks[t]+e.tShift[t],S=e.eMarks[t],_=t+1;if(x>=S)return!1;if(91!==e.src.charCodeAt(x))return!1;if(u=e.lineMax,u>_&&!e.isEmpty(_))for(k=e.md.block.ruler.getRules("references");u>_&&!e.isEmpty(_);_++)if(!(e.tShift[_]-e.blkIndent>3)){for(y=!1,p=0,h=k.length;h>p;p++)if(k[p](e,_,u,!0)){y=!0;break}if(y)break}for(b=e.getLines(t,_,e.blkIndent,!1).trim(),S=b.length,x=1;S>x;x++){if(a=b.charCodeAt(x),91===a)return!1;if(93===a){g=x;break}10===a?$++:92===a&&(x++,S>x&&10===b.charCodeAt(x)&&$++)}if(0>g||58!==b.charCodeAt(g+1))return!1;for(x=g+2;S>x;x++)if(a=b.charCodeAt(x),10===a)$++;else if(32!==a)break;if(m=r(b,x,S),!m.ok)return!1;if(!e.md.inline.validateLink(m.str))return!1;for(f=m.str,x=m.pos,$+=m.lines,c=x,l=$,v=x;S>x;x++)if(a=b.charCodeAt(x),10===a)$++;else if(32!==a)break;for(m=n(b,x,S),S>x&&v!==x&&m.ok?(w=m.str,x=m.pos,$+=m.lines):(w="",x=c,$=l);S>x&&32===b.charCodeAt(x);)x++;return S>x&&10!==b.charCodeAt(x)?!1:s?!0:(d=o(b.slice(1,g)),"undefined"==typeof e.env.references&&(e.env.references={}),"undefined"==typeof e.env.references[d]&&(e.env.references[d]={title:w,href:f}),e.line=t+$+1,!0)}},{"../helpers/normalize_reference":7,"../helpers/parse_link_destination":8,"../helpers/parse_link_title":10}],30:[function(e,t){function r(e,t,r,n){var o,i,s,a,c,l,u;for(this.src=e,this.md=t,this.env=r,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",i=this.src,l=0,u=!1,s=a=l=0,c=i.length;c>a;a++){if(o=i.charCodeAt(a),!u){if(32===o){l++;continue}u=!0}(10===o||a===c-1)&&(10!==o&&a++,this.bMarks.push(s),this.eMarks.push(a),this.tShift.push(l),u=!1,l=0,s=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;t>e&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;t>e&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var r=this.src.length;r>e&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,r){if(r>=e)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,r,n){var o,i,s,a,c,l=e;if(e>=t)return"";if(l+1===t)return i=this.bMarks[l]+Math.min(this.tShift[l],r),s=n?this.bMarks[t]:this.eMarks[t-1],this.src.slice(i,s);for(a=new Array(t-e),o=0;t>l;l++,o++)c=this.tShift[l],c>r&&(c=r),0>c&&(c=0),i=this.bMarks[l]+c,s=t>l+1||n?this.eMarks[l]+1:this.eMarks[l],a[o]=this.src.slice(i,s);return a.join("")},t.exports=r},{}],31:[function(e,t){function r(e,t){var r=e.bMarks[t]+e.blkIndent,n=e.eMarks[t];return e.src.substr(r,n-r)}t.exports=function(e,t,n,o){var i,s,a,c,l,u,f,p,h,d;if(t+2>n)return!1;if(l=t+1,e.tShift[l]<e.blkIndent)return!1;if(a=e.bMarks[l]+e.tShift[l],a>=e.eMarks[l])return!1;if(i=e.src.charCodeAt(a),124!==i&&45!==i&&58!==i)return!1;if(s=r(e,t+1),!/^[-:| ]+$/.test(s))return!1;if(u=s.split("|"),2>=u)return!1;for(f=[],c=0;c<u.length;c++){if(p=u[c].trim(),!p){if(0===c||c===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(p))return!1;f.push(58===p.charCodeAt(p.length-1)?58===p.charCodeAt(0)?"center":"right":58===p.charCodeAt(0)?"left":"")}if(s=r(e,t).trim(),-1===s.indexOf("|"))return!1;if(u=s.replace(/^\||\|$/g,"").split("|"),f.length!==u.length)return!1;if(o)return!0;for(e.tokens.push({type:"table_open",lines:h=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),c=0;c<u.length;c++)e.tokens.push({type:"th_open",align:f[c],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:u[c].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:d=[t+2,0],level:e.level++}),l=t+2;n>l&&!(e.tShift[l]<e.blkIndent)&&(s=r(e,l).trim(),-1!==s.indexOf("|"));l++){for(u=s.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),c=0;c<u.length;c++)e.tokens.push({type:"td_open",align:f[c],level:e.level++}),e.tokens.push({type:"inline",content:u[c].replace(/^\|? *| *\|?$/g,""),level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),h[1]=d[1]=l,e.line=l,!0}},{}],32:[function(e,t){t.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src,level:0,lines:[0,1],children:[]}):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},{}],33:[function(e,t){t.exports=function(e){var t,r,n,o=e.tokens;for(r=0,n=o.length;n>r;r++)t=o[r],"inline"===t.type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},{}],34:[function(e,t){function r(e){return/^<a[>\s]/i.test(e)}function n(e){return/^<\/a\s*>/i.test(e)}function o(){var e=[],t=new i({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,r){switch(r.getType()){case"url":e.push({text:r.matchedText,url:r.getUrl()});break;case"email":e.push({text:r.matchedText,url:"mailto:"+r.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}var i=e("autolinker"),s=e("../common/utils").arrayReplaceAt,a=/www|@|\:\/\//;t.exports=function(e){var t,i,c,l,u,f,p,h,d,g,m,v,b,y=e.tokens,k=null;if(e.md.options.linkify)for(i=0,c=y.length;c>i;i++)if("inline"===y[i].type)for(l=y[i].children,m=0,t=l.length-1;t>=0;t--)if(u=l[t],"link_close"!==u.type){if("html_inline"===u.type&&(r(u.content)&&m>0&&m--,n(u.content)&&m++),!(m>0)&&"text"===u.type&&a.test(u.content)){if(k||(k=o(),v=k.links,b=k.autolinker),f=u.content,v.length=0,b.link(f),!v.length)continue;for(p=[],g=u.level,h=0;h<v.length;h++)e.md.inline.validateLink(v[h].url)&&(d=f.indexOf(v[h].text),d&&(g=g,p.push({type:"text",content:f.slice(0,d),level:g})),p.push({type:"link_open",href:v[h].url,target:"",title:"",level:g++}),p.push({type:"text",content:v[h].text,level:g}),p.push({type:"link_close",level:--g}),f=f.slice(d+v[h].text.length));f.length&&p.push({type:"text",content:f,level:g}),y[i].children=l=s(l,t,p)}}else for(t--;l[t].level!==u.level&&"link_open"!==l[t].type;)t--}},{"../common/utils":5,autolinker:51}],35:[function(e,t){var r=/[\n\t]/g,n=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,o=/\u0000/g;t.exports=function(e){var t,i,s;t=e.src.replace(n,"\n"),t=t.replace(o,"�"),t.indexOf("	")>=0&&(i=0,s=0,t=t.replace(r,function(e,r){var n;return 10===t.charCodeAt(r)?(i=r+1,s=0,e):(n="    ".slice((r-i-s)%4),s=r-i+1,n)})),e.src=t}},{}],36:[function(e,t){function r(e){return e.indexOf("(")<0?e:e.replace(o,function(e,t){return i[t.toLowerCase()]})}var n=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};t.exports=function(e){var t,o,i,s,a;if(e.md.options.typographer)for(a=e.tokens.length-1;a>=0;a--)if("inline"===e.tokens[a].type)for(s=e.tokens[a].children,t=s.length-1;t>=0;t--)o=s[t],"text"===o.type&&(i=o.content,i=r(i),n.test(i)&&(i=i.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])\u2026/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),o.content=i)}},{}],37:[function(e,t){function r(e,t){return 0>t||t>=e.length?!1:!s.test(e[t])}function n(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}var o=/['"]/,i=/['"]/g,s=/[-\s()\[\]]/,a="’";t.exports=function(e){var t,s,c,l,u,f,p,h,d,g,m,v,b,y,k,w,$;if(e.md.options.typographer)for($=[],k=e.tokens.length-1;k>=0;k--)if("inline"===e.tokens[k].type)for(w=e.tokens[k].children,$.length=0,t=0;t<w.length;t++)if(s=w[t],"text"===s.type&&!o.test(s.text)){for(p=w[t].level,b=$.length-1;b>=0&&!($[b].level<=p);b--);$.length=b+1,c=s.content,u=0,f=c.length;e:for(;f>u&&(i.lastIndex=u,l=i.exec(c));)if(h=!r(c,l.index-1),u=l.index+1,y="'"===l[0],d=!r(c,u),d||h){if(m=!d,v=!h)for(b=$.length-1;b>=0&&(g=$[b],!($[b].level<p));b--)if(g.single===y&&$[b].level===p){g=$[b],y?(w[g.token].content=n(w[g.token].content,g.pos,e.md.options.quotes[2]),s.content=n(s.content,l.index,e.md.options.quotes[3])):(w[g.token].content=n(w[g.token].content,g.pos,e.md.options.quotes[0]),s.content=n(s.content,l.index,e.md.options.quotes[1])),$.length=b;continue e}m?$.push({token:t,pos:l.index,single:y,level:p}):v&&y&&(s.content=n(s.content,l.index,a))}else y&&(s.content=n(s.content,l.index,a))}}},{}],38:[function(e,t){t.exports=function(e,t,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=t}},{}],39:[function(e,t){var r=e("../common/url_schemas"),n=e("../common/utils").normalizeLink,o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,i=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;t.exports=function(e,t){var s,a,c,l,u,f=e.pos;return 60!==e.src.charCodeAt(f)?!1:(s=e.src.slice(f),s.indexOf(">")<0?!1:(a=s.match(i))?r.indexOf(a[1].toLowerCase())<0?!1:(l=a[0].slice(1,-1),u=n(l),e.md.inline.validateLink(l)?(t||(e.push({type:"link_open",href:u,target:"",level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=a[0].length,!0):!1):(c=s.match(o),c?(l=c[0].slice(1,-1),u=n("mailto:"+l),e.md.inline.validateLink(u)?(t||(e.push({type:"link_open",href:u,target:"",level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=c[0].length,!0):!1):!1))}},{"../common/url_schemas":4,"../common/utils":5}],40:[function(e,t){t.exports=function(e,t){var r,n,o,i,s,a=e.pos,c=e.src.charCodeAt(a);if(96!==c)return!1;for(r=a,a++,n=e.posMax;n>a&&96===e.src.charCodeAt(a);)a++;for(o=e.src.slice(r,a),i=s=a;-1!==(i=e.src.indexOf("`",s));){for(s=i+1;n>s&&96===e.src.charCodeAt(s);)s++;if(s-i===o.length)return t||e.push({type:"code_inline",content:e.src.slice(a,i).replace(/[ \n]+/g," ").trim(),level:e.level}),e.pos=s,!0}return t||(e.pending+=o),e.pos+=o.length,!0}},{}],41:[function(e,t){function r(e){return e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e}function n(e,t){var n,a,c,l,u,f,p,h=t,d=!0,g=!0,m=e.posMax,v=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;m>h&&e.src.charCodeAt(h)===v;)h++;return h>=m&&(d=!1),c=h-t,a=m>h?e.src.charCodeAt(h):-1,u=n>=0&&(s(n)||i(String.fromCharCode(n))),p=a>=0&&(s(a)||i(String.fromCharCode(a))),l=n>=0&&o(n),f=a>=0&&o(a),f?d=!1:p&&(l||u||-1===n||(d=!1)),l?g=!1:u&&(f||p||-1===a||(g=!1)),95===v&&(r(n)&&(d=!1),r(a)&&(g=!1)),{can_open:d,can_close:g,delims:c}}var o=e("../common/utils").isWhiteSpace,i=e("../common/utils").isPunctChar,s=e("../common/utils").isMdAsciiPunct;t.exports=function(e,t){var r,o,i,s,a,c,l,u=e.posMax,f=e.pos,p=e.src.charCodeAt(f);if(95!==p&&42!==p)return!1;if(t)return!1;if(l=n(e,f),r=l.delims,!l.can_open)return e.pos+=r,e.pending+=e.src.slice(f,e.pos),!0;for(e.pos=f+r,c=[r];e.pos<u;)if(e.src.charCodeAt(e.pos)!==p)e.md.inline.skipToken(e);else{if(l=n(e,e.pos),o=l.delims,l.can_close){for(s=c.pop(),a=o;s!==a;){if(s>a){c.push(s-a);break}if(a-=s,0===c.length)break;e.pos+=s,s=c.pop()}if(0===c.length){r=s,i=!0;break}e.pos+=o;continue}l.can_open&&c.push(o),e.pos+=o}if(!i)return e.pos=f,!1;for(e.posMax=e.pos,e.pos=f+r,o=r;o>1;o-=2)e.push({type:"strong_open",level:e.level++});for(o%2&&e.push({type:"em_open",level:e.level++}),e.md.inline.tokenize(e),o%2&&e.push({type:"em_close",level:--e.level}),o=r;o>1;o-=2)e.push({type:"strong_close",level:--e.level});return e.pos=e.posMax+r,e.posMax=u,!0}},{"../common/utils":5}],42:[function(e,t){var r=e("../common/entities"),n=e("../common/utils").has,o=e("../common/utils").isValidEntityCode,i=e("../common/utils").fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,a=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(e,t){var c,l,u,f=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(f))return!1;if(p>f+1)if(c=e.src.charCodeAt(f+1),35===c){if(u=e.src.slice(f).match(s))return t||(l="x"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),e.pending+=i(o(l)?l:65533)),e.pos+=u[0].length,!0}else if(u=e.src.slice(f).match(a),u&&n(r,u[1]))return t||(e.pending+=r[u[1]]),e.pos+=u[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},{"../common/entities":1,"../common/utils":5}],43:[function(e,t){for(var r=[],n=0;256>n;n++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),t.exports=function(e,t){var n,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(o++,i>o){if(n=e.src.charCodeAt(o),256>n&&0!==r[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),o++;i>o&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},{}],44:[function(e,t){function r(e){var t=32|e;return t>=97&&122>=t}var n=e("../common/html_re").HTML_TAG_RE;t.exports=function(e,t){var o,i,s,a=e.pos;return e.md.options.html?(s=e.posMax,60!==e.src.charCodeAt(a)||a+2>=s?!1:(o=e.src.charCodeAt(a+1),(33===o||63===o||47===o||r(o))&&(i=e.src.slice(a).match(n))?(t||e.push({type:"html_inline",content:e.src.slice(a,a+i[0].length),level:e.level}),e.pos+=i[0].length,!0):!1)):!1}},{"../common/html_re":3}],45:[function(e,t){var r=e("../helpers/parse_link_label"),n=e("../helpers/parse_link_destination"),o=e("../helpers/parse_link_title"),i=e("../helpers/normalize_reference");t.exports=function(e,t){var s,a,c,l,u,f,p,h,d,g,m,v=e.pos,b=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(u=e.pos+2,l=r(e,e.pos+1,!1),0>l)return!1;if(f=l+1,b>f&&40===e.src.charCodeAt(f)){for(f++;b>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);if(f>=b)return!1;for(m=f,h=n(e.src,f,e.posMax),h.ok&&e.md.inline.validateLink(h.str)?(a=h.str,f=h.pos):a="",m=f;b>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);if(h=o(e.src,f,e.posMax),b>f&&m!==f&&h.ok)for(d=h.str,f=h.pos;b>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);else d="";if(f>=b||41!==e.src.charCodeAt(f))return e.pos=v,!1;f++}else{if("undefined"==typeof e.env.references)return!1;for(;b>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);if(b>f&&91===e.src.charCodeAt(f)?(m=f+1,f=r(e,f),f>=0?c=e.src.slice(m,f++):f=l+1):f=l+1,c||(c=e.src.slice(u,l)),p=e.env.references[i(c)],!p)return e.pos=v,!1;a=p.href,d=p.title}if(!t){e.pos=u,e.posMax=l;var y=new e.md.inline.State(e.src.slice(u,l),e.md,e.env,g=[]);y.md.inline.tokenize(y),e.push({type:"image",src:a,title:d,tokens:g,level:e.level})}return e.pos=f,e.posMax=b,!0}},{"../helpers/normalize_reference":7,"../helpers/parse_link_destination":8,"../helpers/parse_link_label":9,"../helpers/parse_link_title":10}],46:[function(e,t){var r=e("../helpers/parse_link_label"),n=e("../helpers/parse_link_destination"),o=e("../helpers/parse_link_title"),i=e("../helpers/normalize_reference");t.exports=function(e,t){var s,a,c,l,u,f,p,h,d,g=e.pos,m=e.posMax,v=e.pos;if(91!==e.src.charCodeAt(e.pos))return!1;if(u=e.pos+1,l=r(e,e.pos,!0),0>l)return!1;if(f=l+1,m>f&&40===e.src.charCodeAt(f)){for(f++;m>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);if(f>=m)return!1;for(v=f,p=n(e.src,f,e.posMax),p.ok&&e.md.inline.validateLink(p.str)?(a=p.str,f=p.pos):a="",v=f;m>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);if(p=o(e.src,f,e.posMax),m>f&&v!==f&&p.ok)for(d=p.str,f=p.pos;m>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);else d="";if(f>=m||41!==e.src.charCodeAt(f))return e.pos=g,!1;f++}else{if("undefined"==typeof e.env.references)return!1;for(;m>f&&(s=e.src.charCodeAt(f),32===s||10===s);f++);if(m>f&&91===e.src.charCodeAt(f)?(v=f+1,f=r(e,f),f>=0?c=e.src.slice(v,f++):f=l+1):f=l+1,c||(c=e.src.slice(u,l)),h=e.env.references[i(c)],!h)return e.pos=g,!1;a=h.href,d=h.title}return t||(e.pos=u,e.posMax=l,e.push({type:"link_open",href:a,target:"",title:d,level:e.level++}),e.md.inline.tokenize(e),e.push({type:"link_close",level:--e.level})),e.pos=f,e.posMax=m,!0}},{"../helpers/normalize_reference":7,"../helpers/parse_link_destination":8,"../helpers/parse_link_label":9,"../helpers/parse_link_title":10}],47:[function(e,t){t.exports=function(e,t){var r,n,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;for(r=e.pending.length-1,n=e.posMax,t||(r>=0&&32===e.pending.charCodeAt(r)?r>=1&&32===e.pending.charCodeAt(r-1)?(e.pending=e.pending.replace(/ +$/,""),e.push({type:"hardbreak",level:e.level})):(e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level})):e.push({type:"softbreak",level:e.level})),o++;n>o&&32===e.src.charCodeAt(o);)o++;return e.pos=o,
5
+!0}},{}],48:[function(e,t){function r(e,t,r,n){this.src=e,this.env=r,this.md=t,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var r=this.cache.length;e>=r;r++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},t.exports=r},{}],49:[function(e,t){function r(e,t){var r,s,a,c,l,u,f,p=t,h=!0,d=!0,g=e.posMax,m=e.src.charCodeAt(t);for(r=t>0?e.src.charCodeAt(t-1):-1;g>p&&e.src.charCodeAt(p)===m;)p++;return p>=g&&(h=!1),a=p-t,s=g>p?e.src.charCodeAt(p):-1,l=r>=0&&(i(r)||o(String.fromCharCode(r))),f=s>=0&&(i(s)||o(String.fromCharCode(s))),c=r>=0&&n(r),u=s>=0&&n(s),u?h=!1:f&&(c||l||-1===r||(h=!1)),c?d=!1:l&&(u||f||-1===s||(d=!1)),{can_open:h,can_close:d,delims:a}}var n=e("../common/utils").isWhiteSpace,o=e("../common/utils").isPunctChar,i=e("../common/utils").isMdAsciiPunct;t.exports=function(e,t){var n,o,i,s,a,c,l=e.posMax,u=e.pos,f=e.src.charCodeAt(u);if(126!==f)return!1;if(t)return!1;if(c=r(e,u),n=c.delims,!c.can_open)return e.pos+=n,e.pending+=e.src.slice(u,e.pos),!0;if(a=Math.floor(n/2),0>=a)return!1;for(e.pos=u+n;e.pos<l;)if(e.src.charCodeAt(e.pos)!==f)e.md.inline.skipToken(e);else{if(c=r(e,e.pos),o=c.delims,i=Math.floor(o/2),c.can_close){if(i>=a){e.pos+=o-2,s=!0;break}a-=i,e.pos+=o;continue}c.can_open&&(a+=i),e.pos+=o}return s?(e.posMax=e.pos,e.pos=u+2,e.push({type:"s_open",level:e.level++}),e.md.inline.tokenize(e),e.push({type:"s_close",level:--e.level}),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=u,!1)}},{"../common/utils":5}],50:[function(e,t){function r(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},{}],51:[function(t,r,n){!function(t,o){"function"==typeof e&&e.amd?e([],function(){return t.returnExportsGlobal=o()}):"object"==typeof n?r.exports=o():t.Autolinker=o()}(this,function(){var e=function t(e){t.Util.assign(this,e),this.matchValidator=new t.MatchValidator};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,className:"",htmlCharacterEntitiesRegex:/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,n=/(?:www\.)/,o=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,i=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,s=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",t.source,o.source,i.source,")","|","(","(?:","(",r.source,o.source,")","|","(?:","(.?//)?",n.source,o.source,")","|","(?:","(.?//)?",o.source,i.source,")",")","(?:"+s.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,link:function(t){var r=this,n=this.getHtmlParser(),o=this.htmlCharacterEntitiesRegex,i=0,s=[];return n.parse(t,{processHtmlNode:function(e,t,r){"a"===t&&(r?i=Math.max(i-1,0):i++),s.push(e)},processTextNode:function(t){if(0===i)for(var n=e.Util.splitAndCapture(t,o),a=0,c=n.length;c>a;a++){var l=n[a],u=r.processTextNode(l);s.push(u)}else s.push(t)}}),s.join("")},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.HtmlParser),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},processTextNode:function(e){var t=this;return e.replace(this.matcherRegex,function(e,r,n,o,i,s,a,c,l){var u=t.processCandidateMatch(e,r,n,o,i,s,a,c,l);if(u){var f=t.createMatchReturnVal(u.match,u.matchStr);return u.prefixStr+f+u.suffixStr}return e})},processCandidateMatch:function(t,r,n,o,i,s,a,c,l){var u,f=c||l,p="",h="";if(r&&!this.twitter||i&&!this.email||s&&!this.urls||!this.matchValidator.isValidMatch(s,a,f))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),h=")"),i)u=new e.match.Email({matchedText:t,email:i});else if(r)n&&(p=n,t=t.slice(1)),u=new e.match.Twitter({matchedText:t,twitterHandle:o});else{if(f){var d=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";d&&(p=d,t=t.slice(1))}u=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!a,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:p,suffixStr:h,matchStr:t,match:u}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var r=e.match(/\(/g),n=e.match(/\)/g),o=r&&r.length||0,i=n&&n.length||0;if(i>o)return!0}return!1},createMatchReturnVal:function(t,r){var n;if(this.replaceFn&&(n=this.replaceFn.call(this,this,t)),"string"==typeof n)return n;if(n===!1)return r;if(n instanceof e.HtmlTag)return n.toString();var o=this.getTagBuilder(),i=o.build(t);return i.toString()}},e.link=function(t,r){var n=new e(r);return n.link(t)},e.match={},e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var n=t.prototype,o=function(){};o.prototype=n;var i;i=r.hasOwnProperty("constructor")?r.constructor:function(){n.constructor.apply(this,arguments)};var s=i.prototype=new o;return s.constructor=i,s.superclass=n,delete r.constructor,e.Util.assign(s,r),i},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,n=[],o=0;r=t.exec(e);)n.push(e.substring(o,r.index)),n.push(r[0]),o=r.index+r[0].length;return n.push(e.substring(o)),n}},e.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=t.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",n,")*","\\s*/?",">",")"].join(""),"gi")}(),parse:function(e,t){t=t||{};for(var r,n=t.processHtmlNode||function(){},o=t.processTextNode||function(){},i=this.htmlRegex,s=0;null!==(r=i.exec(e));){var a=r[0],c=r[1]||r[3],l=!!r[2],u=e.substring(s,r.index);u&&o(u),n(a,c.toLowerCase(),l),s=r.index+a.length}if(s<e.length){var f=e.substring(s);f&&o(f)}}}),e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var r=this.getAttrs();return r[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,n=this.getClass(),o=this.whitespaceRegex,i=e.Util.indexOf,s=n?n.split(o):[],a=t.split(o);r=a.shift();)-1===i(s,r)&&s.push(r);return this.getAttrs()["class"]=s.join(" "),this},removeClass:function(t){for(var r,n=this.getClass(),o=this.whitespaceRegex,i=e.Util.indexOf,s=n?n.split(o):[],a=t.split(o);s.length&&(r=a.shift());){var c=i(s,r);-1!==c&&s.splice(c,1)}return this.getAttrs()["class"]=s.join(" "),this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,r){return t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r)?!1:!0},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0];return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return e&&t?!this.hasWordCharAfterProtocolRegex.test(e):!1},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var r=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return r},createAttrs:function(e,t){var r={href:t},n=this.createCssClass(e);return n&&(r["class"]=n),this.newWindow&&(r.target="_blank"),r},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&amp;/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e})},{}],52:[function(e,t){t.exports=e("./lib/")},{"./lib/":11}]},{},[52])(52)}),window.markdownitMapLines=function(e){e.renderer.rules.paragraph_open=function(e,t){return e[t].lines?'<p id="line-start-'+e[t].lines[0]+'" data-line-end="'+e[t].lines[1]+'">':"<p>"},e.renderer.rules.heading_open=function(e,t){return e[t].lines?"<h"+e[t].hLevel+' id="line-start-'+e[t].lines[0]+'" data-line-end="'+e[t].lines[1]+'">':"<h"+e[t].hLevel+">"},e.renderer.rules.hr=function(e,t){return e[t].lines?'<hr id="line-start-'+e[t].lines[0]+'" data-line-end="'+e[t].lines[1]+'" />\n':"<hr />\n"},e.renderer.rules.code_block=function(e,t){return e[t].lines?'<pre id="line-start-'+e[t].lines[0]+'" data-line-end="'+e[t].lines[1]+'"><code>'+escapeHtml(e[t].content)+"</code></pre>\n":"<pre><code>"+escapeHtml(e[t].content)+"</code></pre>\n"},e.renderer.rules.fence=e.renderer.rules.code_block,e.renderer.rules.tr_open=function(e,t){return e[t].lines?'<tr id="line-start-'+e[t].lines[0]+'" data-line-end="'+e[t].lines[1]+'">':"<tr>"}};var $body,keyCode,doesSupportInputEvent,scrollIntoView,getElRefOffset,escapeHtml,updateElFontSize,Modal,shortcutManager,$document=$(document);$document.ready(function(){$body=$(document.body)}),function(){keyCode={TAB:9,ESCAPE:27,MINUS:189,MINUS_FF:173,PLUS:187,PLUS_FF:61,NUMPADMINUS:109,NUMPADPLUS:107},doesSupportInputEvent=function(){var e="oninput"in document.createElement("textarea");return e&&-1!=navigator.userAgent.indexOf("MSIE 9.0")&&(e=!1),e}(),String.prototype.trim||(String.prototype.trim=function(){return $.trim(this)}),scrollIntoView=function(){var e=function(e,t,r,n,o){var i,s,a="vertical"==t?"scrollTop":"scrollLeft",c="vertical"==t?e.offsetHeight:e.offsetWidth,l=n+2*o;return l>c?void(e[a]=r[0]+(l-c)/2):(i=e[a],s=i-r[0]+o,s>0?void(e[a]-=s):(s=r[1]-(i+c)+o,void(s>0&&(e[a]+=s))))};return function(t){t.padding=t.padding||0,t.axis="horizontal"==t.axis?"horizontal":"vertical";var r;t.el?(t.elSize="vertical"==t.axis?t.el.offsetHeight:t.el.offsetWidth,r=getElRefOffset(t.el,"vertical"==t.axis?"top":"left",t.ref),t.elOffsets=[r,r+t.elSize]):t.elSize=t.elOffsets[1]-t.elOffsets[0],e(t.ref,t.axis,t.elOffsets,t.elSize,t.padding)}}(),getElRefOffset=function(e,t,r){var n="left"!=t?"offsetTop":"offsetLeft",o=e[n];for(r||(r=document.body);(e=e.offsetParent)!=r;)o+=e[n];return o},escapeHtml=function(){var e=/[&<>"']/g,t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},r=function(e){return t[e]};return function(t){return t.replace(e,r)}}(),updateElFontSize=function(e,t){var r=parseFloat(e.css("font-size"));r+=t,e.css("font-size",r)},Promise.prototype.done=function(){this["catch"](function(e){console.error("Uncaught error or rejection inside Promise",e)})},Modal=function(){var e=function(e,t){return['<div class="modal-container" style="display: none">','<div class="modal">','<div class="content">'+e+"</div>",'<div class="buttons"><a href="#" class="decoy"></a>'+t+'<a href="#" class="decoy"></a></div>',"</div>","</div>"].join("")},t=[],r=function(){return t.length?(t[t.length-1].close(),!0):!1},n=function(){$document.on("keydown.modal",function(e){if(e.keyCode==keyCode.ESCAPE){var t=r();t&&e.stopImmediatePropagation()}})},o=function(e){var t=e.el[0].getElementsByClassName("decoy"),r=t[0],n=t[1],o=e.buttonsEls.first(),i=e.buttonsEls.last();e.el.on("focusin",function(e){switch(e.stopPropagation(),e.target){case r:i.focus();break;case n:o.focus()}})},i=function(t){var r=this;r.el=$(e(t.content,t.buttons)).appendTo($body),r.buttonsEls=t.buttons?r.el.find(".buttons .button"):[],r.buttonsEls.length&&(o(r),setTimeout(function(){r.buttonsEls.last().focus()},0)),"function"==typeof t.onInit&&setTimeout(function(){t.onInit.call(r)})};return i.prototype.show=function(){this.el.show(),t.push(this)},i.prototype.close=function(){this.el.trigger("close.modal").remove(),t.splice(t.length-1,1)},i.isModalOpen=function(){return!!t.length},n(),i}(),shortcutManager=function(){var e=" + ",t=new Map,r=function(){$body.on("keydown",n)},n=function(r){if(r.ctrlKey||r.metaKey){var n,o,i=["CTRL"];r.shiftKey&&i.push("SHIFT"),r.altKey&&i.push("ALT"),i.push(r.keyCode),n=i.join(e),o=t.get(n),o&&(Modal.isModalOpen()?r.preventDefault():o(r))}};return $document.ready(r),{register:function(r,n){var o,i,s,a=r instanceof Array?r:[r],c=!0,l=!1,u=void 0;try{for(var f,p=a[Symbol.iterator]();!(c=(f=p.next()).done);c=!0)r=f.value,o=r.split(e),i=o.length-1,s=o[i],keyCode.hasOwnProperty(s)&&(o[i]=keyCode[s]),r=o.join(e),t.set(r,n)}catch(h){l=!0,u=h}finally{try{!c&&p["return"]&&p["return"]()}finally{if(l)throw u}}}}}()}();var preview;$(document).ready(function(){var e=document.getElementById("preview");preview={getSourceLineOffset:function(){var t=function(e){return document.getElementById("line-start-"+e)};return function(r,n){var o,i,s,a,c,l,u=t(r);if(u)return o=getElRefOffset(u,"top"),[o,o+u.offsetHeight];i=0,s=[null,null],c=[!0,!0];do i++,c[0]&&(a=r-i,0>a?(s[0]=0,c[0]=!1):(u=t(a),u&&(s[0]=getElRefOffset(u,"top"),c[0]=!1,l=u.getAttribute("data-line-end"),l&&l>=r&&(s[1]=s[0]+u.offsetHeight,c[1]=!1)))),c[1]&&(a=r+i,a>=n?(s[1]=e.scrollHeight,c[1]=!1):(u=t(a),u&&(s[1]=getElRefOffset(u,"top")+u.offsetHeight,c[1]=!1)));while(c[0]||c[1]);return s}}(),onImagesLoad:function(e){var t,r=$body.find("img"),n=r.length;n&&(t=function(){--n<=0&&e()},r.each(function(){var e=$(this);e.complete?t():e.on("load",t)}))}}});var editor,$window=$(window);$document.ready(function(){var e=$(".buttons-container");editor={fitHeightElements:$(".full-height"),wrappersMargin:$("#left-column > .wrapper:first").outerHeight(!0)-$("#left-column > .wrapper:first").height(),previewMarkdownConverter:window.markdownit({html:!0}).use(window.markdownitMapLines),cleanHtmlMarkdownConverter:window.markdownit({html:!0}),columns:$("#left-column, #right-column"),markdown:"",markdownSource:$("#markdown"),markdownHtml:document.getElementById("html"),markdownPreview:$("#preview"),markdownTargets:$("#html, #preview"),buttonsContainers:e,markdownTargetsTriggers:e.find(".switch"),topPanels:$("#top_panels_container .top_panel"),topPanelsTriggers:e.find(".toppanel"),quickReferencePreText:$("#quick-reference pre"),featuresTriggers:e.find(".feature"),wordCountContainers:$(".word-count"),isSyncScrollDisabled:!0,isFullscreen:!1,activePanel:null,themeSelector:document.getElementById("theme"),init:function(){this.onloadEffect(0),this.initBindings(),this.fitHeight(),this.restoreState(function(){editor.onInput(),editor.onloadEffect(1)}),t.initBindings()},initBindings:function(){if($window.on("resize",function(){editor.fitHeight()}),this.markdownSource.on("keydown",function(e){e.ctrlKey||e.keyCode!=keyCode.TAB||editor.handleTabKeyPress(e)}),doesSupportInputEvent)this.markdownSource.on("input",function(){editor.onInput(!0)});else{var e=function(){editor.onInput(!0)};this.markdownSource.on({"keyup change":e,"cut paste drop":function(){setTimeout(e,0)}})}this.markdownTargetsTriggers.on("click",function(e){e.preventDefault(),editor.switchToPanel($(this).data("switchto"))}),this.topPanelsTriggers.on("click",function(e){e.preventDefault(),editor.toggleTopPanel($("#"+$(this).data("toppanel")))}),this.topPanels.children(".close").on("click",function(e){e.preventDefault(),editor.closeTopPanels()}),this.quickReferencePreText.on("click",function(){editor.addToMarkdownSource($(this).text())}),this.featuresTriggers.on("click",function(e){e.preventDefault();var t=$(this);editor.toggleFeature(t.data("feature"),t.data())})},onInput:function(e){var t=this.markdownSource.val();t!=this.markdown&&(this.markdown=t,this.onChange(e))},onChange:function(e){this.save("markdown",this.markdown),this.convertMarkdown(e)},fitHeight:function(){var e=$window.height()-this.wrappersMargin;this.fitHeightElements.each(function(){var t=$(this);if(t.closest("#left-column").length)var r=e-$("#top_panels_container").outerHeight();else var r=e;t.css({height:r+"px"})})},save:function(e,t){app.save(e,t)},restoreState:function(e){app.restoreState(function(r){r.markdown&&editor.markdownSource.val(r.markdown),"y"!=r.isSyncScrollDisabled&&editor.toggleFeature("sync-scroll"),"y"==r.isFullscreen&&editor.toggleFeature("fullscreen"),editor.switchToPanel(r.activePanel||"preview"),t.restore({fontSizeFactor:r.fontSizeFactor,theme:r.theme}),e()})},convertMarkdown:function(e){var t;("preview"==this.activePanel||"html"==this.activePanel)&&("preview"==this.activePanel?(t=this.previewMarkdownConverter.render(this.markdown),app.updateMarkdownPreview(t,e),this.triggerEditorUpdatedEvent(e)):"html"==this.activePanel&&(t=this.cleanHtmlMarkdownConverter.render(this.markdown),this.markdownHtml.value=t))},triggerEditorUpdatedEvent:function(e){editor.markdownPreview.trigger("updated.editor",[{syncScrollReference:e?editor.syncScroll.ref.CARET:editor.syncScroll.ref.SCROLLBAR}])},addToMarkdownSource:function(e,t,r){var n,o,i=this.markdown;"undefined"==typeof t?(i.length&&(e="\n\n"+e),n=i+e,o=n.length,this.updateMarkdownSource(n,{start:o,end:o})):(n=i.substring(0,t.start)+e+i.substring(t.end),r?t=r:t.start=t.end=t.start+e.length,this.updateMarkdownSource(n,t))},updateMarkdownSource:function(e,t,r){this.markdownSource.val(e),t&&this.setMarkdownSourceCaretPos(t),this.onInput(r)},getMarkdownSourceCaretPos:function(){var e=this.markdownSource[0];if("number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd)return{start:e.selectionStart,end:e.selectionEnd}},setMarkdownSourceCaretPos:function(e){var t=this.markdownSource[0];"setSelectionRange"in t&&(t.blur(),t.setSelectionRange(e.start,e.end),t.focus())},getMarkdownSourceLineFromPos:function(e){var t=this.markdown.slice(0,e.start);return t.split("\n").length-1},getMarkdownSourceLineCount:function(e){return this.markdown.split("\n").length},switchToPanel:function(e){var t=$("#"+e),r=this.markdownTargetsTriggers.filter("[data-switchto="+e+"]");if(this.isFullscreen&&"markdown"==e||this.markdownTargets.not(t).hide(),t.show(),this.markdownTargetsTriggers.not(r).removeClass("active"),r.addClass("active"),"markdown"!=e&&this.featuresTriggers.filter("[data-feature=fullscreen][data-tofocus]").last().data("tofocus",e),this.isFullscreen){var n="markdown"==e?this.markdownSource.closest(this.columns):this.markdownPreview.closest(this.columns);n.show(),this.columns.not(n).hide()}this.activePanel=e,this.save("activePanel",this.activePanel),("preview"==this.activePanel||"html"==this.activePanel)&&this.convertMarkdown()},toggleTopPanel:function(e){e.is(":visible")?this.closeTopPanels():this.openTopPanel(e)},openTopPanel:function(e){var t=this.topPanelsTriggers.filter("[data-toppanel="+e.attr("id")+"]");e.show(),t.addClass("active"),this.topPanels.not(e).hide(),this.topPanelsTriggers.not(t).removeClass("active"),this.fitHeight(),$document.off("keydown.toppanel").on("keydown.toppanel",function(e){e.keyCode==keyCode.ESCAPE&&editor.closeTopPanels()})},closeTopPanels:function(){this.topPanels.hide(),this.topPanelsTriggers.removeClass("active"),this.fitHeight(),$document.off("keydown.toppanel")},toggleFeature:function(e,t){var r=this.featuresTriggers.filter("[data-feature="+e+"]");switch(e){case"sync-scroll":this.toggleSyncScroll();break;case"fullscreen":this.toggleFullscreen(t)}r.toggleClass("active")},toggleSyncScroll:function(){var e,t=function(t,r){var n;n=t&&"updated"==t.type?r.syncScrollReference:e?editor.syncScroll.ref.CARET:editor.syncScroll.ref.SCROLLBAR,editor.syncScroll(n)};return function(){this.isSyncScrollDisabled?(this.markdownPreview.on("updated.editor",t),this.markdownSource.on({"scroll.syncScroll":t,"keydown.syncScroll":function(t){e=t.which<91||t.which>93}}),$body.on("keyup.syncScroll",function(){e=!1}),t(),e=!1):(this.markdownPreview.off("updated.editor"),this.markdownSource.off(".syncScroll"),$body.off("keyup.syncScroll")),this.isSyncScrollDisabled=!this.isSyncScrollDisabled,this.save("isSyncScrollDisabled",this.isSyncScrollDisabled?"y":"n")}}(),toggleFullscreen:function(e){var t=e&&e.tofocus;if(this.isFullscreen=!this.isFullscreen,$body.toggleClass("fullscreen"),t&&this.switchToPanel(t),this.isFullscreen)this.closeTopPanels(),$document.on("keydown.fullscreen",function(e){e.keyCode==keyCode.ESCAPE&&editor.featuresTriggers.filter("[data-feature=fullscreen]").last().trigger("click")});else{this.columns.show();var r=this.markdownTargetsTriggers.filter(".active").first().data("switchto");"markdown"==r&&this.switchToPanel("preview"),"preview"==r&&this.triggerEditorUpdatedEvent(),$document.off("keydown.fullscreen")}this.save("isFullscreen",this.isFullscreen?"y":"n"),$body.trigger("fullscreen.editor",[this.isFullscreen])},syncScroll:function(){var e=function(e){var t=this.markdownPreview[0],r=this.markdownSource[0];e==editor.syncScroll.ref.SCROLLBAR?t.scrollTop=(t.scrollHeight-t.offsetHeight)*r.scrollTop/(r.scrollHeight-r.offsetHeight):app.scrollMarkdownPreviewCaretIntoView()};return e.ref={CARET:0,SCROLLBAR:1},e}(),onloadEffect:function(e){switch(e){case 0:$body.fadeTo(0,0);break;case 1:$body.fadeTo(1e3,1)}},handleTabKeyPress:function(e){var t,r,n,o,i,s=!e.shiftKey,a=this.getMarkdownSourceCaretPos();a&&(t=this.markdown.slice(a.start,a.end),r=t.split("\n"),r.length>1?(i=$.extend({},a),n=this.markdown.slice(0,a.start),o=n.lastIndexOf("\n"),a.start=o+1,r[0]=n.slice(a.start)+r[0],r=$.map(r,function(e,t){return s?(0==t&&i.start++,i.end++,"	"+e):"	"==e.charAt(0)?(0==t&&i.start--,i.end--,e.slice(1)):e}),this.addToMarkdownSource(r.join("\n"),a,i)):s||a.start!=a.end||"	"!=this.markdown.charAt(a.start-1)?this.addToMarkdownSource("	",a):(a.start--,this.addToMarkdownSource("",a)),e.preventDefault())},updateWordCount:function(e){var t="";e.length&&(t=e.trim().replace(/\s+/gi," ").split(" ").length,t=t.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g,",")+" words"),this.wordCountContainers.text(t)}};var t=function(){var e=$("#settings"),t={buttons:{inc:document.getElementById("increase-font-size"),dec:document.getElementById("decrease-font-size"),disabledClass:"is-disabled"},factor:0,factorBounds:[-3,12],cssStep:1.2,update:function(e){var t,r=this.factor;e<this.factorBounds[0]?e=this.factorBounds[0]:e>this.factorBounds[1]&&(e=this.factorBounds[1]),e!=r&&(t=(e-r)*this.cssStep,this.factor=e,editor.save("fontSizeFactor",e),app.updateFontSize(t),$(this.buttons.dec).toggleClass(this.buttons.disabledClass,e==this.factorBounds[0]),$(this.buttons.inc).toggleClass(this.buttons.disabledClass,e==this.factorBounds[1]))},increase:function(){t.update(t.factor+1)},decrease:function(){t.update(t.factor-1)}},r={buttons:{light:document.getElementById("use-light-theme"),dark:document.getElementById("use-dark-theme")},stylesheets:{lightThemeRef:document.getElementById("theme-light-ref"),darkThemeRef:document.getElementById("theme-dark-ref")},use:function(e){editor.save("theme",e),app.useTheme(this.stylesheets[e+"ThemeRef"].getAttribute("data-href"))}};return{restore:function(e){null!=e.fontSizeFactor&&t.update(+e.fontSizeFactor),r.use(e.theme||"light")},initBindings:function(){e.on("click",function(e){if(e.preventDefault(),e.target==t.buttons.inc||e.target==t.buttons.dec){var n=t.factor+(e.target==t.buttons.inc?1:-1);t.update(n)}e.target==r.buttons.light&&r.use("light"),e.target==r.buttons.dark&&r.use("dark")}),shortcutManager.register(["CTRL + PLUS","CTRL + PLUS_FF","CTRL + SHIFT + PLUS","CTRL + SHIFT + PLUS_FF","CTRL + NUMPADPLUS"],function(e){e.preventDefault(),t.increase()}),shortcutManager.register(["CTRL + MINUS","CTRL + MINUS_FF","CTRL + SHIFT + MINUS","CTRL + SHIFT + MINUS_FF","CTRL + NUMPADMINUS"],function(e){e.preventDefault(),t.decrease()}),$document.on("wheel",function(e){var r;e.hasOwnProperty("deltaY")||(e.deltaY=e.originalEvent.deltaY),(e.ctrlKey||e.metaKey)&&e.deltaY&&(e.preventDefault(),Modal.isModalOpen()||(r=e.deltaY<0,r?t.increase():t.decrease()))})}}}()});var app;$(document).ready(function(){app={supportsLocalStorage:"localStorage"in window&&null!==window.localStorage,init:function(){editor.init()},save:function(e,t){if(!this.supportsLocalStorage)return!1;try{localStorage.setItem(e,t)}catch(r){}},restoreState:function(e){var t={};if(this.supportsLocalStorage)try{t.markdown=localStorage.getItem("markdown"),t.isSyncScrollDisabled=localStorage.getItem("isSyncScrollDisabled"),t.isFullscreen=localStorage.getItem("isFullscreen"),t.activePanel=localStorage.getItem("activePanel"),t.fontSizeFactor=localStorage.getItem("fontSizeFactor"),t.theme=localStorage.getItem("theme")}catch(r){}e(t)},updateMarkdownPreview:function(e,t){editor.markdownPreview.html(e),editor.updateWordCount(editor.markdownPreview.text()),preview.onImagesLoad(function(){editor.triggerEditorUpdatedEvent(t)})},scrollMarkdownPreviewCaretIntoView:function(){var e={ref:editor.markdownPreview[0],padding:40};return function(){var t=editor.getMarkdownSourceCaretPos();if(t){var r=editor.getMarkdownSourceLineFromPos(t),n=editor.getMarkdownSourceLineCount();e.elOffsets=preview.getSourceLineOffset(r,n),scrollIntoView(e)}}}(),updateFontSize:function(e){[editor.markdownSource,$(editor.markdownHtml),editor.markdownPreview].forEach(function(t){updateElFontSize(t,e)})},useTheme:function(e){editor.themeSelector.setAttribute("href",e)}},app.init()});
+25664
js/jspdf.debug.js
... ...
@@ -0,0 +1,25664 @@
1
+(function (factory) {
2
+  typeof define === 'function' && define.amd ? define(factory) :
3
+  factory();
4
+}(function () { 'use strict';
5
+
6
+  /** @license
7
+   * jsPDF - PDF Document creation from JavaScript
8
+   * Version 1.5.3 Built on 2018-12-27T14:11:42.696Z
9
+   *                      CommitID d93d28db14
10
+   *
11
+   * Copyright (c) 2010-2016 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
12
+   *               2010 Aaron Spike, https://github.com/acspike
13
+   *               2012 Willow Systems Corporation, willow-systems.com
14
+   *               2012 Pablo Hess, https://github.com/pablohess
15
+   *               2012 Florian Jenett, https://github.com/fjenett
16
+   *               2013 Warren Weckesser, https://github.com/warrenweckesser
17
+   *               2013 Youssef Beddad, https://github.com/lifof
18
+   *               2013 Lee Driscoll, https://github.com/lsdriscoll
19
+   *               2013 Stefan Slonevskiy, https://github.com/stefslon
20
+   *               2013 Jeremy Morel, https://github.com/jmorel
21
+   *               2013 Christoph Hartmann, https://github.com/chris-rock
22
+   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
23
+   *               2014 James Makes, https://github.com/dollaruw
24
+   *               2014 Diego Casorran, https://github.com/diegocr
25
+   *               2014 Steven Spungin, https://github.com/Flamenco
26
+   *               2014 Kenneth Glassey, https://github.com/Gavvers
27
+   *
28
+   * Licensed under the MIT License
29
+   *
30
+   * Contributor(s):
31
+   *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
32
+   *    kim3er, mfo, alnorth, Flamenco
33
+   */
34
+
35
+  function _typeof(obj) {
36
+    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
37
+      _typeof = function (obj) {
38
+        return typeof obj;
39
+      };
40
+    } else {
41
+      _typeof = function (obj) {
42
+        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
43
+      };
44
+    }
45
+
46
+    return _typeof(obj);
47
+  }
48
+
49
+  /**
50
+   * JavaScript Polyfill functions for jsPDF
51
+   * Collected from public resources by
52
+   * https://github.com/diegocr
53
+   */
54
+  (function (global) {
55
+    if (_typeof(global.console) !== "object") {
56
+      // Console-polyfill. MIT license.
57
+      // https://github.com/paulmillr/console-polyfill
58
+      // Make it safe to do console.log() always.
59
+      global.console = {};
60
+      var con = global.console;
61
+      var prop, method;
62
+
63
+      var dummy = function dummy() {};
64
+
65
+      var properties = ['memory'];
66
+      var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');
67
+
68
+      while (prop = properties.pop()) {
69
+        if (!con[prop]) con[prop] = {};
70
+      }
71
+
72
+      while (method = methods.pop()) {
73
+        if (!con[method]) con[method] = dummy;
74
+      }
75
+    }
76
+
77
+    var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
78
+
79
+    if (typeof global.btoa === 'undefined') {
80
+      global.btoa = function (data) {
81
+        //  discuss at: http://phpjs.org/functions/base64_encode/
82
+        // original by: Tyler Akins (http://rumkin.com)
83
+        // improved by: Bayron Guevara
84
+        // improved by: Thunder.m
85
+        // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
86
+        // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
87
+        // improved by: Rafal Kukawski (http://kukawski.pl)
88
+        // bugfixed by: Pellentesque Malesuada
89
+        //   example 1: base64_encode('Kevin van Zonneveld');
90
+        //   returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
91
+        var o1,
92
+            o2,
93
+            o3,
94
+            h1,
95
+            h2,
96
+            h3,
97
+            h4,
98
+            bits,
99
+            i = 0,
100
+            ac = 0,
101
+            enc = '',
102
+            tmp_arr = [];
103
+
104
+        if (!data) {
105
+          return data;
106
+        }
107
+
108
+        do {
109
+          // pack three octets into four hexets
110
+          o1 = data.charCodeAt(i++);
111
+          o2 = data.charCodeAt(i++);
112
+          o3 = data.charCodeAt(i++);
113
+          bits = o1 << 16 | o2 << 8 | o3;
114
+          h1 = bits >> 18 & 0x3f;
115
+          h2 = bits >> 12 & 0x3f;
116
+          h3 = bits >> 6 & 0x3f;
117
+          h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string
118
+
119
+          tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
120
+        } while (i < data.length);
121
+
122
+        enc = tmp_arr.join('');
123
+        var r = data.length % 3;
124
+        return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
125
+      };
126
+    }
127
+
128
+    if (typeof global.atob === 'undefined') {
129
+      global.atob = function (data) {
130
+        //  discuss at: http://phpjs.org/functions/base64_decode/
131
+        // original by: Tyler Akins (http://rumkin.com)
132
+        // improved by: Thunder.m
133
+        // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
134
+        // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
135
+        //    input by: Aman Gupta
136
+        //    input by: Brett Zamir (http://brett-zamir.me)
137
+        // bugfixed by: Onno Marsman
138
+        // bugfixed by: Pellentesque Malesuada
139
+        // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
140
+        //   example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
141
+        //   returns 1: 'Kevin van Zonneveld'
142
+        var o1,
143
+            o2,
144
+            o3,
145
+            h1,
146
+            h2,
147
+            h3,
148
+            h4,
149
+            bits,
150
+            i = 0,
151
+            ac = 0,
152
+            dec = '',
153
+            tmp_arr = [];
154
+
155
+        if (!data) {
156
+          return data;
157
+        }
158
+
159
+        data += '';
160
+
161
+        do {
162
+          // unpack four hexets into three octets using index points in b64
163
+          h1 = b64.indexOf(data.charAt(i++));
164
+          h2 = b64.indexOf(data.charAt(i++));
165
+          h3 = b64.indexOf(data.charAt(i++));
166
+          h4 = b64.indexOf(data.charAt(i++));
167
+          bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
168
+          o1 = bits >> 16 & 0xff;
169
+          o2 = bits >> 8 & 0xff;
170
+          o3 = bits & 0xff;
171
+
172
+          if (h3 == 64) {
173
+            tmp_arr[ac++] = String.fromCharCode(o1);
174
+          } else if (h4 == 64) {
175
+            tmp_arr[ac++] = String.fromCharCode(o1, o2);
176
+          } else {
177
+            tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
178
+          }
179
+        } while (i < data.length);
180
+
181
+        dec = tmp_arr.join('');
182
+        return dec;
183
+      };
184
+    }
185
+
186
+    if (!Array.prototype.map) {
187
+      Array.prototype.map = function (fun
188
+      /*, thisArg */
189
+      ) {
190
+        if (this === void 0 || this === null || typeof fun !== "function") throw new TypeError();
191
+        var t = Object(this),
192
+            len = t.length >>> 0,
193
+            res = new Array(len);
194
+        var thisArg = arguments.length > 1 ? arguments[1] : void 0;
195
+
196
+        for (var i = 0; i < len; i++) {
197
+          // NOTE: Absolute correctness would demand Object.defineProperty
198
+          //       be used.  But this method is fairly new, and failure is
199
+          //       possible only if Object.prototype or Array.prototype
200
+          //       has a property |i| (very unlikely), so use a less-correct
201
+          //       but more portable alternative.
202
+          if (i in t) res[i] = fun.call(thisArg, t[i], i, t);
203
+        }
204
+
205
+        return res;
206
+      };
207
+    }
208
+
209
+    if (!Array.isArray) {
210
+      Array.isArray = function (arg) {
211
+        return Object.prototype.toString.call(arg) === '[object Array]';
212
+      };
213
+    }
214
+
215
+    if (!Array.prototype.forEach) {
216
+      Array.prototype.forEach = function (fun, thisArg) {
217
+
218
+        if (this === void 0 || this === null || typeof fun !== "function") throw new TypeError();
219
+        var t = Object(this),
220
+            len = t.length >>> 0;
221
+
222
+        for (var i = 0; i < len; i++) {
223
+          if (i in t) fun.call(thisArg, t[i], i, t);
224
+        }
225
+      };
226
+    } // https://tc39.github.io/ecma262/#sec-array.prototype.find
227
+
228
+
229
+    if (!Array.prototype.find) {
230
+      Object.defineProperty(Array.prototype, 'find', {
231
+        value: function value(predicate) {
232
+          // 1. Let O be ? ToObject(this value).
233
+          if (this == null) {
234
+            throw new TypeError('"this" is null or not defined');
235
+          }
236
+
237
+          var o = Object(this); // 2. Let len be ? ToLength(? Get(O, "length")).
238
+
239
+          var len = o.length >>> 0; // 3. If IsCallable(predicate) is false, throw a TypeError exception.
240
+
241
+          if (typeof predicate !== 'function') {
242
+            throw new TypeError('predicate must be a function');
243
+          } // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
244
+
245
+
246
+          var thisArg = arguments[1]; // 5. Let k be 0.
247
+
248
+          var k = 0; // 6. Repeat, while k < len
249
+
250
+          while (k < len) {
251
+            // a. Let Pk be ! ToString(k).
252
+            // b. Let kValue be ? Get(O, Pk).
253
+            // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
254
+            // d. If testResult is true, return kValue.
255
+            var kValue = o[k];
256
+
257
+            if (predicate.call(thisArg, kValue, k, o)) {
258
+              return kValue;
259
+            } // e. Increase k by 1.
260
+
261
+
262
+            k++;
263
+          } // 7. Return undefined.
264
+
265
+
266
+          return undefined;
267
+        },
268
+        configurable: true,
269
+        writable: true
270
+      });
271
+    }
272
+
273
+    if (!Object.keys) {
274
+      Object.keys = function () {
275
+
276
+        var hasOwnProperty = Object.prototype.hasOwnProperty,
277
+            hasDontEnumBug = !{
278
+          toString: null
279
+        }.propertyIsEnumerable('toString'),
280
+            dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'],
281
+            dontEnumsLength = dontEnums.length;
282
+        return function (obj) {
283
+          if (_typeof(obj) !== 'object' && (typeof obj !== 'function' || obj === null)) {
284
+            throw new TypeError();
285
+          }
286
+
287
+          var result = [],
288
+              prop,
289
+              i;
290
+
291
+          for (prop in obj) {
292
+            if (hasOwnProperty.call(obj, prop)) {
293
+              result.push(prop);
294
+            }
295
+          }
296
+
297
+          if (hasDontEnumBug) {
298
+            for (i = 0; i < dontEnumsLength; i++) {
299
+              if (hasOwnProperty.call(obj, dontEnums[i])) {
300
+                result.push(dontEnums[i]);
301
+              }
302
+            }
303
+          }
304
+
305
+          return result;
306
+        };
307
+      }();
308
+    }
309
+
310
+    if (typeof Object.assign != 'function') {
311
+      Object.assign = function (target) {
312
+
313
+        if (target == null) {
314
+          throw new TypeError('Cannot convert undefined or null to object');
315
+        }
316
+
317
+        target = Object(target);
318
+
319
+        for (var index = 1; index < arguments.length; index++) {
320
+          var source = arguments[index];
321
+
322
+          if (source != null) {
323
+            for (var key in source) {
324
+              if (Object.prototype.hasOwnProperty.call(source, key)) {
325
+                target[key] = source[key];
326
+              }
327
+            }
328
+          }
329
+        }
330
+
331
+        return target;
332
+      };
333
+    }
334
+
335
+    if (!String.prototype.trim) {
336
+      String.prototype.trim = function () {
337
+        return this.replace(/^\s+|\s+$/g, '');
338
+      };
339
+    }
340
+
341
+    if (!String.prototype.trimLeft) {
342
+      String.prototype.trimLeft = function () {
343
+        return this.replace(/^\s+/g, "");
344
+      };
345
+    }
346
+
347
+    if (!String.prototype.trimRight) {
348
+      String.prototype.trimRight = function () {
349
+        return this.replace(/\s+$/g, "");
350
+      };
351
+    }
352
+
353
+    Number.isInteger = Number.isInteger || function (value) {
354
+      return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
355
+    };
356
+  })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); // `self` is undefined in Firefox for Android content script context
357
+  // while `this` is nsIContentFrameMessageManager
358
+  // with an attribute `content` that corresponds to the window
359
+
360
+  /**
361
+   * Creates new jsPDF document object instance.
362
+   * @name jsPDF
363
+   * @class
364
+   * @param orientation {string/Object} Orientation of the first page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l").<br />
365
+   * Can also be an options object.
366
+   * @param unit {string}  Measurement unit to be used when coordinates are specified.<br />
367
+   * Possible values are "pt" (points), "mm" (Default), "cm", "in" or "px".
368
+   * @param format {string/Array} The format of the first page. Can be:<ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br />
369
+   * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]
370
+   * @returns {jsPDF} jsPDF-instance
371
+   * @description
372
+   * If the first parameter (orientation) is an object, it will be interpreted as an object of named parameters
373
+   * ```
374
+   * {
375
+   *  orientation: 'p',
376
+   *  unit: 'mm',
377
+   *  format: 'a4',
378
+   *  hotfixes: [] // an array of hotfix strings to enable
379
+   * }
380
+   * ```
381
+   */
382
+  var jsPDF = function (global) {
383
+    /**
384
+     * jsPDF's Internal PubSub Implementation.
385
+     * Backward compatible rewritten on 2014 by
386
+     * Diego Casorran, https://github.com/diegocr
387
+     *
388
+     * @class
389
+     * @name PubSub
390
+     * @ignore
391
+     */
392
+
393
+    function PubSub(context) {
394
+      if (_typeof(context) !== 'object') {
395
+        throw new Error('Invalid Context passed to initialize PubSub (jsPDF-module)');
396
+      }
397
+
398
+      var topics = {};
399
+
400
+      this.subscribe = function (topic, callback, once) {
401
+        once = once || false;
402
+
403
+        if (typeof topic !== 'string' || typeof callback !== 'function' || typeof once !== 'boolean') {
404
+          throw new Error('Invalid arguments passed to PubSub.subscribe (jsPDF-module)');
405
+        }
406
+
407
+        if (!topics.hasOwnProperty(topic)) {
408
+          topics[topic] = {};
409
+        }
410
+
411
+        var token = Math.random().toString(35);
412
+        topics[topic][token] = [callback, !!once];
413
+        return token;
414
+      };
415
+
416
+      this.unsubscribe = function (token) {
417
+        for (var topic in topics) {
418
+          if (topics[topic][token]) {
419
+            delete topics[topic][token];
420
+
421
+            if (Object.keys(topics[topic]).length === 0) {
422
+              delete topics[topic];
423
+            }
424
+
425
+            return true;
426
+          }
427
+        }
428
+
429
+        return false;
430
+      };
431
+
432
+      this.publish = function (topic) {
433
+        if (topics.hasOwnProperty(topic)) {
434
+          var args = Array.prototype.slice.call(arguments, 1),
435
+              tokens = [];
436
+
437
+          for (var token in topics[topic]) {
438
+            var sub = topics[topic][token];
439
+
440
+            try {
441
+              sub[0].apply(context, args);
442
+            } catch (ex) {
443
+              if (global.console) {
444
+                console.error('jsPDF PubSub Error', ex.message, ex);
445
+              }
446
+            }
447
+
448
+            if (sub[1]) tokens.push(token);
449
+          }
450
+
451
+          if (tokens.length) tokens.forEach(this.unsubscribe);
452
+        }
453
+      };
454
+
455
+      this.getTopics = function () {
456
+        return topics;
457
+      };
458
+    }
459
+    /**
460
+     * @constructor
461
+     * @private
462
+     */
463
+
464
+
465
+    function jsPDF(orientation, unit, format, compressPdf) {
466
+      var options = {};
467
+      var filters = [];
468
+      var userUnit = 1.0;
469
+
470
+      if (_typeof(orientation) === 'object') {
471
+        options = orientation;
472
+        orientation = options.orientation;
473
+        unit = options.unit || unit;
474
+        format = options.format || format;
475
+        compressPdf = options.compress || options.compressPdf || compressPdf;
476
+        filters = options.filters || (compressPdf === true ? ['FlateEncode'] : filters);
477
+        userUnit = typeof options.userUnit === "number" ? Math.abs(options.userUnit) : 1.0;
478
+      }
479
+
480
+      unit = unit || 'mm';
481
+      orientation = ('' + (orientation || 'P')).toLowerCase();
482
+      var putOnlyUsedFonts = options.putOnlyUsedFonts || true;
483
+      var usedFonts = {};
484
+      var API = {
485
+        internal: {},
486
+        __private__: {}
487
+      };
488
+      API.__private__.PubSub = PubSub;
489
+      var pdfVersion = '1.3';
490
+
491
+      var getPdfVersion = API.__private__.getPdfVersion = function () {
492
+        return pdfVersion;
493
+      };
494
+
495
+      var setPdfVersion = API.__private__.setPdfVersion = function (value) {
496
+        pdfVersion = value;
497
+      }; // Size in pt of various paper formats
498
+
499
+
500
+      var pageFormats = {
501
+        'a0': [2383.94, 3370.39],
502
+        'a1': [1683.78, 2383.94],
503
+        'a2': [1190.55, 1683.78],
504
+        'a3': [841.89, 1190.55],
505
+        'a4': [595.28, 841.89],
506
+        'a5': [419.53, 595.28],
507
+        'a6': [297.64, 419.53],
508
+        'a7': [209.76, 297.64],
509
+        'a8': [147.40, 209.76],
510
+        'a9': [104.88, 147.40],
511
+        'a10': [73.70, 104.88],
512
+        'b0': [2834.65, 4008.19],
513
+        'b1': [2004.09, 2834.65],
514
+        'b2': [1417.32, 2004.09],
515
+        'b3': [1000.63, 1417.32],
516
+        'b4': [708.66, 1000.63],
517
+        'b5': [498.90, 708.66],
518
+        'b6': [354.33, 498.90],
519
+        'b7': [249.45, 354.33],
520
+        'b8': [175.75, 249.45],
521
+        'b9': [124.72, 175.75],
522
+        'b10': [87.87, 124.72],
523
+        'c0': [2599.37, 3676.54],
524
+        'c1': [1836.85, 2599.37],
525
+        'c2': [1298.27, 1836.85],
526
+        'c3': [918.43, 1298.27],
527
+        'c4': [649.13, 918.43],
528
+        'c5': [459.21, 649.13],
529
+        'c6': [323.15, 459.21],
530
+        'c7': [229.61, 323.15],
531
+        'c8': [161.57, 229.61],
532
+        'c9': [113.39, 161.57],
533
+        'c10': [79.37, 113.39],
534
+        'dl': [311.81, 623.62],
535
+        'letter': [612, 792],
536
+        'government-letter': [576, 756],
537
+        'legal': [612, 1008],
538
+        'junior-legal': [576, 360],
539
+        'ledger': [1224, 792],
540
+        'tabloid': [792, 1224],
541
+        'credit-card': [153, 243]
542
+      };
543
+
544
+      var getPageFormats = API.__private__.getPageFormats = function () {
545
+        return pageFormats;
546
+      };
547
+
548
+      var getPageFormat = API.__private__.getPageFormat = function (value) {
549
+        return pageFormats[value];
550
+      };
551
+
552
+      if (typeof format === "string") {
553
+        format = getPageFormat(format);
554
+      }
555
+
556
+      format = format || getPageFormat('a4');
557
+
558
+      var f2 = API.f2 = API.__private__.f2 = function (number) {
559
+        if (isNaN(number)) {
560
+          throw new Error('Invalid argument passed to jsPDF.f2');
561
+        }
562
+
563
+        return number.toFixed(2); // Ie, %.2f
564
+      };
565
+
566
+      var f3 = API.__private__.f3 = function (number) {
567
+        if (isNaN(number)) {
568
+          throw new Error('Invalid argument passed to jsPDF.f3');
569
+        }
570
+
571
+        return number.toFixed(3); // Ie, %.3f
572
+      };
573
+
574
+      var fileId = '00000000000000000000000000000000';
575
+
576
+      var getFileId = API.__private__.getFileId = function () {
577
+        return fileId;
578
+      };
579
+
580
+      var setFileId = API.__private__.setFileId = function (value) {
581
+        value = value || "12345678901234567890123456789012".split('').map(function () {
582
+          return "ABCDEF0123456789".charAt(Math.floor(Math.random() * 16));
583
+        }).join('');
584
+        fileId = value;
585
+        return fileId;
586
+      };
587
+      /**
588
+       * @name setFileId
589
+       * @memberOf jsPDF
590
+       * @function
591
+       * @instance
592
+       * @param {string} value GUID.
593
+       * @returns {jsPDF}
594
+       */
595
+
596
+
597
+      API.setFileId = function (value) {
598
+        setFileId(value);
599
+        return this;
600
+      };
601
+      /**
602
+       * @name getFileId
603
+       * @memberOf jsPDF
604
+       * @function
605
+       * @instance
606
+       *
607
+       * @returns {string} GUID.
608
+       */
609
+
610
+
611
+      API.getFileId = function () {
612
+        return getFileId();
613
+      };
614
+
615
+      var creationDate;
616
+
617
+      var convertDateToPDFDate = API.__private__.convertDateToPDFDate = function (parmDate) {
618
+        var result = '';
619
+        var tzoffset = parmDate.getTimezoneOffset(),
620
+            tzsign = tzoffset < 0 ? '+' : '-',
621
+            tzhour = Math.floor(Math.abs(tzoffset / 60)),
622
+            tzmin = Math.abs(tzoffset % 60),
623
+            timeZoneString = [tzsign, padd2(tzhour), "'", padd2(tzmin), "'"].join('');
624
+        result = ['D:', parmDate.getFullYear(), padd2(parmDate.getMonth() + 1), padd2(parmDate.getDate()), padd2(parmDate.getHours()), padd2(parmDate.getMinutes()), padd2(parmDate.getSeconds()), timeZoneString].join('');
625
+        return result;
626
+      };
627
+
628
+      var convertPDFDateToDate = API.__private__.convertPDFDateToDate = function (parmPDFDate) {
629
+        var year = parseInt(parmPDFDate.substr(2, 4), 10);
630
+        var month = parseInt(parmPDFDate.substr(6, 2), 10) - 1;
631
+        var date = parseInt(parmPDFDate.substr(8, 2), 10);
632
+        var hour = parseInt(parmPDFDate.substr(10, 2), 10);
633
+        var minutes = parseInt(parmPDFDate.substr(12, 2), 10);
634
+        var seconds = parseInt(parmPDFDate.substr(14, 2), 10);
635
+        var timeZoneHour = parseInt(parmPDFDate.substr(16, 2), 10);
636
+        var timeZoneMinutes = parseInt(parmPDFDate.substr(20, 2), 10);
637
+        var resultingDate = new Date(year, month, date, hour, minutes, seconds, 0);
638
+        return resultingDate;
639
+      };
640
+
641
+      var setCreationDate = API.__private__.setCreationDate = function (date) {
642
+        var tmpCreationDateString;
643
+        var regexPDFCreationDate = /^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/;
644
+
645
+        if (typeof date === "undefined") {
646
+          date = new Date();
647
+        }
648
+
649
+        if (_typeof(date) === "object" && Object.prototype.toString.call(date) === "[object Date]") {
650
+          tmpCreationDateString = convertDateToPDFDate(date);
651
+        } else if (regexPDFCreationDate.test(date)) {
652
+          tmpCreationDateString = date;
653
+        } else {
654
+          throw new Error('Invalid argument passed to jsPDF.setCreationDate');
655
+        }
656
+
657
+        creationDate = tmpCreationDateString;
658
+        return creationDate;
659
+      };
660
+
661
+      var getCreationDate = API.__private__.getCreationDate = function (type) {
662
+        var result = creationDate;
663
+
664
+        if (type === "jsDate") {
665
+          result = convertPDFDateToDate(creationDate);
666
+        }
667
+
668
+        return result;
669
+      };
670
+      /**
671
+       * @name setCreationDate
672
+       * @memberOf jsPDF
673
+       * @function
674
+       * @instance
675
+       * @param {Object} date
676
+       * @returns {jsPDF}
677
+       */
678
+
679
+
680
+      API.setCreationDate = function (date) {
681
+        setCreationDate(date);
682
+        return this;
683
+      };
684
+      /**
685
+       * @name getCreationDate
686
+       * @memberOf jsPDF
687
+       * @function
688
+       * @instance
689
+       * @param {Object} type
690
+       * @returns {Object}
691
+       */
692
+
693
+
694
+      API.getCreationDate = function (type) {
695
+        return getCreationDate(type);
696
+      };
697
+
698
+      var padd2 = API.__private__.padd2 = function (number) {
699
+        return ('0' + parseInt(number)).slice(-2);
700
+      };
701
+
702
+      var outToPages = !1; // switches where out() prints. outToPages true = push to pages obj. outToPages false = doc builder content
703
+
704
+      var pages = [];
705
+      var content = [];
706
+      var currentPage;
707
+      var content_length = 0;
708
+      var customOutputDestination;
709
+
710
+      var setOutputDestination = API.__private__.setCustomOutputDestination = function (destination) {
711
+        customOutputDestination = destination;
712
+      };
713
+
714
+      var resetOutputDestination = API.__private__.resetCustomOutputDestination = function (destination) {
715
+        customOutputDestination = undefined;
716
+      };
717
+
718
+      var out = API.__private__.out = function (string) {
719
+        var writeArray;
720
+        string = typeof string === "string" ? string : string.toString();
721
+
722
+        if (typeof customOutputDestination === "undefined") {
723
+          writeArray = outToPages ? pages[currentPage] : content;
724
+        } else {
725
+          writeArray = customOutputDestination;
726
+        }
727
+
728
+        writeArray.push(string);
729
+
730
+        if (!outToPages) {
731
+          content_length += string.length + 1;
732
+        }
733
+
734
+        return writeArray;
735
+      };
736
+
737
+      var write = API.__private__.write = function (value) {
738
+        return out(arguments.length === 1 ? value.toString() : Array.prototype.join.call(arguments, ' '));
739
+      };
740
+
741
+      var getArrayBuffer = API.__private__.getArrayBuffer = function (data) {
742
+        var len = data.length,
743
+            ab = new ArrayBuffer(len),
744
+            u8 = new Uint8Array(ab);
745
+
746
+        while (len--) {
747
+          u8[len] = data.charCodeAt(len);
748
+        }
749
+
750
+        return ab;
751
+      };
752
+
753
+      var standardFonts = [['Helvetica', "helvetica", "normal", 'WinAnsiEncoding'], ['Helvetica-Bold', "helvetica", "bold", 'WinAnsiEncoding'], ['Helvetica-Oblique', "helvetica", "italic", 'WinAnsiEncoding'], ['Helvetica-BoldOblique', "helvetica", "bolditalic", 'WinAnsiEncoding'], ['Courier', "courier", "normal", 'WinAnsiEncoding'], ['Courier-Bold', "courier", "bold", 'WinAnsiEncoding'], ['Courier-Oblique', "courier", "italic", 'WinAnsiEncoding'], ['Courier-BoldOblique', "courier", "bolditalic", 'WinAnsiEncoding'], ['Times-Roman', "times", "normal", 'WinAnsiEncoding'], ['Times-Bold', "times", "bold", 'WinAnsiEncoding'], ['Times-Italic', "times", "italic", 'WinAnsiEncoding'], ['Times-BoldItalic', "times", "bolditalic", 'WinAnsiEncoding'], ['ZapfDingbats', "zapfdingbats", "normal", null], ['Symbol', "symbol", "normal", null]];
754
+
755
+      var getStandardFonts = API.__private__.getStandardFonts = function (data) {
756
+        return standardFonts;
757
+      };
758
+
759
+      var activeFontSize = options.fontSize || 16;
760
+      /**
761
+       * Sets font size for upcoming text elements.
762
+       *
763
+       * @param {number} size Font size in points.
764
+       * @function
765
+       * @instance
766
+       * @returns {jsPDF}
767
+       * @memberOf jsPDF
768
+       * @name setFontSize
769
+       */
770
+
771
+      var setFontSize = API.__private__.setFontSize = API.setFontSize = function (size) {
772
+        activeFontSize = size;
773
+        return this;
774
+      };
775
+      /**
776
+       * Gets the fontsize for upcoming text elements.
777
+       *
778
+       * @function
779
+       * @instance
780
+       * @returns {number}
781
+       * @memberOf jsPDF
782
+       * @name getFontSize
783
+       */
784
+
785
+
786
+      var getFontSize = API.__private__.getFontSize = API.getFontSize = function () {
787
+        return activeFontSize;
788
+      };
789
+
790
+      var R2L = options.R2L || false;
791
+      /**
792
+       * Set value of R2L functionality.
793
+       *
794
+       * @param {boolean} value
795
+       * @function
796
+       * @instance
797
+       * @returns {jsPDF} jsPDF-instance
798
+       * @memberOf jsPDF
799
+       * @name setR2L
800
+       */
801
+
802
+      var setR2L = API.__private__.setR2L = API.setR2L = function (value) {
803
+        R2L = value;
804
+        return this;
805
+      };
806
+      /**
807
+       * Get value of R2L functionality.
808
+       *
809
+       * @function
810
+       * @instance
811
+       * @returns {boolean} jsPDF-instance
812
+       * @memberOf jsPDF
813
+       * @name getR2L
814
+       */
815
+
816
+
817
+      var getR2L = API.__private__.getR2L = API.getR2L = function (value) {
818
+        return R2L;
819
+      };
820
+
821
+      var zoomMode; // default: 1;
822
+
823
+      var setZoomMode = API.__private__.setZoomMode = function (zoom) {
824
+        var validZoomModes = [undefined, null, 'fullwidth', 'fullheight', 'fullpage', 'original'];
825
+
826
+        if (/^\d*\.?\d*\%$/.test(zoom)) {
827
+          zoomMode = zoom;
828
+        } else if (!isNaN(zoom)) {
829
+          zoomMode = parseInt(zoom, 10);
830
+        } else if (validZoomModes.indexOf(zoom) !== -1) {
831
+          zoomMode = zoom;
832
+        } else {
833
+          throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + zoom + '" is not recognized.');
834
+        }
835
+      };
836
+
837
+      var getZoomMode = API.__private__.getZoomMode = function () {
838
+        return zoomMode;
839
+      };
840
+
841
+      var pageMode; // default: 'UseOutlines';
842
+
843
+      var setPageMode = API.__private__.setPageMode = function (pmode) {
844
+        var validPageModes = [undefined, null, 'UseNone', 'UseOutlines', 'UseThumbs', 'FullScreen'];
845
+
846
+        if (validPageModes.indexOf(pmode) == -1) {
847
+          throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + pmode + '" is not recognized.');
848
+        }
849
+
850
+        pageMode = pmode;
851
+      };
852
+
853
+      var getPageMode = API.__private__.getPageMode = function () {
854
+        return pageMode;
855
+      };
856
+
857
+      var layoutMode; // default: 'continuous';
858
+
859
+      var setLayoutMode = API.__private__.setLayoutMode = function (layout) {
860
+        var validLayoutModes = [undefined, null, 'continuous', 'single', 'twoleft', 'tworight', 'two'];
861
+
862
+        if (validLayoutModes.indexOf(layout) == -1) {
863
+          throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + layout + '" is not recognized.');
864
+        }
865
+
866
+        layoutMode = layout;
867
+      };
868
+
869
+      var getLayoutMode = API.__private__.getLayoutMode = function () {
870
+        return layoutMode;
871
+      };
872
+      /**
873
+       * Set the display mode options of the page like zoom and layout.
874
+       *
875
+       * @name setDisplayMode
876
+       * @memberOf jsPDF
877
+       * @function 
878
+       * @instance
879
+       * @param {integer|String} zoom   You can pass an integer or percentage as
880
+       * a string. 2 will scale the document up 2x, '200%' will scale up by the
881
+       * same amount. You can also set it to 'fullwidth', 'fullheight',
882
+       * 'fullpage', or 'original'.
883
+       *
884
+       * Only certain PDF readers support this, such as Adobe Acrobat.
885
+       *
886
+       * @param {string} layout Layout mode can be: 'continuous' - this is the
887
+       * default continuous scroll. 'single' - the single page mode only shows one
888
+       * page at a time. 'twoleft' - two column left mode, first page starts on
889
+       * the left, and 'tworight' - pages are laid out in two columns, with the
890
+       * first page on the right. This would be used for books.
891
+       * @param {string} pmode 'UseOutlines' - it shows the
892
+       * outline of the document on the left. 'UseThumbs' - shows thumbnails along
893
+       * the left. 'FullScreen' - prompts the user to enter fullscreen mode.
894
+       *
895
+       * @returns {jsPDF}
896
+       */
897
+
898
+
899
+      var setDisplayMode = API.__private__.setDisplayMode = API.setDisplayMode = function (zoom, layout, pmode) {
900
+        setZoomMode(zoom);
901
+        setLayoutMode(layout);
902
+        setPageMode(pmode);
903
+        return this;
904
+      };
905
+
906
+      var documentProperties = {
907
+        'title': '',
908
+        'subject': '',
909
+        'author': '',
910
+        'keywords': '',
911
+        'creator': ''
912
+      };
913
+
914
+      var getDocumentProperty = API.__private__.getDocumentProperty = function (key) {
915
+        if (Object.keys(documentProperties).indexOf(key) === -1) {
916
+          throw new Error('Invalid argument passed to jsPDF.getDocumentProperty');
917
+        }
918
+
919
+        return documentProperties[key];
920
+      };
921
+
922
+      var getDocumentProperties = API.__private__.getDocumentProperties = function (properties) {
923
+        return documentProperties;
924
+      };
925
+      /**
926
+       * Adds a properties to the PDF document.
927
+       *
928
+       * @param {Object} A property_name-to-property_value object structure.
929
+       * @function
930
+       * @instance
931
+       * @returns {jsPDF}
932
+       * @memberOf jsPDF
933
+       * @name setDocumentProperties
934
+       */
935
+
936
+
937
+      var setDocumentProperties = API.__private__.setDocumentProperties = API.setProperties = API.setDocumentProperties = function (properties) {
938
+        // copying only those properties we can render.
939
+        for (var property in documentProperties) {
940
+          if (documentProperties.hasOwnProperty(property) && properties[property]) {
941
+            documentProperties[property] = properties[property];
942
+          }
943
+        }
944
+
945
+        return this;
946
+      };
947
+
948
+      var setDocumentProperty = API.__private__.setDocumentProperty = function (key, value) {
949
+        if (Object.keys(documentProperties).indexOf(key) === -1) {
950
+          throw new Error('Invalid arguments passed to jsPDF.setDocumentProperty');
951
+        }
952
+
953
+        return documentProperties[key] = value;
954
+      };
955
+
956
+      var objectNumber = 0; // 'n' Current object number
957
+
958
+      var offsets = []; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.
959
+
960
+      var fonts = {}; // collection of font objects, where key is fontKey - a dynamically created label for a given font.
961
+
962
+      var fontmap = {}; // mapping structure fontName > fontStyle > font key - performance layer. See addFont()
963
+
964
+      var activeFontKey; // will be string representing the KEY of the font as combination of fontName + fontStyle
965
+
966
+      var k; // Scale factor
967
+
968
+      var page = 0;
969
+      var pagesContext = [];
970
+      var additionalObjects = [];
971
+      var events = new PubSub(API);
972
+      var hotfixes = options.hotfixes || [];
973
+
974
+      var newObject = API.__private__.newObject = function () {
975
+        var oid = newObjectDeferred();
976
+        newObjectDeferredBegin(oid, true);
977
+        return oid;
978
+      }; // Does not output the object.  The caller must call newObjectDeferredBegin(oid) before outputing any data
979
+
980
+
981
+      var newObjectDeferred = API.__private__.newObjectDeferred = function () {
982
+        objectNumber++;
983
+
984
+        offsets[objectNumber] = function () {
985
+          return content_length;
986
+        };
987
+
988
+        return objectNumber;
989
+      };
990
+
991
+      var newObjectDeferredBegin = function newObjectDeferredBegin(oid, doOutput) {
992
+        doOutput = typeof doOutput === 'boolean' ? doOutput : false;
993
+        offsets[oid] = content_length;
994
+
995
+        if (doOutput) {
996
+          out(oid + ' 0 obj');
997
+        }
998
+
999
+        return oid;
1000
+      }; // Does not output the object until after the pages have been output.
1001
+      // Returns an object containing the objectId and content.
1002
+      // All pages have been added so the object ID can be estimated to start right after.
1003
+      // This does not modify the current objectNumber;  It must be updated after the newObjects are output.
1004
+
1005
+
1006
+      var newAdditionalObject = API.__private__.newAdditionalObject = function () {
1007
+        var objId = newObjectDeferred();
1008
+        var obj = {
1009
+          objId: objId,
1010
+          content: ''
1011
+        };
1012
+        additionalObjects.push(obj);
1013
+        return obj;
1014
+      };
1015
+
1016
+      var rootDictionaryObjId = newObjectDeferred();
1017
+      var resourceDictionaryObjId = newObjectDeferred(); /////////////////////
1018
+      // Private functions
1019
+      /////////////////////
1020
+
1021
+      var decodeColorString = API.__private__.decodeColorString = function (color) {
1022
+        var colorEncoded = color.split(' ');
1023
+
1024
+        if (colorEncoded.length === 2 && (colorEncoded[1] === 'g' || colorEncoded[1] === 'G')) {
1025
+          // convert grayscale value to rgb so that it can be converted to hex for consistency
1026
+          var floatVal = parseFloat(colorEncoded[0]);
1027
+          colorEncoded = [floatVal, floatVal, floatVal, 'r'];
1028
+        }
1029
+
1030
+        var colorAsRGB = '#';
1031
+
1032
+        for (var i = 0; i < 3; i++) {
1033
+          colorAsRGB += ('0' + Math.floor(parseFloat(colorEncoded[i]) * 255).toString(16)).slice(-2);
1034
+        }
1035
+
1036
+        return colorAsRGB;
1037
+      };
1038
+
1039
+      var encodeColorString = API.__private__.encodeColorString = function (options) {
1040
+        var color;
1041
+
1042
+        if (typeof options === "string") {
1043
+          options = {
1044
+            ch1: options
1045
+          };
1046
+        }
1047
+
1048
+        var ch1 = options.ch1;
1049
+        var ch2 = options.ch2;
1050
+        var ch3 = options.ch3;
1051
+        var ch4 = options.ch4;
1052
+        var precision = options.precision;
1053
+        var letterArray = options.pdfColorType === "draw" ? ['G', 'RG', 'K'] : ['g', 'rg', 'k'];
1054
+
1055
+        if (typeof ch1 === "string" && ch1.charAt(0) !== '#') {
1056
+          var rgbColor = new RGBColor(ch1);
1057
+
1058
+          if (rgbColor.ok) {
1059
+            ch1 = rgbColor.toHex();
1060
+          } else if (!/^\d*\.?\d*$/.test(ch1)) {
1061
+            throw new Error('Invalid color "' + ch1 + '" passed to jsPDF.encodeColorString.');
1062
+          }
1063
+        } //convert short rgb to long form
1064
+
1065
+
1066
+        if (typeof ch1 === "string" && /^#[0-9A-Fa-f]{3}$/.test(ch1)) {
1067
+          ch1 = '#' + ch1[1] + ch1[1] + ch1[2] + ch1[2] + ch1[3] + ch1[3];
1068
+        }
1069
+
1070
+        if (typeof ch1 === "string" && /^#[0-9A-Fa-f]{6}$/.test(ch1)) {
1071
+          var hex = parseInt(ch1.substr(1), 16);
1072
+          ch1 = hex >> 16 & 255;
1073
+          ch2 = hex >> 8 & 255;
1074
+          ch3 = hex & 255;
1075
+        }
1076
+
1077
+        if (typeof ch2 === "undefined" || typeof ch4 === "undefined" && ch1 === ch2 && ch2 === ch3) {
1078
+          // Gray color space.
1079
+          if (typeof ch1 === "string") {
1080
+            color = ch1 + " " + letterArray[0];
1081
+          } else {
1082
+            switch (options.precision) {
1083
+              case 2:
1084
+                color = f2(ch1 / 255) + " " + letterArray[0];
1085
+                break;
1086
+
1087
+              case 3:
1088
+              default:
1089
+                color = f3(ch1 / 255) + " " + letterArray[0];
1090
+            }
1091
+          }
1092
+        } else if (typeof ch4 === "undefined" || _typeof(ch4) === "object") {
1093
+          // assume RGBA
1094
+          if (ch4 && !isNaN(ch4.a)) {
1095
+            //TODO Implement transparency.
1096
+            //WORKAROUND use white for now, if transparent, otherwise handle as rgb
1097
+            if (ch4.a === 0) {
1098
+              color = ['1.000', '1.000', '1.000', letterArray[1]].join(" ");
1099
+              return color;
1100
+            }
1101
+          } // assume RGB
1102
+
1103
+
1104
+          if (typeof ch1 === "string") {
1105
+            color = [ch1, ch2, ch3, letterArray[1]].join(" ");
1106
+          } else {
1107
+            switch (options.precision) {
1108
+              case 2:
1109
+                color = [f2(ch1 / 255), f2(ch2 / 255), f2(ch3 / 255), letterArray[1]].join(" ");
1110
+                break;
1111
+
1112
+              default:
1113
+              case 3:
1114
+                color = [f3(ch1 / 255), f3(ch2 / 255), f3(ch3 / 255), letterArray[1]].join(" ");
1115
+            }
1116
+          }
1117
+        } else {
1118
+          // assume CMYK
1119
+          if (typeof ch1 === 'string') {
1120
+            color = [ch1, ch2, ch3, ch4, letterArray[2]].join(" ");
1121
+          } else {
1122
+            switch (options.precision) {
1123
+              case 2:
1124
+                color = [f2(ch1 / 255), f2(ch2 / 255), f2(ch3 / 255), f2(ch4 / 255), letterArray[2]].join(" ");
1125
+                break;
1126
+
1127
+              case 3:
1128
+              default:
1129
+                color = [f3(ch1 / 255), f3(ch2 / 255), f3(ch3 / 255), f3(ch4 / 255), letterArray[2]].join(" ");
1130
+            }
1131
+          }
1132
+        }
1133
+
1134
+        return color;
1135
+      };
1136
+
1137
+      var getFilters = API.__private__.getFilters = function () {
1138
+        return filters;
1139
+      };
1140
+
1141
+      var putStream = API.__private__.putStream = function (options) {
1142
+        options = options || {};
1143
+        var data = options.data || '';
1144
+        var filters = options.filters || getFilters();
1145
+        var alreadyAppliedFilters = options.alreadyAppliedFilters || [];
1146
+        var addLength1 = options.addLength1 || false;
1147
+        var valueOfLength1 = data.length;
1148
+        var processedData = {};
1149
+
1150
+        if (filters === true) {
1151
+          filters = ['FlateEncode'];
1152
+        }
1153
+
1154
+        var keyValues = options.additionalKeyValues || [];
1155
+
1156
+        if (typeof jsPDF.API.processDataByFilters !== 'undefined') {
1157
+          processedData = jsPDF.API.processDataByFilters(data, filters);
1158
+        } else {
1159
+          processedData = {
1160
+            data: data,
1161
+            reverseChain: []
1162
+          };
1163
+        }
1164
+
1165
+        var filterAsString = processedData.reverseChain + (Array.isArray(alreadyAppliedFilters) ? alreadyAppliedFilters.join(' ') : alreadyAppliedFilters.toString());
1166
+
1167
+        if (processedData.data.length !== 0) {
1168
+          keyValues.push({
1169
+            key: 'Length',
1170
+            value: processedData.data.length
1171
+          });
1172
+
1173
+          if (addLength1 === true) {
1174
+            keyValues.push({
1175
+              key: 'Length1',
1176
+              value: valueOfLength1
1177
+            });
1178
+          }
1179
+        }
1180
+
1181
+        if (filterAsString.length != 0) {
1182
+          //if (filters.length === 0 && alreadyAppliedFilters.length === 1 && typeof alreadyAppliedFilters !== "undefined") {
1183
+          if (filterAsString.split('/').length - 1 === 1) {
1184
+            keyValues.push({
1185
+              key: 'Filter',
1186
+              value: filterAsString
1187
+            });
1188
+          } else {
1189
+            keyValues.push({
1190
+              key: 'Filter',
1191
+              value: '[' + filterAsString + ']'
1192
+            });
1193
+          }
1194
+        }
1195
+
1196
+        out('<<');
1197
+
1198
+        for (var i = 0; i < keyValues.length; i++) {
1199
+          out('/' + keyValues[i].key + ' ' + keyValues[i].value);
1200
+        }
1201
+
1202
+        out('>>');
1203
+
1204
+        if (processedData.data.length !== 0) {
1205
+          out('stream');
1206
+          out(processedData.data);
1207
+          out('endstream');
1208
+        }
1209
+      };
1210
+
1211
+      var putPage = API.__private__.putPage = function (page) {
1212
+        var mediaBox = page.mediaBox;
1213
+        var pageNumber = page.number;
1214
+        var data = page.data;
1215
+        var pageObjectNumber = page.objId;
1216
+        var pageContentsObjId = page.contentsObjId;
1217
+        newObjectDeferredBegin(pageObjectNumber, true);
1218
+        var wPt = pagesContext[currentPage].mediaBox.topRightX - pagesContext[currentPage].mediaBox.bottomLeftX;
1219
+        var hPt = pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY;
1220
+        out('<</Type /Page');
1221
+        out('/Parent ' + page.rootDictionaryObjId + ' 0 R');
1222
+        out('/Resources ' + page.resourceDictionaryObjId + ' 0 R');
1223
+        out('/MediaBox [' + parseFloat(f2(page.mediaBox.bottomLeftX)) + ' ' + parseFloat(f2(page.mediaBox.bottomLeftY)) + ' ' + f2(page.mediaBox.topRightX) + ' ' + f2(page.mediaBox.topRightY) + ']');
1224
+
1225
+        if (page.cropBox !== null) {
1226
+          out('/CropBox [' + f2(page.cropBox.bottomLeftX) + ' ' + f2(page.cropBox.bottomLeftY) + ' ' + f2(page.cropBox.topRightX) + ' ' + f2(page.cropBox.topRightY) + ']');
1227
+        }
1228
+
1229
+        if (page.bleedBox !== null) {
1230
+          out('/BleedBox [' + f2(page.bleedBox.bottomLeftX) + ' ' + f2(page.bleedBox.bottomLeftY) + ' ' + f2(page.bleedBox.topRightX) + ' ' + f2(page.bleedBox.topRightY) + ']');
1231
+        }
1232
+
1233
+        if (page.trimBox !== null) {
1234
+          out('/TrimBox [' + f2(page.trimBox.bottomLeftX) + ' ' + f2(page.trimBox.bottomLeftY) + ' ' + f2(page.trimBox.topRightX) + ' ' + f2(page.trimBox.topRightY) + ']');
1235
+        }
1236
+
1237
+        if (page.artBox !== null) {
1238
+          out('/ArtBox [' + f2(page.artBox.bottomLeftX) + ' ' + f2(page.artBox.bottomLeftY) + ' ' + f2(page.artBox.topRightX) + ' ' + f2(page.artBox.topRightY) + ']');
1239
+        }
1240
+
1241
+        if (typeof page.userUnit === "number" && page.userUnit !== 1.0) {
1242
+          out('/UserUnit ' + page.userUnit);
1243
+        }
1244
+
1245
+        events.publish('putPage', {
1246
+          objId: pageObjectNumber,
1247
+          pageContext: pagesContext[pageNumber],
1248
+          pageNumber: pageNumber,
1249
+          page: data
1250
+        });
1251
+        out('/Contents ' + pageContentsObjId + ' 0 R');
1252
+        out('>>');
1253
+        out('endobj'); // Page content
1254
+
1255
+        var pageContent = data.join('\n');
1256
+        newObjectDeferredBegin(pageContentsObjId, true);
1257
+        putStream({
1258
+          data: pageContent,
1259
+          filters: getFilters()
1260
+        });
1261
+        out('endobj');
1262
+        return pageObjectNumber;
1263
+      };
1264
+
1265
+      var putPages = API.__private__.putPages = function () {
1266
+        var n,
1267
+            i,
1268
+            pageObjectNumbers = [];
1269
+
1270
+        for (n = 1; n <= page; n++) {
1271
+          pagesContext[n].objId = newObjectDeferred();
1272
+          pagesContext[n].contentsObjId = newObjectDeferred();
1273
+        }
1274
+
1275
+        for (n = 1; n <= page; n++) {
1276
+          pageObjectNumbers.push(putPage({
1277
+            number: n,
1278
+            data: pages[n],
1279
+            objId: pagesContext[n].objId,
1280
+            contentsObjId: pagesContext[n].contentsObjId,
1281
+            mediaBox: pagesContext[n].mediaBox,
1282
+            cropBox: pagesContext[n].cropBox,
1283
+            bleedBox: pagesContext[n].bleedBox,
1284
+            trimBox: pagesContext[n].trimBox,
1285
+            artBox: pagesContext[n].artBox,
1286
+            userUnit: pagesContext[n].userUnit,
1287
+            rootDictionaryObjId: rootDictionaryObjId,
1288
+            resourceDictionaryObjId: resourceDictionaryObjId
1289
+          }));
1290
+        }
1291
+
1292
+        newObjectDeferredBegin(rootDictionaryObjId, true);
1293
+        out('<</Type /Pages');
1294
+        var kids = '/Kids [';
1295
+
1296
+        for (i = 0; i < page; i++) {
1297
+          kids += pageObjectNumbers[i] + ' 0 R ';
1298
+        }
1299
+
1300
+        out(kids + ']');
1301
+        out('/Count ' + page);
1302
+        out('>>');
1303
+        out('endobj');
1304
+        events.publish('postPutPages');
1305
+      };
1306
+
1307
+      var putFont = function putFont(font) {
1308
+        events.publish('putFont', {
1309
+          font: font,
1310
+          out: out,
1311
+          newObject: newObject,
1312
+          putStream: putStream
1313
+        });
1314
+
1315
+        if (font.isAlreadyPutted !== true) {
1316
+          font.objectNumber = newObject();
1317
+          out('<<');
1318
+          out('/Type /Font');
1319
+          out('/BaseFont /' + font.postScriptName);
1320
+          out('/Subtype /Type1');
1321
+
1322
+          if (typeof font.encoding === 'string') {
1323
+            out('/Encoding /' + font.encoding);
1324
+          }
1325
+
1326
+          out('/FirstChar 32');
1327
+          out('/LastChar 255');
1328
+          out('>>');
1329
+          out('endobj');
1330
+        }
1331
+      };
1332
+
1333
+      var putFonts = function putFonts() {
1334
+        for (var fontKey in fonts) {
1335
+          if (fonts.hasOwnProperty(fontKey)) {
1336
+            if (putOnlyUsedFonts === false || putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey)) {
1337
+              putFont(fonts[fontKey]);
1338
+            }
1339
+          }
1340
+        }
1341
+      };
1342
+
1343
+      var putResourceDictionary = function putResourceDictionary() {
1344
+        out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
1345
+        out('/Font <<'); // Do this for each font, the '1' bit is the index of the font
1346
+
1347
+        for (var fontKey in fonts) {
1348
+          if (fonts.hasOwnProperty(fontKey)) {
1349
+            if (putOnlyUsedFonts === false || putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey)) {
1350
+              out('/' + fontKey + ' ' + fonts[fontKey].objectNumber + ' 0 R');
1351
+            }
1352
+          }
1353
+        }
1354
+
1355
+        out('>>');
1356
+        out('/XObject <<');
1357
+        events.publish('putXobjectDict');
1358
+        out('>>');
1359
+      };
1360
+
1361
+      var putResources = function putResources() {
1362
+        putFonts();
1363
+        events.publish('putResources');
1364
+        newObjectDeferredBegin(resourceDictionaryObjId, true);
1365
+        out('<<');
1366
+        putResourceDictionary();
1367
+        out('>>');
1368
+        out('endobj');
1369
+        events.publish('postPutResources');
1370
+      };
1371
+
1372
+      var putAdditionalObjects = function putAdditionalObjects() {
1373
+        events.publish('putAdditionalObjects');
1374
+
1375
+        for (var i = 0; i < additionalObjects.length; i++) {
1376
+          var obj = additionalObjects[i];
1377
+          newObjectDeferredBegin(obj.objId, true);
1378
+          out(obj.content);
1379
+          out('endobj');
1380
+        }
1381
+
1382
+        events.publish('postPutAdditionalObjects');
1383
+      };
1384
+
1385
+      var addToFontDictionary = function addToFontDictionary(fontKey, fontName, fontStyle) {
1386
+        // this is mapping structure for quick font key lookup.
1387
+        // returns the KEY of the font (ex: "F1") for a given
1388
+        // pair of font name and type (ex: "Arial". "Italic")
1389
+        if (!fontmap.hasOwnProperty(fontName)) {
1390
+          fontmap[fontName] = {};
1391
+        }
1392
+
1393
+        fontmap[fontName][fontStyle] = fontKey;
1394
+      };
1395
+
1396
+      var addFont = function addFont(postScriptName, fontName, fontStyle, encoding, isStandardFont) {
1397
+        isStandardFont = isStandardFont || false;
1398
+        var fontKey = 'F' + (Object.keys(fonts).length + 1).toString(10),
1399
+            // This is FontObject
1400
+        font = {
1401
+          'id': fontKey,
1402
+          'postScriptName': postScriptName,
1403
+          'fontName': fontName,
1404
+          'fontStyle': fontStyle,
1405
+          'encoding': encoding,
1406
+          'isStandardFont': isStandardFont,
1407
+          'metadata': {}
1408
+        };
1409
+        var instance = this;
1410
+        events.publish('addFont', {
1411
+          font: font,
1412
+          instance: instance
1413
+        });
1414
+
1415
+        if (fontKey !== undefined) {
1416
+          fonts[fontKey] = font;
1417
+          addToFontDictionary(fontKey, fontName, fontStyle);
1418
+        }
1419
+
1420
+        return fontKey;
1421
+      };
1422
+
1423
+      var addFonts = function addFonts(arrayOfFonts) {
1424
+        for (var i = 0, l = standardFonts.length; i < l; i++) {
1425
+          var fontKey = addFont(arrayOfFonts[i][0], arrayOfFonts[i][1], arrayOfFonts[i][2], standardFonts[i][3], true);
1426
+          usedFonts[fontKey] = true; // adding aliases for standard fonts, this time matching the capitalization
1427
+
1428
+          var parts = arrayOfFonts[i][0].split('-');
1429
+          addToFontDictionary(fontKey, parts[0], parts[1] || '');
1430
+        }
1431
+
1432
+        events.publish('addFonts', {
1433
+          fonts: fonts,
1434
+          dictionary: fontmap
1435
+        });
1436
+      };
1437
+
1438
+      var SAFE = function __safeCall(fn) {
1439
+        fn.foo = function __safeCallWrapper() {
1440
+          try {
1441
+            return fn.apply(this, arguments);
1442
+          } catch (e) {
1443
+            var stack = e.stack || '';
1444
+            if (~stack.indexOf(' at ')) stack = stack.split(" at ")[1];
1445
+            var m = "Error in function " + stack.split("\n")[0].split('<')[0] + ": " + e.message;
1446
+
1447
+            if (global.console) {
1448
+              global.console.error(m, e);
1449
+              if (global.alert) alert(m);
1450
+            } else {
1451
+              throw new Error(m);
1452
+            }
1453
+          }
1454
+        };
1455
+
1456
+        fn.foo.bar = fn;
1457
+        return fn.foo;
1458
+      };
1459
+
1460
+      var to8bitStream = function to8bitStream(text, flags) {
1461
+        /**
1462
+         * PDF 1.3 spec:
1463
+         * "For text strings encoded in Unicode, the first two bytes must be 254 followed by
1464
+         * 255, representing the Unicode byte order marker, U+FEFF. (This sequence conflicts
1465
+         * with the PDFDocEncoding character sequence thorn ydieresis, which is unlikely
1466
+         * to be a meaningful beginning of a word or phrase.) The remainder of the
1467
+         * string consists of Unicode character codes, according to the UTF-16 encoding
1468
+         * specified in the Unicode standard, version 2.0. Commonly used Unicode values
1469
+         * are represented as 2 bytes per character, with the high-order byte appearing first
1470
+         * in the string."
1471
+         *
1472
+         * In other words, if there are chars in a string with char code above 255, we
1473
+         * recode the string to UCS2 BE - string doubles in length and BOM is prepended.
1474
+         *
1475
+         * HOWEVER!
1476
+         * Actual *content* (body) text (as opposed to strings used in document properties etc)
1477
+         * does NOT expect BOM. There, it is treated as a literal GID (Glyph ID)
1478
+         *
1479
+         * Because of Adobe's focus on "you subset your fonts!" you are not supposed to have
1480
+         * a font that maps directly Unicode (UCS2 / UTF16BE) code to font GID, but you could
1481
+         * fudge it with "Identity-H" encoding and custom CIDtoGID map that mimics Unicode
1482
+         * code page. There, however, all characters in the stream are treated as GIDs,
1483
+         * including BOM, which is the reason we need to skip BOM in content text (i.e. that
1484
+         * that is tied to a font).
1485
+         *
1486
+         * To signal this "special" PDFEscape / to8bitStream handling mode,
1487
+         * API.text() function sets (unless you overwrite it with manual values
1488
+         * given to API.text(.., flags) )
1489
+         * flags.autoencode = true
1490
+         * flags.noBOM = true
1491
+         *
1492
+         * ===================================================================================
1493
+         * `flags` properties relied upon:
1494
+         *   .sourceEncoding = string with encoding label.
1495
+         *                     "Unicode" by default. = encoding of the incoming text.
1496
+         *                     pass some non-existing encoding name
1497
+         *                     (ex: 'Do not touch my strings! I know what I am doing.')
1498
+         *                     to make encoding code skip the encoding step.
1499
+         *   .outputEncoding = Either valid PDF encoding name
1500
+         *                     (must be supported by jsPDF font metrics, otherwise no encoding)
1501
+         *                     or a JS object, where key = sourceCharCode, value = outputCharCode
1502
+         *                     missing keys will be treated as: sourceCharCode === outputCharCode
1503
+         *   .noBOM
1504
+         *       See comment higher above for explanation for why this is important
1505
+         *   .autoencode
1506
+         *       See comment higher above for explanation for why this is important
1507
+         */
1508
+        var i, l, sourceEncoding, encodingBlock, outputEncoding, newtext, isUnicode, ch, bch;
1509
+        flags = flags || {};
1510
+        sourceEncoding = flags.sourceEncoding || 'Unicode';
1511
+        outputEncoding = flags.outputEncoding; // This 'encoding' section relies on font metrics format
1512
+        // attached to font objects by, among others,
1513
+        // "Willow Systems' standard_font_metrics plugin"
1514
+        // see jspdf.plugin.standard_font_metrics.js for format
1515
+        // of the font.metadata.encoding Object.
1516
+        // It should be something like
1517
+        //   .encoding = {'codePages':['WinANSI....'], 'WinANSI...':{code:code, ...}}
1518
+        //   .widths = {0:width, code:width, ..., 'fof':divisor}
1519
+        //   .kerning = {code:{previous_char_code:shift, ..., 'fof':-divisor},...}
1520
+
1521
+        if ((flags.autoencode || outputEncoding) && fonts[activeFontKey].metadata && fonts[activeFontKey].metadata[sourceEncoding] && fonts[activeFontKey].metadata[sourceEncoding].encoding) {
1522
+          encodingBlock = fonts[activeFontKey].metadata[sourceEncoding].encoding; // each font has default encoding. Some have it clearly defined.
1523
+
1524
+          if (!outputEncoding && fonts[activeFontKey].encoding) {
1525
+            outputEncoding = fonts[activeFontKey].encoding;
1526
+          } // Hmmm, the above did not work? Let's try again, in different place.
1527
+
1528
+
1529
+          if (!outputEncoding && encodingBlock.codePages) {
1530
+            outputEncoding = encodingBlock.codePages[0]; // let's say, first one is the default
1531
+          }
1532
+
1533
+          if (typeof outputEncoding === 'string') {
1534
+            outputEncoding = encodingBlock[outputEncoding];
1535
+          } // we want output encoding to be a JS Object, where
1536
+          // key = sourceEncoding's character code and
1537
+          // value = outputEncoding's character code.
1538
+
1539
+
1540
+          if (outputEncoding) {
1541
+            isUnicode = false;
1542
+            newtext = [];
1543
+
1544
+            for (i = 0, l = text.length; i < l; i++) {
1545
+              ch = outputEncoding[text.charCodeAt(i)];
1546
+
1547
+              if (ch) {
1548
+                newtext.push(String.fromCharCode(ch));
1549
+              } else {
1550
+                newtext.push(text[i]);
1551
+              } // since we are looping over chars anyway, might as well
1552
+              // check for residual unicodeness
1553
+
1554
+
1555
+              if (newtext[i].charCodeAt(0) >> 8) {
1556
+                /* more than 255 */
1557
+                isUnicode = true;
1558
+              }
1559
+            }
1560
+
1561
+            text = newtext.join('');
1562
+          }
1563
+        }
1564
+
1565
+        i = text.length; // isUnicode may be set to false above. Hence the triple-equal to undefined
1566
+
1567
+        while (isUnicode === undefined && i !== 0) {
1568
+          if (text.charCodeAt(i - 1) >> 8) {
1569
+            /* more than 255 */
1570
+            isUnicode = true;
1571
+          }
1572
+
1573
+          i--;
1574
+        }
1575
+
1576
+        if (!isUnicode) {
1577
+          return text;
1578
+        }
1579
+
1580
+        newtext = flags.noBOM ? [] : [254, 255];
1581
+
1582
+        for (i = 0, l = text.length; i < l; i++) {
1583
+          ch = text.charCodeAt(i);
1584
+          bch = ch >> 8; // divide by 256
1585
+
1586
+          if (bch >> 8) {
1587
+            /* something left after dividing by 256 second time */
1588
+            throw new Error("Character at position " + i + " of string '" + text + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
1589
+          }
1590
+
1591
+          newtext.push(bch);
1592
+          newtext.push(ch - (bch << 8));
1593
+        }
1594
+
1595
+        return String.fromCharCode.apply(undefined, newtext);
1596
+      };
1597
+
1598
+      var pdfEscape = API.__private__.pdfEscape = API.pdfEscape = function (text, flags) {
1599
+        /**
1600
+         * Replace '/', '(', and ')' with pdf-safe versions
1601
+         *
1602
+         * Doing to8bitStream does NOT make this PDF display unicode text. For that
1603
+         * we also need to reference a unicode font and embed it - royal pain in the rear.
1604
+         *
1605
+         * There is still a benefit to to8bitStream - PDF simply cannot handle 16bit chars,
1606
+         * which JavaScript Strings are happy to provide. So, while we still cannot display
1607
+         * 2-byte characters property, at least CONDITIONALLY converting (entire string containing)
1608
+         * 16bit chars to (USC-2-BE) 2-bytes per char + BOM streams we ensure that entire PDF
1609
+         * is still parseable.
1610
+         * This will allow immediate support for unicode in document properties strings.
1611
+         */
1612
+        return to8bitStream(text, flags).replace(/\\/g, '\\\\').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
1613
+      };
1614
+
1615
+      var beginPage = API.__private__.beginPage = function (width, height) {
1616
+        var tmp; // Dimensions are stored as user units and converted to points on output
1617
+
1618
+        var orientation = typeof height === 'string' && height.toLowerCase();
1619
+
1620
+        if (typeof width === 'string') {
1621
+          if (tmp = getPageFormat(width.toLowerCase())) {
1622
+            width = tmp[0];
1623
+            height = tmp[1];
1624
+          }
1625
+        }
1626
+
1627
+        if (Array.isArray(width)) {
1628
+          height = width[1];
1629
+          width = width[0];
1630
+        }
1631
+
1632
+        if (isNaN(width) || isNaN(height)) {
1633
+          width = format[0];
1634
+          height = format[1];
1635
+        }
1636
+
1637
+        if (orientation) {
1638
+          switch (orientation.substr(0, 1)) {
1639
+            case 'l':
1640
+              if (height > width) orientation = 's';
1641
+              break;
1642
+
1643
+            case 'p':
1644
+              if (width > height) orientation = 's';
1645
+              break;
1646
+          }
1647
+
1648
+          if (orientation === 's') {
1649
+            tmp = width;
1650
+            width = height;
1651
+            height = tmp;
1652
+          }
1653
+        }
1654
+
1655
+        if (width > 14400 || height > 14400) {
1656
+          console.warn('A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400');
1657
+          width = Math.min(14400, width);
1658
+          height = Math.min(14400, height);
1659
+        }
1660
+
1661
+        format = [width, height];
1662
+        outToPages = true;
1663
+        pages[++page] = [];
1664
+        pagesContext[page] = {
1665
+          objId: 0,
1666
+          contentsObjId: 0,
1667
+          userUnit: Number(userUnit),
1668
+          artBox: null,
1669
+          bleedBox: null,
1670
+          cropBox: null,
1671
+          trimBox: null,
1672
+          mediaBox: {
1673
+            bottomLeftX: 0,
1674
+            bottomLeftY: 0,
1675
+            topRightX: Number(width),
1676
+            topRightY: Number(height)
1677
+          }
1678
+        };
1679
+
1680
+        _setPage(page);
1681
+      };
1682
+
1683
+      var _addPage = function _addPage() {
1684
+        beginPage.apply(this, arguments); // Set line width
1685
+
1686
+        setLineWidth(lineWidth); // Set draw color
1687
+
1688
+        out(strokeColor); // resurrecting non-default line caps, joins
1689
+
1690
+        if (lineCapID !== 0) {
1691
+          out(lineCapID + ' J');
1692
+        }
1693
+
1694
+        if (lineJoinID !== 0) {
1695
+          out(lineJoinID + ' j');
1696
+        }
1697
+
1698
+        events.publish('addPage', {
1699
+          pageNumber: page
1700
+        });
1701
+      };
1702
+
1703
+      var _deletePage = function _deletePage(n) {
1704
+        if (n > 0 && n <= page) {
1705
+          pages.splice(n, 1);
1706
+          page--;
1707
+
1708
+          if (currentPage > page) {
1709
+            currentPage = page;
1710
+          }
1711
+
1712
+          this.setPage(currentPage);
1713
+        }
1714
+      };
1715
+
1716
+      var _setPage = function _setPage(n) {
1717
+        if (n > 0 && n <= page) {
1718
+          currentPage = n;
1719
+        }
1720
+      };
1721
+
1722
+      var getNumberOfPages = API.__private__.getNumberOfPages = API.getNumberOfPages = function () {
1723
+        return pages.length - 1;
1724
+      };
1725
+      /**
1726
+       * Returns a document-specific font key - a label assigned to a
1727
+       * font name + font type combination at the time the font was added
1728
+       * to the font inventory.
1729
+       *
1730
+       * Font key is used as label for the desired font for a block of text
1731
+       * to be added to the PDF document stream.
1732
+       * @private
1733
+       * @function
1734
+       * @param fontName {string} can be undefined on "falthy" to indicate "use current"
1735
+       * @param fontStyle {string} can be undefined on "falthy" to indicate "use current"
1736
+       * @returns {string} Font key.
1737
+       * @ignore
1738
+       */
1739
+
1740
+
1741
+      var _getFont = function getFont(fontName, fontStyle, options) {
1742
+        var key = undefined,
1743
+            fontNameLowerCase;
1744
+        options = options || {};
1745
+        fontName = fontName !== undefined ? fontName : fonts[activeFontKey].fontName;
1746
+        fontStyle = fontStyle !== undefined ? fontStyle : fonts[activeFontKey].fontStyle;
1747
+        fontNameLowerCase = fontName.toLowerCase();
1748
+
1749
+        if (fontmap[fontNameLowerCase] !== undefined && fontmap[fontNameLowerCase][fontStyle] !== undefined) {
1750
+          key = fontmap[fontNameLowerCase][fontStyle];
1751
+        } else if (fontmap[fontName] !== undefined && fontmap[fontName][fontStyle] !== undefined) {
1752
+          key = fontmap[fontName][fontStyle];
1753
+        } else {
1754
+          if (options.disableWarning === false) {
1755
+            console.warn("Unable to look up font label for font '" + fontName + "', '" + fontStyle + "'. Refer to getFontList() for available fonts.");
1756
+          }
1757
+        }
1758
+
1759
+        if (!key && !options.noFallback) {
1760
+          key = fontmap['times'][fontStyle];
1761
+
1762
+          if (key == null) {
1763
+            key = fontmap['times']['normal'];
1764
+          }
1765
+        }
1766
+
1767
+        return key;
1768
+      };
1769
+
1770
+      var putInfo = API.__private__.putInfo = function () {
1771
+        newObject();
1772
+        out('<<');
1773
+        out('/Producer (jsPDF ' + jsPDF.version + ')');
1774
+
1775
+        for (var key in documentProperties) {
1776
+          if (documentProperties.hasOwnProperty(key) && documentProperties[key]) {
1777
+            out('/' + key.substr(0, 1).toUpperCase() + key.substr(1) + ' (' + pdfEscape(documentProperties[key]) + ')');
1778
+          }
1779
+        }
1780
+
1781
+        out('/CreationDate (' + creationDate + ')');
1782
+        out('>>');
1783
+        out('endobj');
1784
+      };
1785
+
1786
+      var putCatalog = API.__private__.putCatalog = function (options) {
1787
+        options = options || {};
1788
+        var tmpRootDictionaryObjId = options.rootDictionaryObjId || rootDictionaryObjId;
1789
+        newObject();
1790
+        out('<<');
1791
+        out('/Type /Catalog');
1792
+        out('/Pages ' + tmpRootDictionaryObjId + ' 0 R'); // PDF13ref Section 7.2.1
1793
+
1794
+        if (!zoomMode) zoomMode = 'fullwidth';
1795
+
1796
+        switch (zoomMode) {
1797
+          case 'fullwidth':
1798
+            out('/OpenAction [3 0 R /FitH null]');
1799
+            break;
1800
+
1801
+          case 'fullheight':
1802
+            out('/OpenAction [3 0 R /FitV null]');
1803
+            break;
1804
+
1805
+          case 'fullpage':
1806
+            out('/OpenAction [3 0 R /Fit]');
1807
+            break;
1808
+
1809
+          case 'original':
1810
+            out('/OpenAction [3 0 R /XYZ null null 1]');
1811
+            break;
1812
+
1813
+          default:
1814
+            var pcn = '' + zoomMode;
1815
+            if (pcn.substr(pcn.length - 1) === '%') zoomMode = parseInt(zoomMode) / 100;
1816
+
1817
+            if (typeof zoomMode === 'number') {
1818
+              out('/OpenAction [3 0 R /XYZ null null ' + f2(zoomMode) + ']');
1819
+            }
1820
+
1821
+        }
1822
+
1823
+        if (!layoutMode) layoutMode = 'continuous';
1824
+
1825
+        switch (layoutMode) {
1826
+          case 'continuous':
1827
+            out('/PageLayout /OneColumn');
1828
+            break;
1829
+
1830
+          case 'single':
1831
+            out('/PageLayout /SinglePage');
1832
+            break;
1833
+
1834
+          case 'two':
1835
+          case 'twoleft':
1836
+            out('/PageLayout /TwoColumnLeft');
1837
+            break;
1838
+
1839
+          case 'tworight':
1840
+            out('/PageLayout /TwoColumnRight');
1841
+            break;
1842
+        }
1843
+
1844
+        if (pageMode) {
1845
+          /**
1846
+           * A name object specifying how the document should be displayed when opened:
1847
+           * UseNone      : Neither document outline nor thumbnail images visible -- DEFAULT
1848
+           * UseOutlines  : Document outline visible
1849
+           * UseThumbs    : Thumbnail images visible
1850
+           * FullScreen   : Full-screen mode, with no menu bar, window controls, or any other window visible
1851
+           */
1852
+          out('/PageMode /' + pageMode);
1853
+        }
1854
+
1855
+        events.publish('putCatalog');
1856
+        out('>>');
1857
+        out('endobj');
1858
+      };
1859
+
1860
+      var putTrailer = API.__private__.putTrailer = function () {
1861
+        out('trailer');
1862
+        out('<<');
1863
+        out('/Size ' + (objectNumber + 1));
1864
+        out('/Root ' + objectNumber + ' 0 R');
1865
+        out('/Info ' + (objectNumber - 1) + ' 0 R');
1866
+        out("/ID [ <" + fileId + "> <" + fileId + "> ]");
1867
+        out('>>');
1868
+      };
1869
+
1870
+      var putHeader = API.__private__.putHeader = function () {
1871
+        out('%PDF-' + pdfVersion);
1872
+        out("%\xBA\xDF\xAC\xE0");
1873
+      };
1874
+
1875
+      var putXRef = API.__private__.putXRef = function () {
1876
+        var i = 1;
1877
+        var p = "0000000000";
1878
+        out('xref');
1879
+        out('0 ' + (objectNumber + 1));
1880
+        out('0000000000 65535 f ');
1881
+
1882
+        for (i = 1; i <= objectNumber; i++) {
1883
+          var offset = offsets[i];
1884
+
1885
+          if (typeof offset === 'function') {
1886
+            out((p + offsets[i]()).slice(-10) + ' 00000 n ');
1887
+          } else {
1888
+            if (typeof offsets[i] !== "undefined") {
1889
+              out((p + offsets[i]).slice(-10) + ' 00000 n ');
1890
+            } else {
1891
+              out('0000000000 00000 n ');
1892
+            }
1893
+          }
1894
+        }
1895
+      };
1896
+
1897
+      var buildDocument = API.__private__.buildDocument = function () {
1898
+        outToPages = false; // switches out() to content
1899
+        //reset fields relevant for objectNumber generation and xref.
1900
+
1901
+        objectNumber = 0;
1902
+        content_length = 0;
1903
+        content = [];
1904
+        offsets = [];
1905
+        additionalObjects = [];
1906
+        rootDictionaryObjId = newObjectDeferred();
1907
+        resourceDictionaryObjId = newObjectDeferred();
1908
+        events.publish('buildDocument');
1909
+        putHeader();
1910
+        putPages();
1911
+        putAdditionalObjects();
1912
+        putResources();
1913
+        putInfo();
1914
+        putCatalog();
1915
+        var offsetOfXRef = content_length;
1916
+        putXRef();
1917
+        putTrailer();
1918
+        out('startxref');
1919
+        out('' + offsetOfXRef);
1920
+        out('%%EOF');
1921
+        outToPages = true;
1922
+        return content.join('\n');
1923
+      };
1924
+
1925
+      var getBlob = API.__private__.getBlob = function (data) {
1926
+        return new Blob([getArrayBuffer(data)], {
1927
+          type: "application/pdf"
1928
+        });
1929
+      };
1930
+      /**
1931
+       * Generates the PDF document.
1932
+       *
1933
+       * If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
1934
+       *
1935
+       * @param {string} type A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow'.
1936
+       * @param {Object} options An object providing some additional signalling to PDF generator. Possible options are 'filename'.
1937
+       *
1938
+       * @function
1939
+       * @instance
1940
+       * @returns {jsPDF}
1941
+       * @memberOf jsPDF
1942
+       * @name output
1943
+       */
1944
+
1945
+
1946
+      var output = API.output = API.__private__.output = SAFE(function output(type, options) {
1947
+        options = options || {};
1948
+        var pdfDocument = buildDocument();
1949
+
1950
+        if (typeof options === "string") {
1951
+          options = {
1952
+            filename: options
1953
+          };
1954
+        } else {
1955
+          options.filename = options.filename || 'generated.pdf';
1956
+        }
1957
+
1958
+        switch (type) {
1959
+          case undefined:
1960
+            return pdfDocument;
1961
+
1962
+          case 'save':
1963
+            API.save(options.filename);
1964
+            break;
1965
+
1966
+          case 'arraybuffer':
1967
+            return getArrayBuffer(pdfDocument);
1968
+
1969
+          case 'blob':
1970
+            return getBlob(pdfDocument);
1971
+
1972
+          case 'bloburi':
1973
+          case 'bloburl':
1974
+            // Developer is responsible of calling revokeObjectURL
1975
+            if (typeof global.URL !== "undefined" && typeof global.URL.createObjectURL === "function") {
1976
+              return global.URL && global.URL.createObjectURL(getBlob(pdfDocument)) || void 0;
1977
+            } else {
1978
+              console.warn('bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.');
1979
+            }
1980
+
1981
+            break;
1982
+
1983
+          case 'datauristring':
1984
+          case 'dataurlstring':
1985
+            return 'data:application/pdf;filename=' + options.filename + ';base64,' + btoa(pdfDocument);
1986
+
1987
+          case 'dataurlnewwindow':
1988
+            var htmlForNewWindow = '<html>' + '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style>' + '<body>' + '<iframe src="' + this.output('datauristring') + '"></iframe>' + '</body></html>';
1989
+            var nW = global.open();
1990
+
1991
+            if (nW !== null) {
1992
+              nW.document.write(htmlForNewWindow);
1993
+            }
1994
+
1995
+            if (nW || typeof safari === "undefined") return nW;
1996
+
1997
+          /* pass through */
1998
+
1999
+          case 'datauri':
2000
+          case 'dataurl':
2001
+            return global.document.location.href = 'data:application/pdf;filename=' + options.filename + ';base64,' + btoa(pdfDocument);
2002
+
2003
+          default:
2004
+            return null;
2005
+        }
2006
+      });
2007
+      /**
2008
+       * Used to see if a supplied hotfix was requested when the pdf instance was created.
2009
+       * @param {string} hotfixName - The name of the hotfix to check.
2010
+       * @returns {boolean}
2011
+       */
2012
+
2013
+      var hasHotfix = function hasHotfix(hotfixName) {
2014
+        return Array.isArray(hotfixes) === true && hotfixes.indexOf(hotfixName) > -1;
2015
+      };
2016
+
2017
+      switch (unit) {
2018
+        case 'pt':
2019
+          k = 1;
2020
+          break;
2021
+
2022
+        case 'mm':
2023
+          k = 72 / 25.4;
2024
+          break;
2025
+
2026
+        case 'cm':
2027
+          k = 72 / 2.54;
2028
+          break;
2029
+
2030
+        case 'in':
2031
+          k = 72;
2032
+          break;
2033
+
2034
+        case 'px':
2035
+          if (hasHotfix('px_scaling') == true) {
2036
+            k = 72 / 96;
2037
+          } else {
2038
+            k = 96 / 72;
2039
+          }
2040
+
2041
+          break;
2042
+
2043
+        case 'pc':
2044
+          k = 12;
2045
+          break;
2046
+
2047
+        case 'em':
2048
+          k = 12;
2049
+          break;
2050
+
2051
+        case 'ex':
2052
+          k = 6;
2053
+          break;
2054
+
2055
+        default:
2056
+          throw new Error('Invalid unit: ' + unit);
2057
+      }
2058
+
2059
+      setCreationDate();
2060
+      setFileId(); //---------------------------------------
2061
+      // Public API
2062
+
2063
+      var getPageInfo = API.__private__.getPageInfo = function (pageNumberOneBased) {
2064
+        if (isNaN(pageNumberOneBased) || pageNumberOneBased % 1 !== 0) {
2065
+          throw new Error('Invalid argument passed to jsPDF.getPageInfo');
2066
+        }
2067
+
2068
+        var objId = pagesContext[pageNumberOneBased].objId;
2069
+        return {
2070
+          objId: objId,
2071
+          pageNumber: pageNumberOneBased,
2072
+          pageContext: pagesContext[pageNumberOneBased]
2073
+        };
2074
+      };
2075
+
2076
+      var getPageInfoByObjId = API.__private__.getPageInfoByObjId = function (objId) {
2077
+
2078
+        for (var pageNumber in pagesContext) {
2079
+          if (pagesContext[pageNumber].objId === objId) {
2080
+            break;
2081
+          }
2082
+        }
2083
+
2084
+        if (isNaN(objId) || objId % 1 !== 0) {
2085
+          throw new Error('Invalid argument passed to jsPDF.getPageInfoByObjId');
2086
+        }
2087
+
2088
+        return getPageInfo(pageNumber);
2089
+      };
2090
+
2091
+      var getCurrentPageInfo = API.__private__.getCurrentPageInfo = function () {
2092
+        return {
2093
+          objId: pagesContext[currentPage].objId,
2094
+          pageNumber: currentPage,
2095
+          pageContext: pagesContext[currentPage]
2096
+        };
2097
+      };
2098
+      /**
2099
+       * Adds (and transfers the focus to) new page to the PDF document.
2100
+       * @param format {String/Array} The format of the new page. Can be: <ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br />
2101
+       * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]
2102
+       * @param orientation {string} Orientation of the new page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l").
2103
+       * @function
2104
+       * @instance
2105
+       * @returns {jsPDF}
2106
+       *
2107
+       * @memberOf jsPDF
2108
+       * @name addPage
2109
+       */
2110
+
2111
+
2112
+      API.addPage = function () {
2113
+        _addPage.apply(this, arguments);
2114
+
2115
+        return this;
2116
+      };
2117
+      /**
2118
+       * Adds (and transfers the focus to) new page to the PDF document.
2119
+       * @function
2120
+       * @instance
2121
+       * @returns {jsPDF}
2122
+       *
2123
+       * @memberOf jsPDF
2124
+       * @name setPage
2125
+       * @param {number} page Switch the active page to the page number specified.
2126
+       * @example
2127
+       * doc = jsPDF()
2128
+       * doc.addPage()
2129
+       * doc.addPage()
2130
+       * doc.text('I am on page 3', 10, 10)
2131
+       * doc.setPage(1)
2132
+       * doc.text('I am on page 1', 10, 10)
2133
+       */
2134
+
2135
+
2136
+      API.setPage = function () {
2137
+        _setPage.apply(this, arguments);
2138
+
2139
+        return this;
2140
+      };
2141
+      /**
2142
+       * @name insertPage
2143
+       * @memberOf jsPDF
2144
+       * 
2145
+       * @function 
2146
+       * @instance
2147
+       * @param {Object} beforePage
2148
+       * @returns {jsPDF}
2149
+       */
2150
+
2151
+
2152
+      API.insertPage = function (beforePage) {
2153
+        this.addPage();
2154
+        this.movePage(currentPage, beforePage);
2155
+        return this;
2156
+      };
2157
+      /**
2158
+       * @name movePage
2159
+       * @memberOf jsPDF
2160
+       * @function
2161
+       * @instance
2162
+       * @param {Object} targetPage
2163
+       * @param {Object} beforePage
2164
+       * @returns {jsPDF}
2165
+       */
2166
+
2167
+
2168
+      API.movePage = function (targetPage, beforePage) {
2169
+        if (targetPage > beforePage) {
2170
+          var tmpPages = pages[targetPage];
2171
+          var tmpPagesContext = pagesContext[targetPage];
2172
+
2173
+          for (var i = targetPage; i > beforePage; i--) {
2174
+            pages[i] = pages[i - 1];
2175
+            pagesContext[i] = pagesContext[i - 1];
2176
+          }
2177
+
2178
+          pages[beforePage] = tmpPages;
2179
+          pagesContext[beforePage] = tmpPagesContext;
2180
+          this.setPage(beforePage);
2181
+        } else if (targetPage < beforePage) {
2182
+          var tmpPages = pages[targetPage];
2183
+          var tmpPagesContext = pagesContext[targetPage];
2184
+
2185
+          for (var i = targetPage; i < beforePage; i++) {
2186
+            pages[i] = pages[i + 1];
2187
+            pagesContext[i] = pagesContext[i + 1];
2188
+          }
2189
+
2190
+          pages[beforePage] = tmpPages;
2191
+          pagesContext[beforePage] = tmpPagesContext;
2192
+          this.setPage(beforePage);
2193
+        }
2194
+
2195
+        return this;
2196
+      };
2197
+      /**
2198
+       * Deletes a page from the PDF.
2199
+       * @name deletePage
2200
+       * @memberOf jsPDF
2201
+       * @function
2202
+       * @instance
2203
+       * @returns {jsPDF}
2204
+       */
2205
+
2206
+
2207
+      API.deletePage = function () {
2208
+        _deletePage.apply(this, arguments);
2209
+
2210
+        return this;
2211
+      };
2212
+      /**
2213
+       * Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings.
2214
+       *
2215
+       * @function
2216
+       * @instance
2217
+       * @param {String|Array} text String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call.
2218
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.
2219
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
2220
+       * @param {Object} [options] - Collection of settings signaling how the text must be encoded.
2221
+       * @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify.
2222
+       * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle.
2223
+       * @param {string} [options.angle=0] - Rotate the text counterclockwise. Expects the angle in degree.
2224
+       * @param {string} [options.charSpace=0] - The space between each letter.
2225
+       * @param {string} [options.lineHeightFactor=1.15] - The lineheight of each line.
2226
+       * @param {string} [options.flags] - Flags for to8bitStream.
2227
+       * @param {string} [options.flags.noBOM=true] - Don't add BOM to Unicode-text.
2228
+       * @param {string} [options.flags.autoencode=true] - Autoencode the Text.
2229
+       * @param {string} [options.maxWidth=0] - Split the text by given width, 0 = no split.
2230
+       * @param {string} [options.renderingMode=fill] - Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping.
2231
+       * @returns {jsPDF}
2232
+       * @memberOf jsPDF
2233
+       * @name text
2234
+       */
2235
+
2236
+
2237
+      var text = API.__private__.text = API.text = function (text, x, y, options) {
2238
+        /**
2239
+         * Inserts something like this into PDF
2240
+         *   BT
2241
+         *    /F1 16 Tf  % Font name + size
2242
+         *    16 TL % How many units down for next line in multiline text
2243
+         *    0 g % color
2244
+         *    28.35 813.54 Td % position
2245
+         *    (line one) Tj
2246
+         *    T* (line two) Tj
2247
+         *    T* (line three) Tj
2248
+         *   ET
2249
+         */
2250
+        //backwardsCompatibility
2251
+        var tmp; // Pre-August-2012 the order of arguments was function(x, y, text, flags)
2252
+        // in effort to make all calls have similar signature like
2253
+        //   function(data, coordinates... , miscellaneous)
2254
+        // this method had its args flipped.
2255
+        // code below allows backward compatibility with old arg order.
2256
+
2257
+        if (typeof text === 'number' && typeof x === 'number' && (typeof y === 'string' || Array.isArray(y))) {
2258
+          tmp = y;
2259
+          y = x;
2260
+          x = text;
2261
+          text = tmp;
2262
+        }
2263
+
2264
+        var flags = arguments[3];
2265
+        var angle = arguments[4];
2266
+        var align = arguments[5];
2267
+
2268
+        if (_typeof(flags) !== "object" || flags === null) {
2269
+          if (typeof angle === 'string') {
2270
+            align = angle;
2271
+            angle = null;
2272
+          }
2273
+
2274
+          if (typeof flags === 'string') {
2275
+            align = flags;
2276
+            flags = null;
2277
+          }
2278
+
2279
+          if (typeof flags === 'number') {
2280
+            angle = flags;
2281
+            flags = null;
2282
+          }
2283
+
2284
+          options = {
2285
+            flags: flags,
2286
+            angle: angle,
2287
+            align: align
2288
+          };
2289
+        }
2290
+
2291
+        flags = flags || {};
2292
+        flags.noBOM = flags.noBOM || true;
2293
+        flags.autoencode = flags.autoencode || true;
2294
+
2295
+        if (isNaN(x) || isNaN(y) || typeof text === "undefined" || text === null) {
2296
+          throw new Error('Invalid arguments passed to jsPDF.text');
2297
+        }
2298
+
2299
+        if (text.length === 0) {
2300
+          return scope;
2301
+        }
2302
+
2303
+        var xtra = '';
2304
+        var isHex = false;
2305
+        var lineHeight = typeof options.lineHeightFactor === 'number' ? options.lineHeightFactor : lineHeightFactor;
2306
+        var scope = options.scope || this;
2307
+
2308
+        function ESC(s) {
2309
+          s = s.split("\t").join(Array(options.TabLen || 9).join(" "));
2310
+          return pdfEscape(s, flags);
2311
+        }
2312
+
2313
+        function transformTextToSpecialArray(text) {
2314
+          //we don't want to destroy original text array, so cloning it
2315
+          var sa = text.concat();
2316
+          var da = [];
2317
+          var len = sa.length;
2318
+          var curDa; //we do array.join('text that must not be PDFescaped")
2319
+          //thus, pdfEscape each component separately
2320
+
2321
+          while (len--) {
2322
+            curDa = sa.shift();
2323
+
2324
+            if (typeof curDa === "string") {
2325
+              da.push(curDa);
2326
+            } else {
2327
+              if (Array.isArray(text) && curDa.length === 1) {
2328
+                da.push(curDa[0]);
2329
+              } else {
2330
+                da.push([curDa[0], curDa[1], curDa[2]]);
2331
+              }
2332
+            }
2333
+          }
2334
+
2335
+          return da;
2336
+        }
2337
+
2338
+        function processTextByFunction(text, processingFunction) {
2339
+          var result;
2340
+
2341
+          if (typeof text === 'string') {
2342
+            result = processingFunction(text)[0];
2343
+          } else if (Array.isArray(text)) {
2344
+            //we don't want to destroy original text array, so cloning it
2345
+            var sa = text.concat();
2346
+            var da = [];
2347
+            var len = sa.length;
2348
+            var curDa;
2349
+            var tmpResult; //we do array.join('text that must not be PDFescaped")
2350
+            //thus, pdfEscape each component separately
2351
+
2352
+            while (len--) {
2353
+              curDa = sa.shift();
2354
+
2355
+              if (typeof curDa === "string") {
2356
+                da.push(processingFunction(curDa)[0]);
2357
+              } else if (Array.isArray(curDa) && curDa[0] === "string") {
2358
+                tmpResult = processingFunction(curDa[0], curDa[1], curDa[2]);
2359
+                da.push([tmpResult[0], tmpResult[1], tmpResult[2]]);
2360
+              }
2361
+            }
2362
+
2363
+            result = da;
2364
+          }
2365
+
2366
+          return result;
2367
+        } //Check if text is of type String
2368
+
2369
+
2370
+        var textIsOfTypeString = false;
2371
+        var tmpTextIsOfTypeString = true;
2372
+
2373
+        if (typeof text === 'string') {
2374
+          textIsOfTypeString = true;
2375
+        } else if (Array.isArray(text)) {
2376
+          //we don't want to destroy original text array, so cloning it
2377
+          var sa = text.concat();
2378
+          var da = [];
2379
+          var len = sa.length;
2380
+          var curDa; //we do array.join('text that must not be PDFescaped")
2381
+          //thus, pdfEscape each component separately
2382
+
2383
+          while (len--) {
2384
+            curDa = sa.shift();
2385
+
2386
+            if (typeof curDa !== "string" || Array.isArray(curDa) && typeof curDa[0] !== "string") {
2387
+              tmpTextIsOfTypeString = false;
2388
+            }
2389
+          }
2390
+
2391
+          textIsOfTypeString = tmpTextIsOfTypeString;
2392
+        }
2393
+
2394
+        if (textIsOfTypeString === false) {
2395
+          throw new Error('Type of text must be string or Array. "' + text + '" is not recognized.');
2396
+        } //Escaping 
2397
+
2398
+
2399
+        var activeFontEncoding = fonts[activeFontKey].encoding;
2400
+
2401
+        if (activeFontEncoding === "WinAnsiEncoding" || activeFontEncoding === "StandardEncoding") {
2402
+          text = processTextByFunction(text, function (text, posX, posY) {
2403
+            return [ESC(text), posX, posY];
2404
+          });
2405
+        } //If there are any newlines in text, we assume
2406
+        //the user wanted to print multiple lines, so break the
2407
+        //text up into an array. If the text is already an array,
2408
+        //we assume the user knows what they are doing.
2409
+        //Convert text into an array anyway to simplify
2410
+        //later code.
2411
+
2412
+
2413
+        if (typeof text === 'string') {
2414
+          if (text.match(/[\r?\n]/)) {
2415
+            text = text.split(/\r\n|\r|\n/g);
2416
+          } else {
2417
+            text = [text];
2418
+          }
2419
+        } //baseline
2420
+
2421
+
2422
+        var height = activeFontSize / scope.internal.scaleFactor;
2423
+        var descent = height * (lineHeightFactor - 1);
2424
+
2425
+        switch (options.baseline) {
2426
+          case 'bottom':
2427
+            y -= descent;
2428
+            break;
2429
+
2430
+          case 'top':
2431
+            y += height - descent;
2432
+            break;
2433
+
2434
+          case 'hanging':
2435
+            y += height - 2 * descent;
2436
+            break;
2437
+
2438
+          case 'middle':
2439
+            y += height / 2 - descent;
2440
+            break;
2441
+
2442
+          case 'ideographic':
2443
+          case 'alphabetic':
2444
+          default:
2445
+            // do nothing, everything is fine
2446
+            break;
2447
+        } //multiline
2448
+
2449
+
2450
+        var maxWidth = options.maxWidth || 0;
2451
+
2452
+        if (maxWidth > 0) {
2453
+          if (typeof text === 'string') {
2454
+            text = scope.splitTextToSize(text, maxWidth);
2455
+          } else if (Object.prototype.toString.call(text) === '[object Array]') {
2456
+            text = scope.splitTextToSize(text.join(" "), maxWidth);
2457
+          }
2458
+        } //creating Payload-Object to make text byRef
2459
+
2460
+
2461
+        var payload = {
2462
+          text: text,
2463
+          x: x,
2464
+          y: y,
2465
+          options: options,
2466
+          mutex: {
2467
+            pdfEscape: pdfEscape,
2468
+            activeFontKey: activeFontKey,
2469
+            fonts: fonts,
2470
+            activeFontSize: activeFontSize
2471
+          }
2472
+        };
2473
+        events.publish('preProcessText', payload);
2474
+        text = payload.text;
2475
+        options = payload.options; //angle
2476
+
2477
+        var angle = options.angle;
2478
+        var k = scope.internal.scaleFactor;
2479
+        var transformationMatrix = [];
2480
+
2481
+        if (angle) {
2482
+          angle *= Math.PI / 180;
2483
+          var c = Math.cos(angle),
2484
+              s = Math.sin(angle);
2485
+          transformationMatrix = [f2(c), f2(s), f2(s * -1), f2(c)];
2486
+        } //charSpace
2487
+
2488
+
2489
+        var charSpace = options.charSpace;
2490
+
2491
+        if (typeof charSpace !== 'undefined') {
2492
+          xtra += f3(charSpace * k) + " Tc\n";
2493
+        } //lang
2494
+
2495
+
2496
+        var lang = options.lang;
2497
+        var tmpRenderingMode = -1;
2498
+        var parmRenderingMode = typeof options.renderingMode !== "undefined" ? options.renderingMode : options.stroke;
2499
+        var pageContext = scope.internal.getCurrentPageInfo().pageContext;
2500
+
2501
+        switch (parmRenderingMode) {
2502
+          case 0:
2503
+          case false:
2504
+          case 'fill':
2505
+            tmpRenderingMode = 0;
2506
+            break;
2507
+
2508
+          case 1:
2509
+          case true:
2510
+          case 'stroke':
2511
+            tmpRenderingMode = 1;
2512
+            break;
2513
+
2514
+          case 2:
2515
+          case 'fillThenStroke':
2516
+            tmpRenderingMode = 2;
2517
+            break;
2518
+
2519
+          case 3:
2520
+          case 'invisible':
2521
+            tmpRenderingMode = 3;
2522
+            break;
2523
+
2524
+          case 4:
2525
+          case 'fillAndAddForClipping':
2526
+            tmpRenderingMode = 4;
2527
+            break;
2528
+
2529
+          case 5:
2530
+          case 'strokeAndAddPathForClipping':
2531
+            tmpRenderingMode = 5;
2532
+            break;
2533
+
2534
+          case 6:
2535
+          case 'fillThenStrokeAndAddToPathForClipping':
2536
+            tmpRenderingMode = 6;
2537
+            break;
2538
+
2539
+          case 7:
2540
+          case 'addToPathForClipping':
2541
+            tmpRenderingMode = 7;
2542
+            break;
2543
+        }
2544
+
2545
+        var usedRenderingMode = typeof pageContext.usedRenderingMode !== 'undefined' ? pageContext.usedRenderingMode : -1; //if the coder wrote it explicitly to use a specific 
2546
+        //renderingMode, then use it
2547
+
2548
+        if (tmpRenderingMode !== -1) {
2549
+          xtra += tmpRenderingMode + " Tr\n"; //otherwise check if we used the rendering Mode already
2550
+          //if so then set the rendering Mode...
2551
+        } else if (usedRenderingMode !== -1) {
2552
+          xtra += "0 Tr\n";
2553
+        }
2554
+
2555
+        if (tmpRenderingMode !== -1) {
2556
+          pageContext.usedRenderingMode = tmpRenderingMode;
2557
+        } //align
2558
+
2559
+
2560
+        var align = options.align || 'left';
2561
+        var leading = activeFontSize * lineHeight;
2562
+        var pageWidth = scope.internal.pageSize.getWidth();
2563
+        var k = scope.internal.scaleFactor;
2564
+        var activeFont = fonts[activeFontKey];
2565
+        var charSpace = options.charSpace || activeCharSpace;
2566
+        var maxWidth = options.maxWidth || 0;
2567
+        var lineWidths;
2568
+        var flags = {};
2569
+        var wordSpacingPerLine = [];
2570
+
2571
+        if (Object.prototype.toString.call(text) === '[object Array]') {
2572
+          var da = transformTextToSpecialArray(text);
2573
+          var newY;
2574
+          var maxLineLength;
2575
+          var lineWidths;
2576
+
2577
+          if (align !== "left") {
2578
+            lineWidths = da.map(function (v) {
2579
+              return scope.getStringUnitWidth(v, {
2580
+                font: activeFont,
2581
+                charSpace: charSpace,
2582
+                fontSize: activeFontSize
2583
+              }) * activeFontSize / k;
2584
+            });
2585
+          }
2586
+
2587
+          var maxLineLength = Math.max.apply(Math, lineWidths); //The first line uses the "main" Td setting,
2588
+          //and the subsequent lines are offset by the
2589
+          //previous line's x coordinate.
2590
+
2591
+          var prevWidth = 0;
2592
+          var delta;
2593
+          var newX;
2594
+
2595
+          if (align === "right") {
2596
+            x -= lineWidths[0];
2597
+            text = [];
2598
+
2599
+            for (var i = 0, len = da.length; i < len; i++) {
2600
+              delta = maxLineLength - lineWidths[i];
2601
+
2602
+              if (i === 0) {
2603
+                newX = getHorizontalCoordinate(x);
2604
+                newY = getVerticalCoordinate(y);
2605
+              } else {
2606
+                newX = (prevWidth - lineWidths[i]) * k;
2607
+                newY = -leading;
2608
+              }
2609
+
2610
+              text.push([da[i], newX, newY]);
2611
+              prevWidth = lineWidths[i];
2612
+            }
2613
+          } else if (align === "center") {
2614
+            x -= lineWidths[0] / 2;
2615
+            text = [];
2616
+
2617
+            for (var i = 0, len = da.length; i < len; i++) {
2618
+              delta = (maxLineLength - lineWidths[i]) / 2;
2619
+
2620
+              if (i === 0) {
2621
+                newX = getHorizontalCoordinate(x);
2622
+                newY = getVerticalCoordinate(y);
2623
+              } else {
2624
+                newX = (prevWidth - lineWidths[i]) / 2 * k;
2625
+                newY = -leading;
2626
+              }
2627
+
2628
+              text.push([da[i], newX, newY]);
2629
+              prevWidth = lineWidths[i];
2630
+            }
2631
+          } else if (align === "left") {
2632
+            text = [];
2633
+
2634
+            for (var i = 0, len = da.length; i < len; i++) {
2635
+              newY = i === 0 ? getVerticalCoordinate(y) : -leading;
2636
+              newX = i === 0 ? getHorizontalCoordinate(x) : 0; //text.push([da[i], newX, newY]);
2637
+
2638
+              text.push(da[i]);
2639
+            }
2640
+          } else if (align === "justify") {
2641
+            text = [];
2642
+            var maxWidth = maxWidth !== 0 ? maxWidth : pageWidth;
2643
+
2644
+            for (var i = 0, len = da.length; i < len; i++) {
2645
+              newY = i === 0 ? getVerticalCoordinate(y) : -leading;
2646
+              newX = i === 0 ? getHorizontalCoordinate(x) : 0;
2647
+
2648
+              if (i < len - 1) {
2649
+                wordSpacingPerLine.push(((maxWidth - lineWidths[i]) / (da[i].split(" ").length - 1) * k).toFixed(2));
2650
+              }
2651
+
2652
+              text.push([da[i], newX, newY]);
2653
+            }
2654
+          } else {
2655
+            throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
2656
+          }
2657
+        } //R2L
2658
+
2659
+
2660
+        var doReversing = typeof options.R2L === "boolean" ? options.R2L : R2L;
2661
+
2662
+        if (doReversing === true) {
2663
+          text = processTextByFunction(text, function (text, posX, posY) {
2664
+            return [text.split("").reverse().join(""), posX, posY];
2665
+          });
2666
+        } //creating Payload-Object to make text byRef
2667
+
2668
+
2669
+        var payload = {
2670
+          text: text,
2671
+          x: x,
2672
+          y: y,
2673
+          options: options,
2674
+          mutex: {
2675
+            pdfEscape: pdfEscape,
2676
+            activeFontKey: activeFontKey,
2677
+            fonts: fonts,
2678
+            activeFontSize: activeFontSize
2679
+          }
2680
+        };
2681
+        events.publish('postProcessText', payload);
2682
+        text = payload.text;
2683
+        isHex = payload.mutex.isHex;
2684
+        var da = transformTextToSpecialArray(text);
2685
+        text = [];
2686
+        var variant = 0;
2687
+        var len = da.length;
2688
+        var posX;
2689
+        var posY;
2690
+        var content;
2691
+        var wordSpacing = '';
2692
+
2693
+        for (var i = 0; i < len; i++) {
2694
+          wordSpacing = '';
2695
+
2696
+          if (!Array.isArray(da[i])) {
2697
+            posX = getHorizontalCoordinate(x);
2698
+            posY = getVerticalCoordinate(y);
2699
+            content = (isHex ? "<" : "(") + da[i] + (isHex ? ">" : ")");
2700
+          } else {
2701
+            posX = parseFloat(da[i][1]);
2702
+            posY = parseFloat(da[i][2]);
2703
+            content = (isHex ? "<" : "(") + da[i][0] + (isHex ? ">" : ")");
2704
+            variant = 1;
2705
+          }
2706
+
2707
+          if (wordSpacingPerLine !== undefined && wordSpacingPerLine[i] !== undefined) {
2708
+            wordSpacing = wordSpacingPerLine[i] + " Tw\n";
2709
+          }
2710
+
2711
+          if (transformationMatrix.length !== 0 && i === 0) {
2712
+            text.push(wordSpacing + transformationMatrix.join(" ") + " " + posX.toFixed(2) + " " + posY.toFixed(2) + " Tm\n" + content);
2713
+          } else if (variant === 1 || variant === 0 && i === 0) {
2714
+            text.push(wordSpacing + posX.toFixed(2) + " " + posY.toFixed(2) + " Td\n" + content);
2715
+          } else {
2716
+            text.push(wordSpacing + content);
2717
+          }
2718
+        }
2719
+
2720
+        if (variant === 0) {
2721
+          text = text.join(" Tj\nT* ");
2722
+        } else {
2723
+          text = text.join(" Tj\n");
2724
+        }
2725
+
2726
+        text += " Tj\n";
2727
+        var result = 'BT\n/' + activeFontKey + ' ' + activeFontSize + ' Tf\n' + // font face, style, size
2728
+        (activeFontSize * lineHeight).toFixed(2) + ' TL\n' + // line spacing
2729
+        textColor + '\n';
2730
+        result += xtra;
2731
+        result += text;
2732
+        result += "ET";
2733
+        out(result);
2734
+        usedFonts[activeFontKey] = true;
2735
+        return scope;
2736
+      };
2737
+      /**
2738
+       * Letter spacing method to print text with gaps
2739
+       *
2740
+       * @function
2741
+       * @instance
2742
+       * @param {String|Array} text String to be added to the page.
2743
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page
2744
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
2745
+       * @param {number} spacing Spacing (in units declared at inception)
2746
+       * @returns {jsPDF}
2747
+       * @memberOf jsPDF
2748
+       * @name lstext
2749
+       * @deprecated We'll be removing this function. It doesn't take character width into account.
2750
+       */
2751
+
2752
+
2753
+      var lstext = API.__private__.lstext = API.lstext = function (text, x, y, charSpace) {
2754
+        console.warn('jsPDF.lstext is deprecated');
2755
+        return this.text(text, x, y, {
2756
+          charSpace: charSpace
2757
+        });
2758
+      };
2759
+      /**
2760
+       * 
2761
+       * @name clip
2762
+       * @function
2763
+       * @instance
2764
+       * @param {string} rule 
2765
+       * @returns {jsPDF}
2766
+       * @memberOf jsPDF
2767
+       * @description All .clip() after calling drawing ops with a style argument of null.
2768
+       */
2769
+
2770
+
2771
+      var clip = API.__private__.clip = API.clip = function (rule) {
2772
+        // Call .clip() after calling drawing ops with a style argument of null
2773
+        // W is the PDF clipping op
2774
+        if ('evenodd' === rule) {
2775
+          out('W*');
2776
+        } else {
2777
+          out('W');
2778
+        } // End the path object without filling or stroking it.
2779
+        // This operator is a path-painting no-op, used primarily for the side effect of changing the current clipping path
2780
+        // (see Section 4.4.3, “Clipping Path Operators”)
2781
+
2782
+
2783
+        out('n');
2784
+      };
2785
+      /**
2786
+       * This fixes the previous function clip(). Perhaps the 'stroke path' hack was due to the missing 'n' instruction?
2787
+       * We introduce the fixed version so as to not break API.
2788
+       * @param fillRule
2789
+       * @ignore
2790
+       */
2791
+
2792
+
2793
+      var clip_fixed = API.__private__.clip_fixed = API.clip_fixed = function (rule) {
2794
+        console.log("clip_fixed is deprecated");
2795
+        API.clip(rule);
2796
+      };
2797
+
2798
+      var isValidStyle = API.__private__.isValidStyle = function (style) {
2799
+        var validStyleVariants = [undefined, null, 'S', 'F', 'DF', 'FD', 'f', 'f*', 'B', 'B*'];
2800
+        var result = false;
2801
+
2802
+        if (validStyleVariants.indexOf(style) !== -1) {
2803
+          result = true;
2804
+        }
2805
+
2806
+        return result;
2807
+      };
2808
+
2809
+      var getStyle = API.__private__.getStyle = function (style) {
2810
+        // see path-painting operators in PDF spec
2811
+        var op = 'S'; // stroke
2812
+
2813
+        if (style === 'F') {
2814
+          op = 'f'; // fill
2815
+        } else if (style === 'FD' || style === 'DF') {
2816
+          op = 'B'; // both
2817
+        } else if (style === 'f' || style === 'f*' || style === 'B' || style === 'B*') {
2818
+          /*
2819
+           Allow direct use of these PDF path-painting operators:
2820
+           - f    fill using nonzero winding number rule
2821
+           - f*    fill using even-odd rule
2822
+           - B    fill then stroke with fill using non-zero winding number rule
2823
+           - B*    fill then stroke with fill using even-odd rule
2824
+           */
2825
+          op = style;
2826
+        }
2827
+
2828
+        return op;
2829
+      };
2830
+      /**
2831
+       * Draw a line on the current page.
2832
+       *
2833
+       * @name line
2834
+       * @function 
2835
+       * @instance
2836
+       * @param {number} x1
2837
+       * @param {number} y1
2838
+       * @param {number} x2
2839
+       * @param {number} y2
2840
+       * @returns {jsPDF}
2841
+       * @memberOf jsPDF
2842
+       */
2843
+
2844
+
2845
+      var line = API.__private__.line = API.line = function (x1, y1, x2, y2) {
2846
+        if (isNaN(x1) || isNaN(y1) || isNaN(x2) || isNaN(y2)) {
2847
+          throw new Error('Invalid arguments passed to jsPDF.line');
2848
+        }
2849
+
2850
+        return this.lines([[x2 - x1, y2 - y1]], x1, y1);
2851
+      };
2852
+      /**
2853
+       * Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates.
2854
+       * All data points in `lines` are relative to last line origin.
2855
+       * `x`, `y` become x1,y1 for first line / curve in the set.
2856
+       * For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point.
2857
+       * For bezier curves you need to specify [x2,y2,x3,y3,x4,y4] - vectors to control points 1, 2, ending point. All vectors are against the start of the curve - x1,y1.
2858
+       *
2859
+       * @example .lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, [1,1], 'F', false) // line, line, bezier curve, line
2860
+       * @param {Array} lines Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves).
2861
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.
2862
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
2863
+       * @param {number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction.
2864
+       * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
2865
+       * @param {boolean} closed If true, the path is closed with a straight line from the end of the last curve to the starting point.
2866
+       * @function
2867
+       * @instance
2868
+       * @returns {jsPDF}
2869
+       * @memberOf jsPDF
2870
+       * @name lines
2871
+       */
2872
+
2873
+
2874
+      var lines = API.__private__.lines = API.lines = function (lines, x, y, scale, style, closed) {
2875
+        var scalex, scaley, i, l, leg, x2, y2, x3, y3, x4, y4, tmp; // Pre-August-2012 the order of arguments was function(x, y, lines, scale, style)
2876
+        // in effort to make all calls have similar signature like
2877
+        //   function(content, coordinateX, coordinateY , miscellaneous)
2878
+        // this method had its args flipped.
2879
+        // code below allows backward compatibility with old arg order.
2880
+
2881
+        if (typeof lines === 'number') {
2882
+          tmp = y;
2883
+          y = x;
2884
+          x = lines;
2885
+          lines = tmp;
2886
+        }
2887
+
2888
+        scale = scale || [1, 1];
2889
+        closed = closed || false;
2890
+
2891
+        if (isNaN(x) || isNaN(y) || !Array.isArray(lines) || !Array.isArray(scale) || !isValidStyle(style) || typeof closed !== 'boolean') {
2892
+          throw new Error('Invalid arguments passed to jsPDF.lines');
2893
+        } // starting point
2894
+
2895
+
2896
+        out(f3(getHorizontalCoordinate(x)) + ' ' + f3(getVerticalCoordinate(y)) + ' m ');
2897
+        scalex = scale[0];
2898
+        scaley = scale[1];
2899
+        l = lines.length; //, x2, y2 // bezier only. In page default measurement "units", *after* scaling
2900
+        //, x3, y3 // bezier only. In page default measurement "units", *after* scaling
2901
+        // ending point for all, lines and bezier. . In page default measurement "units", *after* scaling
2902
+
2903
+        x4 = x; // last / ending point = starting point for first item.
2904
+
2905
+        y4 = y; // last / ending point = starting point for first item.
2906
+
2907
+        for (i = 0; i < l; i++) {
2908
+          leg = lines[i];
2909
+
2910
+          if (leg.length === 2) {
2911
+            // simple line
2912
+            x4 = leg[0] * scalex + x4; // here last x4 was prior ending point
2913
+
2914
+            y4 = leg[1] * scaley + y4; // here last y4 was prior ending point
2915
+
2916
+            out(f3(getHorizontalCoordinate(x4)) + ' ' + f3(getVerticalCoordinate(y4)) + ' l');
2917
+          } else {
2918
+            // bezier curve
2919
+            x2 = leg[0] * scalex + x4; // here last x4 is prior ending point
2920
+
2921
+            y2 = leg[1] * scaley + y4; // here last y4 is prior ending point
2922
+
2923
+            x3 = leg[2] * scalex + x4; // here last x4 is prior ending point
2924
+
2925
+            y3 = leg[3] * scaley + y4; // here last y4 is prior ending point
2926
+
2927
+            x4 = leg[4] * scalex + x4; // here last x4 was prior ending point
2928
+
2929
+            y4 = leg[5] * scaley + y4; // here last y4 was prior ending point
2930
+
2931
+            out(f3(getHorizontalCoordinate(x2)) + ' ' + f3(getVerticalCoordinate(y2)) + ' ' + f3(getHorizontalCoordinate(x3)) + ' ' + f3(getVerticalCoordinate(y3)) + ' ' + f3(getHorizontalCoordinate(x4)) + ' ' + f3(getVerticalCoordinate(y4)) + ' c');
2932
+          }
2933
+        }
2934
+
2935
+        if (closed) {
2936
+          out(' h');
2937
+        } // stroking / filling / both the path
2938
+
2939
+
2940
+        if (style !== null) {
2941
+          out(getStyle(style));
2942
+        }
2943
+
2944
+        return this;
2945
+      };
2946
+      /**
2947
+       * Adds a rectangle to PDF.
2948
+       *
2949
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.
2950
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
2951
+       * @param {number} w Width (in units declared at inception of PDF document).
2952
+       * @param {number} h Height (in units declared at inception of PDF document).
2953
+       * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
2954
+       * @function
2955
+       * @instance
2956
+       * @returns {jsPDF}
2957
+       * @memberOf jsPDF
2958
+       * @name rect
2959
+       */
2960
+
2961
+
2962
+      var rect = API.__private__.rect = API.rect = function (x, y, w, h, style) {
2963
+        if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h) || !isValidStyle(style)) {
2964
+          throw new Error('Invalid arguments passed to jsPDF.rect');
2965
+        }
2966
+
2967
+        out([f2(getHorizontalCoordinate(x)), f2(getVerticalCoordinate(y)), f2(w * k), f2(-h * k), 're'].join(' '));
2968
+
2969
+        if (style !== null) {
2970
+          out(getStyle(style));
2971
+        }
2972
+
2973
+        return this;
2974
+      };
2975
+      /**
2976
+       * Adds a triangle to PDF.
2977
+       *
2978
+       * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page.
2979
+       * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page.
2980
+       * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page.
2981
+       * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page.
2982
+       * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page.
2983
+       * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page.
2984
+       * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
2985
+       * @function
2986
+       * @instance
2987
+       * @returns {jsPDF}
2988
+       * @memberOf jsPDF
2989
+       * @name triangle
2990
+       */
2991
+
2992
+
2993
+      var triangle = API.__private__.triangle = API.triangle = function (x1, y1, x2, y2, x3, y3, style) {
2994
+        if (isNaN(x1) || isNaN(y1) || isNaN(x2) || isNaN(y2) || isNaN(x3) || isNaN(y3) || !isValidStyle(style)) {
2995
+          throw new Error('Invalid arguments passed to jsPDF.triangle');
2996
+        }
2997
+
2998
+        this.lines([[x2 - x1, y2 - y1], // vector to point 2
2999
+        [x3 - x2, y3 - y2], // vector to point 3
3000
+        [x1 - x3, y1 - y3] // closing vector back to point 1
3001
+        ], x1, y1, // start of path
3002
+        [1, 1], style, true);
3003
+        return this;
3004
+      };
3005
+      /**
3006
+       * Adds a rectangle with rounded corners to PDF.
3007
+       *
3008
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.
3009
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
3010
+       * @param {number} w Width (in units declared at inception of PDF document).
3011
+       * @param {number} h Height (in units declared at inception of PDF document).
3012
+       * @param {number} rx Radius along x axis (in units declared at inception of PDF document).
3013
+       * @param {number} ry Radius along y axis (in units declared at inception of PDF document).
3014
+       * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
3015
+       * @function
3016
+       * @instance
3017
+       * @returns {jsPDF}
3018
+       * @memberOf jsPDF
3019
+       * @name roundedRect
3020
+       */
3021
+
3022
+
3023
+      var roundedRect = API.__private__.roundedRect = API.roundedRect = function (x, y, w, h, rx, ry, style) {
3024
+        if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h) || isNaN(rx) || isNaN(ry) || !isValidStyle(style)) {
3025
+          throw new Error('Invalid arguments passed to jsPDF.roundedRect');
3026
+        }
3027
+
3028
+        var MyArc = 4 / 3 * (Math.SQRT2 - 1);
3029
+        this.lines([[w - 2 * rx, 0], [rx * MyArc, 0, rx, ry - ry * MyArc, rx, ry], [0, h - 2 * ry], [0, ry * MyArc, -(rx * MyArc), ry, -rx, ry], [-w + 2 * rx, 0], [-(rx * MyArc), 0, -rx, -(ry * MyArc), -rx, -ry], [0, -h + 2 * ry], [0, -(ry * MyArc), rx * MyArc, -ry, rx, -ry]], x + rx, y, // start of path
3030
+        [1, 1], style);
3031
+        return this;
3032
+      };
3033
+      /**
3034
+       * Adds an ellipse to PDF.
3035
+       *
3036
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.
3037
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
3038
+       * @param {number} rx Radius along x axis (in units declared at inception of PDF document).
3039
+       * @param {number} ry Radius along y axis (in units declared at inception of PDF document).
3040
+       * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
3041
+       * @function
3042
+       * @instance
3043
+       * @returns {jsPDF}
3044
+       * @memberOf jsPDF
3045
+       * @name ellipse
3046
+       */
3047
+
3048
+
3049
+      var ellise = API.__private__.ellipse = API.ellipse = function (x, y, rx, ry, style) {
3050
+        if (isNaN(x) || isNaN(y) || isNaN(rx) || isNaN(ry) || !isValidStyle(style)) {
3051
+          throw new Error('Invalid arguments passed to jsPDF.ellipse');
3052
+        }
3053
+
3054
+        var lx = 4 / 3 * (Math.SQRT2 - 1) * rx,
3055
+            ly = 4 / 3 * (Math.SQRT2 - 1) * ry;
3056
+        out([f2(getHorizontalCoordinate(x + rx)), f2(getVerticalCoordinate(y)), 'm', f2(getHorizontalCoordinate(x + rx)), f2(getVerticalCoordinate(y - ly)), f2(getHorizontalCoordinate(x + lx)), f2(getVerticalCoordinate(y - ry)), f2(getHorizontalCoordinate(x)), f2(getVerticalCoordinate(y - ry)), 'c'].join(' '));
3057
+        out([f2(getHorizontalCoordinate(x - lx)), f2(getVerticalCoordinate(y - ry)), f2(getHorizontalCoordinate(x - rx)), f2(getVerticalCoordinate(y - ly)), f2(getHorizontalCoordinate(x - rx)), f2(getVerticalCoordinate(y)), 'c'].join(' '));
3058
+        out([f2(getHorizontalCoordinate(x - rx)), f2(getVerticalCoordinate(y + ly)), f2(getHorizontalCoordinate(x - lx)), f2(getVerticalCoordinate(y + ry)), f2(getHorizontalCoordinate(x)), f2(getVerticalCoordinate(y + ry)), 'c'].join(' '));
3059
+        out([f2(getHorizontalCoordinate(x + lx)), f2(getVerticalCoordinate(y + ry)), f2(getHorizontalCoordinate(x + rx)), f2(getVerticalCoordinate(y + ly)), f2(getHorizontalCoordinate(x + rx)), f2(getVerticalCoordinate(y)), 'c'].join(' '));
3060
+
3061
+        if (style !== null) {
3062
+          out(getStyle(style));
3063
+        }
3064
+
3065
+        return this;
3066
+      };
3067
+      /**
3068
+       * Adds an circle to PDF.
3069
+       *
3070
+       * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.
3071
+       * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
3072
+       * @param {number} r Radius (in units declared at inception of PDF document).
3073
+       * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
3074
+       * @function
3075
+       * @instance
3076
+       * @returns {jsPDF}
3077
+       * @memberOf jsPDF
3078
+       * @name circle
3079
+       */
3080
+
3081
+
3082
+      var circle = API.__private__.circle = API.circle = function (x, y, r, style) {
3083
+        if (isNaN(x) || isNaN(y) || isNaN(r) || !isValidStyle(style)) {
3084
+          throw new Error('Invalid arguments passed to jsPDF.circle');
3085
+        }
3086
+
3087
+        return this.ellipse(x, y, r, r, style);
3088
+      };
3089
+      /**
3090
+       * Sets text font face, variant for upcoming text elements.
3091
+       * See output of jsPDF.getFontList() for possible font names, styles.
3092
+       *
3093
+       * @param {string} fontName Font name or family. Example: "times".
3094
+       * @param {string} fontStyle Font style or variant. Example: "italic".
3095
+       * @function
3096
+       * @instance
3097
+       * @returns {jsPDF}
3098
+       * @memberOf jsPDF
3099
+       * @name setFont
3100
+       */
3101
+
3102
+
3103
+      API.setFont = function (fontName, fontStyle) {
3104
+        activeFontKey = _getFont(fontName, fontStyle, {
3105
+          disableWarning: false
3106
+        });
3107
+        return this;
3108
+      };
3109
+      /**
3110
+       * Switches font style or variant for upcoming text elements,
3111
+       * while keeping the font face or family same.
3112
+       * See output of jsPDF.getFontList() for possible font names, styles.
3113
+       *
3114
+       * @param {string} style Font style or variant. Example: "italic".
3115
+       * @function
3116
+       * @instance
3117
+       * @returns {jsPDF}
3118
+       * @memberOf jsPDF
3119
+       * @name setFontStyle
3120
+       */
3121
+
3122
+
3123
+      API.setFontStyle = API.setFontType = function (style) {
3124
+        activeFontKey = _getFont(undefined, style); // if font is not found, the above line blows up and we never go further
3125
+
3126
+        return this;
3127
+      };
3128
+      /**
3129
+       * Returns an object - a tree of fontName to fontStyle relationships available to
3130
+       * active PDF document.
3131
+       *
3132
+       * @public
3133
+       * @function
3134
+       * @instance
3135
+       * @returns {Object} Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... }
3136
+       * @memberOf jsPDF
3137
+       * @name getFontList
3138
+       */
3139
+
3140
+
3141
+      var getFontList = API.__private__.getFontList = API.getFontList = function () {
3142
+        // TODO: iterate over fonts array or return copy of fontmap instead in case more are ever added.
3143
+        var list = {},
3144
+            fontName,
3145
+            fontStyle,
3146
+            tmp;
3147
+
3148
+        for (fontName in fontmap) {
3149
+          if (fontmap.hasOwnProperty(fontName)) {
3150
+            list[fontName] = tmp = [];
3151
+
3152
+            for (fontStyle in fontmap[fontName]) {
3153
+              if (fontmap[fontName].hasOwnProperty(fontStyle)) {
3154
+                tmp.push(fontStyle);
3155
+              }
3156
+            }
3157
+          }
3158
+        }
3159
+
3160
+        return list;
3161
+      };
3162
+      /**
3163
+       * Add a custom font to the current instance.
3164
+       *
3165
+       * @property {string} postScriptName PDF specification full name for the font.
3166
+       * @property {string} id PDF-document-instance-specific label assinged to the font.
3167
+       * @property {string} fontStyle Style of the Font.
3168
+       * @property {Object} encoding Encoding_name-to-Font_metrics_object mapping.
3169
+       * @function
3170
+       * @instance
3171
+       * @memberOf jsPDF
3172
+       * @name addFont
3173
+       */
3174
+
3175
+
3176
+      API.addFont = function (postScriptName, fontName, fontStyle, encoding) {
3177
+        encoding = encoding || 'Identity-H';
3178
+        addFont.call(this, postScriptName, fontName, fontStyle, encoding);
3179
+      };
3180
+
3181
+      var lineWidth = options.lineWidth || 0.200025; // 2mm
3182
+
3183
+      /**
3184
+       * Sets line width for upcoming lines.
3185
+       *
3186
+       * @param {number} width Line width (in units declared at inception of PDF document).
3187
+       * @function
3188
+       * @instance
3189
+       * @returns {jsPDF}
3190
+       * @memberOf jsPDF
3191
+       * @name setLineWidth
3192
+       */
3193
+
3194
+      var setLineWidth = API.__private__.setLineWidth = API.setLineWidth = function (width) {
3195
+        out((width * k).toFixed(2) + ' w');
3196
+        return this;
3197
+      };
3198
+      /**
3199
+       * Sets the dash pattern for upcoming lines.
3200
+       * 
3201
+       * To reset the settings simply call the method without any parameters.
3202
+       * @param {array} dashArray The pattern of the line, expects numbers. 
3203
+       * @param {number} dashPhase The phase at which the dash pattern starts.
3204
+       * @function
3205
+       * @instance
3206
+       * @returns {jsPDF}
3207
+       * @memberOf jsPDF
3208
+       * @name setLineDash
3209
+       */
3210
+
3211
+
3212
+      var setLineDash = API.__private__.setLineDash = jsPDF.API.setLineDash = function (dashArray, dashPhase) {
3213
+        dashArray = dashArray || [];
3214
+        dashPhase = dashPhase || 0;
3215
+
3216
+        if (isNaN(dashPhase) || !Array.isArray(dashArray)) {
3217
+          throw new Error('Invalid arguments passed to jsPDF.setLineDash');
3218
+        }
3219
+
3220
+        dashArray = dashArray.map(function (x) {
3221
+          return (x * k).toFixed(3);
3222
+        }).join(' ');
3223
+        dashPhase = parseFloat((dashPhase * k).toFixed(3));
3224
+        out('[' + dashArray + '] ' + dashPhase + ' d');
3225
+        return this;
3226
+      };
3227
+
3228
+      var lineHeightFactor;
3229
+
3230
+      var getLineHeight = API.__private__.getLineHeight = API.getLineHeight = function () {
3231
+        return activeFontSize * lineHeightFactor;
3232
+      };
3233
+
3234
+      var lineHeightFactor;
3235
+
3236
+      var getLineHeight = API.__private__.getLineHeight = API.getLineHeight = function () {
3237
+        return activeFontSize * lineHeightFactor;
3238
+      };
3239
+      /**
3240
+       * Sets the LineHeightFactor of proportion.
3241
+       *
3242
+       * @param {number} value LineHeightFactor value. Default: 1.15.
3243
+       * @function
3244
+       * @instance
3245
+       * @returns {jsPDF}
3246
+       * @memberOf jsPDF
3247
+       * @name setLineHeightFactor
3248
+       */
3249
+
3250
+
3251
+      var setLineHeightFactor = API.__private__.setLineHeightFactor = API.setLineHeightFactor = function (value) {
3252
+        value = value || 1.15;
3253
+
3254
+        if (typeof value === "number") {
3255
+          lineHeightFactor = value;
3256
+        }
3257
+
3258
+        return this;
3259
+      };
3260
+      /**
3261
+       * Gets the LineHeightFactor, default: 1.15.
3262
+       *
3263
+       * @function
3264
+       * @instance
3265
+       * @returns {number} lineHeightFactor
3266
+       * @memberOf jsPDF
3267
+       * @name getLineHeightFactor
3268
+       */
3269
+
3270
+
3271
+      var getLineHeightFactor = API.__private__.getLineHeightFactor = API.getLineHeightFactor = function () {
3272
+        return lineHeightFactor;
3273
+      };
3274
+
3275
+      setLineHeightFactor(options.lineHeight);
3276
+
3277
+      var getHorizontalCoordinate = API.__private__.getHorizontalCoordinate = function (value) {
3278
+        return value * k;
3279
+      };
3280
+
3281
+      var getVerticalCoordinate = API.__private__.getVerticalCoordinate = function (value) {
3282
+        return pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY - value * k;
3283
+      };
3284
+
3285
+      var getHorizontalCoordinateString = API.__private__.getHorizontalCoordinateString = function (value) {
3286
+        return f2(value * k);
3287
+      };
3288
+
3289
+      var getVerticalCoordinateString = API.__private__.getVerticalCoordinateString = function (value) {
3290
+        return f2(pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY - value * k);
3291
+      };
3292
+
3293
+      var strokeColor = options.strokeColor || '0 G';
3294
+      /**
3295
+       *  Gets the stroke color for upcoming elements.
3296
+       *
3297
+       * @function
3298
+       * @instance
3299
+       * @returns {string} colorAsHex
3300
+       * @memberOf jsPDF
3301
+       * @name getDrawColor
3302
+       */
3303
+
3304
+      var getStrokeColor = API.__private__.getStrokeColor = API.getDrawColor = function () {
3305
+        return decodeColorString(strokeColor);
3306
+      };
3307
+      /**
3308
+       * Sets the stroke color for upcoming elements.
3309
+       *
3310
+       * Depending on the number of arguments given, Gray, RGB, or CMYK
3311
+       * color space is implied.
3312
+       *
3313
+       * When only ch1 is given, "Gray" color space is implied and it
3314
+       * must be a value in the range from 0.00 (solid black) to to 1.00 (white)
3315
+       * if values are communicated as String types, or in range from 0 (black)
3316
+       * to 255 (white) if communicated as Number type.
3317
+       * The RGB-like 0-255 range is provided for backward compatibility.
3318
+       *
3319
+       * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each
3320
+       * value must be in the range from 0.00 (minimum intensity) to to 1.00
3321
+       * (max intensity) if values are communicated as String types, or
3322
+       * from 0 (min intensity) to to 255 (max intensity) if values are communicated
3323
+       * as Number types.
3324
+       * The RGB-like 0-255 range is provided for backward compatibility.
3325
+       *
3326
+       * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each
3327
+       * value must be a in the range from 0.00 (0% concentration) to to
3328
+       * 1.00 (100% concentration)
3329
+       *
3330
+       * Because JavaScript treats fixed point numbers badly (rounds to
3331
+       * floating point nearest to binary representation) it is highly advised to
3332
+       * communicate the fractional numbers as String types, not JavaScript Number type.
3333
+       *
3334
+       * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.
3335
+       * @param {Number|String} ch2 Color channel value.
3336
+       * @param {Number|String} ch3 Color channel value.
3337
+       * @param {Number|String} ch4 Color channel value.
3338
+       *
3339
+       * @function
3340
+       * @instance
3341
+       * @returns {jsPDF}
3342
+       * @memberOf jsPDF
3343
+       * @name setDrawColor
3344
+       */
3345
+
3346
+
3347
+      var setStrokeColor = API.__private__.setStrokeColor = API.setDrawColor = function (ch1, ch2, ch3, ch4) {
3348
+        var options = {
3349
+          "ch1": ch1,
3350
+          "ch2": ch2,
3351
+          "ch3": ch3,
3352
+          "ch4": ch4,
3353
+          "pdfColorType": "draw",
3354
+          "precision": 2
3355
+        };
3356
+        strokeColor = encodeColorString(options);
3357
+        out(strokeColor);
3358
+        return this;
3359
+      };
3360
+
3361
+      var fillColor = options.fillColor || '0 g';
3362
+      /**
3363
+       * Gets the fill color for upcoming elements.
3364
+       *
3365
+       * @function
3366
+       * @instance
3367
+       * @returns {string} colorAsHex
3368
+       * @memberOf jsPDF
3369
+       * @name getFillColor
3370
+       */
3371
+
3372
+      var getFillColor = API.__private__.getFillColor = API.getFillColor = function () {
3373
+        return decodeColorString(fillColor);
3374
+      };
3375
+      /**
3376
+       * Sets the fill color for upcoming elements.
3377
+       *
3378
+       * Depending on the number of arguments given, Gray, RGB, or CMYK
3379
+       * color space is implied.
3380
+       *
3381
+       * When only ch1 is given, "Gray" color space is implied and it
3382
+       * must be a value in the range from 0.00 (solid black) to to 1.00 (white)
3383
+       * if values are communicated as String types, or in range from 0 (black)
3384
+       * to 255 (white) if communicated as Number type.
3385
+       * The RGB-like 0-255 range is provided for backward compatibility.
3386
+       *
3387
+       * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each
3388
+       * value must be in the range from 0.00 (minimum intensity) to to 1.00
3389
+       * (max intensity) if values are communicated as String types, or
3390
+       * from 0 (min intensity) to to 255 (max intensity) if values are communicated
3391
+       * as Number types.
3392
+       * The RGB-like 0-255 range is provided for backward compatibility.
3393
+       *
3394
+       * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each
3395
+       * value must be a in the range from 0.00 (0% concentration) to to
3396
+       * 1.00 (100% concentration)
3397
+       *
3398
+       * Because JavaScript treats fixed point numbers badly (rounds to
3399
+       * floating point nearest to binary representation) it is highly advised to
3400
+       * communicate the fractional numbers as String types, not JavaScript Number type.
3401
+       *
3402
+       * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.
3403
+       * @param {Number|String} ch2 Color channel value.
3404
+       * @param {Number|String} ch3 Color channel value.
3405
+       * @param {Number|String} ch4 Color channel value.
3406
+       *
3407
+       * @function
3408
+       * @instance
3409
+       * @returns {jsPDF}
3410
+       * @memberOf jsPDF
3411
+       * @name setFillColor
3412
+       */
3413
+
3414
+
3415
+      var setFillColor = API.__private__.setFillColor = API.setFillColor = function (ch1, ch2, ch3, ch4) {
3416
+        var options = {
3417
+          "ch1": ch1,
3418
+          "ch2": ch2,
3419
+          "ch3": ch3,
3420
+          "ch4": ch4,
3421
+          "pdfColorType": "fill",
3422
+          "precision": 2
3423
+        };
3424
+        fillColor = encodeColorString(options);
3425
+        out(fillColor);
3426
+        return this;
3427
+      };
3428
+
3429
+      var textColor = options.textColor || '0 g';
3430
+      /**
3431
+       * Gets the text color for upcoming elements.
3432
+       *
3433
+       * @function
3434
+       * @instance
3435
+       * @returns {string} colorAsHex
3436
+       * @memberOf jsPDF
3437
+       * @name getTextColor
3438
+       */
3439
+
3440
+      var getTextColor = API.__private__.getTextColor = API.getTextColor = function () {
3441
+        return decodeColorString(textColor);
3442
+      };
3443
+      /**
3444
+       * Sets the text color for upcoming elements.
3445
+       *
3446
+       * Depending on the number of arguments given, Gray, RGB, or CMYK
3447
+       * color space is implied.
3448
+       *
3449
+       * When only ch1 is given, "Gray" color space is implied and it
3450
+       * must be a value in the range from 0.00 (solid black) to to 1.00 (white)
3451
+       * if values are communicated as String types, or in range from 0 (black)
3452
+       * to 255 (white) if communicated as Number type.
3453
+       * The RGB-like 0-255 range is provided for backward compatibility.
3454
+       *
3455
+       * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each
3456
+       * value must be in the range from 0.00 (minimum intensity) to to 1.00
3457
+       * (max intensity) if values are communicated as String types, or
3458
+       * from 0 (min intensity) to to 255 (max intensity) if values are communicated
3459
+       * as Number types.
3460
+       * The RGB-like 0-255 range is provided for backward compatibility.
3461
+       *
3462
+       * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each
3463
+       * value must be a in the range from 0.00 (0% concentration) to to
3464
+       * 1.00 (100% concentration)
3465
+       *
3466
+       * Because JavaScript treats fixed point numbers badly (rounds to
3467
+       * floating point nearest to binary representation) it is highly advised to
3468
+       * communicate the fractional numbers as String types, not JavaScript Number type.
3469
+       *
3470
+       * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.
3471
+       * @param {Number|String} ch2 Color channel value.
3472
+       * @param {Number|String} ch3 Color channel value.
3473
+       * @param {Number|String} ch4 Color channel value.
3474
+       *
3475
+       * @function
3476
+       * @instance
3477
+       * @returns {jsPDF}
3478
+       * @memberOf jsPDF
3479
+       * @name setTextColor
3480
+       */
3481
+
3482
+
3483
+      var setTextColor = API.__private__.setTextColor = API.setTextColor = function (ch1, ch2, ch3, ch4) {
3484
+        var options = {
3485
+          "ch1": ch1,
3486
+          "ch2": ch2,
3487
+          "ch3": ch3,
3488
+          "ch4": ch4,
3489
+          "pdfColorType": "text",
3490
+          "precision": 3
3491
+        };
3492
+        textColor = encodeColorString(options);
3493
+        return this;
3494
+      };
3495
+
3496
+      var activeCharSpace = options.charSpace || 0;
3497
+      /**
3498
+       * Get global value of CharSpace.
3499
+       *
3500
+       * @function
3501
+       * @instance
3502
+       * @returns {number} charSpace
3503
+       * @memberOf jsPDF
3504
+       * @name getCharSpace
3505
+       */
3506
+
3507
+      var getCharSpace = API.__private__.getCharSpace = API.getCharSpace = function () {
3508
+        return activeCharSpace;
3509
+      };
3510
+      /**
3511
+       * Set global value of CharSpace.
3512
+       *
3513
+       * @param {number} charSpace
3514
+       * @function
3515
+       * @instance
3516
+       * @returns {jsPDF} jsPDF-instance
3517
+       * @memberOf jsPDF
3518
+       * @name setCharSpace
3519
+       */
3520
+
3521
+
3522
+      var setCharSpace = API.__private__.setCharSpace = API.setCharSpace = function (charSpace) {
3523
+        if (isNaN(charSpace)) {
3524
+          throw new Error('Invalid argument passed to jsPDF.setCharSpace');
3525
+        }
3526
+
3527
+        activeCharSpace = charSpace;
3528
+        return this;
3529
+      };
3530
+
3531
+      var lineCapID = 0;
3532
+      /**
3533
+       * Is an Object providing a mapping from human-readable to
3534
+       * integer flag values designating the varieties of line cap
3535
+       * and join styles.
3536
+       *
3537
+       * @memberOf jsPDF
3538
+       * @name CapJoinStyles
3539
+       */
3540
+
3541
+      API.CapJoinStyles = {
3542
+        0: 0,
3543
+        'butt': 0,
3544
+        'but': 0,
3545
+        'miter': 0,
3546
+        1: 1,
3547
+        'round': 1,
3548
+        'rounded': 1,
3549
+        'circle': 1,
3550
+        2: 2,
3551
+        'projecting': 2,
3552
+        'project': 2,
3553
+        'square': 2,
3554
+        'bevel': 2
3555
+      };
3556
+      /**
3557
+       * Sets the line cap styles.
3558
+       * See {jsPDF.CapJoinStyles} for variants.
3559
+       *
3560
+       * @param {String|Number} style A string or number identifying the type of line cap.
3561
+       * @function
3562
+       * @instance
3563
+       * @returns {jsPDF}
3564
+       * @memberOf jsPDF
3565
+       * @name setLineCap
3566
+       */
3567
+
3568
+      var setLineCap = API.__private__.setLineCap = API.setLineCap = function (style) {
3569
+        var id = API.CapJoinStyles[style];
3570
+
3571
+        if (id === undefined) {
3572
+          throw new Error("Line cap style of '" + style + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
3573
+        }
3574
+
3575
+        lineCapID = id;
3576
+        out(id + ' J');
3577
+        return this;
3578
+      };
3579
+
3580
+      var lineJoinID = 0;
3581
+      /**
3582
+       * Sets the line join styles.
3583
+       * See {jsPDF.CapJoinStyles} for variants.
3584
+       *
3585
+       * @param {String|Number} style A string or number identifying the type of line join.
3586
+       * @function
3587
+       * @instance
3588
+       * @returns {jsPDF}
3589
+       * @memberOf jsPDF
3590
+       * @name setLineJoin
3591
+       */
3592
+
3593
+      var setLineJoin = API.__private__.setLineJoin = API.setLineJoin = function (style) {
3594
+        var id = API.CapJoinStyles[style];
3595
+
3596
+        if (id === undefined) {
3597
+          throw new Error("Line join style of '" + style + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
3598
+        }
3599
+
3600
+        lineJoinID = id;
3601
+        out(id + ' j');
3602
+        return this;
3603
+      };
3604
+
3605
+      var miterLimit;
3606
+      /**
3607
+       * Sets the miterLimit property, which effects the maximum miter length.
3608
+       *
3609
+       * @param {number} length The length of the miter
3610
+       * @function
3611
+       * @instance
3612
+       * @returns {jsPDF}
3613
+       * @memberOf jsPDF
3614
+       * @name setMiterLimit
3615
+       */
3616
+
3617
+      var setMiterLimit = API.__private__.setMiterLimit = API.setMiterLimit = function (length) {
3618
+        length = length || 0;
3619
+
3620
+        if (isNaN(length)) {
3621
+          throw new Error('Invalid argument passed to jsPDF.setMiterLimit');
3622
+        }
3623
+
3624
+        miterLimit = parseFloat(f2(length * k));
3625
+        out(miterLimit + ' M');
3626
+        return this;
3627
+      };
3628
+      /**
3629
+       * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf').
3630
+       * Uses FileSaver.js-method saveAs.
3631
+       *
3632
+       * @memberOf jsPDF
3633
+       * @name save
3634
+       * @function
3635
+       * @instance
3636
+       * @param  {string} filename The filename including extension.
3637
+       * @param  {Object} options An Object with additional options, possible options: 'returnPromise'.
3638
+       * @returns {jsPDF} jsPDF-instance
3639
+       */
3640
+
3641
+
3642
+      API.save = function (filename, options) {
3643
+        filename = filename || 'generated.pdf';
3644
+        options = options || {};
3645
+        options.returnPromise = options.returnPromise || false;
3646
+
3647
+        if (options.returnPromise === false) {
3648
+          saveAs(getBlob(buildDocument()), filename);
3649
+
3650
+          if (typeof saveAs.unload === 'function') {
3651
+            if (global.setTimeout) {
3652
+              setTimeout(saveAs.unload, 911);
3653
+            }
3654
+          }
3655
+        } else {
3656
+          return new Promise(function (resolve, reject) {
3657
+            try {
3658
+              var result = saveAs(getBlob(buildDocument()), filename);
3659
+
3660
+              if (typeof saveAs.unload === 'function') {
3661
+                if (global.setTimeout) {
3662
+                  setTimeout(saveAs.unload, 911);
3663
+                }
3664
+              }
3665
+
3666
+              resolve(result);
3667
+            } catch (e) {
3668
+              reject(e.message);
3669
+            }
3670
+          });
3671
+        }
3672
+      }; // applying plugins (more methods) ON TOP of built-in API.
3673
+      // this is intentional as we allow plugins to override
3674
+      // built-ins
3675
+
3676
+
3677
+      for (var plugin in jsPDF.API) {
3678
+        if (jsPDF.API.hasOwnProperty(plugin)) {
3679
+          if (plugin === 'events' && jsPDF.API.events.length) {
3680
+            (function (events, newEvents) {
3681
+              // jsPDF.API.events is a JS Array of Arrays
3682
+              // where each Array is a pair of event name, handler
3683
+              // Events were added by plugins to the jsPDF instantiator.
3684
+              // These are always added to the new instance and some ran
3685
+              // during instantiation.
3686
+              var eventname, handler_and_args, i;
3687
+
3688
+              for (i = newEvents.length - 1; i !== -1; i--) {
3689
+                // subscribe takes 3 args: 'topic', function, runonce_flag
3690
+                // if undefined, runonce is false.
3691
+                // users can attach callback directly,
3692
+                // or they can attach an array with [callback, runonce_flag]
3693
+                // that's what the "apply" magic is for below.
3694
+                eventname = newEvents[i][0];
3695
+                handler_and_args = newEvents[i][1];
3696
+                events.subscribe.apply(events, [eventname].concat(typeof handler_and_args === 'function' ? [handler_and_args] : handler_and_args));
3697
+              }
3698
+            })(events, jsPDF.API.events);
3699
+          } else {
3700
+            API[plugin] = jsPDF.API[plugin];
3701
+          }
3702
+        }
3703
+      }
3704
+      /**
3705
+       * Object exposing internal API to plugins
3706
+       * @public
3707
+       * @ignore
3708
+       */
3709
+
3710
+
3711
+      API.internal = {
3712
+        'pdfEscape': pdfEscape,
3713
+        'getStyle': getStyle,
3714
+        'getFont': function getFont() {
3715
+          return fonts[_getFont.apply(API, arguments)];
3716
+        },
3717
+        'getFontSize': getFontSize,
3718
+        'getCharSpace': getCharSpace,
3719
+        'getTextColor': getTextColor,
3720
+        'getLineHeight': getLineHeight,
3721
+        'getLineHeightFactor': getLineHeightFactor,
3722
+        'write': write,
3723
+        'getHorizontalCoordinate': getHorizontalCoordinate,
3724
+        'getVerticalCoordinate': getVerticalCoordinate,
3725
+        'getCoordinateString': getHorizontalCoordinateString,
3726
+        'getVerticalCoordinateString': getVerticalCoordinateString,
3727
+        'collections': {},
3728
+        'newObject': newObject,
3729
+        'newAdditionalObject': newAdditionalObject,
3730
+        'newObjectDeferred': newObjectDeferred,
3731
+        'newObjectDeferredBegin': newObjectDeferredBegin,
3732
+        'getFilters': getFilters,
3733
+        'putStream': putStream,
3734
+        'events': events,
3735
+        // ratio that you use in multiplication of a given "size" number to arrive to 'point'
3736
+        // units of measurement.
3737
+        // scaleFactor is set at initialization of the document and calculated against the stated
3738
+        // default measurement units for the document.
3739
+        // If default is "mm", k is the number that will turn number in 'mm' into 'points' number.
3740
+        // through multiplication.
3741
+        'scaleFactor': k,
3742
+        'pageSize': {
3743
+          getWidth: function getWidth() {
3744
+            return (pagesContext[currentPage].mediaBox.topRightX - pagesContext[currentPage].mediaBox.bottomLeftX) / k;
3745
+          },
3746
+          setWidth: function setWidth(value) {
3747
+            pagesContext[currentPage].mediaBox.topRightX = value * k + pagesContext[currentPage].mediaBox.bottomLeftX;
3748
+          },
3749
+          getHeight: function getHeight() {
3750
+            return (pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY) / k;
3751
+          },
3752
+          setHeight: function setHeight(value) {
3753
+            pagesContext[currentPage].mediaBox.topRightY = value * k + pagesContext[currentPage].mediaBox.bottomLeftY;
3754
+          }
3755
+        },
3756
+        'output': output,
3757
+        'getNumberOfPages': getNumberOfPages,
3758
+        'pages': pages,
3759
+        'out': out,
3760
+        'f2': f2,
3761
+        'f3': f3,
3762
+        'getPageInfo': getPageInfo,
3763
+        'getPageInfoByObjId': getPageInfoByObjId,
3764
+        'getCurrentPageInfo': getCurrentPageInfo,
3765
+        'getPDFVersion': getPdfVersion,
3766
+        'hasHotfix': hasHotfix //Expose the hasHotfix check so plugins can also check them.
3767
+
3768
+      };
3769
+      Object.defineProperty(API.internal.pageSize, 'width', {
3770
+        get: function get() {
3771
+          return (pagesContext[currentPage].mediaBox.topRightX - pagesContext[currentPage].mediaBox.bottomLeftX) / k;
3772
+        },
3773
+        set: function set(value) {
3774
+          pagesContext[currentPage].mediaBox.topRightX = value * k + pagesContext[currentPage].mediaBox.bottomLeftX;
3775
+        },
3776
+        enumerable: true,
3777
+        configurable: true
3778
+      });
3779
+      Object.defineProperty(API.internal.pageSize, 'height', {
3780
+        get: function get() {
3781
+          return (pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY) / k;
3782
+        },
3783
+        set: function set(value) {
3784
+          pagesContext[currentPage].mediaBox.topRightY = value * k + pagesContext[currentPage].mediaBox.bottomLeftY;
3785
+        },
3786
+        enumerable: true,
3787
+        configurable: true
3788
+      }); //////////////////////////////////////////////////////
3789
+      // continuing initialization of jsPDF Document object
3790
+      //////////////////////////////////////////////////////
3791
+      // Add the first page automatically
3792
+
3793
+      addFonts(standardFonts);
3794
+      activeFontKey = 'F1';
3795
+
3796
+      _addPage(format, orientation);
3797
+
3798
+      events.publish('initialized');
3799
+      return API;
3800
+    }
3801
+    /**
3802
+     * jsPDF.API is a STATIC property of jsPDF class.
3803
+     * jsPDF.API is an object you can add methods and properties to.
3804
+     * The methods / properties you add will show up in new jsPDF objects.
3805
+     *
3806
+     * One property is prepopulated. It is the 'events' Object. Plugin authors can add topics,
3807
+     * callbacks to this object. These will be reassigned to all new instances of jsPDF.
3808
+     *
3809
+     * @static
3810
+     * @public
3811
+     * @memberOf jsPDF
3812
+     * @name API
3813
+     *
3814
+     * @example
3815
+     * jsPDF.API.mymethod = function(){
3816
+     *   // 'this' will be ref to internal API object. see jsPDF source
3817
+     *   // , so you can refer to built-in methods like so:
3818
+     *   //     this.line(....)
3819
+     *   //     this.text(....)
3820
+     * }
3821
+     * var pdfdoc = new jsPDF()
3822
+     * pdfdoc.mymethod() // <- !!!!!!
3823
+     */
3824
+
3825
+
3826
+    jsPDF.API = {
3827
+      events: []
3828
+    };
3829
+    /**
3830
+     * The version of jsPDF.
3831
+     * @name version
3832
+     * @type {string}
3833
+     * @memberOf jsPDF
3834
+     */
3835
+
3836
+    jsPDF.version = '1.5.3';
3837
+
3838
+    if (typeof define === 'function' && define.amd) {
3839
+      define('jsPDF', function () {
3840
+        return jsPDF;
3841
+      });
3842
+    } else if (typeof module !== 'undefined' && module.exports) {
3843
+      module.exports = jsPDF;
3844
+      module.exports.jsPDF = jsPDF;
3845
+    } else {
3846
+      global.jsPDF = jsPDF;
3847
+    }
3848
+
3849
+    return jsPDF;
3850
+  }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); // `self` is undefined in Firefox for Android content script context
3851
+  // while `this` is nsIContentFrameMessageManager
3852
+  // with an attribute `content` that corresponds to the window
3853
+
3854
+  /*rollup-keeper-start*/
3855
+
3856
+
3857
+  window.tmp = jsPDF;
3858
+  /*rollup-keeper-end*/
3859
+
3860
+  /**
3861
+   * @license
3862
+   * Copyright (c) 2016 Alexander Weidt,
3863
+   * https://github.com/BiggA94
3864
+   * 
3865
+   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
3866
+   */
3867
+
3868
+  /** 
3869
+  * jsPDF AcroForm Plugin
3870
+  * @module AcroForm
3871
+  */
3872
+  (function (jsPDFAPI, globalObj) {
3873
+
3874
+    var scope;
3875
+    var scaleFactor = 1;
3876
+
3877
+    var pdfEscape = function pdfEscape(value) {
3878
+      return value.replace(/\\/g, '\\\\').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
3879
+    };
3880
+
3881
+    var pdfUnescape = function pdfUnescape(value) {
3882
+      return value.replace(/\\\\/g, '\\').replace(/\\\(/g, '(').replace(/\\\)/g, ')');
3883
+    };
3884
+
3885
+    var f2 = function f2(number) {
3886
+      if (isNaN(number)) {
3887
+        throw new Error('Invalid argument passed to jsPDF.f2');
3888
+      }
3889
+
3890
+      return number.toFixed(2); // Ie, %.2f
3891
+    };
3892
+
3893
+    var f5 = function f5(number) {
3894
+      if (isNaN(number)) {
3895
+        throw new Error('Invalid argument passed to jsPDF.f2');
3896
+      }
3897
+
3898
+      return number.toFixed(5); // Ie, %.2f
3899
+    };
3900
+
3901
+    jsPDFAPI.__acroform__ = {};
3902
+
3903
+    var inherit = function inherit(child, parent) {
3904
+
3905
+      child.prototype = Object.create(parent.prototype);
3906
+      child.prototype.constructor = child;
3907
+    };
3908
+
3909
+    var scale = function scale(x) {
3910
+      return x * scaleFactor;
3911
+    };
3912
+
3913
+    var antiScale = function antiScale(x) {
3914
+      return x / scaleFactor;
3915
+    };
3916
+
3917
+    var createFormXObject = function createFormXObject(formObject) {
3918
+      var xobj = new AcroFormXObject();
3919
+      var height = AcroFormAppearance.internal.getHeight(formObject) || 0;
3920
+      var width = AcroFormAppearance.internal.getWidth(formObject) || 0;
3921
+      xobj.BBox = [0, 0, Number(f2(width)), Number(f2(height))];
3922
+      return xobj;
3923
+    };
3924
+    /**
3925
+    * Bit-Operations
3926
+    */
3927
+
3928
+
3929
+    var setBit = jsPDFAPI.__acroform__.setBit = function (number, bitPosition) {
3930
+      number = number || 0;
3931
+      bitPosition = bitPosition || 0;
3932
+
3933
+      if (isNaN(number) || isNaN(bitPosition)) {
3934
+        throw new Error('Invalid arguments passed to jsPDF.API.__acroform__.setBit');
3935
+      }
3936
+
3937
+      var bitMask = 1 << bitPosition;
3938
+      number |= bitMask;
3939
+      return number;
3940
+    };
3941
+
3942
+    var clearBit = jsPDFAPI.__acroform__.clearBit = function (number, bitPosition) {
3943
+      number = number || 0;
3944
+      bitPosition = bitPosition || 0;
3945
+
3946
+      if (isNaN(number) || isNaN(bitPosition)) {
3947
+        throw new Error('Invalid arguments passed to jsPDF.API.__acroform__.clearBit');
3948
+      }
3949
+
3950
+      var bitMask = 1 << bitPosition;
3951
+      number &= ~bitMask;
3952
+      return number;
3953
+    };
3954
+
3955
+    var getBit = jsPDFAPI.__acroform__.getBit = function (number, bitPosition) {
3956
+      if (isNaN(number) || isNaN(bitPosition)) {
3957
+        throw new Error('Invalid arguments passed to jsPDF.API.__acroform__.getBit');
3958
+      }
3959
+
3960
+      return (number & 1 << bitPosition) === 0 ? 0 : 1;
3961
+    };
3962
+    /*
3963
+    * Ff starts counting the bit position at 1 and not like javascript at 0
3964
+    */
3965
+
3966
+
3967
+    var getBitForPdf = jsPDFAPI.__acroform__.getBitForPdf = function (number, bitPosition) {
3968
+      if (isNaN(number) || isNaN(bitPosition)) {
3969
+        throw new Error('Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf');
3970
+      }
3971
+
3972
+      return getBit(number, bitPosition - 1);
3973
+    };
3974
+
3975
+    var setBitForPdf = jsPDFAPI.__acroform__.setBitForPdf = function (number, bitPosition) {
3976
+      if (isNaN(number) || isNaN(bitPosition)) {
3977
+        throw new Error('Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf');
3978
+      }
3979
+
3980
+      return setBit(number, bitPosition - 1);
3981
+    };
3982
+
3983
+    var clearBitForPdf = jsPDFAPI.__acroform__.clearBitForPdf = function (number, bitPosition, value) {
3984
+      if (isNaN(number) || isNaN(bitPosition)) {
3985
+        throw new Error('Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf');
3986
+      }
3987
+
3988
+      return clearBit(number, bitPosition - 1);
3989
+    };
3990
+
3991
+    var calculateCoordinates = jsPDFAPI.__acroform__.calculateCoordinates = function (args) {
3992
+      var getHorizontalCoordinate = this.internal.getHorizontalCoordinate;
3993
+      var getVerticalCoordinate = this.internal.getVerticalCoordinate;
3994
+      var x = args[0];
3995
+      var y = args[1];
3996
+      var w = args[2];
3997
+      var h = args[3];
3998
+      var coordinates = {};
3999
+      coordinates.lowerLeft_X = getHorizontalCoordinate(x) || 0;
4000
+      coordinates.lowerLeft_Y = getVerticalCoordinate(y + h) || 0;
4001
+      coordinates.upperRight_X = getHorizontalCoordinate(x + w) || 0;
4002
+      coordinates.upperRight_Y = getVerticalCoordinate(y) || 0;
4003
+      return [Number(f2(coordinates.lowerLeft_X)), Number(f2(coordinates.lowerLeft_Y)), Number(f2(coordinates.upperRight_X)), Number(f2(coordinates.upperRight_Y))];
4004
+    };
4005
+
4006
+    var calculateAppearanceStream = function calculateAppearanceStream(formObject) {
4007
+      if (formObject.appearanceStreamContent) {
4008
+        return formObject.appearanceStreamContent;
4009
+      }
4010
+
4011
+      if (!formObject.V && !formObject.DV) {
4012
+        return;
4013
+      } // else calculate it
4014
+
4015
+
4016
+      var stream = [];
4017
+      var text = formObject.V || formObject.DV;
4018
+      var calcRes = calculateX(formObject, text);
4019
+      var fontKey = scope.internal.getFont(formObject.fontName, formObject.fontStyle).id; //PDF 32000-1:2008, page 444
4020
+
4021
+      stream.push('/Tx BMC');
4022
+      stream.push('q');
4023
+      stream.push('BT'); // Begin Text
4024
+
4025
+      stream.push(scope.__private__.encodeColorString(formObject.color));
4026
+      stream.push('/' + fontKey + ' ' + f2(calcRes.fontSize) + ' Tf');
4027
+      stream.push('1 0 0 1 0 0 Tm'); // Transformation Matrix
4028
+
4029
+      stream.push(calcRes.text);
4030
+      stream.push('ET'); // End Text    
4031
+
4032
+      stream.push('Q');
4033
+      stream.push('EMC');
4034
+      var appearanceStreamContent = new createFormXObject(formObject);
4035
+      appearanceStreamContent.stream = stream.join("\n");
4036
+      return appearanceStreamContent;
4037
+    };
4038
+
4039
+    var calculateX = function calculateX(formObject, text) {
4040
+      var maxFontSize = formObject.maxFontSize || 12;
4041
+      var font = formObject.fontName;
4042
+      var returnValue = {
4043
+        text: "",
4044
+        fontSize: ""
4045
+      }; // Remove Brackets
4046
+
4047
+      text = text.substr(0, 1) == '(' ? text.substr(1) : text;
4048
+      text = text.substr(text.length - 1) == ')' ? text.substr(0, text.length - 1) : text; // split into array of words
4049
+
4050
+      var textSplit = text.split(' ');
4051
+
4052
+      var color = scope.__private__.encodeColorString(formObject.color);
4053
+
4054
+      var fontSize = maxFontSize; // The Starting fontSize (The Maximum)
4055
+
4056
+      var lineSpacing = 2;
4057
+      var borderPadding = 2;
4058
+      var height = AcroFormAppearance.internal.getHeight(formObject) || 0;
4059
+      height = height < 0 ? -height : height;
4060
+      var width = AcroFormAppearance.internal.getWidth(formObject) || 0;
4061
+      width = width < 0 ? -width : width;
4062
+
4063
+      var isSmallerThanWidth = function isSmallerThanWidth(i, lastLine, fontSize) {
4064
+        if (i + 1 < textSplit.length) {
4065
+          var tmp = lastLine + " " + textSplit[i + 1];
4066
+          var TextWidth = calculateFontSpace(tmp, formObject, fontSize).width;
4067
+          var FieldWidth = width - 2 * borderPadding;
4068
+          return TextWidth <= FieldWidth;
4069
+        } else {
4070
+          return false;
4071
+        }
4072
+      };
4073
+
4074
+      fontSize++;
4075
+
4076
+      FontSize: while (true) {
4077
+        var text = "";
4078
+        fontSize--;
4079
+        var textHeight = calculateFontSpace("3", formObject, fontSize).height;
4080
+        var startY = formObject.multiline ? height - fontSize : (height - textHeight) / 2;
4081
+        startY += lineSpacing;
4082
+        var startX = -borderPadding;
4083
+        var lastY = startY;
4084
+        var firstWordInLine = 0,
4085
+            lastWordInLine = 0;
4086
+        var lastLength = 0;
4087
+
4088
+        if (fontSize <= 0) {
4089
+          // In case, the Text doesn't fit at all
4090
+          fontSize = 12;
4091
+          text = "(...) Tj\n";
4092
+          text += "% Width of Text: " + calculateFontSpace(text, formObject, fontSize).width + ", FieldWidth:" + width + "\n";
4093
+          break;
4094
+        }
4095
+
4096
+        lastLength = calculateFontSpace(textSplit[0] + " ", formObject, fontSize).width;
4097
+        var lastLine = "";
4098
+        var lineCount = 0;
4099
+
4100
+        Line: for (var i in textSplit) {
4101
+          if (textSplit.hasOwnProperty(i)) {
4102
+            lastLine += textSplit[i] + " "; // Remove last blank
4103
+
4104
+            lastLine = lastLine.substr(lastLine.length - 1) == " " ? lastLine.substr(0, lastLine.length - 1) : lastLine;
4105
+            var key = parseInt(i);
4106
+            lastLength = calculateFontSpace(lastLine + " ", formObject, fontSize).width;
4107
+            var nextLineIsSmaller = isSmallerThanWidth(key, lastLine, fontSize);
4108
+            var isLastWord = i >= textSplit.length - 1;
4109
+
4110
+            if (nextLineIsSmaller && !isLastWord) {
4111
+              lastLine += " ";
4112
+              continue; // Line
4113
+            } else if (!nextLineIsSmaller && !isLastWord) {
4114
+              if (!formObject.multiline) {
4115
+                continue FontSize;
4116
+              } else {
4117
+                if ((textHeight + lineSpacing) * (lineCount + 2) + lineSpacing > height) {
4118
+                  // If the Text is higher than the
4119
+                  // FieldObject
4120
+                  continue FontSize;
4121
+                }
4122
+
4123
+                lastWordInLine = key; // go on
4124
+              }
4125
+            } else if (isLastWord) {
4126
+              lastWordInLine = key;
4127
+            } else {
4128
+              if (formObject.multiline && (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing > height) {
4129
+                // If the Text is higher than the FieldObject
4130
+                continue FontSize;
4131
+              }
4132
+            }
4133
+
4134
+            var line = '';
4135
+
4136
+            for (var x = firstWordInLine; x <= lastWordInLine; x++) {
4137
+              line += textSplit[x] + ' ';
4138
+            } // Remove last blank
4139
+
4140
+
4141
+            line = line.substr(line.length - 1) == " " ? line.substr(0, line.length - 1) : line; // lastLength -= blankSpace.width;
4142
+
4143
+            lastLength = calculateFontSpace(line, formObject, fontSize).width; // Calculate startX
4144
+
4145
+            switch (formObject.textAlign) {
4146
+              case 'right':
4147
+                startX = width - lastLength - borderPadding;
4148
+                break;
4149
+
4150
+              case 'center':
4151
+                startX = (width - lastLength) / 2;
4152
+                break;
4153
+
4154
+              case 'left':
4155
+              default:
4156
+                startX = borderPadding;
4157
+                break;
4158
+            }
4159
+
4160
+            text += f2(startX) + ' ' + f2(lastY) + ' Td\n';
4161
+            text += '(' + pdfEscape(line) + ') Tj\n'; // reset X in PDF
4162
+
4163
+            text += -f2(startX) + ' 0 Td\n'; // After a Line, adjust y position
4164
+
4165
+            lastY = -(fontSize + lineSpacing);
4166
+
4167
+            lastLength = 0;
4168
+            firstWordInLine = lastWordInLine + 1;
4169
+            lineCount++;
4170
+            lastLine = "";
4171
+            continue Line;
4172
+          }
4173
+        }
4174
+
4175
+        break;
4176
+      }
4177
+
4178
+      returnValue.text = text;
4179
+      returnValue.fontSize = fontSize;
4180
+      return returnValue;
4181
+    };
4182
+    /**
4183
+    * Small workaround for calculating the TextMetric approximately.
4184
+    * 
4185
+    * @param text
4186
+    * @param fontsize
4187
+    * @returns {TextMetrics} (Has Height and Width)
4188
+    */
4189
+
4190
+
4191
+    var calculateFontSpace = function calculateFontSpace(text, formObject, fontSize) {
4192
+      var font = scope.internal.getFont(formObject.fontName, formObject.fontStyle);
4193
+      var width = scope.getStringUnitWidth(text, {
4194
+        font: font,
4195
+        fontSize: parseFloat(fontSize),
4196
+        charSpace: 0
4197
+      }) * parseFloat(fontSize);
4198
+      var height = scope.getStringUnitWidth("3", {
4199
+        font: font,
4200
+        fontSize: parseFloat(fontSize),
4201
+        charSpace: 0
4202
+      }) * parseFloat(fontSize) * 1.5;
4203
+      return {
4204
+        height: height,
4205
+        width: width
4206
+      };
4207
+    };
4208
+
4209
+    var acroformPluginTemplate = {
4210
+      fields: [],
4211
+      xForms: [],
4212
+
4213
+      /**
4214
+      * acroFormDictionaryRoot contains information about the AcroForm
4215
+      * Dictionary 0: The Event-Token, the AcroFormDictionaryCallback has
4216
+      * 1: The Object ID of the Root
4217
+      */
4218
+      acroFormDictionaryRoot: null,
4219
+
4220
+      /**
4221
+      * After the PDF gets evaluated, the reference to the root has to be
4222
+      * reset, this indicates, whether the root has already been printed
4223
+      * out
4224
+      */
4225
+      printedOut: false,
4226
+      internal: null,
4227
+      isInitialized: false
4228
+    };
4229
+
4230
+    var annotReferenceCallback = function annotReferenceCallback() {
4231
+      //set objId to undefined and force it to get a new objId on buildDocument
4232
+      scope.internal.acroformPlugin.acroFormDictionaryRoot.objId = undefined;
4233
+      var fields = scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
4234
+
4235
+      for (var i in fields) {
4236
+        if (fields.hasOwnProperty(i)) {
4237
+          var formObject = fields[i]; //set objId to undefined and force it to get a new objId on buildDocument
4238
+
4239
+          formObject.objId = undefined; // add Annot Reference!
4240
+
4241
+          if (formObject.hasAnnotation) {
4242
+            // If theres an Annotation Widget in the Form Object, put the
4243
+            // Reference in the /Annot array
4244
+            createAnnotationReference.call(scope, formObject);
4245
+          }
4246
+        }
4247
+      }
4248
+    };
4249
+
4250
+    var putForm = function putForm(formObject) {
4251
+      if (scope.internal.acroformPlugin.printedOut) {
4252
+        scope.internal.acroformPlugin.printedOut = false;
4253
+        scope.internal.acroformPlugin.acroFormDictionaryRoot = null;
4254
+      }
4255
+
4256
+      if (!scope.internal.acroformPlugin.acroFormDictionaryRoot) {
4257
+        initializeAcroForm.call(scope);
4258
+      }
4259
+
4260
+      scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(formObject);
4261
+    };
4262
+    /**
4263
+    * Create the Reference to the widgetAnnotation, so that it gets referenced
4264
+    * in the Annot[] int the+ (Requires the Annotation Plugin)
4265
+    */
4266
+
4267
+
4268
+    var createAnnotationReference = function createAnnotationReference(object) {
4269
+      var options = {
4270
+        type: 'reference',
4271
+        object: object
4272
+      };
4273
+
4274
+      var findEntry = function findEntry(entry) {
4275
+        return entry.type === options.type && entry.object === options.object;
4276
+      };
4277
+
4278
+      if (scope.internal.getPageInfo(object.page).pageContext.annotations.find(findEntry) === undefined) {
4279
+        scope.internal.getPageInfo(object.page).pageContext.annotations.push(options);
4280
+      }
4281
+    }; // Callbacks
4282
+
4283
+
4284
+    var putCatalogCallback = function putCatalogCallback() {
4285
+      // Put reference to AcroForm to DocumentCatalog
4286
+      if (typeof scope.internal.acroformPlugin.acroFormDictionaryRoot != 'undefined') {
4287
+        // for safety, shouldn't normally be the case
4288
+        scope.internal.write('/AcroForm ' + scope.internal.acroformPlugin.acroFormDictionaryRoot.objId + ' ' + 0 + ' R');
4289
+      } else {
4290
+        throw new Error('putCatalogCallback: Root missing.');
4291
+      }
4292
+    };
4293
+    /**
4294
+    * Adds /Acroform X 0 R to Document Catalog, and creates the AcroForm
4295
+    * Dictionary
4296
+    */
4297
+
4298
+
4299
+    var AcroFormDictionaryCallback = function AcroFormDictionaryCallback() {
4300
+      // Remove event
4301
+      scope.internal.events.unsubscribe(scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID);
4302
+      delete scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID;
4303
+      scope.internal.acroformPlugin.printedOut = true;
4304
+    };
4305
+    /**
4306
+    * Creates the single Fields and writes them into the Document
4307
+    * 
4308
+    * If fieldArray is set, use the fields that are inside it instead of the
4309
+    * fields from the AcroRoot (for the FormXObjects...)
4310
+    */
4311
+
4312
+
4313
+    var createFieldCallback = function createFieldCallback(fieldArray) {
4314
+      var standardFields = !fieldArray;
4315
+
4316
+      if (!fieldArray) {
4317
+        // in case there is no fieldArray specified, we want to print out
4318
+        // the Fields of the AcroForm
4319
+        // Print out Root
4320
+        scope.internal.newObjectDeferredBegin(scope.internal.acroformPlugin.acroFormDictionaryRoot.objId, true);
4321
+        scope.internal.acroformPlugin.acroFormDictionaryRoot.putStream();
4322
+      }
4323
+
4324
+      var fieldArray = fieldArray || scope.internal.acroformPlugin.acroFormDictionaryRoot.Kids;
4325
+
4326
+      for (var i in fieldArray) {
4327
+        if (fieldArray.hasOwnProperty(i)) {
4328
+          var fieldObject = fieldArray[i];
4329
+          var keyValueList = [];
4330
+          var oldRect = fieldObject.Rect;
4331
+
4332
+          if (fieldObject.Rect) {
4333
+            fieldObject.Rect = calculateCoordinates.call(this, fieldObject.Rect);
4334
+          } // Start Writing the Object
4335
+
4336
+
4337
+          scope.internal.newObjectDeferredBegin(fieldObject.objId, true);
4338
+          fieldObject.DA = AcroFormAppearance.createDefaultAppearanceStream(fieldObject);
4339
+
4340
+          if (_typeof(fieldObject) === "object" && typeof fieldObject.getKeyValueListForStream === "function") {
4341
+            keyValueList = fieldObject.getKeyValueListForStream();
4342
+          }
4343
+
4344
+          fieldObject.Rect = oldRect;
4345
+
4346
+          if (fieldObject.hasAppearanceStream && !fieldObject.appearanceStreamContent) {
4347
+            // Calculate Appearance
4348
+            var appearance = calculateAppearanceStream.call(this, fieldObject);
4349
+            keyValueList.push({
4350
+              key: 'AP',
4351
+              value: "<</N " + appearance + ">>"
4352
+            });
4353
+            scope.internal.acroformPlugin.xForms.push(appearance);
4354
+          } // Assume AppearanceStreamContent is a Array with N,R,D (at least
4355
+          // one of them!)
4356
+
4357
+
4358
+          if (fieldObject.appearanceStreamContent) {
4359
+            var appearanceStreamString = ""; // Iterate over N,R and D
4360
+
4361
+            for (var k in fieldObject.appearanceStreamContent) {
4362
+              if (fieldObject.appearanceStreamContent.hasOwnProperty(k)) {
4363
+                var value = fieldObject.appearanceStreamContent[k];
4364
+                appearanceStreamString += "/" + k + " ";
4365
+                appearanceStreamString += "<<";
4366
+
4367
+                if (Object.keys(value).length >= 1 || Array.isArray(value)) {
4368
+                  // appearanceStream is an Array or Object!
4369
+                  for (var i in value) {
4370
+                    if (value.hasOwnProperty(i)) {
4371
+                      var obj = value[i];
4372
+
4373
+                      if (typeof obj === 'function') {
4374
+                        // if Function is referenced, call it in order
4375
+                        // to get the FormXObject
4376
+                        obj = obj.call(this, fieldObject);
4377
+                      }
4378
+
4379
+                      appearanceStreamString += "/" + i + " " + obj + " "; // In case the XForm is already used, e.g. OffState
4380
+                      // of CheckBoxes, don't add it
4381
+
4382
+                      if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0)) scope.internal.acroformPlugin.xForms.push(obj);
4383
+                    }
4384
+                  }
4385
+                } else {
4386
+                  var obj = value;
4387
+
4388
+                  if (typeof obj === 'function') {
4389
+                    // if Function is referenced, call it in order to
4390
+                    // get the FormXObject
4391
+                    obj = obj.call(this, fieldObject);
4392
+                  }
4393
+
4394
+                  appearanceStreamString += "/" + i + " " + obj;
4395
+                  if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0)) scope.internal.acroformPlugin.xForms.push(obj);
4396
+                }
4397
+
4398
+                appearanceStreamString += ">>";
4399
+              }
4400
+            } // appearance stream is a normal Object..
4401
+
4402
+
4403
+            keyValueList.push({
4404
+              key: 'AP',
4405
+              value: "<<\n" + appearanceStreamString + ">>"
4406
+            });
4407
+          }
4408
+
4409
+          scope.internal.putStream({
4410
+            additionalKeyValues: keyValueList
4411
+          });
4412
+          scope.internal.out("endobj");
4413
+        }
4414
+      }
4415
+
4416
+      if (standardFields) {
4417
+        createXFormObjectCallback.call(this, scope.internal.acroformPlugin.xForms);
4418
+      }
4419
+    };
4420
+
4421
+    var createXFormObjectCallback = function createXFormObjectCallback(fieldArray) {
4422
+      for (var i in fieldArray) {
4423
+        if (fieldArray.hasOwnProperty(i)) {
4424
+          var key = i;
4425
+          var fieldObject = fieldArray[i]; // Start Writing the Object
4426
+
4427
+          scope.internal.newObjectDeferredBegin(fieldObject && fieldObject.objId, true);
4428
+
4429
+          if (_typeof(fieldObject) === "object" && typeof fieldObject.putStream === "function") {
4430
+            fieldObject.putStream();
4431
+          }
4432
+
4433
+          delete fieldArray[key];
4434
+        }
4435
+      }
4436
+    };
4437
+
4438
+    var initializeAcroForm = function initializeAcroForm() {
4439
+      if (this.internal !== undefined && (this.internal.acroformPlugin === undefined || this.internal.acroformPlugin.isInitialized === false)) {
4440
+        scope = this;
4441
+        AcroFormField.FieldNum = 0;
4442
+        this.internal.acroformPlugin = JSON.parse(JSON.stringify(acroformPluginTemplate));
4443
+
4444
+        if (this.internal.acroformPlugin.acroFormDictionaryRoot) {
4445
+          throw new Error("Exception while creating AcroformDictionary");
4446
+        }
4447
+
4448
+        scaleFactor = scope.internal.scaleFactor; // The Object Number of the AcroForm Dictionary
4449
+
4450
+        scope.internal.acroformPlugin.acroFormDictionaryRoot = new AcroFormDictionary(); // add Callback for creating the AcroForm Dictionary
4451
+
4452
+        scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID = scope.internal.events.subscribe('postPutResources', AcroFormDictionaryCallback);
4453
+        scope.internal.events.subscribe('buildDocument', annotReferenceCallback); // buildDocument
4454
+        // Register event, that is triggered when the DocumentCatalog is
4455
+        // written, in order to add /AcroForm
4456
+
4457
+        scope.internal.events.subscribe('putCatalog', putCatalogCallback); // Register event, that creates all Fields
4458
+
4459
+        scope.internal.events.subscribe('postPutPages', createFieldCallback);
4460
+        scope.internal.acroformPlugin.isInitialized = true;
4461
+      }
4462
+    }; //PDF 32000-1:2008, page 26, 7.3.6
4463
+
4464
+
4465
+    var arrayToPdfArray = jsPDFAPI.__acroform__.arrayToPdfArray = function (array) {
4466
+      if (Array.isArray(array)) {
4467
+        var content = '[';
4468
+
4469
+        for (var i = 0; i < array.length; i++) {
4470
+          if (i !== 0) {
4471
+            content += ' ';
4472
+          }
4473
+
4474
+          switch (_typeof(array[i])) {
4475
+            case 'boolean':
4476
+            case 'number':
4477
+            case 'object':
4478
+              content += array[i].toString();
4479
+              break;
4480
+
4481
+            case 'string':
4482
+              if (array[i].substr(0, 1) !== '/') {
4483
+                content += '(' + pdfEscape(array[i].toString()) + ')';
4484
+              } else {
4485
+                content += array[i].toString();
4486
+              }
4487
+
4488
+              break;
4489
+          }
4490
+        }
4491
+
4492
+        content += ']';
4493
+        return content;
4494
+      }
4495
+
4496
+      throw new Error('Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray');
4497
+    };
4498
+
4499
+    function getMatches(string, regex, index) {
4500
+      index || (index = 1); // default to the first capturing group
4501
+
4502
+      var matches = [];
4503
+      var match;
4504
+
4505
+      while (match = regex.exec(string)) {
4506
+        matches.push(match[index]);
4507
+      }
4508
+
4509
+      return matches;
4510
+    }
4511
+
4512
+    var pdfArrayToStringArray = function pdfArrayToStringArray(array) {
4513
+      var result = [];
4514
+
4515
+      if (typeof array === "string") {
4516
+        result = getMatches(array, /\((.*?)\)/g);
4517
+      }
4518
+
4519
+      return result;
4520
+    };
4521
+
4522
+    var toPdfString = function toPdfString(string) {
4523
+      string = string || "";
4524
+      string.toString();
4525
+      string = '(' + pdfEscape(string) + ')';
4526
+      return string;
4527
+    }; // ##########################
4528
+    // Classes
4529
+    // ##########################
4530
+
4531
+    /**
4532
+    * @class AcroFormPDFObject
4533
+    * @classdesc A AcroFormPDFObject
4534
+    */
4535
+
4536
+
4537
+    var AcroFormPDFObject = function AcroFormPDFObject() {
4538
+      var _objId;
4539
+      /**    *
4540
+      * @name AcroFormPDFObject#objId
4541
+      * @type {any}
4542
+      */
4543
+
4544
+
4545
+      Object.defineProperty(this, 'objId', {
4546
+        configurable: true,
4547
+        get: function get() {
4548
+          if (!_objId) {
4549
+            _objId = scope.internal.newObjectDeferred();
4550
+          }
4551
+
4552
+          if (!_objId) {
4553
+            throw new Error("AcroFormPDFObject: Couldn't create Object ID");
4554
+          }
4555
+
4556
+          return _objId;
4557
+        },
4558
+        set: function set(value) {
4559
+          _objId = value;
4560
+        }
4561
+      });
4562
+    };
4563
+    /**
4564
+    * @function AcroFormPDFObject.toString
4565
+    */
4566
+
4567
+
4568
+    AcroFormPDFObject.prototype.toString = function () {
4569
+      return this.objId + " 0 R";
4570
+    };
4571
+
4572
+    AcroFormPDFObject.prototype.putStream = function () {
4573
+      var keyValueList = this.getKeyValueListForStream();
4574
+      scope.internal.putStream({
4575
+        data: this.stream,
4576
+        additionalKeyValues: keyValueList
4577
+      });
4578
+      scope.internal.out("endobj");
4579
+    };
4580
+    /**
4581
+    * Returns an key-value-List of all non-configurable Variables from the Object
4582
+    * 
4583
+    * @name getKeyValueListForStream
4584
+    * @returns {string}
4585
+    */
4586
+
4587
+
4588
+    AcroFormPDFObject.prototype.getKeyValueListForStream = function () {
4589
+      var createKeyValueListFromFieldObject = function createKeyValueListFromFieldObject(fieldObject) {
4590
+        var keyValueList = [];
4591
+        var keys = Object.getOwnPropertyNames(fieldObject).filter(function (key) {
4592
+          return key != 'content' && key != 'appearanceStreamContent' && key.substring(0, 1) != "_";
4593
+        });
4594
+
4595
+        for (var i in keys) {
4596
+          if (Object.getOwnPropertyDescriptor(fieldObject, keys[i]).configurable === false) {
4597
+            var key = keys[i];
4598
+            var value = fieldObject[key];
4599
+
4600
+            if (value) {
4601
+              if (Array.isArray(value)) {
4602
+                keyValueList.push({
4603
+                  key: key,
4604
+                  value: arrayToPdfArray(value)
4605
+                });
4606
+              } else if (value instanceof AcroFormPDFObject) {
4607
+                // In case it is a reference to another PDFObject,
4608
+                // take the reference number
4609
+                keyValueList.push({
4610
+                  key: key,
4611
+                  value: value.objId + " 0 R"
4612
+                });
4613
+              } else if (typeof value !== "function") {
4614
+                keyValueList.push({
4615
+                  key: key,
4616
+                  value: value
4617
+                });
4618
+              }
4619
+            }
4620
+          }
4621
+        }
4622
+
4623
+        return keyValueList;
4624
+      };
4625
+
4626
+      return createKeyValueListFromFieldObject(this);
4627
+    };
4628
+
4629
+    var AcroFormXObject = function AcroFormXObject() {
4630
+      AcroFormPDFObject.call(this);
4631
+      Object.defineProperty(this, 'Type', {
4632
+        value: "/XObject",
4633
+        configurable: false,
4634
+        writeable: true
4635
+      });
4636
+      Object.defineProperty(this, 'Subtype', {
4637
+        value: "/Form",
4638
+        configurable: false,
4639
+        writeable: true
4640
+      });
4641
+      Object.defineProperty(this, 'FormType', {
4642
+        value: 1,
4643
+        configurable: false,
4644
+        writeable: true
4645
+      });
4646
+      var _BBox = [];
4647
+      Object.defineProperty(this, 'BBox', {
4648
+        configurable: false,
4649
+        writeable: true,
4650
+        get: function get() {
4651
+          return _BBox;
4652
+        },
4653
+        set: function set(value) {
4654
+          _BBox = value;
4655
+        }
4656
+      });
4657
+      Object.defineProperty(this, 'Resources', {
4658
+        value: "2 0 R",
4659
+        configurable: false,
4660
+        writeable: true
4661
+      });
4662
+
4663
+      var _stream;
4664
+
4665
+      Object.defineProperty(this, 'stream', {
4666
+        enumerable: false,
4667
+        configurable: true,
4668
+        set: function set(value) {
4669
+          _stream = value.trim();
4670
+        },
4671
+        get: function get() {
4672
+          if (_stream) {
4673
+            return _stream;
4674
+          } else {
4675
+            return null;
4676
+          }
4677
+        }
4678
+      });
4679
+    };
4680
+
4681
+    inherit(AcroFormXObject, AcroFormPDFObject);
4682
+
4683
+    var AcroFormDictionary = function AcroFormDictionary() {
4684
+      AcroFormPDFObject.call(this);
4685
+      var _Kids = [];
4686
+      Object.defineProperty(this, 'Kids', {
4687
+        enumerable: false,
4688
+        configurable: true,
4689
+        get: function get() {
4690
+          if (_Kids.length > 0) {
4691
+            return _Kids;
4692
+          } else {
4693
+            return;
4694
+          }
4695
+        }
4696
+      });
4697
+      Object.defineProperty(this, 'Fields', {
4698
+        enumerable: false,
4699
+        configurable: false,
4700
+        get: function get() {
4701
+          return _Kids;
4702
+        }
4703
+      }); // Default Appearance
4704
+
4705
+      var _DA;
4706
+
4707
+      Object.defineProperty(this, 'DA', {
4708
+        enumerable: false,
4709
+        configurable: false,
4710
+        get: function get() {
4711
+          if (!_DA) {
4712
+            return;
4713
+          }
4714
+
4715
+          return '(' + _DA + ')';
4716
+        },
4717
+        set: function set(value) {
4718
+          _DA = value;
4719
+        }
4720
+      });
4721
+    };
4722
+
4723
+    inherit(AcroFormDictionary, AcroFormPDFObject);
4724
+    /**
4725
+    * The Field Object contains the Variables, that every Field needs
4726
+    * 
4727
+    * @class AcroFormField
4728
+    * @classdesc An AcroForm FieldObject
4729
+    */
4730
+
4731
+    var AcroFormField = function AcroFormField() {
4732
+      AcroFormPDFObject.call(this); //Annotation-Flag See Table 165
4733
+
4734
+      var _F = 4;
4735
+      Object.defineProperty(this, 'F', {
4736
+        enumerable: false,
4737
+        configurable: false,
4738
+        get: function get() {
4739
+          return _F;
4740
+        },
4741
+        set: function set(value) {
4742
+          if (!isNaN(value)) {
4743
+            _F = value;
4744
+          } else {
4745
+            throw new Error('Invalid value "' + value + '" for attribute F supplied.');
4746
+          }
4747
+        }
4748
+      });
4749
+      /**
4750
+      * (PDF 1.2) If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of wether is is displayed on the screen. 
4751
+      * NOTE 2 This can be useful for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page.
4752
+      *
4753
+      * @name AcroFormField#showWhenPrinted
4754
+      * @default true
4755
+      * @type {boolean}
4756
+      */
4757
+
4758
+      Object.defineProperty(this, 'showWhenPrinted', {
4759
+        enumerable: true,
4760
+        configurable: true,
4761
+        get: function get() {
4762
+          return Boolean(getBitForPdf(_F, 3));
4763
+        },
4764
+        set: function set(value) {
4765
+          if (Boolean(value) === true) {
4766
+            this.F = setBitForPdf(_F, 3);
4767
+          } else {
4768
+            this.F = clearBitForPdf(_F, 3);
4769
+          }
4770
+        }
4771
+      });
4772
+      var _Ff = 0;
4773
+      Object.defineProperty(this, 'Ff', {
4774
+        enumerable: false,
4775
+        configurable: false,
4776
+        get: function get() {
4777
+          return _Ff;
4778
+        },
4779
+        set: function set(value) {
4780
+          if (!isNaN(value)) {
4781
+            _Ff = value;
4782
+          } else {
4783
+            throw new Error('Invalid value "' + value + '" for attribute Ff supplied.');
4784
+          }
4785
+        }
4786
+      });
4787
+      var _Rect = [];
4788
+      Object.defineProperty(this, 'Rect', {
4789
+        enumerable: false,
4790
+        configurable: false,
4791
+        get: function get() {
4792
+          if (_Rect.length === 0) {
4793
+            return;
4794
+          }
4795
+
4796
+          return _Rect;
4797
+        },
4798
+        set: function set(value) {
4799
+          if (typeof value !== "undefined") {
4800
+            _Rect = value;
4801
+          } else {
4802
+            _Rect = [];
4803
+          }
4804
+        }
4805
+      });
4806
+      /**
4807
+      * The x-position of the field.
4808
+      *
4809
+      * @name AcroFormField#x
4810
+      * @default null
4811
+      * @type {number}
4812
+      */
4813
+
4814
+      Object.defineProperty(this, 'x', {
4815
+        enumerable: true,
4816
+        configurable: true,
4817
+        get: function get() {
4818
+          if (!_Rect || isNaN(_Rect[0])) {
4819
+            return 0;
4820
+          }
4821
+
4822
+          return antiScale(_Rect[0]);
4823
+        },
4824
+        set: function set(value) {
4825
+          _Rect[0] = scale(value);
4826
+        }
4827
+      });
4828
+      /**
4829
+      * The y-position of the field.
4830
+      *
4831
+      * @name AcroFormField#y
4832
+      * @default null
4833
+      * @type {number}
4834
+      */
4835
+
4836
+      Object.defineProperty(this, 'y', {
4837
+        enumerable: true,
4838
+        configurable: true,
4839
+        get: function get() {
4840
+          if (!_Rect || isNaN(_Rect[1])) {
4841
+            return 0;
4842
+          }
4843
+
4844
+          return antiScale(_Rect[1]);
4845
+        },
4846
+        set: function set(value) {
4847
+          _Rect[1] = scale(value);
4848
+        }
4849
+      });
4850
+      /**
4851
+      * The width of the field.
4852
+      *
4853
+      * @name AcroFormField#width
4854
+      * @default null
4855
+      * @type {number}
4856
+      */
4857
+
4858
+      Object.defineProperty(this, 'width', {
4859
+        enumerable: true,
4860
+        configurable: true,
4861
+        get: function get() {
4862
+          if (!_Rect || isNaN(_Rect[2])) {
4863
+            return 0;
4864
+          }
4865
+
4866
+          return antiScale(_Rect[2]);
4867
+        },
4868
+        set: function set(value) {
4869
+          _Rect[2] = scale(value);
4870
+        }
4871
+      });
4872
+      /**
4873
+      * The height of the field.
4874
+      *
4875
+      * @name AcroFormField#height
4876
+      * @default null
4877
+      * @type {number}
4878
+      */
4879
+
4880
+      Object.defineProperty(this, 'height', {
4881
+        enumerable: true,
4882
+        configurable: true,
4883
+        get: function get() {
4884
+          if (!_Rect || isNaN(_Rect[3])) {
4885
+            return 0;
4886
+          }
4887
+
4888
+          return antiScale(_Rect[3]);
4889
+        },
4890
+        set: function set(value) {
4891
+          _Rect[3] = scale(value);
4892
+        }
4893
+      });
4894
+      var _FT = "";
4895
+      Object.defineProperty(this, 'FT', {
4896
+        enumerable: true,
4897
+        configurable: false,
4898
+        get: function get() {
4899
+          return _FT;
4900
+        },
4901
+        set: function set(value) {
4902
+          switch (value) {
4903
+            case '/Btn':
4904
+            case '/Tx':
4905
+            case '/Ch':
4906
+            case '/Sig':
4907
+              _FT = value;
4908
+              break;
4909
+
4910
+            default:
4911
+              throw new Error('Invalid value "' + value + '" for attribute FT supplied.');
4912
+          }
4913
+        }
4914
+      });
4915
+      var _T = null;
4916
+      Object.defineProperty(this, 'T', {
4917
+        enumerable: true,
4918
+        configurable: false,
4919
+        get: function get() {
4920
+          if (!_T || _T.length < 1) {
4921
+            // In case of a Child from a Radio´Group, you don't need a FieldName
4922
+            if (this instanceof AcroFormChildClass) {
4923
+              return;
4924
+            }
4925
+
4926
+            _T = "FieldObject" + AcroFormField.FieldNum++;
4927
+          }
4928
+
4929
+          return '(' + pdfEscape(_T) + ')';
4930
+        },
4931
+        set: function set(value) {
4932
+          _T = value.toString();
4933
+        }
4934
+      });
4935
+      /**
4936
+      * (Optional) The partial field name (see 12.7.3.2, “Field Names”).
4937
+      *
4938
+      * @name AcroFormField#fieldName
4939
+      * @default null
4940
+      * @type {string}
4941
+      */
4942
+
4943
+      Object.defineProperty(this, 'fieldName', {
4944
+        configurable: true,
4945
+        enumerable: true,
4946
+        get: function get() {
4947
+          return _T;
4948
+        },
4949
+        set: function set(value) {
4950
+          _T = value;
4951
+        }
4952
+      });
4953
+      var _fontName = 'helvetica';
4954
+      /**
4955
+      * The fontName of the font to be used.
4956
+      *
4957
+      * @name AcroFormField#fontName
4958
+      * @default 'helvetica'
4959
+      * @type {string}
4960
+      */
4961
+
4962
+      Object.defineProperty(this, 'fontName', {
4963
+        enumerable: true,
4964
+        configurable: true,
4965
+        get: function get() {
4966
+          return _fontName;
4967
+        },
4968
+        set: function set(value) {
4969
+          _fontName = value;
4970
+        }
4971
+      });
4972
+      var _fontStyle = 'normal';
4973
+      /**
4974
+      * The fontStyle of the font to be used.
4975
+      *
4976
+      * @name AcroFormField#fontStyle
4977
+      * @default 'normal'
4978
+      * @type {string}
4979
+      */
4980
+
4981
+      Object.defineProperty(this, 'fontStyle', {
4982
+        enumerable: true,
4983
+        configurable: true,
4984
+        get: function get() {
4985
+          return _fontStyle;
4986
+        },
4987
+        set: function set(value) {
4988
+          _fontStyle = value;
4989
+        }
4990
+      });
4991
+      var _fontSize = 0;
4992
+      /**
4993
+      * The fontSize of the font to be used.
4994
+      *
4995
+      * @name AcroFormField#fontSize
4996
+      * @default 0 (for auto)
4997
+      * @type {number}
4998
+      */
4999
+
5000
+      Object.defineProperty(this, 'fontSize', {
5001
+        enumerable: true,
5002
+        configurable: true,
5003
+        get: function get() {
5004
+          return antiScale(_fontSize);
5005
+        },
5006
+        set: function set(value) {
5007
+          _fontSize = scale(value);
5008
+        }
5009
+      });
5010
+      var _maxFontSize = 50;
5011
+      /**
5012
+      * The maximum fontSize of the font to be used.
5013
+      *
5014
+      * @name AcroFormField#maxFontSize
5015
+      * @default 0 (for auto)
5016
+      * @type {number}
5017
+      */
5018
+
5019
+      Object.defineProperty(this, 'maxFontSize', {
5020
+        enumerable: true,
5021
+        configurable: true,
5022
+        get: function get() {
5023
+          return antiScale(_maxFontSize);
5024
+        },
5025
+        set: function set(value) {
5026
+          _maxFontSize = scale(value);
5027
+        }
5028
+      });
5029
+      var _color = 'black';
5030
+      /**
5031
+      * The color of the text
5032
+      *
5033
+      * @name AcroFormField#color
5034
+      * @default 'black'
5035
+      * @type {string|rgba}
5036
+      */
5037
+
5038
+      Object.defineProperty(this, 'color', {
5039
+        enumerable: true,
5040
+        configurable: true,
5041
+        get: function get() {
5042
+          return _color;
5043
+        },
5044
+        set: function set(value) {
5045
+          _color = value;
5046
+        }
5047
+      });
5048
+      var _DA = '/F1 0 Tf 0 g'; // Defines the default appearance (Needed for variable Text)
5049
+
5050
+      Object.defineProperty(this, 'DA', {
5051
+        enumerable: true,
5052
+        configurable: false,
5053
+        get: function get() {
5054
+          if (!_DA || this instanceof AcroFormChildClass || this instanceof AcroFormTextField) {
5055
+            return;
5056
+          }
5057
+
5058
+          return toPdfString(_DA);
5059
+        },
5060
+        set: function set(value) {
5061
+          value = value.toString();
5062
+          _DA = value;
5063
+        }
5064
+      });
5065
+      var _DV = null;
5066
+      Object.defineProperty(this, 'DV', {
5067
+        enumerable: false,
5068
+        configurable: false,
5069
+        get: function get() {
5070
+          if (!_DV) {
5071
+            return;
5072
+          }
5073
+
5074
+          if (this instanceof AcroFormButton === false) {
5075
+            return toPdfString(_DV);
5076
+          }
5077
+
5078
+          return _DV;
5079
+        },
5080
+        set: function set(value) {
5081
+          value = value.toString();
5082
+
5083
+          if (this instanceof AcroFormButton === false) {
5084
+            if (value.substr(0, 1) === '(') {
5085
+              _DV = pdfUnescape(value.substr(1, value.length - 2));
5086
+            } else {
5087
+              _DV = pdfUnescape(value);
5088
+            }
5089
+          } else {
5090
+            _DV = value;
5091
+          }
5092
+        }
5093
+      });
5094
+      /**
5095
+      * (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of value. 
5096
+      *
5097
+      * @name AcroFormField#defaultValue
5098
+      * @default null
5099
+      * @type {any}
5100
+      */
5101
+
5102
+      Object.defineProperty(this, 'defaultValue', {
5103
+        enumerable: true,
5104
+        configurable: true,
5105
+        get: function get() {
5106
+          if (this instanceof AcroFormButton === true) {
5107
+            return pdfUnescape(_DV.substr(1, _DV.length - 1));
5108
+          } else {
5109
+            return _DV;
5110
+          }
5111
+        },
5112
+        set: function set(value) {
5113
+          value = value.toString();
5114
+
5115
+          if (this instanceof AcroFormButton === true) {
5116
+            _DV = '/' + value;
5117
+          } else {
5118
+            _DV = value;
5119
+          }
5120
+        }
5121
+      });
5122
+      var _V = null;
5123
+      Object.defineProperty(this, 'V', {
5124
+        enumerable: false,
5125
+        configurable: false,
5126
+        get: function get() {
5127
+          if (!_V) {
5128
+            return;
5129
+          }
5130
+
5131
+          if (this instanceof AcroFormButton === false) {
5132
+            return toPdfString(_V);
5133
+          }
5134
+
5135
+          return _V;
5136
+        },
5137
+        set: function set(value) {
5138
+          value = value.toString();
5139
+
5140
+          if (this instanceof AcroFormButton === false) {
5141
+            if (value.substr(0, 1) === '(') {
5142
+              _V = pdfUnescape(value.substr(1, value.length - 2));
5143
+            } else {
5144
+              _V = pdfUnescape(value);
5145
+            }
5146
+          } else {
5147
+            _V = value;
5148
+          }
5149
+        }
5150
+      });
5151
+      /**
5152
+      * (Optional; inheritable) The field’s value, whose format varies depending on the field type. See the descriptions of individual field types for further information. 
5153
+      *
5154
+      * @name AcroFormField#value
5155
+      * @default null
5156
+      * @type {any}
5157
+      */
5158
+
5159
+      Object.defineProperty(this, 'value', {
5160
+        enumerable: true,
5161
+        configurable: true,
5162
+        get: function get() {
5163
+          if (this instanceof AcroFormButton === true) {
5164
+            return pdfUnescape(_V.substr(1, _V.length - 1));
5165
+          } else {
5166
+            return _V;
5167
+          }
5168
+        },
5169
+        set: function set(value) {
5170
+          value = value.toString();
5171
+
5172
+          if (this instanceof AcroFormButton === true) {
5173
+            _V = '/' + value;
5174
+          } else {
5175
+            _V = value;
5176
+          }
5177
+        }
5178
+      });
5179
+      /**
5180
+      * Check if field has annotations
5181
+      *
5182
+      * @name AcroFormField#hasAnnotation
5183
+      * @readonly
5184
+      * @type {boolean}
5185
+      */
5186
+
5187
+      Object.defineProperty(this, 'hasAnnotation', {
5188
+        enumerable: true,
5189
+        configurable: true,
5190
+        get: function get() {
5191
+          return this.Rect;
5192
+        }
5193
+      });
5194
+      Object.defineProperty(this, 'Type', {
5195
+        enumerable: true,
5196
+        configurable: false,
5197
+        get: function get() {
5198
+          return this.hasAnnotation ? "/Annot" : null;
5199
+        }
5200
+      });
5201
+      Object.defineProperty(this, 'Subtype', {
5202
+        enumerable: true,
5203
+        configurable: false,
5204
+        get: function get() {
5205
+          return this.hasAnnotation ? "/Widget" : null;
5206
+        }
5207
+      });
5208
+      var _hasAppearanceStream = false;
5209
+      /**
5210
+      * true if field has an appearanceStream
5211
+      *
5212
+      * @name AcroFormField#hasAppearanceStream
5213
+      * @readonly
5214
+      * @type {boolean}
5215
+      */
5216
+
5217
+      Object.defineProperty(this, 'hasAppearanceStream', {
5218
+        enumerable: true,
5219
+        configurable: true,
5220
+        writeable: true,
5221
+        get: function get() {
5222
+          return _hasAppearanceStream;
5223
+        },
5224
+        set: function set(value) {
5225
+          value = Boolean(value);
5226
+          _hasAppearanceStream = value;
5227
+        }
5228
+      });
5229
+      /**
5230
+      * The page on which the AcroFormField is placed
5231
+      *
5232
+      * @name AcroFormField#page
5233
+      * @type {number}
5234
+      */
5235
+
5236
+      var _page;
5237
+
5238
+      Object.defineProperty(this, 'page', {
5239
+        enumerable: true,
5240
+        configurable: true,
5241
+        writeable: true,
5242
+        get: function get() {
5243
+          if (!_page) {
5244
+            return;
5245
+          }
5246
+
5247
+          return _page;
5248
+        },
5249
+        set: function set(value) {
5250
+          _page = value;
5251
+        }
5252
+      });
5253
+      /**
5254
+      * If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database. 
5255
+      *
5256
+      * @name AcroFormField#readOnly
5257
+      * @default false
5258
+      * @type {boolean}
5259
+      */
5260
+
5261
+      Object.defineProperty(this, 'readOnly', {
5262
+        enumerable: true,
5263
+        configurable: true,
5264
+        get: function get() {
5265
+          return Boolean(getBitForPdf(this.Ff, 1));
5266
+        },
5267
+        set: function set(value) {
5268
+          if (Boolean(value) === true) {
5269
+            this.Ff = setBitForPdf(this.Ff, 1);
5270
+          } else {
5271
+            this.Ff = clearBitForPdf(this.Ff, 1);
5272
+          }
5273
+        }
5274
+      });
5275
+      /**
5276
+      * If set, the field shall have a value at the time it is exported by a submitform action (see 12.7.5.2, “Submit-Form Action”). 
5277
+      *
5278
+      * @name AcroFormField#required
5279
+      * @default false
5280
+      * @type {boolean}
5281
+      */
5282
+
5283
+      Object.defineProperty(this, 'required', {
5284
+        enumerable: true,
5285
+        configurable: true,
5286
+        get: function get() {
5287
+          return Boolean(getBitForPdf(this.Ff, 2));
5288
+        },
5289
+        set: function set(value) {
5290
+          if (Boolean(value) === true) {
5291
+            this.Ff = setBitForPdf(this.Ff, 2);
5292
+          } else {
5293
+            this.Ff = clearBitForPdf(this.Ff, 2);
5294
+          }
5295
+        }
5296
+      });
5297
+      /**
5298
+      * If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”)
5299
+      *
5300
+      * @name AcroFormField#noExport
5301
+      * @default false
5302
+      * @type {boolean}
5303
+      */
5304
+
5305
+      Object.defineProperty(this, 'noExport', {
5306
+        enumerable: true,
5307
+        configurable: true,
5308
+        get: function get() {
5309
+          return Boolean(getBitForPdf(this.Ff, 3));
5310
+        },
5311
+        set: function set(value) {
5312
+          if (Boolean(value) === true) {
5313
+            this.Ff = setBitForPdf(this.Ff, 3);
5314
+          } else {
5315
+            this.Ff = clearBitForPdf(this.Ff, 3);
5316
+          }
5317
+        }
5318
+      });
5319
+      var _Q = null;
5320
+      Object.defineProperty(this, 'Q', {
5321
+        enumerable: true,
5322
+        configurable: false,
5323
+        get: function get() {
5324
+          if (_Q === null) {
5325
+            return;
5326
+          }
5327
+
5328
+          return _Q;
5329
+        },
5330
+        set: function set(value) {
5331
+          if ([0, 1, 2].indexOf(value) !== -1) {
5332
+            _Q = value;
5333
+          } else {
5334
+            throw new Error('Invalid value "' + value + '" for attribute Q supplied.');
5335
+          }
5336
+        }
5337
+      });
5338
+      /**
5339
+      * (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text:
5340
+      * 'left', 'center', 'right'
5341
+      *
5342
+      * @name AcroFormField#textAlign
5343
+      * @default 'left'
5344
+      * @type {string}
5345
+      */
5346
+
5347
+      Object.defineProperty(this, 'textAlign', {
5348
+        get: function get() {
5349
+          var result = 'left';
5350
+
5351
+          switch (_Q) {
5352
+            case 0:
5353
+            default:
5354
+              result = 'left';
5355
+              break;
5356
+
5357
+            case 1:
5358
+              result = 'center';
5359
+              break;
5360
+
5361
+            case 2:
5362
+              result = 'right';
5363
+              break;
5364
+          }
5365
+
5366
+          return result;
5367
+        },
5368
+        configurable: true,
5369
+        enumerable: true,
5370
+        set: function set(value) {
5371
+          switch (value) {
5372
+            case 'right':
5373
+            case 2:
5374
+              _Q = 2;
5375
+              break;
5376
+
5377
+            case 'center':
5378
+            case 1:
5379
+              _Q = 1;
5380
+              break;
5381
+
5382
+            case 'left':
5383
+            case 0:
5384
+            default:
5385
+              _Q = 0;
5386
+          }
5387
+        }
5388
+      });
5389
+    };
5390
+
5391
+    inherit(AcroFormField, AcroFormPDFObject);
5392
+    /**
5393
+    * @class AcroFormChoiceField
5394
+    * @extends AcroFormField
5395
+    */
5396
+
5397
+    var AcroFormChoiceField = function AcroFormChoiceField() {
5398
+      AcroFormField.call(this); // Field Type = Choice Field
5399
+
5400
+      this.FT = "/Ch"; // options
5401
+
5402
+      this.V = '()';
5403
+      this.fontName = 'zapfdingbats'; // Top Index
5404
+
5405
+      var _TI = 0;
5406
+      Object.defineProperty(this, 'TI', {
5407
+        enumerable: true,
5408
+        configurable: false,
5409
+        get: function get() {
5410
+          return _TI;
5411
+        },
5412
+        set: function set(value) {
5413
+          _TI = value;
5414
+        }
5415
+      });
5416
+      /**
5417
+      * (Optional) For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0.
5418
+      * 
5419
+      * @name AcroFormChoiceField#topIndex
5420
+      * @default 0
5421
+      * @type {number}
5422
+      */
5423
+
5424
+      Object.defineProperty(this, 'topIndex', {
5425
+        enumerable: true,
5426
+        configurable: true,
5427
+        get: function get() {
5428
+          return _TI;
5429
+        },
5430
+        set: function set(value) {
5431
+          _TI = value;
5432
+        }
5433
+      });
5434
+      var _Opt = [];
5435
+      Object.defineProperty(this, 'Opt', {
5436
+        enumerable: true,
5437
+        configurable: false,
5438
+        get: function get() {
5439
+          return arrayToPdfArray(_Opt);
5440
+        },
5441
+        set: function set(value) {
5442
+          _Opt = pdfArrayToStringArray(value);
5443
+        }
5444
+      });
5445
+      /**
5446
+      * @memberof AcroFormChoiceField
5447
+      * @name getOptions
5448
+      * @function
5449
+      * @instance
5450
+      * @returns {array} array of Options
5451
+      */
5452
+
5453
+      this.getOptions = function () {
5454
+        return _Opt;
5455
+      };
5456
+      /**
5457
+      * @memberof AcroFormChoiceField
5458
+      * @name setOptions
5459
+      * @function
5460
+      * @instance
5461
+      * @param {array} value
5462
+      */
5463
+
5464
+
5465
+      this.setOptions = function (value) {
5466
+        _Opt = value;
5467
+
5468
+        if (this.sort) {
5469
+          _Opt.sort();
5470
+        }
5471
+      };
5472
+      /**
5473
+      * @memberof AcroFormChoiceField
5474
+      * @name addOption
5475
+      * @function
5476
+      * @instance
5477
+      * @param {string} value
5478
+      */
5479
+
5480
+
5481
+      this.addOption = function (value) {
5482
+        value = value || "";
5483
+        value = value.toString();
5484
+
5485
+        _Opt.push(value);
5486
+
5487
+        if (this.sort) {
5488
+          _Opt.sort();
5489
+        }
5490
+      };
5491
+      /**
5492
+      * @memberof AcroFormChoiceField
5493
+      * @name removeOption
5494
+      * @function
5495
+      * @instance
5496
+      * @param {string} value
5497
+      * @param {boolean} allEntries (default: false)
5498
+      */
5499
+
5500
+
5501
+      this.removeOption = function (value, allEntries) {
5502
+        allEntries = allEntries || false;
5503
+        value = value || "";
5504
+        value = value.toString();
5505
+
5506
+        while (_Opt.indexOf(value) !== -1) {
5507
+          _Opt.splice(_Opt.indexOf(value), 1);
5508
+
5509
+          if (allEntries === false) {
5510
+            break;
5511
+          }
5512
+        }
5513
+      };
5514
+      /**
5515
+      * If set, the field is a combo box; if clear, the field is a list box. 
5516
+      *
5517
+      * @name AcroFormChoiceField#combo
5518
+      * @default false
5519
+      * @type {boolean}
5520
+      */
5521
+
5522
+
5523
+      Object.defineProperty(this, 'combo', {
5524
+        enumerable: true,
5525
+        configurable: true,
5526
+        get: function get() {
5527
+          return Boolean(getBitForPdf(this.Ff, 18));
5528
+        },
5529
+        set: function set(value) {
5530
+          if (Boolean(value) === true) {
5531
+            this.Ff = setBitForPdf(this.Ff, 18);
5532
+          } else {
5533
+            this.Ff = clearBitForPdf(this.Ff, 18);
5534
+          }
5535
+        }
5536
+      });
5537
+      /**
5538
+      * If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set. 
5539
+      *
5540
+      * @name AcroFormChoiceField#edit
5541
+      * @default false
5542
+      * @type {boolean}
5543
+      */
5544
+
5545
+      Object.defineProperty(this, 'edit', {
5546
+        enumerable: true,
5547
+        configurable: true,
5548
+        get: function get() {
5549
+          return Boolean(getBitForPdf(this.Ff, 19));
5550
+        },
5551
+        set: function set(value) {
5552
+          //PDF 32000-1:2008, page 444
5553
+          if (this.combo === true) {
5554
+            if (Boolean(value) === true) {
5555
+              this.Ff = setBitForPdf(this.Ff, 19);
5556
+            } else {
5557
+              this.Ff = clearBitForPdf(this.Ff, 19);
5558
+            }
5559
+          }
5560
+        }
5561
+      });
5562
+      /**
5563
+      * If set, the field’s option items shall be sorted alphabetically. This flag is intended for use by writers, not by readers. Conforming readers shall display the options in the order in which they occur in the Opt array (see Table 231). 
5564
+      *
5565
+      * @name AcroFormChoiceField#sort
5566
+      * @default false
5567
+      * @type {boolean}
5568
+      */
5569
+
5570
+      Object.defineProperty(this, 'sort', {
5571
+        enumerable: true,
5572
+        configurable: true,
5573
+        get: function get() {
5574
+          return Boolean(getBitForPdf(this.Ff, 20));
5575
+        },
5576
+        set: function set(value) {
5577
+          if (Boolean(value) === true) {
5578
+            this.Ff = setBitForPdf(this.Ff, 20);
5579
+
5580
+            _Opt.sort();
5581
+          } else {
5582
+            this.Ff = clearBitForPdf(this.Ff, 20);
5583
+          }
5584
+        }
5585
+      });
5586
+      /**
5587
+      * (PDF 1.4) If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected 
5588
+      *
5589
+      * @name AcroFormChoiceField#multiSelect
5590
+      * @default false
5591
+      * @type {boolean}
5592
+      */
5593
+
5594
+      Object.defineProperty(this, 'multiSelect', {
5595
+        enumerable: true,
5596
+        configurable: true,
5597
+        get: function get() {
5598
+          return Boolean(getBitForPdf(this.Ff, 22));
5599
+        },
5600
+        set: function set(value) {
5601
+          if (Boolean(value) === true) {
5602
+            this.Ff = setBitForPdf(this.Ff, 22);
5603
+          } else {
5604
+            this.Ff = clearBitForPdf(this.Ff, 22);
5605
+          }
5606
+        }
5607
+      });
5608
+      /**
5609
+      * (PDF 1.4) If set, text entered in the field shall not be spellchecked. This flag shall not be used unless the Combo and Edit flags are both set. 
5610
+      *
5611
+      * @name AcroFormChoiceField#doNotSpellCheck
5612
+      * @default false
5613
+      * @type {boolean}
5614
+      */
5615
+
5616
+      Object.defineProperty(this, 'doNotSpellCheck', {
5617
+        enumerable: true,
5618
+        configurable: true,
5619
+        get: function get() {
5620
+          return Boolean(getBitForPdf(this.Ff, 23));
5621
+        },
5622
+        set: function set(value) {
5623
+          if (Boolean(value) === true) {
5624
+            this.Ff = setBitForPdf(this.Ff, 23);
5625
+          } else {
5626
+            this.Ff = clearBitForPdf(this.Ff, 23);
5627
+          }
5628
+        }
5629
+      });
5630
+      /**
5631
+      * (PDF 1.5) If set, the new value shall be committed as soon as a selection is made (commonly with the pointing device). In this case, supplying a value for a field involves three actions: selecting the field for fill-in, selecting a choice for the fill-in value, and leaving that field, which finalizes or “commits” the data choice and triggers any actions associated with the entry or changing of this data. If this flag is on, then processing does not wait for leaving the field action to occur, but immediately proceeds to the third step.
5632
+      * This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field.
5633
+      *
5634
+      * @name AcroFormChoiceField#commitOnSelChange
5635
+      * @default false
5636
+      * @type {boolean}
5637
+      */
5638
+
5639
+      Object.defineProperty(this, 'commitOnSelChange', {
5640
+        enumerable: true,
5641
+        configurable: true,
5642
+        get: function get() {
5643
+          return Boolean(getBitForPdf(this.Ff, 27));
5644
+        },
5645
+        set: function set(value) {
5646
+          if (Boolean(value) === true) {
5647
+            this.Ff = setBitForPdf(this.Ff, 27);
5648
+          } else {
5649
+            this.Ff = clearBitForPdf(this.Ff, 27);
5650
+          }
5651
+        }
5652
+      });
5653
+      this.hasAppearanceStream = false;
5654
+    };
5655
+
5656
+    inherit(AcroFormChoiceField, AcroFormField);
5657
+    /**
5658
+    * @class AcroFormListBox
5659
+    * @extends AcroFormChoiceField
5660
+    * @extends AcroFormField
5661
+    */
5662
+
5663
+    var AcroFormListBox = function AcroFormListBox() {
5664
+      AcroFormChoiceField.call(this);
5665
+      this.fontName = 'helvetica'; //PDF 32000-1:2008, page 444
5666
+
5667
+      this.combo = false;
5668
+    };
5669
+
5670
+    inherit(AcroFormListBox, AcroFormChoiceField);
5671
+    /**
5672
+    * @class AcroFormComboBox 
5673
+    * @extends AcroFormListBox
5674
+    * @extends AcroFormChoiceField
5675
+    * @extends AcroFormField
5676
+    */
5677
+
5678
+    var AcroFormComboBox = function AcroFormComboBox() {
5679
+      AcroFormListBox.call(this);
5680
+      this.combo = true;
5681
+    };
5682
+
5683
+    inherit(AcroFormComboBox, AcroFormListBox);
5684
+    /**
5685
+    * @class AcroFormEditBox 
5686
+    * @extends AcroFormComboBox
5687
+    * @extends AcroFormListBox
5688
+    * @extends AcroFormChoiceField
5689
+    * @extends AcroFormField
5690
+    */
5691
+
5692
+    var AcroFormEditBox = function AcroFormEditBox() {
5693
+      AcroFormComboBox.call(this);
5694
+      this.edit = true;
5695
+    };
5696
+
5697
+    inherit(AcroFormEditBox, AcroFormComboBox);
5698
+    /**
5699
+    * @class AcroFormButton
5700
+    * @extends AcroFormField
5701
+    */
5702
+
5703
+    var AcroFormButton = function AcroFormButton() {
5704
+      AcroFormField.call(this);
5705
+      this.FT = "/Btn";
5706
+      /**
5707
+      * (Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected.
5708
+      * 
5709
+      * @name AcroFormButton#noToggleToOff
5710
+      * @type {boolean}
5711
+      */
5712
+
5713
+      Object.defineProperty(this, 'noToggleToOff', {
5714
+        enumerable: true,
5715
+        configurable: true,
5716
+        get: function get() {
5717
+          return Boolean(getBitForPdf(this.Ff, 15));
5718
+        },
5719
+        set: function set(value) {
5720
+          if (Boolean(value) === true) {
5721
+            this.Ff = setBitForPdf(this.Ff, 15);
5722
+          } else {
5723
+            this.Ff = clearBitForPdf(this.Ff, 15);
5724
+          }
5725
+        }
5726
+      });
5727
+      /**
5728
+      * If set, the field is a set of radio buttons; if clear, the field is a checkbox. This flag may be set only if the Pushbutton flag is clear. 
5729
+      * 
5730
+      * @name AcroFormButton#radio
5731
+      * @type {boolean}
5732
+      */
5733
+
5734
+      Object.defineProperty(this, 'radio', {
5735
+        enumerable: true,
5736
+        configurable: true,
5737
+        get: function get() {
5738
+          return Boolean(getBitForPdf(this.Ff, 16));
5739
+        },
5740
+        set: function set(value) {
5741
+          if (Boolean(value) === true) {
5742
+            this.Ff = setBitForPdf(this.Ff, 16);
5743
+          } else {
5744
+            this.Ff = clearBitForPdf(this.Ff, 16);
5745
+          }
5746
+        }
5747
+      });
5748
+      /**
5749
+      * If set, the field is a pushbutton that does not retain a permanent value. 
5750
+      *
5751
+      * @name AcroFormButton#pushButton
5752
+      * @type {boolean}
5753
+      */
5754
+
5755
+      Object.defineProperty(this, 'pushButton', {
5756
+        enumerable: true,
5757
+        configurable: true,
5758
+        get: function get() {
5759
+          return Boolean(getBitForPdf(this.Ff, 17));
5760
+        },
5761
+        set: function set(value) {
5762
+          if (Boolean(value) === true) {
5763
+            this.Ff = setBitForPdf(this.Ff, 17);
5764
+          } else {
5765
+            this.Ff = clearBitForPdf(this.Ff, 17);
5766
+          }
5767
+        }
5768
+      });
5769
+      /**
5770
+      * (PDF 1.5) If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons).
5771
+      *
5772
+      * @name AcroFormButton#radioIsUnison
5773
+      * @type {boolean}
5774
+      */
5775
+
5776
+      Object.defineProperty(this, 'radioIsUnison', {
5777
+        enumerable: true,
5778
+        configurable: true,
5779
+        get: function get() {
5780
+          return Boolean(getBitForPdf(this.Ff, 26));
5781
+        },
5782
+        set: function set(value) {
5783
+          if (Boolean(value) === true) {
5784
+            this.Ff = setBitForPdf(this.Ff, 26);
5785
+          } else {
5786
+            this.Ff = clearBitForPdf(this.Ff, 26);
5787
+          }
5788
+        }
5789
+      });
5790
+      var _MK = {};
5791
+      Object.defineProperty(this, 'MK', {
5792
+        enumerable: false,
5793
+        configurable: false,
5794
+        get: function get() {
5795
+          if (Object.keys(_MK).length !== 0) {
5796
+            var result = [];
5797
+            result.push('<<');
5798
+            var key;
5799
+
5800
+            for (key in _MK) {
5801
+              result.push('/' + key + ' (' + _MK[key] + ')');
5802
+            }
5803
+
5804
+            result.push('>>');
5805
+            return result.join('\n');
5806
+          }
5807
+
5808
+          return;
5809
+        },
5810
+        set: function set(value) {
5811
+          if (_typeof(value) === "object") {
5812
+            _MK = value;
5813
+          }
5814
+        }
5815
+      });
5816
+      /**
5817
+      * From the PDF reference:
5818
+      * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user. 
5819
+      * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, "Button Fields"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, "Button Fields") and radio buttons (Radio Buttons in 12.7.4.2, "Button Fields").
5820
+      *
5821
+      * - '8' = Cross, 
5822
+      * - 'l' =  Circle,
5823
+      * - '' = nothing
5824
+      * @name AcroFormButton#caption
5825
+      * @type {string}
5826
+      */
5827
+
5828
+      Object.defineProperty(this, 'caption', {
5829
+        enumerable: true,
5830
+        configurable: true,
5831
+        get: function get() {
5832
+          return _MK.CA || '';
5833
+        },
5834
+        set: function set(value) {
5835
+          if (typeof value === "string") {
5836
+            _MK.CA = value;
5837
+          }
5838
+        }
5839
+      });
5840
+
5841
+      var _AS;
5842
+
5843
+      Object.defineProperty(this, 'AS', {
5844
+        enumerable: false,
5845
+        configurable: false,
5846
+        get: function get() {
5847
+          return _AS;
5848
+        },
5849
+        set: function set(value) {
5850
+          _AS = value;
5851
+        }
5852
+      });
5853
+      /**
5854
+      * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams")
5855
+      *
5856
+      * @name AcroFormButton#appearanceState
5857
+      * @type {any}
5858
+      */
5859
+
5860
+      Object.defineProperty(this, 'appearanceState', {
5861
+        enumerable: true,
5862
+        configurable: true,
5863
+        get: function get() {
5864
+          return _AS.substr(1, _AS.length - 1);
5865
+        },
5866
+        set: function set(value) {
5867
+          _AS = '/' + value;
5868
+        }
5869
+      });
5870
+    };
5871
+
5872
+    inherit(AcroFormButton, AcroFormField);
5873
+    /**
5874
+    * @class AcroFormPushButton
5875
+    * @extends AcroFormButton
5876
+    * @extends AcroFormField
5877
+    */
5878
+
5879
+    var AcroFormPushButton = function AcroFormPushButton() {
5880
+      AcroFormButton.call(this);
5881
+      this.pushButton = true;
5882
+    };
5883
+
5884
+    inherit(AcroFormPushButton, AcroFormButton);
5885
+    /**
5886
+    * @class AcroFormRadioButton
5887
+    * @extends AcroFormButton
5888
+    * @extends AcroFormField
5889
+    */
5890
+
5891
+    var AcroFormRadioButton = function AcroFormRadioButton() {
5892
+      AcroFormButton.call(this);
5893
+      this.radio = true;
5894
+      this.pushButton = false;
5895
+      var _Kids = [];
5896
+      Object.defineProperty(this, 'Kids', {
5897
+        enumerable: true,
5898
+        configurable: false,
5899
+        get: function get() {
5900
+          return _Kids;
5901
+        },
5902
+        set: function set(value) {
5903
+          if (typeof value !== "undefined") {
5904
+            _Kids = value;
5905
+          } else {
5906
+            _Kids = [];
5907
+          }
5908
+        }
5909
+      });
5910
+    };
5911
+
5912
+    inherit(AcroFormRadioButton, AcroFormButton);
5913
+    /**
5914
+    * The Child class of a RadioButton (the radioGroup) -> The single Buttons
5915
+    * 
5916
+    * @class AcroFormChildClass
5917
+    * @extends AcroFormField
5918
+    * @ignore
5919
+    */
5920
+
5921
+    var AcroFormChildClass = function AcroFormChildClass() {
5922
+      AcroFormField.call(this);
5923
+
5924
+      var _parent;
5925
+
5926
+      Object.defineProperty(this, 'Parent', {
5927
+        enumerable: false,
5928
+        configurable: false,
5929
+        get: function get() {
5930
+          return _parent;
5931
+        },
5932
+        set: function set(value) {
5933
+          _parent = value;
5934
+        }
5935
+      });
5936
+
5937
+      var _optionName;
5938
+
5939
+      Object.defineProperty(this, 'optionName', {
5940
+        enumerable: false,
5941
+        configurable: true,
5942
+        get: function get() {
5943
+          return _optionName;
5944
+        },
5945
+        set: function set(value) {
5946
+          _optionName = value;
5947
+        }
5948
+      });
5949
+      var _MK = {};
5950
+      Object.defineProperty(this, 'MK', {
5951
+        enumerable: false,
5952
+        configurable: false,
5953
+        get: function get() {
5954
+          var result = [];
5955
+          result.push('<<');
5956
+          var key;
5957
+
5958
+          for (key in _MK) {
5959
+            result.push('/' + key + ' (' + _MK[key] + ')');
5960
+          }
5961
+
5962
+          result.push('>>');
5963
+          return result.join('\n');
5964
+        },
5965
+        set: function set(value) {
5966
+          if (_typeof(value) === "object") {
5967
+            _MK = value;
5968
+          }
5969
+        }
5970
+      });
5971
+      /**
5972
+      * From the PDF reference:
5973
+      * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user. 
5974
+      * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, "Button Fields"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, "Button Fields") and radio buttons (Radio Buttons in 12.7.4.2, "Button Fields").
5975
+      *
5976
+      * - '8' = Cross, 
5977
+      * - 'l' =  Circle,
5978
+      * - '' = nothing
5979
+      * @name AcroFormButton#caption
5980
+      * @type {string}
5981
+      */
5982
+
5983
+      Object.defineProperty(this, 'caption', {
5984
+        enumerable: true,
5985
+        configurable: true,
5986
+        get: function get() {
5987
+          return _MK.CA || '';
5988
+        },
5989
+        set: function set(value) {
5990
+          if (typeof value === "string") {
5991
+            _MK.CA = value;
5992
+          }
5993
+        }
5994
+      });
5995
+
5996
+      var _AS;
5997
+
5998
+      Object.defineProperty(this, 'AS', {
5999
+        enumerable: false,
6000
+        configurable: false,
6001
+        get: function get() {
6002
+          return _AS;
6003
+        },
6004
+        set: function set(value) {
6005
+          _AS = value;
6006
+        }
6007
+      });
6008
+      /**
6009
+      * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams")
6010
+      *
6011
+      * @name AcroFormButton#appearanceState
6012
+      * @type {any}
6013
+      */
6014
+
6015
+      Object.defineProperty(this, 'appearanceState', {
6016
+        enumerable: true,
6017
+        configurable: true,
6018
+        get: function get() {
6019
+          return _AS.substr(1, _AS.length - 1);
6020
+        },
6021
+        set: function set(value) {
6022
+          _AS = '/' + value;
6023
+        }
6024
+      });
6025
+      this.optionName = name;
6026
+      this.caption = 'l';
6027
+      this.appearanceState = 'Off'; // todo: set AppearanceType as variable that can be set from the
6028
+      // outside...
6029
+
6030
+      this._AppearanceType = AcroFormAppearance.RadioButton.Circle; // The Default appearanceType is the Circle
6031
+
6032
+      this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(name);
6033
+    };
6034
+
6035
+    inherit(AcroFormChildClass, AcroFormField);
6036
+
6037
+    AcroFormRadioButton.prototype.setAppearance = function (appearance) {
6038
+      if (!('createAppearanceStream' in appearance && 'getCA' in appearance)) {
6039
+        throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
6040
+        return;
6041
+      }
6042
+
6043
+      for (var objId in this.Kids) {
6044
+        if (this.Kids.hasOwnProperty(objId)) {
6045
+          var child = this.Kids[objId];
6046
+          child.appearanceStreamContent = appearance.createAppearanceStream(child.optionName);
6047
+          child.caption = appearance.getCA();
6048
+        }
6049
+      }
6050
+    };
6051
+
6052
+    AcroFormRadioButton.prototype.createOption = function (name) {
6053
+      var kidCount = this.Kids.length; // Create new Child for RadioGroup
6054
+
6055
+      var child = new AcroFormChildClass();
6056
+      child.Parent = this;
6057
+      child.optionName = name; // Add to Parent
6058
+
6059
+      this.Kids.push(child);
6060
+      addField.call(this, child);
6061
+      return child;
6062
+    };
6063
+    /**
6064
+    * @class AcroFormCheckBox
6065
+    * @extends AcroFormButton
6066
+    * @extends AcroFormField
6067
+    */
6068
+
6069
+
6070
+    var AcroFormCheckBox = function AcroFormCheckBox() {
6071
+      AcroFormButton.call(this);
6072
+      this.fontName = 'zapfdingbats';
6073
+      this.caption = '3';
6074
+      this.appearanceState = 'On';
6075
+      this.value = "On";
6076
+      this.textAlign = 'center';
6077
+      this.appearanceStreamContent = AcroFormAppearance.CheckBox.createAppearanceStream();
6078
+    };
6079
+
6080
+    inherit(AcroFormCheckBox, AcroFormButton);
6081
+    /**
6082
+    * @class AcroFormTextField
6083
+    * @extends AcroFormField
6084
+    */
6085
+
6086
+    var AcroFormTextField = function AcroFormTextField() {
6087
+      AcroFormField.call(this);
6088
+      this.FT = '/Tx';
6089
+      /**
6090
+      * If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line. 
6091
+      *
6092
+      * @name AcroFormTextField#multiline
6093
+      * @type {boolean}
6094
+      */
6095
+
6096
+      Object.defineProperty(this, 'multiline', {
6097
+        enumerable: true,
6098
+        configurable: true,
6099
+        get: function get() {
6100
+          return Boolean(getBitForPdf(this.Ff, 13));
6101
+        },
6102
+        set: function set(value) {
6103
+          if (Boolean(value) === true) {
6104
+            this.Ff = setBitForPdf(this.Ff, 13);
6105
+          } else {
6106
+            this.Ff = clearBitForPdf(this.Ff, 13);
6107
+          }
6108
+        }
6109
+      });
6110
+      /**
6111
+      * (PDF 1.4) If set, the text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field. 
6112
+      * 
6113
+      * @name AcroFormTextField#fileSelect
6114
+      * @type {boolean}
6115
+      */
6116
+
6117
+      Object.defineProperty(this, 'fileSelect', {
6118
+        enumerable: true,
6119
+        configurable: true,
6120
+        get: function get() {
6121
+          return Boolean(getBitForPdf(this.Ff, 21));
6122
+        },
6123
+        set: function set(value) {
6124
+          if (Boolean(value) === true) {
6125
+            this.Ff = setBitForPdf(this.Ff, 21);
6126
+          } else {
6127
+            this.Ff = clearBitForPdf(this.Ff, 21);
6128
+          }
6129
+        }
6130
+      });
6131
+      /**
6132
+      * (PDF 1.4) If set, text entered in the field shall not be spell-checked. 
6133
+      *
6134
+      * @name AcroFormTextField#doNotSpellCheck
6135
+      * @type {boolean}
6136
+      */
6137
+
6138
+      Object.defineProperty(this, 'doNotSpellCheck', {
6139
+        enumerable: true,
6140
+        configurable: true,
6141
+        get: function get() {
6142
+          return Boolean(getBitForPdf(this.Ff, 23));
6143
+        },
6144
+        set: function set(value) {
6145
+          if (Boolean(value) === true) {
6146
+            this.Ff = setBitForPdf(this.Ff, 23);
6147
+          } else {
6148
+            this.Ff = clearBitForPdf(this.Ff, 23);
6149
+          }
6150
+        }
6151
+      });
6152
+      /**
6153
+      * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for noninteractive form filling, the filler should take care not to add more character than will visibly fit in the defined area. 
6154
+      * 
6155
+      * @name AcroFormTextField#doNotScroll
6156
+      * @type {boolean}
6157
+      */
6158
+
6159
+      Object.defineProperty(this, 'doNotScroll', {
6160
+        enumerable: true,
6161
+        configurable: true,
6162
+        get: function get() {
6163
+          return Boolean(getBitForPdf(this.Ff, 24));
6164
+        },
6165
+        set: function set(value) {
6166
+          if (Boolean(value) === true) {
6167
+            this.Ff = setBitForPdf(this.Ff, 24);
6168
+          } else {
6169
+            this.Ff = clearBitForPdf(this.Ff, 24);
6170
+          }
6171
+        }
6172
+      });
6173
+      /**
6174
+      * (PDF 1.5) May be set only if the MaxLen entry is present in the text field dictionary (see Table 229) and if the Multiline, Password, and FileSelect flags are clear. If set, the field shall be automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.
6175
+      * 
6176
+      * @name AcroFormTextField#comb
6177
+      * @type {boolean}
6178
+      */
6179
+
6180
+      Object.defineProperty(this, 'comb', {
6181
+        enumerable: true,
6182
+        configurable: true,
6183
+        get: function get() {
6184
+          return Boolean(getBitForPdf(this.Ff, 25));
6185
+        },
6186
+        set: function set(value) {
6187
+          if (Boolean(value) === true) {
6188
+            this.Ff = setBitForPdf(this.Ff, 25);
6189
+          } else {
6190
+            this.Ff = clearBitForPdf(this.Ff, 25);
6191
+          }
6192
+        }
6193
+      });
6194
+      /**
6195
+      * (PDF 1.5) If set, the value of this field shall be a rich text string (see 12.7.3.4, “Rich Text Strings”). If the field has a value, the RV entry of the field dictionary (Table 222) shall specify the rich text string.
6196
+      * 
6197
+      * @name AcroFormTextField#richText
6198
+      * @type {boolean}
6199
+      */
6200
+
6201
+      Object.defineProperty(this, 'richText', {
6202
+        enumerable: true,
6203
+        configurable: true,
6204
+        get: function get() {
6205
+          return Boolean(getBitForPdf(this.Ff, 26));
6206
+        },
6207
+        set: function set(value) {
6208
+          if (Boolean(value) === true) {
6209
+            this.Ff = setBitForPdf(this.Ff, 26);
6210
+          } else {
6211
+            this.Ff = clearBitForPdf(this.Ff, 26);
6212
+          }
6213
+        }
6214
+      });
6215
+      var _MaxLen = null;
6216
+      Object.defineProperty(this, 'MaxLen', {
6217
+        enumerable: true,
6218
+        configurable: false,
6219
+        get: function get() {
6220
+          return _MaxLen;
6221
+        },
6222
+        set: function set(value) {
6223
+          _MaxLen = value;
6224
+        }
6225
+      });
6226
+      /**
6227
+      * (Optional; inheritable) The maximum length of the field’s text, in characters. 
6228
+      *
6229
+      * @name AcroFormTextField#maxLength
6230
+      * @type {number}
6231
+      */
6232
+
6233
+      Object.defineProperty(this, 'maxLength', {
6234
+        enumerable: true,
6235
+        configurable: true,
6236
+        get: function get() {
6237
+          return _MaxLen;
6238
+        },
6239
+        set: function set(value) {
6240
+          if (Number.isInteger(value)) {
6241
+            _MaxLen = value;
6242
+          }
6243
+        }
6244
+      });
6245
+      Object.defineProperty(this, 'hasAppearanceStream', {
6246
+        enumerable: true,
6247
+        configurable: true,
6248
+        get: function get() {
6249
+          return this.V || this.DV;
6250
+        }
6251
+      });
6252
+    };
6253
+
6254
+    inherit(AcroFormTextField, AcroFormField);
6255
+    /**
6256
+    * @class AcroFormPasswordField
6257
+    * @extends AcroFormTextField
6258
+    * @extends AcroFormField
6259
+    */
6260
+
6261
+    var AcroFormPasswordField = function AcroFormPasswordField() {
6262
+      AcroFormTextField.call(this);
6263
+      /**
6264
+      * If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters.
6265
+      * NOTE To protect password confidentiality, readers should never store the value of the text field in the PDF file if this flag is set. 
6266
+      *
6267
+      * @name AcroFormTextField#password
6268
+      * @type {boolean}
6269
+      */
6270
+
6271
+      Object.defineProperty(this, 'password', {
6272
+        enumerable: true,
6273
+        configurable: true,
6274
+        get: function get() {
6275
+          return Boolean(getBitForPdf(this.Ff, 14));
6276
+        },
6277
+        set: function set(value) {
6278
+          if (Boolean(value) === true) {
6279
+            this.Ff = setBitForPdf(this.Ff, 14);
6280
+          } else {
6281
+            this.Ff = clearBitForPdf(this.Ff, 14);
6282
+          }
6283
+        }
6284
+      });
6285
+      this.password = true;
6286
+    };
6287
+
6288
+    inherit(AcroFormPasswordField, AcroFormTextField); // Contains Methods for creating standard appearances
6289
+
6290
+    var AcroFormAppearance = {
6291
+      CheckBox: {
6292
+        createAppearanceStream: function createAppearanceStream() {
6293
+          var appearance = {
6294
+            N: {
6295
+              On: AcroFormAppearance.CheckBox.YesNormal
6296
+            },
6297
+            D: {
6298
+              On: AcroFormAppearance.CheckBox.YesPushDown,
6299
+              Off: AcroFormAppearance.CheckBox.OffPushDown
6300
+            }
6301
+          };
6302
+          return appearance;
6303
+        },
6304
+
6305
+        /**
6306
+          * Returns the standard On Appearance for a CheckBox
6307
+          * 
6308
+          * @returns {AcroFormXObject}
6309
+          */
6310
+        YesPushDown: function YesPushDown(formObject) {
6311
+          var xobj = createFormXObject(formObject);
6312
+          var stream = [];
6313
+          var fontKey = scope.internal.getFont(formObject.fontName, formObject.fontStyle).id;
6314
+
6315
+          var encodedColor = scope.__private__.encodeColorString(formObject.color);
6316
+
6317
+          var calcRes = calculateX(formObject, formObject.caption);
6318
+          stream.push("0.749023 g");
6319
+          stream.push("0 0 " + f2(AcroFormAppearance.internal.getWidth(formObject)) + " " + f2(AcroFormAppearance.internal.getHeight(formObject)) + " re");
6320
+          stream.push("f");
6321
+          stream.push("BMC");
6322
+          stream.push("q");
6323
+          stream.push("0 0 1 rg");
6324
+          stream.push("/" + fontKey + " " + f2(calcRes.fontSize) + " Tf " + encodedColor);
6325
+          stream.push("BT");
6326
+          stream.push(calcRes.text);
6327
+          stream.push("ET");
6328
+          stream.push("Q");
6329
+          stream.push("EMC");
6330
+          xobj.stream = stream.join("\n");
6331
+          return xobj;
6332
+        },
6333
+        YesNormal: function YesNormal(formObject) {
6334
+          var xobj = createFormXObject(formObject);
6335
+          var fontKey = scope.internal.getFont(formObject.fontName, formObject.fontStyle).id;
6336
+
6337
+          var encodedColor = scope.__private__.encodeColorString(formObject.color);
6338
+
6339
+          var stream = [];
6340
+          var height = AcroFormAppearance.internal.getHeight(formObject);
6341
+          var width = AcroFormAppearance.internal.getWidth(formObject);
6342
+          var calcRes = calculateX(formObject, formObject.caption);
6343
+          stream.push("1 g");
6344
+          stream.push("0 0 " + f2(width) + " " + f2(height) + " re");
6345
+          stream.push("f");
6346
+          stream.push("q");
6347
+          stream.push("0 0 1 rg");
6348
+          stream.push("0 0 " + f2(width - 1) + " " + f2(height - 1) + " re");
6349
+          stream.push("W");
6350
+          stream.push("n");
6351
+          stream.push("0 g");
6352
+          stream.push("BT");
6353
+          stream.push("/" + fontKey + " " + f2(calcRes.fontSize) + " Tf " + encodedColor);
6354
+          stream.push(calcRes.text);
6355
+          stream.push("ET");
6356
+          stream.push("Q");
6357
+          xobj.stream = stream.join("\n");
6358
+          return xobj;
6359
+        },
6360
+
6361
+        /**
6362
+          * Returns the standard Off Appearance for a CheckBox
6363
+          * 
6364
+          * @returns {AcroFormXObject}
6365
+          */
6366
+        OffPushDown: function OffPushDown(formObject) {
6367
+          var xobj = createFormXObject(formObject);
6368
+          var stream = [];
6369
+          stream.push("0.749023 g");
6370
+          stream.push("0 0 " + f2(AcroFormAppearance.internal.getWidth(formObject)) + " " + f2(AcroFormAppearance.internal.getHeight(formObject)) + " re");
6371
+          stream.push("f");
6372
+          xobj.stream = stream.join("\n");
6373
+          return xobj;
6374
+        }
6375
+      },
6376
+      RadioButton: {
6377
+        Circle: {
6378
+          createAppearanceStream: function createAppearanceStream(name) {
6379
+            var appearanceStreamContent = {
6380
+              D: {
6381
+                'Off': AcroFormAppearance.RadioButton.Circle.OffPushDown
6382
+              },
6383
+              N: {}
6384
+            };
6385
+            appearanceStreamContent.N[name] = AcroFormAppearance.RadioButton.Circle.YesNormal;
6386
+            appearanceStreamContent.D[name] = AcroFormAppearance.RadioButton.Circle.YesPushDown;
6387
+            return appearanceStreamContent;
6388
+          },
6389
+          getCA: function getCA() {
6390
+            return 'l';
6391
+          },
6392
+          YesNormal: function YesNormal(formObject) {
6393
+            var xobj = createFormXObject(formObject);
6394
+            var stream = []; // Make the Radius of the Circle relative to min(height, width) of formObject
6395
+
6396
+            var DotRadius = AcroFormAppearance.internal.getWidth(formObject) <= AcroFormAppearance.internal.getHeight(formObject) ? AcroFormAppearance.internal.getWidth(formObject) / 4 : AcroFormAppearance.internal.getHeight(formObject) / 4; // The Borderpadding...
6397
+
6398
+            DotRadius = Number((DotRadius * 0.9).toFixed(5));
6399
+            var c = AcroFormAppearance.internal.Bezier_C;
6400
+            var DotRadiusBezier = Number((DotRadius * c).toFixed(5));
6401
+            /*
6402
+              * The Following is a Circle created with Bezier-Curves.
6403
+              */
6404
+
6405
+            stream.push("q");
6406
+            stream.push("1 0 0 1 " + f5(AcroFormAppearance.internal.getWidth(formObject) / 2) + " " + f5(AcroFormAppearance.internal.getHeight(formObject) / 2) + " cm");
6407
+            stream.push(DotRadius + " 0 m");
6408
+            stream.push(DotRadius + " " + DotRadiusBezier + " " + DotRadiusBezier + " " + DotRadius + " 0 " + DotRadius + " c");
6409
+            stream.push("-" + DotRadiusBezier + " " + DotRadius + " -" + DotRadius + " " + DotRadiusBezier + " -" + DotRadius + " 0 c");
6410
+            stream.push("-" + DotRadius + " -" + DotRadiusBezier + " -" + DotRadiusBezier + " -" + DotRadius + " 0 -" + DotRadius + " c");
6411
+            stream.push(DotRadiusBezier + " -" + DotRadius + " " + DotRadius + " -" + DotRadiusBezier + " " + DotRadius + " 0 c");
6412
+            stream.push("f");
6413
+            stream.push("Q");
6414
+            xobj.stream = stream.join("\n");
6415
+            return xobj;
6416
+          },
6417
+          YesPushDown: function YesPushDown(formObject) {
6418
+            var xobj = createFormXObject(formObject);
6419
+            var stream = [];
6420
+            var DotRadius = AcroFormAppearance.internal.getWidth(formObject) <= AcroFormAppearance.internal.getHeight(formObject) ? AcroFormAppearance.internal.getWidth(formObject) / 4 : AcroFormAppearance.internal.getHeight(formObject) / 4; // The Borderpadding...
6421
+
6422
+            var DotRadius = Number((DotRadius * 0.9).toFixed(5)); // Save results for later use; no need to waste
6423
+            // processor ticks on doing math
6424
+
6425
+            var k = Number((DotRadius * 2).toFixed(5));
6426
+            var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));
6427
+            var dc = Number((DotRadius * AcroFormAppearance.internal.Bezier_C).toFixed(5));
6428
+            stream.push("0.749023 g");
6429
+            stream.push("q");
6430
+            stream.push("1 0 0 1 " + f5(AcroFormAppearance.internal.getWidth(formObject) / 2) + " " + f5(AcroFormAppearance.internal.getHeight(formObject) / 2) + " cm");
6431
+            stream.push(k + " 0 m");
6432
+            stream.push(k + " " + kc + " " + kc + " " + k + " 0 " + k + " c");
6433
+            stream.push("-" + kc + " " + k + " -" + k + " " + kc + " -" + k + " 0 c");
6434
+            stream.push("-" + k + " -" + kc + " -" + kc + " -" + k + " 0 -" + k + " c");
6435
+            stream.push(kc + " -" + k + " " + k + " -" + kc + " " + k + " 0 c");
6436
+            stream.push("f");
6437
+            stream.push("Q");
6438
+            stream.push("0 g");
6439
+            stream.push("q");
6440
+            stream.push("1 0 0 1 " + f5(AcroFormAppearance.internal.getWidth(formObject) / 2) + " " + f5(AcroFormAppearance.internal.getHeight(formObject) / 2) + " cm");
6441
+            stream.push(DotRadius + " 0 m");
6442
+            stream.push("" + DotRadius + " " + dc + " " + dc + " " + DotRadius + " 0 " + DotRadius + " c");
6443
+            stream.push("-" + dc + " " + DotRadius + " -" + DotRadius + " " + dc + " -" + DotRadius + " 0 c");
6444
+            stream.push("-" + DotRadius + " -" + dc + " -" + dc + " -" + DotRadius + " 0 -" + DotRadius + " c");
6445
+            stream.push(dc + " -" + DotRadius + " " + DotRadius + " -" + dc + " " + DotRadius + " 0 c");
6446
+            stream.push("f");
6447
+            stream.push("Q");
6448
+            xobj.stream = stream.join("\n");
6449
+            return xobj;
6450
+          },
6451
+          OffPushDown: function OffPushDown(formObject) {
6452
+            var xobj = createFormXObject(formObject);
6453
+            var stream = [];
6454
+            var DotRadius = AcroFormAppearance.internal.getWidth(formObject) <= AcroFormAppearance.internal.getHeight(formObject) ? AcroFormAppearance.internal.getWidth(formObject) / 4 : AcroFormAppearance.internal.getHeight(formObject) / 4; // The Borderpadding...
6455
+
6456
+            var DotRadius = Number((DotRadius * 0.9).toFixed(5)); // Save results for later use; no need to waste
6457
+            // processor ticks on doing math
6458
+
6459
+            var k = Number((DotRadius * 2).toFixed(5));
6460
+            var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));
6461
+            stream.push("0.749023 g");
6462
+            stream.push("q");
6463
+            stream.push("1 0 0 1 " + f5(AcroFormAppearance.internal.getWidth(formObject) / 2) + " " + f5(AcroFormAppearance.internal.getHeight(formObject) / 2) + " cm");
6464
+            stream.push(k + " 0 m");
6465
+            stream.push(k + " " + kc + " " + kc + " " + k + " 0 " + k + " c");
6466
+            stream.push("-" + kc + " " + k + " -" + k + " " + kc + " -" + k + " 0 c");
6467
+            stream.push("-" + k + " -" + kc + " -" + kc + " -" + k + " 0 -" + k + " c");
6468
+            stream.push(kc + " -" + k + " " + k + " -" + kc + " " + k + " 0 c");
6469
+            stream.push("f");
6470
+            stream.push("Q");
6471
+            xobj.stream = stream.join("\n");
6472
+            return xobj;
6473
+          }
6474
+        },
6475
+        Cross: {
6476
+          /**
6477
+            * Creates the Actual AppearanceDictionary-References
6478
+            * 
6479
+            * @param {string} name
6480
+            * @returns {Object}
6481
+            * @ignore
6482
+            */
6483
+          createAppearanceStream: function createAppearanceStream(name) {
6484
+            var appearanceStreamContent = {
6485
+              D: {
6486
+                'Off': AcroFormAppearance.RadioButton.Cross.OffPushDown
6487
+              },
6488
+              N: {}
6489
+            };
6490
+            appearanceStreamContent.N[name] = AcroFormAppearance.RadioButton.Cross.YesNormal;
6491
+            appearanceStreamContent.D[name] = AcroFormAppearance.RadioButton.Cross.YesPushDown;
6492
+            return appearanceStreamContent;
6493
+          },
6494
+          getCA: function getCA() {
6495
+            return '8';
6496
+          },
6497
+          YesNormal: function YesNormal(formObject) {
6498
+            var xobj = createFormXObject(formObject);
6499
+            var stream = [];
6500
+            var cross = AcroFormAppearance.internal.calculateCross(formObject);
6501
+            stream.push("q");
6502
+            stream.push("1 1 " + f2(AcroFormAppearance.internal.getWidth(formObject) - 2) + " " + f2(AcroFormAppearance.internal.getHeight(formObject) - 2) + " re");
6503
+            stream.push("W");
6504
+            stream.push("n");
6505
+            stream.push(f2(cross.x1.x) + " " + f2(cross.x1.y) + " m");
6506
+            stream.push(f2(cross.x2.x) + " " + f2(cross.x2.y) + " l");
6507
+            stream.push(f2(cross.x4.x) + " " + f2(cross.x4.y) + " m");
6508
+            stream.push(f2(cross.x3.x) + " " + f2(cross.x3.y) + " l");
6509
+            stream.push("s");
6510
+            stream.push("Q");
6511
+            xobj.stream = stream.join("\n");
6512
+            return xobj;
6513
+          },
6514
+          YesPushDown: function YesPushDown(formObject) {
6515
+            var xobj = createFormXObject(formObject);
6516
+            var cross = AcroFormAppearance.internal.calculateCross(formObject);
6517
+            var stream = [];
6518
+            stream.push("0.749023 g");
6519
+            stream.push("0 0 " + f2(AcroFormAppearance.internal.getWidth(formObject)) + " " + f2(AcroFormAppearance.internal.getHeight(formObject)) + " re");
6520
+            stream.push("f");
6521
+            stream.push("q");
6522
+            stream.push("1 1 " + f2(AcroFormAppearance.internal.getWidth(formObject) - 2) + " " + f2(AcroFormAppearance.internal.getHeight(formObject) - 2) + " re");
6523
+            stream.push("W");
6524
+            stream.push("n");
6525
+            stream.push(f2(cross.x1.x) + " " + f2(cross.x1.y) + " m");
6526
+            stream.push(f2(cross.x2.x) + " " + f2(cross.x2.y) + " l");
6527
+            stream.push(f2(cross.x4.x) + " " + f2(cross.x4.y) + " m");
6528
+            stream.push(f2(cross.x3.x) + " " + f2(cross.x3.y) + " l");
6529
+            stream.push("s");
6530
+            stream.push("Q");
6531
+            xobj.stream = stream.join("\n");
6532
+            return xobj;
6533
+          },
6534
+          OffPushDown: function OffPushDown(formObject) {
6535
+            var xobj = createFormXObject(formObject);
6536
+            var stream = [];
6537
+            stream.push("0.749023 g");
6538
+            stream.push("0 0 " + f2(AcroFormAppearance.internal.getWidth(formObject)) + " " + f2(AcroFormAppearance.internal.getHeight(formObject)) + " re");
6539
+            stream.push("f");
6540
+            xobj.stream = stream.join("\n");
6541
+            return xobj;
6542
+          }
6543
+        }
6544
+      },
6545
+
6546
+      /**
6547
+        * Returns the standard Appearance
6548
+        * 
6549
+        * @returns {AcroFormXObject}
6550
+        */
6551
+      createDefaultAppearanceStream: function createDefaultAppearanceStream(formObject) {
6552
+        // Set Helvetica to Standard Font (size: auto)
6553
+        // Color: Black
6554
+        var fontKey = scope.internal.getFont(formObject.fontName, formObject.fontStyle).id;
6555
+
6556
+        var encodedColor = scope.__private__.encodeColorString(formObject.color);
6557
+
6558
+        var fontSize = formObject.fontSize;
6559
+        var result = '/' + fontKey + ' ' + fontSize + ' Tf ' + encodedColor;
6560
+        return result;
6561
+      }
6562
+    };
6563
+    AcroFormAppearance.internal = {
6564
+      Bezier_C: 0.551915024494,
6565
+      calculateCross: function calculateCross(formObject) {
6566
+        var width = AcroFormAppearance.internal.getWidth(formObject);
6567
+        var height = AcroFormAppearance.internal.getHeight(formObject);
6568
+        var a = Math.min(width, height);
6569
+
6570
+        var cross = {
6571
+          x1: {
6572
+            // upperLeft
6573
+            x: (width - a) / 2,
6574
+            y: (height - a) / 2 + a // height - borderPadding
6575
+
6576
+          },
6577
+          x2: {
6578
+            // lowerRight
6579
+            x: (width - a) / 2 + a,
6580
+            y: (height - a) / 2 // borderPadding
6581
+
6582
+          },
6583
+          x3: {
6584
+            // lowerLeft
6585
+            x: (width - a) / 2,
6586
+            y: (height - a) / 2 // borderPadding
6587
+
6588
+          },
6589
+          x4: {
6590
+            // upperRight
6591
+            x: (width - a) / 2 + a,
6592
+            y: (height - a) / 2 + a // height - borderPadding
6593
+
6594
+          }
6595
+        };
6596
+        return cross;
6597
+      }
6598
+    };
6599
+
6600
+    AcroFormAppearance.internal.getWidth = function (formObject) {
6601
+      var result = 0;
6602
+
6603
+      if (_typeof(formObject) === "object") {
6604
+        result = scale(formObject.Rect[2]);
6605
+      }
6606
+
6607
+      return result;
6608
+    };
6609
+
6610
+    AcroFormAppearance.internal.getHeight = function (formObject) {
6611
+      var result = 0;
6612
+
6613
+      if (_typeof(formObject) === "object") {
6614
+        result = scale(formObject.Rect[3]);
6615
+      }
6616
+
6617
+      return result;
6618
+    }; // Public:
6619
+
6620
+    /**
6621
+    * Add an AcroForm-Field to the jsPDF-instance
6622
+    *
6623
+    * @name addField
6624
+    * @function 
6625
+    * @instance
6626
+    * @param {Object} fieldObject
6627
+    * @returns {jsPDF}
6628
+    */
6629
+
6630
+
6631
+    var addField = jsPDFAPI.addField = function (fieldObject) {
6632
+      initializeAcroForm.call(this);
6633
+
6634
+      if (fieldObject instanceof AcroFormField) {
6635
+        putForm.call(this, fieldObject);
6636
+      } else {
6637
+        throw new Error('Invalid argument passed to jsPDF.addField.');
6638
+      }
6639
+
6640
+      fieldObject.page = scope.internal.getCurrentPageInfo().pageNumber;
6641
+      return this;
6642
+    };
6643
+    /**
6644
+    * @name addButton
6645
+    * @function
6646
+    * @instance
6647
+    * @param {AcroFormButton} options
6648
+    * @returns {jsPDF}
6649
+    * @deprecated
6650
+    */
6651
+
6652
+
6653
+    var addButton = jsPDFAPI.addButton = function (button) {
6654
+      if (button instanceof AcroFormButton === false) {
6655
+        throw new Error('Invalid argument passed to jsPDF.addButton.');
6656
+      }
6657
+
6658
+      return addField.call(this, button);
6659
+    };
6660
+    /**
6661
+    * @name addTextField
6662
+    * @function
6663
+    * @instance
6664
+    * @param {AcroFormTextField} textField
6665
+    * @returns {jsPDF}
6666
+    * @deprecated
6667
+    */
6668
+
6669
+
6670
+    var addTextField = jsPDFAPI.addTextField = function (textField) {
6671
+      if (textField instanceof AcroFormTextField === false) {
6672
+        throw new Error('Invalid argument passed to jsPDF.addTextField.');
6673
+      }
6674
+
6675
+      return addField.call(this, textField);
6676
+    };
6677
+    /**
6678
+    * @name addChoiceField
6679
+    * @function
6680
+    * @instance
6681
+    * @param {AcroFormChoiceField} 
6682
+    * @returns {jsPDF}
6683
+    * @deprecated
6684
+    */
6685
+
6686
+
6687
+    var addChoiceField = jsPDFAPI.addChoiceField = function (choiceField) {
6688
+      if (choiceField instanceof AcroFormChoiceField === false) {
6689
+        throw new Error('Invalid argument passed to jsPDF.addChoiceField.');
6690
+      }
6691
+
6692
+      return addField.call(this, choiceField);
6693
+    };
6694
+
6695
+    if (_typeof(globalObj) == "object" && typeof globalObj["ChoiceField"] === "undefined" && typeof globalObj["ListBox"] === "undefined" && typeof globalObj["ComboBox"] === "undefined" && typeof globalObj["EditBox"] === "undefined" && typeof globalObj["Button"] === "undefined" && typeof globalObj["PushButton"] === "undefined" && typeof globalObj["RadioButton"] === "undefined" && typeof globalObj["CheckBox"] === "undefined" && typeof globalObj["TextField"] === "undefined" && typeof globalObj["PasswordField"] === "undefined") {
6696
+      globalObj["ChoiceField"] = AcroFormChoiceField;
6697
+      globalObj["ListBox"] = AcroFormListBox;
6698
+      globalObj["ComboBox"] = AcroFormComboBox;
6699
+      globalObj["EditBox"] = AcroFormEditBox;
6700
+      globalObj["Button"] = AcroFormButton;
6701
+      globalObj["PushButton"] = AcroFormPushButton;
6702
+      globalObj["RadioButton"] = AcroFormRadioButton;
6703
+      globalObj["CheckBox"] = AcroFormCheckBox;
6704
+      globalObj["TextField"] = AcroFormTextField;
6705
+      globalObj["PasswordField"] = AcroFormPasswordField; // backwardsCompatibility
6706
+
6707
+      globalObj["AcroForm"] = {
6708
+        Appearance: AcroFormAppearance
6709
+      };
6710
+    } else {
6711
+      console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already.");
6712
+    }
6713
+
6714
+    jsPDFAPI.AcroFormChoiceField = AcroFormChoiceField;
6715
+    jsPDFAPI.AcroFormListBox = AcroFormListBox;
6716
+    jsPDFAPI.AcroFormComboBox = AcroFormComboBox;
6717
+    jsPDFAPI.AcroFormEditBox = AcroFormEditBox;
6718
+    jsPDFAPI.AcroFormButton = AcroFormButton;
6719
+    jsPDFAPI.AcroFormPushButton = AcroFormPushButton;
6720
+    jsPDFAPI.AcroFormRadioButton = AcroFormRadioButton;
6721
+    jsPDFAPI.AcroFormCheckBox = AcroFormCheckBox;
6722
+    jsPDFAPI.AcroFormTextField = AcroFormTextField;
6723
+    jsPDFAPI.AcroFormPasswordField = AcroFormPasswordField;
6724
+    jsPDFAPI.AcroFormAppearance = AcroFormAppearance;
6725
+    jsPDFAPI.AcroForm = {
6726
+      ChoiceField: AcroFormChoiceField,
6727
+      ListBox: AcroFormListBox,
6728
+      ComboBox: AcroFormComboBox,
6729
+      EditBox: AcroFormEditBox,
6730
+      Button: AcroFormButton,
6731
+      PushButton: AcroFormPushButton,
6732
+      RadioButton: AcroFormRadioButton,
6733
+      CheckBox: AcroFormCheckBox,
6734
+      TextField: AcroFormTextField,
6735
+      PasswordField: AcroFormPasswordField,
6736
+      Appearance: AcroFormAppearance
6737
+    };
6738
+  })(jsPDF.API, typeof window !== "undefined" && window || typeof global !== "undefined" && global);
6739
+
6740
+  /** @license
6741
+   * jsPDF addImage plugin
6742
+   * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
6743
+   *               2013 Chris Dowling, https://github.com/gingerchris
6744
+   *               2013 Trinh Ho, https://github.com/ineedfat
6745
+   *               2013 Edwin Alejandro Perez, https://github.com/eaparango
6746
+   *               2013 Norah Smith, https://github.com/burnburnrocket
6747
+   *               2014 Diego Casorran, https://github.com/diegocr
6748
+   *               2014 James Robb, https://github.com/jamesbrobb
6749
+   *
6750
+   * 
6751
+   */
6752
+
6753
+  /**
6754
+  * @name addImage
6755
+  * @module
6756
+  */
6757
+  (function (jsPDFAPI) {
6758
+
6759
+    var namespace = 'addImage_';
6760
+    var imageFileTypeHeaders = {
6761
+      PNG: [[0x89, 0x50, 0x4e, 0x47]],
6762
+      TIFF: [[0x4D, 0x4D, 0x00, 0x2A], //Motorola
6763
+      [0x49, 0x49, 0x2A, 0x00] //Intel
6764
+      ],
6765
+      JPEG: [[0xFF, 0xD8, 0xFF, 0xE0, undefined, undefined, 0x4A, 0x46, 0x49, 0x46, 0x00], //JFIF
6766
+      [0xFF, 0xD8, 0xFF, 0xE1, undefined, undefined, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00] //Exif
6767
+      ],
6768
+      JPEG2000: [[0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20]],
6769
+      GIF87a: [[0x47, 0x49, 0x46, 0x38, 0x37, 0x61]],
6770
+      GIF89a: [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61]],
6771
+      BMP: [[0x42, 0x4D], //BM - Windows 3.1x, 95, NT, ... etc.
6772
+      [0x42, 0x41], //BA - OS/2 struct bitmap array
6773
+      [0x43, 0x49], //CI - OS/2 struct color icon
6774
+      [0x43, 0x50], //CP - OS/2 const color pointer
6775
+      [0x49, 0x43], //IC - OS/2 struct icon
6776
+      [0x50, 0x54] //PT - OS/2 pointer
6777
+      ]
6778
+    };
6779
+    /**
6780
+    * Recognize filetype of Image by magic-bytes
6781
+    * 
6782
+    * https://en.wikipedia.org/wiki/List_of_file_signatures
6783
+    *
6784
+    * @name getImageFileTypeByImageData
6785
+    * @public
6786
+    * @function
6787
+    * @param {string|arraybuffer} imageData imageData as binary String or arraybuffer
6788
+    * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG'
6789
+    * 
6790
+    * @returns {string} filetype of Image
6791
+    */
6792
+
6793
+    var getImageFileTypeByImageData = jsPDFAPI.getImageFileTypeByImageData = function (imageData, fallbackFormat) {
6794
+      fallbackFormat = fallbackFormat || 'UNKNOWN';
6795
+      var i;
6796
+      var j;
6797
+      var result = 'UNKNOWN';
6798
+      var headerSchemata;
6799
+      var compareResult;
6800
+      var fileType;
6801
+
6802
+      if (jsPDFAPI.isArrayBufferView(imageData)) {
6803
+        imageData = jsPDFAPI.arrayBufferToBinaryString(imageData);
6804
+      }
6805
+
6806
+      for (fileType in imageFileTypeHeaders) {
6807
+        headerSchemata = imageFileTypeHeaders[fileType];
6808
+
6809
+        for (i = 0; i < headerSchemata.length; i += 1) {
6810
+          compareResult = true;
6811
+
6812
+          for (j = 0; j < headerSchemata[i].length; j += 1) {
6813
+            if (headerSchemata[i][j] === undefined) {
6814
+              continue;
6815
+            }
6816
+
6817
+            if (headerSchemata[i][j] !== imageData.charCodeAt(j)) {
6818
+              compareResult = false;
6819
+              break;
6820
+            }
6821
+          }
6822
+
6823
+          if (compareResult === true) {
6824
+            result = fileType;
6825
+            break;
6826
+          }
6827
+        }
6828
+      }
6829
+
6830
+      if (result === 'UNKNOWN' && fallbackFormat !== 'UNKNOWN') {
6831
+        console.warn('FileType of Image not recognized. Processing image as "' + fallbackFormat + '".');
6832
+        result = fallbackFormat;
6833
+      }
6834
+
6835
+      return result;
6836
+    }; // Image functionality ported from pdf.js
6837
+
6838
+
6839
+    var putImage = function putImage(img) {
6840
+      var objectNumber = this.internal.newObject(),
6841
+          out = this.internal.write,
6842
+          putStream = this.internal.putStream,
6843
+          getFilters = this.internal.getFilters;
6844
+      var filters = getFilters();
6845
+
6846
+      while (filters.indexOf('FlateEncode') !== -1) {
6847
+        filters.splice(filters.indexOf('FlateEncode'), 1);
6848
+      }
6849
+
6850
+      img['n'] = objectNumber;
6851
+      var additionalKeyValues = [];
6852
+      additionalKeyValues.push({
6853
+        key: 'Type',
6854
+        value: '/XObject'
6855
+      });
6856
+      additionalKeyValues.push({
6857
+        key: 'Subtype',
6858
+        value: '/Image'
6859
+      });
6860
+      additionalKeyValues.push({
6861
+        key: 'Width',
6862
+        value: img['w']
6863
+      });
6864
+      additionalKeyValues.push({
6865
+        key: 'Height',
6866
+        value: img['h']
6867
+      });
6868
+
6869
+      if (img['cs'] === this.color_spaces.INDEXED) {
6870
+        additionalKeyValues.push({
6871
+          key: 'ColorSpace',
6872
+          value: '[/Indexed /DeviceRGB ' // if an indexed png defines more than one colour with transparency, we've created a smask
6873
+          + (img['pal'].length / 3 - 1) + ' ' + ('smask' in img ? objectNumber + 2 : objectNumber + 1) + ' 0 R]'
6874
+        });
6875
+      } else {
6876
+        additionalKeyValues.push({
6877
+          key: 'ColorSpace',
6878
+          value: '/' + img['cs']
6879
+        });
6880
+
6881
+        if (img['cs'] === this.color_spaces.DEVICE_CMYK) {
6882
+          additionalKeyValues.push({
6883
+            key: 'Decode',
6884
+            value: '[1 0 1 0 1 0 1 0]'
6885
+          });
6886
+        }
6887
+      }
6888
+
6889
+      additionalKeyValues.push({
6890
+        key: 'BitsPerComponent',
6891
+        value: img['bpc']
6892
+      });
6893
+
6894
+      if ('dp' in img) {
6895
+        additionalKeyValues.push({
6896
+          key: 'DecodeParms',
6897
+          value: '<<' + img['dp'] + '>>'
6898
+        });
6899
+      }
6900
+
6901
+      if ('trns' in img && img['trns'].constructor == Array) {
6902
+        var trns = '',
6903
+            i = 0,
6904
+            len = img['trns'].length;
6905
+
6906
+        for (; i < len; i++) {
6907
+          trns += img['trns'][i] + ' ' + img['trns'][i] + ' ';
6908
+        }
6909
+
6910
+        additionalKeyValues.push({
6911
+          key: 'Mask',
6912
+          value: '[' + trns + ']'
6913
+        });
6914
+      }
6915
+
6916
+      if ('smask' in img) {
6917
+        additionalKeyValues.push({
6918
+          key: 'SMask',
6919
+          value: objectNumber + 1 + ' 0 R'
6920
+        });
6921
+      }
6922
+
6923
+      var alreadyAppliedFilters = typeof img['f'] !== "undefined" ? ['/' + img['f']] : undefined;
6924
+      putStream({
6925
+        data: img['data'],
6926
+        additionalKeyValues: additionalKeyValues,
6927
+        alreadyAppliedFilters: alreadyAppliedFilters
6928
+      });
6929
+      out('endobj'); // Soft mask
6930
+
6931
+      if ('smask' in img) {
6932
+        var dp = '/Predictor ' + img['p'] + ' /Colors 1 /BitsPerComponent ' + img['bpc'] + ' /Columns ' + img['w'];
6933
+        var smask = {
6934
+          'w': img['w'],
6935
+          'h': img['h'],
6936
+          'cs': 'DeviceGray',
6937
+          'bpc': img['bpc'],
6938
+          'dp': dp,
6939
+          'data': img['smask']
6940
+        };
6941
+        if ('f' in img) smask.f = img['f'];
6942
+        putImage.call(this, smask);
6943
+      } //Palette
6944
+
6945
+
6946
+      if (img['cs'] === this.color_spaces.INDEXED) {
6947
+        this.internal.newObject(); //out('<< /Filter / ' + img['f'] +' /Length ' + img['pal'].length + '>>');
6948
+        //putStream(zlib.compress(img['pal']));
6949
+
6950
+        putStream({
6951
+          data: this.arrayBufferToBinaryString(new Uint8Array(img['pal']))
6952
+        });
6953
+        out('endobj');
6954
+      }
6955
+    },
6956
+        putResourcesCallback = function putResourcesCallback() {
6957
+      var images = this.internal.collections[namespace + 'images'];
6958
+
6959
+      for (var i in images) {
6960
+        putImage.call(this, images[i]);
6961
+      }
6962
+    },
6963
+        putXObjectsDictCallback = function putXObjectsDictCallback() {
6964
+      var images = this.internal.collections[namespace + 'images'],
6965
+          out = this.internal.write,
6966
+          image;
6967
+
6968
+      for (var i in images) {
6969
+        image = images[i];
6970
+        out('/I' + image['i'], image['n'], '0', 'R');
6971
+      }
6972
+    },
6973
+        checkCompressValue = function checkCompressValue(value) {
6974
+      if (value && typeof value === 'string') value = value.toUpperCase();
6975
+      return value in jsPDFAPI.image_compression ? value : jsPDFAPI.image_compression.NONE;
6976
+    },
6977
+        getImages = function getImages() {
6978
+      var images = this.internal.collections[namespace + 'images']; //first run, so initialise stuff
6979
+
6980
+      if (!images) {
6981
+        this.internal.collections[namespace + 'images'] = images = {};
6982
+        this.internal.events.subscribe('putResources', putResourcesCallback);
6983
+        this.internal.events.subscribe('putXobjectDict', putXObjectsDictCallback);
6984
+      }
6985
+
6986
+      return images;
6987
+    },
6988
+        getImageIndex = function getImageIndex(images) {
6989
+      var imageIndex = 0;
6990
+
6991
+      if (images) {
6992
+        // this is NOT the first time this method is ran on this instance of jsPDF object.
6993
+        imageIndex = Object.keys ? Object.keys(images).length : function (o) {
6994
+          var i = 0;
6995
+
6996
+          for (var e in o) {
6997
+            if (o.hasOwnProperty(e)) {
6998
+              i++;
6999
+            }
7000
+          }
7001
+
7002
+          return i;
7003
+        }(images);
7004
+      }
7005
+
7006
+      return imageIndex;
7007
+    },
7008
+        notDefined = function notDefined(value) {
7009
+      return typeof value === 'undefined' || value === null || value.length === 0;
7010
+    },
7011
+        generateAliasFromImageData = function generateAliasFromImageData(imageData) {
7012
+      if (typeof imageData === 'string') {
7013
+        return jsPDFAPI.sHashCode(imageData);
7014
+      }
7015
+
7016
+      if (jsPDFAPI.isArrayBufferView(imageData)) {
7017
+        return jsPDFAPI.sHashCode(jsPDFAPI.arrayBufferToBinaryString(imageData));
7018
+      }
7019
+
7020
+      return null;
7021
+    },
7022
+        isImageTypeSupported = function isImageTypeSupported(type) {
7023
+      return typeof jsPDFAPI["process" + type.toUpperCase()] === "function";
7024
+    },
7025
+        isDOMElement = function isDOMElement(object) {
7026
+      return _typeof(object) === 'object' && object.nodeType === 1;
7027
+    },
7028
+        createDataURIFromElement = function createDataURIFromElement(element, format) {
7029
+      //if element is an image which uses data url definition, just return the dataurl
7030
+      if (element.nodeName === 'IMG' && element.hasAttribute('src')) {
7031
+        var src = '' + element.getAttribute('src'); //is base64 encoded dataUrl, directly process it
7032
+
7033
+        if (src.indexOf('data:image/') === 0) {
7034
+          return unescape(src);
7035
+        } //it is probably an url, try to load it
7036
+
7037
+
7038
+        var tmpImageData = jsPDFAPI.loadFile(src);
7039
+
7040
+        if (tmpImageData !== undefined) {
7041
+          return btoa(tmpImageData);
7042
+        }
7043
+      }
7044
+
7045
+      if (element.nodeName === 'CANVAS') {
7046
+        var canvas = element;
7047
+        return element.toDataURL('image/jpeg', 1.0);
7048
+      } //absolute fallback method
7049
+
7050
+
7051
+      var canvas = document.createElement('canvas');
7052
+      canvas.width = element.clientWidth || element.width;
7053
+      canvas.height = element.clientHeight || element.height;
7054
+      var ctx = canvas.getContext('2d');
7055
+
7056
+      if (!ctx) {
7057
+        throw 'addImage requires canvas to be supported by browser.';
7058
+      }
7059
+
7060
+      ctx.drawImage(element, 0, 0, canvas.width, canvas.height);
7061
+      return canvas.toDataURL(('' + format).toLowerCase() == 'png' ? 'image/png' : 'image/jpeg');
7062
+    },
7063
+        checkImagesForAlias = function checkImagesForAlias(alias, images) {
7064
+      var cached_info;
7065
+
7066
+      if (images) {
7067
+        for (var e in images) {
7068
+          if (alias === images[e].alias) {
7069
+            cached_info = images[e];
7070
+            break;
7071
+          }
7072
+        }
7073
+      }
7074
+
7075
+      return cached_info;
7076
+    },
7077
+        determineWidthAndHeight = function determineWidthAndHeight(w, h, info) {
7078
+      if (!w && !h) {
7079
+        w = -96;
7080
+        h = -96;
7081
+      }
7082
+
7083
+      if (w < 0) {
7084
+        w = -1 * info['w'] * 72 / w / this.internal.scaleFactor;
7085
+      }
7086
+
7087
+      if (h < 0) {
7088
+        h = -1 * info['h'] * 72 / h / this.internal.scaleFactor;
7089
+      }
7090
+
7091
+      if (w === 0) {
7092
+        w = h * info['w'] / info['h'];
7093
+      }
7094
+
7095
+      if (h === 0) {
7096
+        h = w * info['h'] / info['w'];
7097
+      }
7098
+
7099
+      return [w, h];
7100
+    },
7101
+        writeImageToPDF = function writeImageToPDF(x, y, w, h, info, index, images, rotation) {
7102
+      var dims = determineWidthAndHeight.call(this, w, h, info),
7103
+          coord = this.internal.getCoordinateString,
7104
+          vcoord = this.internal.getVerticalCoordinateString;
7105
+      w = dims[0];
7106
+      h = dims[1];
7107
+      images[index] = info;
7108
+
7109
+      if (rotation) {
7110
+        rotation *= Math.PI / 180;
7111
+        var c = Math.cos(rotation);
7112
+        var s = Math.sin(rotation); //like in pdf Reference do it 4 digits instead of 2
7113
+
7114
+        var f4 = function f4(number) {
7115
+          return number.toFixed(4);
7116
+        };
7117
+
7118
+        var rotationTransformationMatrix = [f4(c), f4(s), f4(s * -1), f4(c), 0, 0, 'cm'];
7119
+      }
7120
+
7121
+      this.internal.write('q'); //Save graphics state
7122
+
7123
+      if (rotation) {
7124
+        this.internal.write([1, '0', '0', 1, coord(x), vcoord(y + h), 'cm'].join(' ')); //Translate
7125
+
7126
+        this.internal.write(rotationTransformationMatrix.join(' ')); //Rotate
7127
+
7128
+        this.internal.write([coord(w), '0', '0', coord(h), '0', '0', 'cm'].join(' ')); //Scale
7129
+      } else {
7130
+        this.internal.write([coord(w), '0', '0', coord(h), coord(x), vcoord(y + h), 'cm'].join(' ')); //Translate and Scale
7131
+      }
7132
+
7133
+      this.internal.write('/I' + info['i'] + ' Do'); //Paint Image
7134
+
7135
+      this.internal.write('Q'); //Restore graphics state
7136
+    };
7137
+    /**
7138
+     * COLOR SPACES
7139
+     */
7140
+
7141
+
7142
+    jsPDFAPI.color_spaces = {
7143
+      DEVICE_RGB: 'DeviceRGB',
7144
+      DEVICE_GRAY: 'DeviceGray',
7145
+      DEVICE_CMYK: 'DeviceCMYK',
7146
+      CAL_GREY: 'CalGray',
7147
+      CAL_RGB: 'CalRGB',
7148
+      LAB: 'Lab',
7149
+      ICC_BASED: 'ICCBased',
7150
+      INDEXED: 'Indexed',
7151
+      PATTERN: 'Pattern',
7152
+      SEPARATION: 'Separation',
7153
+      DEVICE_N: 'DeviceN'
7154
+    };
7155
+    /**
7156
+     * DECODE METHODS
7157
+     */
7158
+
7159
+    jsPDFAPI.decode = {
7160
+      DCT_DECODE: 'DCTDecode',
7161
+      FLATE_DECODE: 'FlateDecode',
7162
+      LZW_DECODE: 'LZWDecode',
7163
+      JPX_DECODE: 'JPXDecode',
7164
+      JBIG2_DECODE: 'JBIG2Decode',
7165
+      ASCII85_DECODE: 'ASCII85Decode',
7166
+      ASCII_HEX_DECODE: 'ASCIIHexDecode',
7167
+      RUN_LENGTH_DECODE: 'RunLengthDecode',
7168
+      CCITT_FAX_DECODE: 'CCITTFaxDecode'
7169
+    };
7170
+    /**
7171
+     * IMAGE COMPRESSION TYPES
7172
+     */
7173
+
7174
+    jsPDFAPI.image_compression = {
7175
+      NONE: 'NONE',
7176
+      FAST: 'FAST',
7177
+      MEDIUM: 'MEDIUM',
7178
+      SLOW: 'SLOW'
7179
+    };
7180
+    /**
7181
+    * @name sHashCode
7182
+    * @function 
7183
+    * @param {string} str
7184
+    * @returns {string} 
7185
+    */
7186
+
7187
+    jsPDFAPI.sHashCode = function (str) {
7188
+      str = str || "";
7189
+      var hash = 0,
7190
+          i,
7191
+          chr;
7192
+      if (str.length === 0) return hash;
7193
+
7194
+      for (i = 0; i < str.length; i++) {
7195
+        chr = str.charCodeAt(i);
7196
+        hash = (hash << 5) - hash + chr;
7197
+        hash |= 0; // Convert to 32bit integer
7198
+      }
7199
+
7200
+      return hash;
7201
+    };
7202
+    /**
7203
+    * @name isString
7204
+    * @function
7205
+    * @param {any} object
7206
+    * @returns {boolean} 
7207
+    */
7208
+
7209
+
7210
+    jsPDFAPI.isString = function (object) {
7211
+      return typeof object === 'string';
7212
+    };
7213
+    /**
7214
+    * Validates if given String is a valid Base64-String
7215
+    *
7216
+    * @name validateStringAsBase64
7217
+    * @public
7218
+    * @function
7219
+    * @param {String} possible Base64-String
7220
+    * 
7221
+    * @returns {boolean}
7222
+    */
7223
+
7224
+
7225
+    jsPDFAPI.validateStringAsBase64 = function (possibleBase64String) {
7226
+      possibleBase64String = possibleBase64String || '';
7227
+      possibleBase64String.toString().trim();
7228
+      var result = true;
7229
+
7230
+      if (possibleBase64String.length === 0) {
7231
+        result = false;
7232
+      }
7233
+
7234
+      if (possibleBase64String.length % 4 !== 0) {
7235
+        result = false;
7236
+      }
7237
+
7238
+      if (/^[A-Za-z0-9+\/]+$/.test(possibleBase64String.substr(0, possibleBase64String.length - 2)) === false) {
7239
+        result = false;
7240
+      }
7241
+
7242
+      if (/^[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==$/.test(possibleBase64String.substr(-2)) === false) {
7243
+        result = false;
7244
+      }
7245
+
7246
+      return result;
7247
+    };
7248
+    /**
7249
+     * Strips out and returns info from a valid base64 data URI
7250
+     *
7251
+     * @name extractInfoFromBase64DataURI
7252
+     * @function 
7253
+     * @param {string} dataUrl a valid data URI of format 'data:[<MIME-type>][;base64],<data>'
7254
+     * @returns {Array}an Array containing the following
7255
+     * [0] the complete data URI
7256
+     * [1] <MIME-type>
7257
+     * [2] format - the second part of the mime-type i.e 'png' in 'image/png'
7258
+     * [4] <data>
7259
+     */
7260
+
7261
+
7262
+    jsPDFAPI.extractInfoFromBase64DataURI = function (dataURI) {
7263
+      return /^data:([\w]+?\/([\w]+?));\S*;*base64,(.+)$/g.exec(dataURI);
7264
+    };
7265
+    /**
7266
+     * Strips out and returns info from a valid base64 data URI
7267
+     *
7268
+     * @name extractImageFromDataUrl
7269
+     * @function 
7270
+     * @param {string} dataUrl a valid data URI of format 'data:[<MIME-type>][;base64],<data>'
7271
+     * @returns {Array}an Array containing the following
7272
+     * [0] the complete data URI
7273
+     * [1] <MIME-type>
7274
+     * [2] format - the second part of the mime-type i.e 'png' in 'image/png'
7275
+     * [4] <data>
7276
+     */
7277
+
7278
+
7279
+    jsPDFAPI.extractImageFromDataUrl = function (dataUrl) {
7280
+      dataUrl = dataUrl || '';
7281
+      var dataUrlParts = dataUrl.split('base64,');
7282
+      var result = null;
7283
+
7284
+      if (dataUrlParts.length === 2) {
7285
+        var extractedInfo = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(dataUrlParts[0]);
7286
+
7287
+        if (Array.isArray(extractedInfo)) {
7288
+          result = {
7289
+            mimeType: extractedInfo[1],
7290
+            charset: extractedInfo[2],
7291
+            data: dataUrlParts[1]
7292
+          };
7293
+        }
7294
+      }
7295
+
7296
+      return result;
7297
+    };
7298
+    /**
7299
+     * Check to see if ArrayBuffer is supported
7300
+     * 
7301
+     * @name supportsArrayBuffer
7302
+     * @function
7303
+     * @returns {boolean}
7304
+     */
7305
+
7306
+
7307
+    jsPDFAPI.supportsArrayBuffer = function () {
7308
+      return typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined';
7309
+    };
7310
+    /**
7311
+     * Tests supplied object to determine if ArrayBuffer
7312
+     *
7313
+     * @name isArrayBuffer
7314
+     * @function 
7315
+     * @param {Object} object an Object
7316
+     * 
7317
+     * @returns {boolean}
7318
+     */
7319
+
7320
+
7321
+    jsPDFAPI.isArrayBuffer = function (object) {
7322
+      if (!this.supportsArrayBuffer()) return false;
7323
+      return object instanceof ArrayBuffer;
7324
+    };
7325
+    /**
7326
+     * Tests supplied object to determine if it implements the ArrayBufferView (TypedArray) interface
7327
+     *
7328
+     * @name isArrayBufferView
7329
+     * @function 
7330
+     * @param {Object} object an Object
7331
+     * @returns {boolean}
7332
+     */
7333
+
7334
+
7335
+    jsPDFAPI.isArrayBufferView = function (object) {
7336
+      if (!this.supportsArrayBuffer()) return false;
7337
+      if (typeof Uint32Array === 'undefined') return false;
7338
+      return object instanceof Int8Array || object instanceof Uint8Array || typeof Uint8ClampedArray !== 'undefined' && object instanceof Uint8ClampedArray || object instanceof Int16Array || object instanceof Uint16Array || object instanceof Int32Array || object instanceof Uint32Array || object instanceof Float32Array || object instanceof Float64Array;
7339
+    };
7340
+    /**
7341
+    * Convert the Buffer to a Binary String
7342
+    *
7343
+    * @name binaryStringToUint8Array
7344
+    * @public
7345
+    * @function
7346
+    * @param {ArrayBuffer} BinaryString with ImageData
7347
+    * 
7348
+    * @returns {Uint8Array}
7349
+    */
7350
+
7351
+
7352
+    jsPDFAPI.binaryStringToUint8Array = function (binary_string) {
7353
+      /*
7354
+       * not sure how efficient this will be will bigger files. Is there a native method?
7355
+       */
7356
+      var len = binary_string.length;
7357
+      var bytes = new Uint8Array(len);
7358
+
7359
+      for (var i = 0; i < len; i++) {
7360
+        bytes[i] = binary_string.charCodeAt(i);
7361
+      }
7362
+
7363
+      return bytes;
7364
+    };
7365
+    /**
7366
+    * Convert the Buffer to a Binary String
7367
+    *
7368
+    * @name arrayBufferToBinaryString
7369
+    * @public
7370
+    * @function
7371
+    * @param {ArrayBuffer} ArrayBuffer with ImageData
7372
+    * 
7373
+    * @returns {String}
7374
+    */
7375
+
7376
+
7377
+    jsPDFAPI.arrayBufferToBinaryString = function (buffer) {
7378
+      // if (typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.reduce !== 'undefined') {
7379
+      // return new Uint8Array(buffer).reduce(function (data, byte) {
7380
+      // return data.push(String.fromCharCode(byte)), data;
7381
+      // }, []).join('');
7382
+      // }
7383
+      if (typeof atob === "function") {
7384
+        return atob(this.arrayBufferToBase64(buffer));
7385
+      }
7386
+    };
7387
+    /**
7388
+    * Converts an ArrayBuffer directly to base64
7389
+    *
7390
+    * Taken from  http://jsperf.com/encoding-xhr-image-data/31
7391
+    *
7392
+    * Need to test if this is a better solution for larger files
7393
+    *
7394
+    * @name arrayBufferToBase64
7395
+    * @param {arraybuffer} arrayBuffer
7396
+    * @public
7397
+    * @function
7398
+    * 
7399
+    * @returns {string}
7400
+    */
7401
+
7402
+
7403
+    jsPDFAPI.arrayBufferToBase64 = function (arrayBuffer) {
7404
+      var base64 = '';
7405
+      var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
7406
+      var bytes = new Uint8Array(arrayBuffer);
7407
+      var byteLength = bytes.byteLength;
7408
+      var byteRemainder = byteLength % 3;
7409
+      var mainLength = byteLength - byteRemainder;
7410
+      var a, b, c, d;
7411
+      var chunk; // Main loop deals with bytes in chunks of 3
7412
+
7413
+      for (var i = 0; i < mainLength; i = i + 3) {
7414
+        // Combine the three bytes into a single integer
7415
+        chunk = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2]; // Use bitmasks to extract 6-bit segments from the triplet
7416
+
7417
+        a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
7418
+
7419
+        b = (chunk & 258048) >> 12; // 258048   = (2^6 - 1) << 12
7420
+
7421
+        c = (chunk & 4032) >> 6; // 4032     = (2^6 - 1) << 6
7422
+
7423
+        d = chunk & 63; // 63       = 2^6 - 1
7424
+        // Convert the raw binary segments to the appropriate ASCII encoding
7425
+
7426
+        base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
7427
+      } // Deal with the remaining bytes and padding
7428
+
7429
+
7430
+      if (byteRemainder == 1) {
7431
+        chunk = bytes[mainLength];
7432
+        a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
7433
+        // Set the 4 least significant bits to zero
7434
+
7435
+        b = (chunk & 3) << 4; // 3   = 2^2 - 1
7436
+
7437
+        base64 += encodings[a] + encodings[b] + '==';
7438
+      } else if (byteRemainder == 2) {
7439
+        chunk = bytes[mainLength] << 8 | bytes[mainLength + 1];
7440
+        a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
7441
+
7442
+        b = (chunk & 1008) >> 4; // 1008  = (2^6 - 1) << 4
7443
+        // Set the 2 least significant bits to zero
7444
+
7445
+        c = (chunk & 15) << 2; // 15    = 2^4 - 1
7446
+
7447
+        base64 += encodings[a] + encodings[b] + encodings[c] + '=';
7448
+      }
7449
+
7450
+      return base64;
7451
+    };
7452
+    /**
7453
+    * 
7454
+    * @name createImageInfo
7455
+    * @param {Object} data 
7456
+    * @param {number} wd width
7457
+    * @param {number} ht height
7458
+    * @param {Object} cs colorSpace
7459
+    * @param {number} bpc bits per channel
7460
+    * @param {any} f 
7461
+    * @param {number} imageIndex
7462
+    * @param {string} alias
7463
+    * @param {any} dp
7464
+    * @param {any} trns
7465
+    * @param {any} pal
7466
+    * @param {any} smask
7467
+    * @param {any} p
7468
+    * @public
7469
+    * @function
7470
+    * 
7471
+    * @returns {Object}
7472
+    */
7473
+
7474
+
7475
+    jsPDFAPI.createImageInfo = function (data, wd, ht, cs, bpc, f, imageIndex, alias, dp, trns, pal, smask, p) {
7476
+      var info = {
7477
+        alias: alias,
7478
+        w: wd,
7479
+        h: ht,
7480
+        cs: cs,
7481
+        bpc: bpc,
7482
+        i: imageIndex,
7483
+        data: data // n: objectNumber will be added by putImage code
7484
+
7485
+      };
7486
+      if (f) info.f = f;
7487
+      if (dp) info.dp = dp;
7488
+      if (trns) info.trns = trns;
7489
+      if (pal) info.pal = pal;
7490
+      if (smask) info.smask = smask;
7491
+      if (p) info.p = p; // predictor parameter for PNG compression
7492
+
7493
+      return info;
7494
+    };
7495
+    /**
7496
+    * Adds an Image to the PDF.
7497
+    *
7498
+    * @name addImage
7499
+    * @public
7500
+    * @function
7501
+    * @param {string/Image-Element/Canvas-Element/Uint8Array} imageData imageData as base64 encoded DataUrl or Image-HTMLElement or Canvas-HTMLElement
7502
+    * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG'
7503
+    * @param {number} x x Coordinate (in units declared at inception of PDF document) against left edge of the page
7504
+    * @param {number} y y Coordinate (in units declared at inception of PDF document) against upper edge of the page
7505
+    * @param {number} width width of the image (in units declared at inception of PDF document)
7506
+    * @param {number} height height of the Image (in units declared at inception of PDF document)
7507
+    * @param {string} alias alias of the image (if used multiple times)
7508
+    * @param {string} compression compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'
7509
+    * @param {number} rotation rotation of the image in degrees (0-359)
7510
+    * 
7511
+    * @returns jsPDF
7512
+    */
7513
+
7514
+
7515
+    jsPDFAPI.addImage = function (imageData, format, x, y, w, h, alias, compression, rotation) {
7516
+
7517
+      var tmpImageData = '';
7518
+
7519
+      if (typeof format !== 'string') {
7520
+        var tmp = h;
7521
+        h = w;
7522
+        w = y;
7523
+        y = x;
7524
+        x = format;
7525
+        format = tmp;
7526
+      }
7527
+
7528
+      if (_typeof(imageData) === 'object' && !isDOMElement(imageData) && "imageData" in imageData) {
7529
+        var options = imageData;
7530
+        imageData = options.imageData;
7531
+        format = options.format || format || 'UNKNOWN';
7532
+        x = options.x || x || 0;
7533
+        y = options.y || y || 0;
7534
+        w = options.w || w;
7535
+        h = options.h || h;
7536
+        alias = options.alias || alias;
7537
+        compression = options.compression || compression;
7538
+        rotation = options.rotation || options.angle || rotation;
7539
+      } //If compression is not explicitly set, determine if we should use compression
7540
+
7541
+
7542
+      var filters = this.internal.getFilters();
7543
+
7544
+      if (compression === undefined && filters.indexOf('FlateEncode') !== -1) {
7545
+        compression = 'SLOW';
7546
+      }
7547
+
7548
+      if (typeof imageData === "string") {
7549
+        imageData = unescape(imageData);
7550
+      }
7551
+
7552
+      if (isNaN(x) || isNaN(y)) {
7553
+        console.error('jsPDF.addImage: Invalid coordinates', arguments);
7554
+        throw new Error('Invalid coordinates passed to jsPDF.addImage');
7555
+      }
7556
+
7557
+      var images = getImages.call(this),
7558
+          info,
7559
+          dataAsBinaryString;
7560
+
7561
+      if (!(info = checkImagesForAlias(imageData, images))) {
7562
+        if (isDOMElement(imageData)) imageData = createDataURIFromElement(imageData, format);
7563
+        if (notDefined(alias)) alias = generateAliasFromImageData(imageData);
7564
+
7565
+        if (!(info = checkImagesForAlias(alias, images))) {
7566
+          if (this.isString(imageData)) {
7567
+            tmpImageData = this.convertStringToImageData(imageData);
7568
+
7569
+            if (tmpImageData !== '') {
7570
+              imageData = tmpImageData;
7571
+            } else {
7572
+              tmpImageData = jsPDFAPI.loadFile(imageData);
7573
+
7574
+              if (tmpImageData !== undefined) {
7575
+                imageData = tmpImageData;
7576
+              }
7577
+            }
7578
+          }
7579
+
7580
+          format = this.getImageFileTypeByImageData(imageData, format);
7581
+          if (!isImageTypeSupported(format)) throw new Error('addImage does not support files of type \'' + format + '\', please ensure that a plugin for \'' + format + '\' support is added.');
7582
+          /**
7583
+           * need to test if it's more efficient to convert all binary strings
7584
+           * to TypedArray - or should we just leave and process as string?
7585
+           */
7586
+
7587
+          if (this.supportsArrayBuffer()) {
7588
+            // no need to convert if imageData is already uint8array
7589
+            if (!(imageData instanceof Uint8Array)) {
7590
+              dataAsBinaryString = imageData;
7591
+              imageData = this.binaryStringToUint8Array(imageData);
7592
+            }
7593
+          }
7594
+
7595
+          info = this['process' + format.toUpperCase()](imageData, getImageIndex(images), alias, checkCompressValue(compression), dataAsBinaryString);
7596
+
7597
+          if (!info) {
7598
+            throw new Error('An unknown error occurred whilst processing the image');
7599
+          }
7600
+        }
7601
+      }
7602
+
7603
+      writeImageToPDF.call(this, x, y, w, h, info, info.i, images, rotation);
7604
+      return this;
7605
+    };
7606
+    /**
7607
+    * @name convertStringToImageData
7608
+    * @function
7609
+    * @param {string} stringData
7610
+    * @returns {string} binary data
7611
+    */
7612
+
7613
+
7614
+    jsPDFAPI.convertStringToImageData = function (stringData) {
7615
+      var base64Info;
7616
+      var imageData = '';
7617
+      var rawData;
7618
+
7619
+      if (this.isString(stringData)) {
7620
+        var base64Info = this.extractImageFromDataUrl(stringData);
7621
+        rawData = base64Info !== null ? base64Info.data : stringData;
7622
+
7623
+        try {
7624
+          imageData = atob(rawData);
7625
+        } catch (e) {
7626
+          if (!jsPDFAPI.validateStringAsBase64(rawData)) {
7627
+            throw new Error('Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ');
7628
+          } else {
7629
+            throw new Error('atob-Error in jsPDF.convertStringToImageData ' + e.message);
7630
+          }
7631
+        }
7632
+      }
7633
+
7634
+      return imageData;
7635
+    };
7636
+    /**
7637
+     * JPEG SUPPORT
7638
+     **/
7639
+    //takes a string imgData containing the raw bytes of
7640
+    //a jpeg image and returns [width, height]
7641
+    //Algorithm from: http://www.64lines.com/jpeg-width-height
7642
+
7643
+
7644
+    var getJpegSize = function getJpegSize(imgData) {
7645
+
7646
+      var width, height, numcomponents; // Verify we have a valid jpeg header 0xff,0xd8,0xff,0xe0,?,?,'J','F','I','F',0x00
7647
+
7648
+      if (getImageFileTypeByImageData(imgData) !== 'JPEG') {
7649
+        throw new Error('getJpegSize requires a binary string jpeg file');
7650
+      }
7651
+
7652
+      var blockLength = imgData.charCodeAt(4) * 256 + imgData.charCodeAt(5);
7653
+      var i = 4,
7654
+          len = imgData.length;
7655
+
7656
+      while (i < len) {
7657
+        i += blockLength;
7658
+
7659
+        if (imgData.charCodeAt(i) !== 0xff) {
7660
+          throw new Error('getJpegSize could not find the size of the image');
7661
+        }
7662
+
7663
+        if (imgData.charCodeAt(i + 1) === 0xc0 || //(SOF) Huffman  - Baseline DCT
7664
+        imgData.charCodeAt(i + 1) === 0xc1 || //(SOF) Huffman  - Extended sequential DCT
7665
+        imgData.charCodeAt(i + 1) === 0xc2 || // Progressive DCT (SOF2)
7666
+        imgData.charCodeAt(i + 1) === 0xc3 || // Spatial (sequential) lossless (SOF3)
7667
+        imgData.charCodeAt(i + 1) === 0xc4 || // Differential sequential DCT (SOF5)
7668
+        imgData.charCodeAt(i + 1) === 0xc5 || // Differential progressive DCT (SOF6)
7669
+        imgData.charCodeAt(i + 1) === 0xc6 || // Differential spatial (SOF7)
7670
+        imgData.charCodeAt(i + 1) === 0xc7) {
7671
+          height = imgData.charCodeAt(i + 5) * 256 + imgData.charCodeAt(i + 6);
7672
+          width = imgData.charCodeAt(i + 7) * 256 + imgData.charCodeAt(i + 8);
7673
+          numcomponents = imgData.charCodeAt(i + 9);
7674
+          return [width, height, numcomponents];
7675
+        } else {
7676
+          i += 2;
7677
+          blockLength = imgData.charCodeAt(i) * 256 + imgData.charCodeAt(i + 1);
7678
+        }
7679
+      }
7680
+    },
7681
+        getJpegSizeFromBytes = function getJpegSizeFromBytes(data) {
7682
+      var hdr = data[0] << 8 | data[1];
7683
+      if (hdr !== 0xFFD8) throw new Error('Supplied data is not a JPEG');
7684
+      var len = data.length,
7685
+          block = (data[4] << 8) + data[5],
7686
+          pos = 4,
7687
+          bytes,
7688
+          width,
7689
+          height,
7690
+          numcomponents;
7691
+
7692
+      while (pos < len) {
7693
+        pos += block;
7694
+        bytes = readBytes(data, pos);
7695
+        block = (bytes[2] << 8) + bytes[3];
7696
+
7697
+        if ((bytes[1] === 0xC0 || bytes[1] === 0xC2) && bytes[0] === 0xFF && block > 7) {
7698
+          bytes = readBytes(data, pos + 5);
7699
+          width = (bytes[2] << 8) + bytes[3];
7700
+          height = (bytes[0] << 8) + bytes[1];
7701
+          numcomponents = bytes[4];
7702
+          return {
7703
+            width: width,
7704
+            height: height,
7705
+            numcomponents: numcomponents
7706
+          };
7707
+        }
7708
+
7709
+        pos += 2;
7710
+      }
7711
+
7712
+      throw new Error('getJpegSizeFromBytes could not find the size of the image');
7713
+    },
7714
+        readBytes = function readBytes(data, offset) {
7715
+      return data.subarray(offset, offset + 5);
7716
+    };
7717
+    /**
7718
+    * @ignore
7719
+    */
7720
+
7721
+
7722
+    jsPDFAPI.processJPEG = function (data, index, alias, compression, dataAsBinaryString, colorSpace) {
7723
+
7724
+      var filter = this.decode.DCT_DECODE,
7725
+          bpc = 8,
7726
+          dims;
7727
+
7728
+      if (!this.isString(data) && !this.isArrayBuffer(data) && !this.isArrayBufferView(data)) {
7729
+        return null;
7730
+      }
7731
+
7732
+      if (this.isString(data)) {
7733
+        dims = getJpegSize(data);
7734
+      }
7735
+
7736
+      if (this.isArrayBuffer(data)) {
7737
+        data = new Uint8Array(data);
7738
+      }
7739
+
7740
+      if (this.isArrayBufferView(data)) {
7741
+        dims = getJpegSizeFromBytes(data); // if we already have a stored binary string rep use that
7742
+
7743
+        data = dataAsBinaryString || this.arrayBufferToBinaryString(data);
7744
+      }
7745
+
7746
+      if (colorSpace === undefined) {
7747
+        switch (dims.numcomponents) {
7748
+          case 1:
7749
+            colorSpace = this.color_spaces.DEVICE_GRAY;
7750
+            break;
7751
+
7752
+          case 4:
7753
+            colorSpace = this.color_spaces.DEVICE_CMYK;
7754
+            break;
7755
+
7756
+          default:
7757
+          case 3:
7758
+            colorSpace = this.color_spaces.DEVICE_RGB;
7759
+            break;
7760
+        }
7761
+      }
7762
+
7763
+      return this.createImageInfo(data, dims.width, dims.height, colorSpace, bpc, filter, index, alias);
7764
+    };
7765
+    /**
7766
+    * @ignore
7767
+    */
7768
+
7769
+
7770
+    jsPDFAPI.processJPG = function ()
7771
+    /*data, index, alias, compression, dataAsBinaryString*/
7772
+    {
7773
+      return this.processJPEG.apply(this, arguments);
7774
+    };
7775
+    /**
7776
+    * @name getImageProperties
7777
+    * @function
7778
+    * @param {Object} imageData
7779
+    * @returns {Object}
7780
+    */
7781
+
7782
+
7783
+    jsPDFAPI.getImageProperties = function (imageData) {
7784
+      var info;
7785
+      var tmpImageData = '';
7786
+      var format;
7787
+
7788
+      if (isDOMElement(imageData)) {
7789
+        imageData = createDataURIFromElement(imageData);
7790
+      }
7791
+
7792
+      if (this.isString(imageData)) {
7793
+        tmpImageData = this.convertStringToImageData(imageData);
7794
+
7795
+        if (tmpImageData !== '') {
7796
+          imageData = tmpImageData;
7797
+        } else {
7798
+          tmpImageData = jsPDFAPI.loadFile(imageData);
7799
+
7800
+          if (tmpImageData !== undefined) {
7801
+            imageData = tmpImageData;
7802
+          }
7803
+        }
7804
+      }
7805
+
7806
+      format = this.getImageFileTypeByImageData(imageData);
7807
+
7808
+      if (!isImageTypeSupported(format)) {
7809
+        throw new Error('addImage does not support files of type \'' + format + '\', please ensure that a plugin for \'' + format + '\' support is added.');
7810
+      }
7811
+      /**
7812
+       * need to test if it's more efficient to convert all binary strings
7813
+       * to TypedArray - or should we just leave and process as string?
7814
+       */
7815
+
7816
+
7817
+      if (this.supportsArrayBuffer()) {
7818
+        // no need to convert if imageData is already uint8array
7819
+        if (!(imageData instanceof Uint8Array)) {
7820
+          imageData = this.binaryStringToUint8Array(imageData);
7821
+        }
7822
+      }
7823
+
7824
+      info = this['process' + format.toUpperCase()](imageData);
7825
+
7826
+      if (!info) {
7827
+        throw new Error('An unknown error occurred whilst processing the image');
7828
+      }
7829
+
7830
+      return {
7831
+        fileType: format,
7832
+        width: info.w,
7833
+        height: info.h,
7834
+        colorSpace: info.cs,
7835
+        compressionMode: info.f,
7836
+        bitsPerComponent: info.bpc
7837
+      };
7838
+    };
7839
+  })(jsPDF.API);
7840
+
7841
+  /**
7842
+   * @license
7843
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
7844
+   *
7845
+   * Licensed under the MIT License.
7846
+   * http://opensource.org/licenses/mit-license
7847
+   */
7848
+
7849
+  /**
7850
+   * jsPDF Annotations PlugIn
7851
+   *
7852
+   * There are many types of annotations in a PDF document. Annotations are placed
7853
+   * on a page at a particular location. They are not 'attached' to an object.
7854
+   * <br />
7855
+   * This plugin current supports <br />
7856
+   * <li> Goto Page (set pageNumber and top in options)
7857
+   * <li> Goto Name (set name and top in options)
7858
+   * <li> Goto URL (set url in options)
7859
+   * <p>
7860
+   * 	The destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below)
7861
+   *  (set magFactor in options).  XYZ is the default.
7862
+   * </p>
7863
+   * <p>
7864
+   *  Links, Text, Popup, and FreeText are supported.
7865
+   * </p>
7866
+   * <p>
7867
+   * Options In PDF spec Not Implemented Yet
7868
+   * <li> link border
7869
+   * <li> named target
7870
+   * <li> page coordinates
7871
+   * <li> destination page scaling and layout
7872
+   * <li> actions other than URL and GotoPage
7873
+   * <li> background / hover actions
7874
+   * </p>
7875
+   * @name annotations
7876
+   * @module
7877
+   */
7878
+
7879
+  /*
7880
+      Destination Magnification Factors
7881
+      See PDF 1.3 Page 386 for meanings and options
7882
+
7883
+      [supported]
7884
+  	XYZ (options; left top zoom)
7885
+  	Fit (no options)
7886
+  	FitH (options: top)
7887
+  	FitV (options: left)
7888
+
7889
+  	[not supported]
7890
+  	FitR
7891
+  	FitB
7892
+  	FitBH
7893
+  	FitBV
7894
+   */
7895
+  (function (jsPDFAPI) {
7896
+
7897
+    jsPDF.API.events.push(['addPage', function (addPageData) {
7898
+      var pageInfo = this.internal.getPageInfo(addPageData.pageNumber);
7899
+      pageInfo.pageContext.annotations = [];
7900
+    }]);
7901
+    jsPDFAPI.events.push(['putPage', function (putPageData) {
7902
+      var pageInfo = this.internal.getPageInfoByObjId(putPageData.objId);
7903
+      var pageAnnos = putPageData.pageContext.annotations;
7904
+
7905
+      var notEmpty = function notEmpty(obj) {
7906
+        if (typeof obj != 'undefined') {
7907
+          if (obj != '') {
7908
+            return true;
7909
+          }
7910
+        }
7911
+      };
7912
+
7913
+      var found = false;
7914
+
7915
+      for (var a = 0; a < pageAnnos.length && !found; a++) {
7916
+        var anno = pageAnnos[a];
7917
+
7918
+        switch (anno.type) {
7919
+          case 'link':
7920
+            if (notEmpty(anno.options.url) || notEmpty(anno.options.pageNumber)) {
7921
+              found = true;
7922
+              break;
7923
+            }
7924
+
7925
+          case 'reference':
7926
+          case 'text':
7927
+          case 'freetext':
7928
+            found = true;
7929
+            break;
7930
+        }
7931
+      }
7932
+
7933
+      if (found == false) {
7934
+        return;
7935
+      }
7936
+
7937
+      this.internal.write("/Annots [");
7938
+      var pageHeight = this.internal.pageSize.height;
7939
+      var getHorizontalCoordinateString = this.internal.getCoordinateString;
7940
+      var getVerticalCoordinateString = this.internal.getVerticalCoordinateString;
7941
+
7942
+      for (var a = 0; a < pageAnnos.length; a++) {
7943
+        var anno = pageAnnos[a];
7944
+
7945
+        switch (anno.type) {
7946
+          case 'reference':
7947
+            // References to Widget Annotations (for AcroForm Fields)
7948
+            this.internal.write(' ' + anno.object.objId + ' 0 R ');
7949
+            break;
7950
+
7951
+          case 'text':
7952
+            // Create a an object for both the text and the popup
7953
+            var objText = this.internal.newAdditionalObject();
7954
+            var objPopup = this.internal.newAdditionalObject();
7955
+            var title = anno.title || 'Note';
7956
+            var rect = "/Rect [" + getHorizontalCoordinateString(anno.bounds.x) + " " + getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) + " " + getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) + " " + getVerticalCoordinateString(anno.bounds.y) + "] ";
7957
+            line = '<</Type /Annot /Subtype /' + 'Text' + ' ' + rect + '/Contents (' + anno.contents + ')';
7958
+            line += ' /Popup ' + objPopup.objId + " 0 R";
7959
+            line += ' /P ' + pageInfo.objId + " 0 R";
7960
+            line += ' /T (' + title + ') >>';
7961
+            objText.content = line;
7962
+            var parent = objText.objId + ' 0 R';
7963
+            var popoff = 30;
7964
+            var rect = "/Rect [" + getHorizontalCoordinateString(anno.bounds.x + popoff) + " " + getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) + " " + getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w + popoff) + " " + getVerticalCoordinateString(anno.bounds.y) + "] ";
7965
+            line = '<</Type /Annot /Subtype /' + 'Popup' + ' ' + rect + ' /Parent ' + parent;
7966
+
7967
+            if (anno.open) {
7968
+              line += ' /Open true';
7969
+            }
7970
+
7971
+            line += ' >>';
7972
+            objPopup.content = line;
7973
+            this.internal.write(objText.objId, '0 R', objPopup.objId, '0 R');
7974
+            break;
7975
+
7976
+          case 'freetext':
7977
+            var rect = "/Rect [" + getHorizontalCoordinateString(anno.bounds.x) + " " + getVerticalCoordinateString(anno.bounds.y) + " " + getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) + " " + getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) + "] ";
7978
+            var color = anno.color || '#000000';
7979
+            line = '<</Type /Annot /Subtype /' + 'FreeText' + ' ' + rect + '/Contents (' + anno.contents + ')';
7980
+            line += ' /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#' + color + ')';
7981
+            line += ' /Border [0 0 0]';
7982
+            line += ' >>';
7983
+            this.internal.write(line);
7984
+            break;
7985
+
7986
+          case 'link':
7987
+            if (anno.options.name) {
7988
+              var loc = this.annotations._nameMap[anno.options.name];
7989
+              anno.options.pageNumber = loc.page;
7990
+              anno.options.top = loc.y;
7991
+            } else {
7992
+              if (!anno.options.top) {
7993
+                anno.options.top = 0;
7994
+              }
7995
+            }
7996
+
7997
+            var rect = "/Rect [" + getHorizontalCoordinateString(anno.x) + " " + getVerticalCoordinateString(anno.y) + " " + getHorizontalCoordinateString(anno.x + anno.w) + " " + getVerticalCoordinateString(anno.y + anno.h) + "] ";
7998
+            var line = '';
7999
+
8000
+            if (anno.options.url) {
8001
+              line = '<</Type /Annot /Subtype /Link ' + rect + '/Border [0 0 0] /A <</S /URI /URI (' + anno.options.url + ') >>';
8002
+            } else if (anno.options.pageNumber) {
8003
+              // first page is 0
8004
+              var info = this.internal.getPageInfo(anno.options.pageNumber);
8005
+              line = '<</Type /Annot /Subtype /Link ' + rect + '/Border [0 0 0] /Dest [' + info.objId + " 0 R";
8006
+              anno.options.magFactor = anno.options.magFactor || "XYZ";
8007
+
8008
+              switch (anno.options.magFactor) {
8009
+                case 'Fit':
8010
+                  line += ' /Fit]';
8011
+                  break;
8012
+
8013
+                case 'FitH':
8014
+                  line += ' /FitH ' + anno.options.top + ']';
8015
+                  break;
8016
+
8017
+                case 'FitV':
8018
+                  anno.options.left = anno.options.left || 0;
8019
+                  line += ' /FitV ' + anno.options.left + ']';
8020
+                  break;
8021
+
8022
+                case 'XYZ':
8023
+                default:
8024
+                  var top = getVerticalCoordinateString(anno.options.top);
8025
+                  anno.options.left = anno.options.left || 0; // 0 or null zoom will not change zoom factor
8026
+
8027
+                  if (typeof anno.options.zoom === 'undefined') {
8028
+                    anno.options.zoom = 0;
8029
+                  }
8030
+
8031
+                  line += ' /XYZ ' + anno.options.left + ' ' + top + ' ' + anno.options.zoom + ']';
8032
+                  break;
8033
+              }
8034
+            }
8035
+
8036
+            if (line != '') {
8037
+              line += " >>";
8038
+              this.internal.write(line);
8039
+            }
8040
+
8041
+            break;
8042
+        }
8043
+      }
8044
+
8045
+      this.internal.write("]");
8046
+    }]);
8047
+    /**
8048
+    * @name createAnnotation
8049
+    * @function
8050
+    * @param {Object} options 
8051
+    */
8052
+
8053
+    jsPDFAPI.createAnnotation = function (options) {
8054
+      var pageInfo = this.internal.getCurrentPageInfo();
8055
+
8056
+      switch (options.type) {
8057
+        case 'link':
8058
+          this.link(options.bounds.x, options.bounds.y, options.bounds.w, options.bounds.h, options);
8059
+          break;
8060
+
8061
+        case 'text':
8062
+        case 'freetext':
8063
+          pageInfo.pageContext.annotations.push(options);
8064
+          break;
8065
+      }
8066
+    };
8067
+    /**
8068
+     * Create a link
8069
+     *
8070
+     * valid options
8071
+     * <li> pageNumber or url [required]
8072
+     * <p>If pageNumber is specified, top and zoom may also be specified</p>
8073
+     * @name link
8074
+     * @function
8075
+     * @param {number} x
8076
+     * @param {number} y
8077
+     * @param {number} w
8078
+     * @param {number} h
8079
+     * @param {Object} options
8080
+     */
8081
+
8082
+
8083
+    jsPDFAPI.link = function (x, y, w, h, options) {
8084
+      var pageInfo = this.internal.getCurrentPageInfo();
8085
+      pageInfo.pageContext.annotations.push({
8086
+        x: x,
8087
+        y: y,
8088
+        w: w,
8089
+        h: h,
8090
+        options: options,
8091
+        type: 'link'
8092
+      });
8093
+    };
8094
+    /**
8095
+     * Currently only supports single line text.
8096
+     * Returns the width of the text/link
8097
+     *
8098
+     * @name textWithLink
8099
+     * @function
8100
+     * @param {string} text
8101
+     * @param {number} x
8102
+     * @param {number} y
8103
+     * @param {Object} options
8104
+     * @returns {number} width the width of the text/link
8105
+     */
8106
+
8107
+
8108
+    jsPDFAPI.textWithLink = function (text, x, y, options) {
8109
+      var width = this.getTextWidth(text);
8110
+      var height = this.internal.getLineHeight() / this.internal.scaleFactor;
8111
+      this.text(text, x, y); //TODO We really need the text baseline height to do this correctly.
8112
+      // Or ability to draw text on top, bottom, center, or baseline.
8113
+
8114
+      y += height * .2;
8115
+      this.link(x, y - height, width, height, options);
8116
+      return width;
8117
+    }; //TODO move into external library
8118
+
8119
+    /**
8120
+    * @name getTextWidth
8121
+    * @function
8122
+    * @param {string} text
8123
+    * @returns {number} txtWidth
8124
+    */
8125
+
8126
+
8127
+    jsPDFAPI.getTextWidth = function (text) {
8128
+      var fontSize = this.internal.getFontSize();
8129
+      var txtWidth = this.getStringUnitWidth(text) * fontSize / this.internal.scaleFactor;
8130
+      return txtWidth;
8131
+    };
8132
+
8133
+    return this;
8134
+  })(jsPDF.API);
8135
+
8136
+  /**
8137
+   * @license
8138
+   * Copyright (c) 2017 Aras Abbasi 
8139
+   *
8140
+   * Licensed under the MIT License.
8141
+   * http://opensource.org/licenses/mit-license
8142
+   */
8143
+
8144
+  /**
8145
+  * jsPDF arabic parser PlugIn
8146
+  *
8147
+  * @name arabic
8148
+  * @module
8149
+  */
8150
+  (function (jsPDFAPI) {
8151
+    /**
8152
+     * Arabic shape substitutions: char code => (isolated, final, initial, medial).
8153
+     * Arabic Substition A
8154
+     */
8155
+
8156
+    var arabicSubstitionA = {
8157
+      0x0621: [0xFE80],
8158
+      // ARABIC LETTER HAMZA 
8159
+      0x0622: [0xFE81, 0xFE82],
8160
+      // ARABIC LETTER ALEF WITH MADDA ABOVE
8161
+      0x0623: [0xFE83, 0xFE84],
8162
+      // ARABIC LETTER ALEF WITH HAMZA ABOVE
8163
+      0x0624: [0xFE85, 0xFE86],
8164
+      // ARABIC LETTER WAW WITH HAMZA ABOVE
8165
+      0x0625: [0xFE87, 0xFE88],
8166
+      // ARABIC LETTER ALEF WITH HAMZA BELOW
8167
+      0x0626: [0xFE89, 0xFE8A, 0xFE8B, 0xFE8C],
8168
+      // ARABIC LETTER YEH WITH HAMZA ABOVE 
8169
+      0x0627: [0xFE8D, 0xFE8E],
8170
+      // ARABIC LETTER ALEF
8171
+      0x0628: [0xFE8F, 0xFE90, 0xFE91, 0xFE92],
8172
+      // ARABIC LETTER BEH
8173
+      0x0629: [0xFE93, 0xFE94],
8174
+      // ARABIC LETTER TEH MARBUTA 
8175
+      0x062A: [0xFE95, 0xFE96, 0xFE97, 0xFE98],
8176
+      // ARABIC LETTER TEH
8177
+      0x062B: [0xFE99, 0xFE9A, 0xFE9B, 0xFE9C],
8178
+      // ARABIC LETTER THEH
8179
+      0x062C: [0xFE9D, 0xFE9E, 0xFE9F, 0xFEA0],
8180
+      // ARABIC LETTER JEEM
8181
+      0x062D: [0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4],
8182
+      // ARABIC LETTER HAH
8183
+      0x062E: [0xFEA5, 0xFEA6, 0xFEA7, 0xFEA8],
8184
+      // ARABIC LETTER KHAH
8185
+      0x062F: [0xFEA9, 0xFEAA],
8186
+      // ARABIC LETTER DAL
8187
+      0x0630: [0xFEAB, 0xFEAC],
8188
+      // ARABIC LETTER THAL
8189
+      0x0631: [0xFEAD, 0xFEAE],
8190
+      // ARABIC LETTER REH
8191
+      0x0632: [0xFEAF, 0xFEB0],
8192
+      // ARABIC LETTER ZAIN
8193
+      0x0633: [0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4],
8194
+      // ARABIC LETTER SEEN
8195
+      0x0634: [0xFEB5, 0xFEB6, 0xFEB7, 0xFEB8],
8196
+      // ARABIC LETTER SHEEN 
8197
+      0x0635: [0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC],
8198
+      // ARABIC LETTER SAD
8199
+      0x0636: [0xFEBD, 0xFEBE, 0xFEBF, 0xFEC0],
8200
+      // ARABIC LETTER DAD
8201
+      0x0637: [0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4],
8202
+      // ARABIC LETTER TAH
8203
+      0x0638: [0xFEC5, 0xFEC6, 0xFEC7, 0xFEC8],
8204
+      // ARABIC LETTER ZAH
8205
+      0x0639: [0xFEC9, 0xFECA, 0xFECB, 0xFECC],
8206
+      // ARABIC LETTER AIN
8207
+      0x063A: [0xFECD, 0xFECE, 0xFECF, 0xFED0],
8208
+      // ARABIC LETTER GHAIN 
8209
+      0x0641: [0xFED1, 0xFED2, 0xFED3, 0xFED4],
8210
+      // ARABIC LETTER FEH
8211
+      0x0642: [0xFED5, 0xFED6, 0xFED7, 0xFED8],
8212
+      // ARABIC LETTER QAF
8213
+      0x0643: [0xFED9, 0xFEDA, 0xFEDB, 0xFEDC],
8214
+      // ARABIC LETTER KAF
8215
+      0x0644: [0xFEDD, 0xFEDE, 0xFEDF, 0xFEE0],
8216
+      // ARABIC LETTER LAM
8217
+      0x0645: [0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4],
8218
+      // ARABIC LETTER MEEM
8219
+      0x0646: [0xFEE5, 0xFEE6, 0xFEE7, 0xFEE8],
8220
+      // ARABIC LETTER NOON 
8221
+      0x0647: [0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC],
8222
+      // ARABIC LETTER HEH
8223
+      0x0648: [0xFEED, 0xFEEE],
8224
+      // ARABIC LETTER WAW
8225
+      0x0649: [0xFEEF, 0xFEF0, 64488, 64489],
8226
+      // ARABIC LETTER ALEF MAKSURA 
8227
+      0x064A: [0xFEF1, 0xFEF2, 0xFEF3, 0xFEF4],
8228
+      // ARABIC LETTER YEH
8229
+      0x0671: [0xFB50, 0xFB51],
8230
+      // ARABIC LETTER ALEF WASLA
8231
+      0x0677: [0xFBDD],
8232
+      // ARABIC LETTER U WITH HAMZA ABOVE
8233
+      0x0679: [0xFB66, 0xFB67, 0xFB68, 0xFB69],
8234
+      // ARABIC LETTER TTEH
8235
+      0x067A: [0xFB5E, 0xFB5F, 0xFB60, 0xFB61],
8236
+      // ARABIC LETTER TTEHEH
8237
+      0x067B: [0xFB52, 0xFB53, 0xFB54, 0xFB55],
8238
+      // ARABIC LETTER BEEH
8239
+      0x067E: [0xFB56, 0xFB57, 0xFB58, 0xFB59],
8240
+      // ARABIC LETTER PEH 
8241
+      0x067F: [0xFB62, 0xFB63, 0xFB64, 0xFB65],
8242
+      // ARABIC LETTER TEHEH
8243
+      0x0680: [0xFB5A, 0xFB5B, 0xFB5C, 0xFB5D],
8244
+      // ARABIC LETTER BEHEH
8245
+      0x0683: [0xFB76, 0xFB77, 0xFB78, 0xFB79],
8246
+      // ARABIC LETTER NYEH
8247
+      0x0684: [0xFB72, 0xFB73, 0xFB74, 0xFB75],
8248
+      // ARABIC LETTER DYEH
8249
+      0x0686: [0xFB7A, 0xFB7B, 0xFB7C, 0xFB7D],
8250
+      // ARABIC LETTER TCHEH
8251
+      0x0687: [0xFB7E, 0xFB7F, 0xFB80, 0xFB81],
8252
+      // ARABIC LETTER TCHEHEH
8253
+      0x0688: [0xFB88, 0xFB89],
8254
+      // ARABIC LETTER DDAL
8255
+      0x068C: [0xFB84, 0xFB85],
8256
+      // ARABIC LETTER DAHAL
8257
+      0x068D: [0xFB82, 0xFB83],
8258
+      // ARABIC LETTER DDAHAL
8259
+      0x068E: [0xFB86, 0xFB87],
8260
+      // ARABIC LETTER DUL 
8261
+      0x0691: [0xFB8C, 0xFB8D],
8262
+      // ARABIC LETTER RREH
8263
+      0x0698: [0xFB8A, 0xFB8B],
8264
+      // ARABIC LETTER JEH
8265
+      0x06A4: [0xFB6A, 0xFB6B, 0xFB6C, 0xFB6D],
8266
+      // ARABIC LETTER VEH
8267
+      0x06A6: [0xFB6E, 0xFB6F, 0xFB70, 0xFB71],
8268
+      // ARABIC LETTER PEHEH
8269
+      0x06A9: [0xFB8E, 0xFB8F, 0xFB90, 0xFB91],
8270
+      // ARABIC LETTER KEHEH
8271
+      0x06AD: [0xFBD3, 0xFBD4, 0xFBD5, 0xFBD6],
8272
+      // ARABIC LETTER NG
8273
+      0x06AF: [0xFB92, 0xFB93, 0xFB94, 0xFB95],
8274
+      // ARABIC LETTER GAF
8275
+      0x06B1: [0xFB9A, 0xFB9B, 0xFB9C, 0xFB9D],
8276
+      // ARABIC LETTER NGOEH
8277
+      0x06B3: [0xFB96, 0xFB97, 0xFB98, 0xFB99],
8278
+      // ARABIC LETTER GUEH
8279
+      0x06BA: [0xFB9E, 0xFB9F],
8280
+      // ARABIC LETTER NOON GHUNNA
8281
+      0x06BB: [0xFBA0, 0xFBA1, 0xFBA2, 0xFBA3],
8282
+      // ARABIC LETTER RNOON
8283
+      0x06BE: [0xFBAA, 0xFBAB, 0xFBAC, 0xFBAD],
8284
+      // ARABIC LETTER HEH DOACHASHMEE
8285
+      0x06C0: [0xFBA4, 0xFBA5],
8286
+      // ARABIC LETTER HEH WITH YEH ABOVE
8287
+      0x06C1: [0xFBA6, 0xFBA7, 0xFBA8, 0xFBA9],
8288
+      // ARABIC LETTER HEH GOAL
8289
+      0x06C5: [0xFBE0, 0xFBE1],
8290
+      // ARABIC LETTER KIRGHIZ OE
8291
+      0x06C6: [0xFBD9, 0xFBDA],
8292
+      // ARABIC LETTER OE
8293
+      0x06C7: [0xFBD7, 0xFBD8],
8294
+      // ARABIC LETTER U
8295
+      0x06C8: [0xFBDB, 0xFBDC],
8296
+      // ARABIC LETTER YU
8297
+      0x06C9: [0xFBE2, 0xFBE3],
8298
+      // ARABIC LETTER KIRGHIZ YU
8299
+      0x06CB: [0xFBDE, 0xFBDF],
8300
+      // ARABIC LETTER VE
8301
+      0x06CC: [0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF],
8302
+      // ARABIC LETTER FARSI YEH
8303
+      0x06D0: [0xFBE4, 0xFBE5, 0xFBE6, 0xFBE7],
8304
+      //ARABIC LETTER E
8305
+      0x06D2: [0xFBAE, 0xFBAF],
8306
+      // ARABIC LETTER YEH BARREE
8307
+      0x06D3: [0xFBB0, 0xFBB1] // ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
8308
+
8309
+    };
8310
+    var ligatures = {
8311
+      0xFEDF: {
8312
+        0xFE82: 0xFEF5,
8313
+        // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM
8314
+        0xFE84: 0xFEF7,
8315
+        // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM
8316
+        0xFE88: 0xFEF9,
8317
+        // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM
8318
+        0xFE8E: 0xFEFB // ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM
8319
+
8320
+      },
8321
+      0xFEE0: {
8322
+        0xFE82: 0xFEF6,
8323
+        // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM
8324
+        0xFE84: 0xFEF8,
8325
+        // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM
8326
+        0xFE88: 0xFEFA,
8327
+        // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM
8328
+        0xFE8E: 0xFEFC // ARABIC LIGATURE LAM WITH ALEF FINAL FORM
8329
+
8330
+      },
8331
+      0xFE8D: {
8332
+        0xFEDF: {
8333
+          0xFEE0: {
8334
+            0xFEEA: 0xFDF2
8335
+          }
8336
+        }
8337
+      },
8338
+      // ALLAH
8339
+      0x0651: {
8340
+        0x064C: 0xFC5E,
8341
+        // Shadda + Dammatan
8342
+        0x064D: 0xFC5F,
8343
+        // Shadda + Kasratan
8344
+        0x064E: 0xFC60,
8345
+        // Shadda + Fatha
8346
+        0x064F: 0xFC61,
8347
+        // Shadda + Damma
8348
+        0x0650: 0xFC62 // Shadda + Kasra
8349
+
8350
+      }
8351
+    };
8352
+    var arabic_diacritics = {
8353
+      1612: 64606,
8354
+      // Shadda + Dammatan
8355
+      1613: 64607,
8356
+      // Shadda + Kasratan
8357
+      1614: 64608,
8358
+      // Shadda + Fatha
8359
+      1615: 64609,
8360
+      // Shadda + Damma
8361
+      1616: 64610 // Shadda + Kasra
8362
+
8363
+    };
8364
+    var alfletter = [1570, 1571, 1573, 1575];
8365
+    var noChangeInForm = -1;
8366
+    var isolatedForm = 0;
8367
+    var finalForm = 1;
8368
+    var initialForm = 2;
8369
+    var medialForm = 3;
8370
+    jsPDFAPI.__arabicParser__ = {}; //private
8371
+
8372
+    var isInArabicSubstitutionA = jsPDFAPI.__arabicParser__.isInArabicSubstitutionA = function (letter) {
8373
+      return typeof arabicSubstitionA[letter.charCodeAt(0)] !== "undefined";
8374
+    };
8375
+
8376
+    var isArabicLetter = jsPDFAPI.__arabicParser__.isArabicLetter = function (letter) {
8377
+      return typeof letter === "string" && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(letter);
8378
+    };
8379
+
8380
+    var isArabicEndLetter = jsPDFAPI.__arabicParser__.isArabicEndLetter = function (letter) {
8381
+      return isArabicLetter(letter) && isInArabicSubstitutionA(letter) && arabicSubstitionA[letter.charCodeAt(0)].length <= 2;
8382
+    };
8383
+
8384
+    var isArabicAlfLetter = jsPDFAPI.__arabicParser__.isArabicAlfLetter = function (letter) {
8385
+      return isArabicLetter(letter) && alfletter.indexOf(letter.charCodeAt(0)) >= 0;
8386
+    };
8387
+
8388
+    var arabicLetterHasIsolatedForm = jsPDFAPI.__arabicParser__.arabicLetterHasIsolatedForm = function (letter) {
8389
+      return isArabicLetter(letter) && isInArabicSubstitutionA(letter) && arabicSubstitionA[letter.charCodeAt(0)].length >= 1;
8390
+    };
8391
+
8392
+    var arabicLetterHasFinalForm = jsPDFAPI.__arabicParser__.arabicLetterHasFinalForm = function (letter) {
8393
+      return isArabicLetter(letter) && isInArabicSubstitutionA(letter) && arabicSubstitionA[letter.charCodeAt(0)].length >= 2;
8394
+    };
8395
+
8396
+    var arabicLetterHasInitialForm = jsPDFAPI.__arabicParser__.arabicLetterHasInitialForm = function (letter) {
8397
+      return isArabicLetter(letter) && isInArabicSubstitutionA(letter) && arabicSubstitionA[letter.charCodeAt(0)].length >= 3;
8398
+    };
8399
+
8400
+    var arabicLetterHasMedialForm = jsPDFAPI.__arabicParser__.arabicLetterHasMedialForm = function (letter) {
8401
+      return isArabicLetter(letter) && isInArabicSubstitutionA(letter) && arabicSubstitionA[letter.charCodeAt(0)].length == 4;
8402
+    };
8403
+
8404
+    var resolveLigatures = jsPDFAPI.__arabicParser__.resolveLigatures = function (letters) {
8405
+      var i = 0;
8406
+      var tmpLigatures = ligatures;
8407
+      var position = isolatedForm;
8408
+      var result = '';
8409
+      var effectedLetters = 0;
8410
+
8411
+      for (i = 0; i < letters.length; i += 1) {
8412
+        if (typeof tmpLigatures[letters.charCodeAt(i)] !== "undefined") {
8413
+          effectedLetters++;
8414
+          tmpLigatures = tmpLigatures[letters.charCodeAt(i)];
8415
+
8416
+          if (typeof tmpLigatures === "number") {
8417
+            position = getCorrectForm(letters.charAt(i), letters.charAt(i - effectedLetters), letters.charAt(i + 1));
8418
+            position = position !== -1 ? position : 0;
8419
+            result += String.fromCharCode(tmpLigatures);
8420
+            tmpLigatures = ligatures;
8421
+            effectedLetters = 0;
8422
+          }
8423
+
8424
+          if (i === letters.length - 1) {
8425
+            tmpLigatures = ligatures;
8426
+            result += letters.charAt(i - (effectedLetters - 1));
8427
+            i = i - (effectedLetters - 1);
8428
+            effectedLetters = 0;
8429
+          }
8430
+        } else {
8431
+          tmpLigatures = ligatures;
8432
+          result += letters.charAt(i - effectedLetters);
8433
+          i = i - effectedLetters;
8434
+          effectedLetters = 0;
8435
+        }
8436
+      }
8437
+
8438
+      return result;
8439
+    };
8440
+
8441
+    var isArabicDiacritic = jsPDFAPI.__arabicParser__.isArabicDiacritic = function (letter) {
8442
+      return letter !== undefined && arabic_diacritics[letter.charCodeAt(0)] !== undefined;
8443
+    };
8444
+
8445
+    var getCorrectForm = jsPDFAPI.__arabicParser__.getCorrectForm = function (currentChar, beforeChar, nextChar) {
8446
+
8447
+      if (!isArabicLetter(currentChar)) {
8448
+        return -1;
8449
+      }
8450
+
8451
+      if (isInArabicSubstitutionA(currentChar) === false) {
8452
+        return noChangeInForm;
8453
+      }
8454
+
8455
+      if (!arabicLetterHasFinalForm(currentChar) || !isArabicLetter(beforeChar) && !isArabicLetter(nextChar) || !isArabicLetter(nextChar) && isArabicEndLetter(beforeChar) || isArabicEndLetter(currentChar) && !isArabicLetter(beforeChar) || isArabicEndLetter(currentChar) && isArabicAlfLetter(beforeChar) || isArabicEndLetter(currentChar) && isArabicEndLetter(beforeChar)) {
8456
+        return isolatedForm;
8457
+      }
8458
+
8459
+      if (arabicLetterHasMedialForm(currentChar) && isArabicLetter(beforeChar) && !isArabicEndLetter(beforeChar) && isArabicLetter(nextChar) && arabicLetterHasFinalForm(nextChar)) {
8460
+        return medialForm;
8461
+      }
8462
+
8463
+      if (isArabicEndLetter(currentChar) || !isArabicLetter(nextChar)) {
8464
+        return finalForm;
8465
+      }
8466
+
8467
+      return initialForm;
8468
+    };
8469
+    /**
8470
+    * @name processArabic
8471
+    * @function
8472
+    * @param {string} text
8473
+    * @param {boolean} reverse
8474
+    * @returns {string}
8475
+    */
8476
+
8477
+
8478
+    var processArabic = jsPDFAPI.__arabicParser__.processArabic = jsPDFAPI.processArabic = function (text) {
8479
+      text = text || "";
8480
+      var result = "";
8481
+      var i = 0;
8482
+      var j = 0;
8483
+      var position = 0;
8484
+      var currentLetter = "";
8485
+      var prevLetter = "";
8486
+      var nextLetter = "";
8487
+      var words = text.split("\\s+");
8488
+      var newWords = [];
8489
+
8490
+      for (i = 0; i < words.length; i += 1) {
8491
+        newWords.push('');
8492
+
8493
+        for (j = 0; j < words[i].length; j += 1) {
8494
+          currentLetter = words[i][j];
8495
+          prevLetter = words[i][j - 1];
8496
+          nextLetter = words[i][j + 1];
8497
+
8498
+          if (isArabicLetter(currentLetter)) {
8499
+            position = getCorrectForm(currentLetter, prevLetter, nextLetter);
8500
+
8501
+            if (position !== -1) {
8502
+              newWords[i] += String.fromCharCode(arabicSubstitionA[currentLetter.charCodeAt(0)][position]);
8503
+            } else {
8504
+              newWords[i] += currentLetter;
8505
+            }
8506
+          } else {
8507
+            newWords[i] += currentLetter;
8508
+          }
8509
+        }
8510
+
8511
+        newWords[i] = resolveLigatures(newWords[i]);
8512
+      }
8513
+
8514
+      result = newWords.join(' ');
8515
+      return result;
8516
+    };
8517
+
8518
+    var arabicParserFunction = function arabicParserFunction(args) {
8519
+      var text = args.text;
8520
+      var x = args.x;
8521
+      var y = args.y;
8522
+      var options = args.options || {};
8523
+      var mutex = args.mutex || {};
8524
+      var lang = options.lang;
8525
+      var tmpText = [];
8526
+
8527
+      if (Object.prototype.toString.call(text) === '[object Array]') {
8528
+        var i = 0;
8529
+        tmpText = [];
8530
+
8531
+        for (i = 0; i < text.length; i += 1) {
8532
+          if (Object.prototype.toString.call(text[i]) === '[object Array]') {
8533
+            tmpText.push([processArabic(text[i][0]), text[i][1], text[i][2]]);
8534
+          } else {
8535
+            tmpText.push([processArabic(text[i])]);
8536
+          }
8537
+        }
8538
+
8539
+        args.text = tmpText;
8540
+      } else {
8541
+        args.text = processArabic(text);
8542
+      }
8543
+    };
8544
+
8545
+    jsPDFAPI.events.push(['preProcessText', arabicParserFunction]);
8546
+  })(jsPDF.API);
8547
+
8548
+  /** @license
8549
+   * jsPDF Autoprint Plugin
8550
+   *
8551
+   * Licensed under the MIT License.
8552
+   * http://opensource.org/licenses/mit-license
8553
+   */
8554
+
8555
+  /**
8556
+  * @name autoprint
8557
+  * @module
8558
+  */
8559
+  (function (jsPDFAPI) {
8560
+    /**
8561
+    * Makes the PDF automatically print. This works in Chrome, Firefox, Acrobat
8562
+    * Reader.
8563
+    *
8564
+    * @name autoPrint
8565
+    * @function
8566
+    * @param {Object} options (optional) Set the attribute variant to 'non-conform' (default) or 'javascript' to activate different methods of automatic printing when opening in a PDF-viewer .
8567
+    * @returns {jsPDF}
8568
+    * @example
8569
+    * var doc = new jsPDF();
8570
+    * doc.text(10, 10, 'This is a test');
8571
+    * doc.autoPrint({variant: 'non-conform'});
8572
+    * doc.save('autoprint.pdf');
8573
+    */
8574
+
8575
+    jsPDFAPI.autoPrint = function (options) {
8576
+
8577
+      var refAutoPrintTag;
8578
+      options = options || {};
8579
+      options.variant = options.variant || 'non-conform';
8580
+
8581
+      switch (options.variant) {
8582
+        case 'javascript':
8583
+          //https://github.com/Rob--W/pdf.js/commit/c676ecb5a0f54677b9f3340c3ef2cf42225453bb
8584
+          this.addJS('print({});');
8585
+          break;
8586
+
8587
+        case 'non-conform':
8588
+        default:
8589
+          this.internal.events.subscribe('postPutResources', function () {
8590
+            refAutoPrintTag = this.internal.newObject();
8591
+            this.internal.out("<<");
8592
+            this.internal.out("/S /Named");
8593
+            this.internal.out("/Type /Action");
8594
+            this.internal.out("/N /Print");
8595
+            this.internal.out(">>");
8596
+            this.internal.out("endobj");
8597
+          });
8598
+          this.internal.events.subscribe("putCatalog", function () {
8599
+            this.internal.out("/OpenAction " + refAutoPrintTag + " 0 R");
8600
+          });
8601
+          break;
8602
+      }
8603
+
8604
+      return this;
8605
+    };
8606
+  })(jsPDF.API);
8607
+
8608
+  /**
8609
+   * @license
8610
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
8611
+   *
8612
+   * Licensed under the MIT License.
8613
+   * http://opensource.org/licenses/mit-license
8614
+   */
8615
+
8616
+  /**
8617
+   * jsPDF Canvas PlugIn
8618
+   * This plugin mimics the HTML5 Canvas
8619
+   * 
8620
+   * The goal is to provide a way for current canvas users to print directly to a PDF.
8621
+   * @name canvas
8622
+   * @module
8623
+   */
8624
+  (function (jsPDFAPI) {
8625
+    /**
8626
+    * @class Canvas
8627
+    * @classdesc A Canvas Wrapper for jsPDF
8628
+    */
8629
+
8630
+    var Canvas = function Canvas() {
8631
+      var jsPdfInstance = undefined;
8632
+      Object.defineProperty(this, 'pdf', {
8633
+        get: function get() {
8634
+          return jsPdfInstance;
8635
+        },
8636
+        set: function set(value) {
8637
+          jsPdfInstance = value;
8638
+        }
8639
+      });
8640
+      var _width = 150;
8641
+      /**
8642
+      * The height property is a positive integer reflecting the height HTML attribute of the <canvas> element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
8643
+      * This is one of the two properties, the other being width, that controls the size of the canvas.
8644
+      *
8645
+      * @name width
8646
+      */
8647
+
8648
+      Object.defineProperty(this, 'width', {
8649
+        get: function get() {
8650
+          return _width;
8651
+        },
8652
+        set: function set(value) {
8653
+          if (isNaN(value) || Number.isInteger(value) === false || value < 0) {
8654
+            _width = 150;
8655
+          } else {
8656
+            _width = value;
8657
+          }
8658
+
8659
+          if (this.getContext('2d').pageWrapXEnabled) {
8660
+            this.getContext('2d').pageWrapX = _width + 1;
8661
+          }
8662
+        }
8663
+      });
8664
+      var _height = 300;
8665
+      /**
8666
+      * The width property is a positive integer reflecting the width HTML attribute of the <canvas> element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
8667
+      * This is one of the two properties, the other being height, that controls the size of the canvas.
8668
+      *
8669
+      * @name height
8670
+      */
8671
+
8672
+      Object.defineProperty(this, 'height', {
8673
+        get: function get() {
8674
+          return _height;
8675
+        },
8676
+        set: function set(value) {
8677
+          if (isNaN(value) || Number.isInteger(value) === false || value < 0) {
8678
+            _height = 300;
8679
+          } else {
8680
+            _height = value;
8681
+          }
8682
+
8683
+          if (this.getContext('2d').pageWrapYEnabled) {
8684
+            this.getContext('2d').pageWrapY = _height + 1;
8685
+          }
8686
+        }
8687
+      });
8688
+      var _childNodes = [];
8689
+      Object.defineProperty(this, 'childNodes', {
8690
+        get: function get() {
8691
+          return _childNodes;
8692
+        },
8693
+        set: function set(value) {
8694
+          _childNodes = value;
8695
+        }
8696
+      });
8697
+      var _style = {};
8698
+      Object.defineProperty(this, 'style', {
8699
+        get: function get() {
8700
+          return _style;
8701
+        },
8702
+        set: function set(value) {
8703
+          _style = value;
8704
+        }
8705
+      });
8706
+      Object.defineProperty(this, 'parentNode', {
8707
+        get: function get() {
8708
+          return false;
8709
+        }
8710
+      });
8711
+    };
8712
+    /**
8713
+    * The getContext() method returns a drawing context on the canvas, or null if the context identifier is not supported.
8714
+    * 
8715
+    * @name getContext
8716
+    * @function
8717
+    * @param {string} contextType Is a String containing the context identifier defining the drawing context associated to the canvas. Possible value is "2d", leading to the creation of a Context2D object representing a two-dimensional rendering context.
8718
+    * @param {object} contextAttributes
8719
+    */
8720
+
8721
+
8722
+    Canvas.prototype.getContext = function (contextType, contextAttributes) {
8723
+      contextType = contextType || '2d';
8724
+      var key;
8725
+
8726
+      if (contextType !== '2d') {
8727
+        return null;
8728
+      }
8729
+
8730
+      for (key in contextAttributes) {
8731
+        if (this.pdf.context2d.hasOwnProperty(key)) {
8732
+          this.pdf.context2d[key] = contextAttributes[key];
8733
+        }
8734
+      }
8735
+
8736
+      this.pdf.context2d._canvas = this;
8737
+      return this.pdf.context2d;
8738
+    };
8739
+    /**
8740
+    * The toDataURL() method is just a stub to throw an error if accidently called.
8741
+    * 
8742
+    * @name toDataURL
8743
+    * @function
8744
+    */
8745
+
8746
+
8747
+    Canvas.prototype.toDataURL = function () {
8748
+      throw new Error('toDataURL is not implemented.');
8749
+    };
8750
+
8751
+    jsPDFAPI.events.push(['initialized', function () {
8752
+      this.canvas = new Canvas();
8753
+      this.canvas.pdf = this;
8754
+    }]);
8755
+    return this;
8756
+  })(jsPDF.API);
8757
+
8758
+  /** 
8759
+   * @license
8760
+   * ====================================================================
8761
+   * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
8762
+   *               2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
8763
+   *               2013 Lee Driscoll, https://github.com/lsdriscoll
8764
+   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
8765
+   *               2014 James Hall, james@parall.ax
8766
+   *               2014 Diego Casorran, https://github.com/diegocr
8767
+   *
8768
+   * 
8769
+   * ====================================================================
8770
+   */
8771
+
8772
+  /**
8773
+  * @name cell
8774
+  * @module
8775
+  */
8776
+  (function (jsPDFAPI) {
8777
+    /*jslint browser:true */
8778
+
8779
+    /*global document: false, jsPDF */
8780
+
8781
+    var padding = 3,
8782
+        margin = 13,
8783
+        headerFunction,
8784
+        lastCellPos = {
8785
+      x: undefined,
8786
+      y: undefined,
8787
+      w: undefined,
8788
+      h: undefined,
8789
+      ln: undefined
8790
+    },
8791
+        pages = 1,
8792
+        setLastCellPosition = function setLastCellPosition(x, y, w, h, ln) {
8793
+      lastCellPos = {
8794
+        'x': x,
8795
+        'y': y,
8796
+        'w': w,
8797
+        'h': h,
8798
+        'ln': ln
8799
+      };
8800
+    },
8801
+        getLastCellPosition = function getLastCellPosition() {
8802
+      return lastCellPos;
8803
+    },
8804
+        NO_MARGINS = {
8805
+      left: 0,
8806
+      top: 0,
8807
+      bottom: 0
8808
+    };
8809
+    /**
8810
+    * @name setHeaderFunction
8811
+    * @function
8812
+    * @param {function} func
8813
+    */
8814
+
8815
+
8816
+    jsPDFAPI.setHeaderFunction = function (func) {
8817
+      headerFunction = func;
8818
+    };
8819
+    /**
8820
+    * @name getTextDimensions
8821
+    * @function
8822
+    * @param {string} txt
8823
+    * @returns {Object} dimensions
8824
+    */
8825
+
8826
+
8827
+    jsPDFAPI.getTextDimensions = function (text, options) {
8828
+      var fontSize = this.table_font_size || this.internal.getFontSize();
8829
+      var fontStyle = this.internal.getFont().fontStyle;
8830
+      options = options || {};
8831
+      var scaleFactor = options.scaleFactor || this.internal.scaleFactor;
8832
+      var width = 0;
8833
+      var amountOfLines = 0;
8834
+      var height = 0;
8835
+      var tempWidth = 0;
8836
+
8837
+      if (typeof text === 'string') {
8838
+        width = this.getStringUnitWidth(text) * fontSize;
8839
+
8840
+        if (width !== 0) {
8841
+          amountOfLines = 1;
8842
+        }
8843
+      } else if (Object.prototype.toString.call(text) === '[object Array]') {
8844
+        for (var i = 0; i < text.length; i++) {
8845
+          tempWidth = this.getStringUnitWidth(text[i]) * fontSize;
8846
+
8847
+          if (width < tempWidth) {
8848
+            width = tempWidth;
8849
+          }
8850
+        }
8851
+
8852
+        if (width !== 0) {
8853
+          amountOfLines = text.length;
8854
+        }
8855
+      } else {
8856
+        throw new Error('getTextDimensions expects text-parameter to be of type String or an Array of Strings.');
8857
+      }
8858
+
8859
+      width = width / scaleFactor;
8860
+      height = Math.max((amountOfLines * fontSize * this.getLineHeightFactor() - fontSize * (this.getLineHeightFactor() - 1)) / scaleFactor, 0);
8861
+      return {
8862
+        w: width,
8863
+        h: height
8864
+      };
8865
+    };
8866
+    /**
8867
+    * @name cellAddPage
8868
+    * @function
8869
+    */
8870
+
8871
+
8872
+    jsPDFAPI.cellAddPage = function () {
8873
+      var margins = this.margins || NO_MARGINS;
8874
+      this.addPage();
8875
+      setLastCellPosition(margins.left, margins.top, undefined, undefined); //setLastCellPosition(undefined, undefined, undefined, undefined, undefined);
8876
+
8877
+      pages += 1;
8878
+    };
8879
+    /**
8880
+    * @name cellInitialize
8881
+    * @function
8882
+    */
8883
+
8884
+
8885
+    jsPDFAPI.cellInitialize = function () {
8886
+      lastCellPos = {
8887
+        x: undefined,
8888
+        y: undefined,
8889
+        w: undefined,
8890
+        h: undefined,
8891
+        ln: undefined
8892
+      };
8893
+      pages = 1;
8894
+    };
8895
+    /**
8896
+    * @name cell
8897
+    * @function
8898
+    * @param {number} x
8899
+    * @param {number} y
8900
+    * @param {number} w
8901
+    * @param {number} h
8902
+    * @param {string} txt
8903
+    * @param {number} ln lineNumber
8904
+    * @param {string} align
8905
+    * @return {jsPDF} jsPDF-instance
8906
+    */
8907
+
8908
+
8909
+    jsPDFAPI.cell = function (x, y, w, h, txt, ln, align) {
8910
+      var curCell = getLastCellPosition();
8911
+      var pgAdded = false; // If this is not the first cell, we must change its position
8912
+
8913
+      if (curCell.ln !== undefined) {
8914
+        if (curCell.ln === ln) {
8915
+          //Same line
8916
+          x = curCell.x + curCell.w;
8917
+          y = curCell.y;
8918
+        } else {
8919
+          //New line
8920
+          var margins = this.margins || NO_MARGINS;
8921
+
8922
+          if (curCell.y + curCell.h + h + margin >= this.internal.pageSize.getHeight() - margins.bottom) {
8923
+            this.cellAddPage();
8924
+            pgAdded = true;
8925
+
8926
+            if (this.printHeaders && this.tableHeaderRow) {
8927
+              this.printHeaderRow(ln, true);
8928
+            }
8929
+          } //We ignore the passed y: the lines may have different heights
8930
+
8931
+
8932
+          y = getLastCellPosition().y + getLastCellPosition().h;
8933
+          if (pgAdded) y = margin + 10;
8934
+        }
8935
+      }
8936
+
8937
+      if (txt[0] !== undefined) {
8938
+        if (this.printingHeaderRow) {
8939
+          this.rect(x, y, w, h, 'FD');
8940
+        } else {
8941
+          this.rect(x, y, w, h);
8942
+        }
8943
+
8944
+        if (align === 'right') {
8945
+          if (!(txt instanceof Array)) {
8946
+            txt = [txt];
8947
+          }
8948
+
8949
+          for (var i = 0; i < txt.length; i++) {
8950
+            var currentLine = txt[i];
8951
+            var textSize = this.getStringUnitWidth(currentLine) * this.internal.getFontSize() / this.internal.scaleFactor;
8952
+            this.text(currentLine, x + w - textSize - padding, y + this.internal.getLineHeight() * (i + 1));
8953
+          }
8954
+        } else {
8955
+          this.text(txt, x + padding, y + this.internal.getLineHeight());
8956
+        }
8957
+      }
8958
+
8959
+      setLastCellPosition(x, y, w, h, ln);
8960
+      return this;
8961
+    };
8962
+    /**
8963
+     * Return the maximum value from an array
8964
+     * 
8965
+     * @name arrayMax
8966
+     * @function 
8967
+     * @param {Array} array
8968
+     * @param comparisonFn
8969
+     * @returns {number}
8970
+     */
8971
+
8972
+
8973
+    jsPDFAPI.arrayMax = function (array, comparisonFn) {
8974
+      var max = array[0],
8975
+          i,
8976
+          ln,
8977
+          item;
8978
+
8979
+      for (i = 0, ln = array.length; i < ln; i += 1) {
8980
+        item = array[i];
8981
+
8982
+        if (comparisonFn) {
8983
+          if (comparisonFn(max, item) === -1) {
8984
+            max = item;
8985
+          }
8986
+        } else {
8987
+          if (item > max) {
8988
+            max = item;
8989
+          }
8990
+        }
8991
+      }
8992
+
8993
+      return max;
8994
+    };
8995
+    /**
8996
+     * Create a table from a set of data.
8997
+     * @name table
8998
+     * @function
8999
+     * @param {Integer} [x] : left-position for top-left corner of table
9000
+     * @param {Integer} [y] top-position for top-left corner of table
9001
+     * @param {Object[]} [data] As array of objects containing key-value pairs corresponding to a row of data.
9002
+     * @param {String[]} [headers] Omit or null to auto-generate headers at a performance cost
9003
+      * @param {Object} [config.printHeaders] True to print column headers at the top of every page
9004
+     * @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value
9005
+     * @param {Object} [config.margins] margin values for left, top, bottom, and width
9006
+     * @param {Object} [config.fontSize] Integer fontSize to use (optional)
9007
+     * @returns {jsPDF} jsPDF-instance
9008
+     */
9009
+
9010
+
9011
+    jsPDFAPI.table = function (x, y, data, headers, config) {
9012
+      if (!data) {
9013
+        throw 'No data for PDF table';
9014
+      }
9015
+
9016
+      var headerNames = [],
9017
+          headerPrompts = [],
9018
+          header,
9019
+          i,
9020
+          ln,
9021
+          cln,
9022
+          columnMatrix = {},
9023
+          columnWidths = {},
9024
+          columnData,
9025
+          column,
9026
+          columnMinWidths = [],
9027
+          j,
9028
+          tableHeaderConfigs = [],
9029
+          model,
9030
+          jln,
9031
+          func,
9032
+          //set up defaults. If a value is provided in config, defaults will be overwritten:
9033
+      autoSize = false,
9034
+          printHeaders = true,
9035
+          fontSize = 12,
9036
+          margins = NO_MARGINS;
9037
+      margins.width = this.internal.pageSize.getWidth();
9038
+
9039
+      if (config) {
9040
+        //override config defaults if the user has specified non-default behavior:
9041
+        if (config.autoSize === true) {
9042
+          autoSize = true;
9043
+        }
9044
+
9045
+        if (config.printHeaders === false) {
9046
+          printHeaders = false;
9047
+        }
9048
+
9049
+        if (config.fontSize) {
9050
+          fontSize = config.fontSize;
9051
+        }
9052
+
9053
+        if (config.css && typeof config.css['font-size'] !== "undefined") {
9054
+          fontSize = config.css['font-size'] * 16;
9055
+        }
9056
+
9057
+        if (config.margins) {
9058
+          margins = config.margins;
9059
+        }
9060
+      }
9061
+      /**
9062
+       * @property {Number} lnMod
9063
+       * Keep track of the current line number modifier used when creating cells
9064
+       */
9065
+
9066
+
9067
+      this.lnMod = 0;
9068
+      lastCellPos = {
9069
+        x: undefined,
9070
+        y: undefined,
9071
+        w: undefined,
9072
+        h: undefined,
9073
+        ln: undefined
9074
+      }, pages = 1;
9075
+      this.printHeaders = printHeaders;
9076
+      this.margins = margins;
9077
+      this.setFontSize(fontSize);
9078
+      this.table_font_size = fontSize; // Set header values
9079
+
9080
+      if (headers === undefined || headers === null) {
9081
+        // No headers defined so we derive from data
9082
+        headerNames = Object.keys(data[0]);
9083
+      } else if (headers[0] && typeof headers[0] !== 'string') {
9084
+        var px2pt = 0.264583 * 72 / 25.4; // Split header configs into names and prompts
9085
+
9086
+        for (i = 0, ln = headers.length; i < ln; i += 1) {
9087
+          header = headers[i];
9088
+          headerNames.push(header.name);
9089
+          headerPrompts.push(header.prompt);
9090
+          columnWidths[header.name] = header.width * px2pt;
9091
+        }
9092
+      } else {
9093
+        headerNames = headers;
9094
+      }
9095
+
9096
+      if (autoSize) {
9097
+        // Create a matrix of columns e.g., {column_title: [row1_Record, row2_Record]}
9098
+        func = function func(rec) {
9099
+          return rec[header];
9100
+        };
9101
+
9102
+        for (i = 0, ln = headerNames.length; i < ln; i += 1) {
9103
+          header = headerNames[i];
9104
+          columnMatrix[header] = data.map(func); // get header width
9105
+
9106
+          columnMinWidths.push(this.getTextDimensions(headerPrompts[i] || header, {
9107
+            scaleFactor: 1
9108
+          }).w);
9109
+          column = columnMatrix[header]; // get cell widths
9110
+
9111
+          for (j = 0, cln = column.length; j < cln; j += 1) {
9112
+            columnData = column[j];
9113
+            columnMinWidths.push(this.getTextDimensions(columnData, {
9114
+              scaleFactor: 1
9115
+            }).w);
9116
+          } // get final column width
9117
+
9118
+
9119
+          columnWidths[header] = jsPDFAPI.arrayMax(columnMinWidths); //have to reset
9120
+
9121
+          columnMinWidths = [];
9122
+        }
9123
+      } // -- Construct the table
9124
+
9125
+
9126
+      if (printHeaders) {
9127
+        var lineHeight = this.calculateLineHeight(headerNames, columnWidths, headerPrompts.length ? headerPrompts : headerNames); // Construct the header row
9128
+
9129
+        for (i = 0, ln = headerNames.length; i < ln; i += 1) {
9130
+          header = headerNames[i];
9131
+          tableHeaderConfigs.push([x, y, columnWidths[header], lineHeight, String(headerPrompts.length ? headerPrompts[i] : header)]);
9132
+        } // Store the table header config
9133
+
9134
+
9135
+        this.setTableHeaderRow(tableHeaderConfigs); // Print the header for the start of the table
9136
+
9137
+        this.printHeaderRow(1, false);
9138
+      } // Construct the data rows
9139
+
9140
+
9141
+      for (i = 0, ln = data.length; i < ln; i += 1) {
9142
+        var lineHeight;
9143
+        model = data[i];
9144
+        lineHeight = this.calculateLineHeight(headerNames, columnWidths, model);
9145
+
9146
+        for (j = 0, jln = headerNames.length; j < jln; j += 1) {
9147
+          header = headerNames[j];
9148
+          this.cell(x, y, columnWidths[header], lineHeight, model[header], i + 2, header.align);
9149
+        }
9150
+      }
9151
+
9152
+      this.lastCellPos = lastCellPos;
9153
+      this.table_x = x;
9154
+      this.table_y = y;
9155
+      return this;
9156
+    };
9157
+    /**
9158
+     * Calculate the height for containing the highest column
9159
+     *
9160
+     * @name calculateLineHeight
9161
+     * @function
9162
+     * @param {String[]} headerNames is the header, used as keys to the data
9163
+     * @param {Integer[]} columnWidths is size of each column
9164
+     * @param {Object[]} model is the line of data we want to calculate the height of
9165
+     * @returns {number} lineHeight
9166
+     */
9167
+
9168
+
9169
+    jsPDFAPI.calculateLineHeight = function (headerNames, columnWidths, model) {
9170
+      var header,
9171
+          lineHeight = 0;
9172
+
9173
+      for (var j = 0; j < headerNames.length; j++) {
9174
+        header = headerNames[j];
9175
+        model[header] = this.splitTextToSize(String(model[header]), columnWidths[header] - padding);
9176
+        var h = this.internal.getLineHeight() * model[header].length + padding;
9177
+        if (h > lineHeight) lineHeight = h;
9178
+      }
9179
+
9180
+      return lineHeight;
9181
+    };
9182
+    /**
9183
+     * Store the config for outputting a table header
9184
+     *
9185
+     * @name setTableHeaderRow
9186
+     * @function
9187
+     * @param {Object[]} config
9188
+     * An array of cell configs that would define a header row: Each config matches the config used by jsPDFAPI.cell
9189
+     * except the ln parameter is excluded
9190
+     */
9191
+
9192
+
9193
+    jsPDFAPI.setTableHeaderRow = function (config) {
9194
+      this.tableHeaderRow = config;
9195
+    };
9196
+    /**
9197
+     * Output the store header row
9198
+     * 
9199
+     * @name printHeaderRow
9200
+     * @function
9201
+     * @param {number} lineNumber The line number to output the header at
9202
+     * @param {boolean} new_page 
9203
+     */
9204
+
9205
+
9206
+    jsPDFAPI.printHeaderRow = function (lineNumber, new_page) {
9207
+      if (!this.tableHeaderRow) {
9208
+        throw 'Property tableHeaderRow does not exist.';
9209
+      }
9210
+
9211
+      var tableHeaderCell, tmpArray, i, ln;
9212
+      this.printingHeaderRow = true;
9213
+
9214
+      if (headerFunction !== undefined) {
9215
+        var position = headerFunction(this, pages);
9216
+        setLastCellPosition(position[0], position[1], position[2], position[3], -1);
9217
+      }
9218
+
9219
+      this.setFontStyle('bold');
9220
+      var tempHeaderConf = [];
9221
+
9222
+      for (i = 0, ln = this.tableHeaderRow.length; i < ln; i += 1) {
9223
+        this.setFillColor(200, 200, 200);
9224
+        tableHeaderCell = this.tableHeaderRow[i];
9225
+
9226
+        if (new_page) {
9227
+          this.margins.top = margin;
9228
+          tableHeaderCell[1] = this.margins && this.margins.top || 0;
9229
+          tempHeaderConf.push(tableHeaderCell);
9230
+        }
9231
+
9232
+        tmpArray = [].concat(tableHeaderCell);
9233
+        this.cell.apply(this, tmpArray.concat(lineNumber));
9234
+      }
9235
+
9236
+      if (tempHeaderConf.length > 0) {
9237
+        this.setTableHeaderRow(tempHeaderConf);
9238
+      }
9239
+
9240
+      this.setFontStyle('normal');
9241
+      this.printingHeaderRow = false;
9242
+    };
9243
+  })(jsPDF.API);
9244
+
9245
+  /**
9246
+   * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
9247
+   *
9248
+   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
9249
+   */
9250
+
9251
+  /**
9252
+  * This plugin mimics the HTML5 CanvasRenderingContext2D.
9253
+  *
9254
+  * The goal is to provide a way for current canvas implementations to print directly to a PDF.
9255
+  *
9256
+  * @name context2d
9257
+  * @module
9258
+  */
9259
+  (function (jsPDFAPI, globalObj) {
9260
+
9261
+    var ContextLayer = function ContextLayer(ctx) {
9262
+      ctx = ctx || {};
9263
+      this.isStrokeTransparent = ctx.isStrokeTransparent || false;
9264
+      this.strokeOpacity = ctx.strokeOpacity || 1;
9265
+      this.strokeStyle = ctx.strokeStyle || '#000000';
9266
+      this.fillStyle = ctx.fillStyle || '#000000';
9267
+      this.isFillTransparent = ctx.isFillTransparent || false;
9268
+      this.fillOpacity = ctx.fillOpacity || 1;
9269
+      this.font = ctx.font || '10px sans-serif';
9270
+      this.textBaseline = ctx.textBaseline || 'alphabetic';
9271
+      this.textAlign = ctx.textAlign || 'left';
9272
+      this.lineWidth = ctx.lineWidth || 1;
9273
+      this.lineJoin = ctx.lineJoin || 'miter';
9274
+      this.lineCap = ctx.lineCap || 'butt';
9275
+      this.path = ctx.path || [];
9276
+      this.transform = typeof ctx.transform !== 'undefined' ? ctx.transform.clone() : new Matrix();
9277
+      this.globalCompositeOperation = ctx.globalCompositeOperation || 'normal';
9278
+      this.globalAlpha = ctx.globalAlpha || 1.0;
9279
+      this.clip_path = ctx.clip_path || [];
9280
+      this.currentPoint = ctx.currentPoint || new Point();
9281
+      this.miterLimit = ctx.miterLimit || 10.0;
9282
+      this.lastPoint = ctx.lastPoint || new Point();
9283
+      this.ignoreClearRect = typeof ctx.ignoreClearRect === "boolean" ? ctx.ignoreClearRect : true;
9284
+      return this;
9285
+    }; //stub
9286
+
9287
+
9288
+    var f2, f3, getHorizontalCoordinateString, getVerticalCoordinateString, getHorizontalCoordinate, getVerticalCoordinate;
9289
+    jsPDFAPI.events.push(['initialized', function () {
9290
+      this.context2d = new Context2D(this);
9291
+      f2 = this.internal.f2;
9292
+      f3 = this.internal.f3;
9293
+      getHorizontalCoordinateString = this.internal.getCoordinateString;
9294
+      getVerticalCoordinateString = this.internal.getVerticalCoordinateString;
9295
+      getHorizontalCoordinate = this.internal.getHorizontalCoordinate;
9296
+      getVerticalCoordinate = this.internal.getVerticalCoordinate;
9297
+    }]);
9298
+
9299
+    var Context2D = function Context2D(pdf) {
9300
+      Object.defineProperty(this, 'canvas', {
9301
+        get: function get() {
9302
+          return {
9303
+            parentNode: false,
9304
+            style: false
9305
+          };
9306
+        }
9307
+      });
9308
+      Object.defineProperty(this, 'pdf', {
9309
+        get: function get() {
9310
+          return pdf;
9311
+        }
9312
+      });
9313
+      var _pageWrapXEnabled = false;
9314
+      /**
9315
+      * @name pageWrapXEnabled
9316
+      * @type {boolean}
9317
+      * @default false
9318
+      */
9319
+
9320
+      Object.defineProperty(this, 'pageWrapXEnabled', {
9321
+        get: function get() {
9322
+          return _pageWrapXEnabled;
9323
+        },
9324
+        set: function set(value) {
9325
+          _pageWrapXEnabled = Boolean(value);
9326
+        }
9327
+      });
9328
+      var _pageWrapYEnabled = false;
9329
+      /**
9330
+      * @name pageWrapYEnabled
9331
+      * @type {boolean}
9332
+      * @default true
9333
+      */
9334
+
9335
+      Object.defineProperty(this, 'pageWrapYEnabled', {
9336
+        get: function get() {
9337
+          return _pageWrapYEnabled;
9338
+        },
9339
+        set: function set(value) {
9340
+          _pageWrapYEnabled = Boolean(value);
9341
+        }
9342
+      });
9343
+      var _posX = 0;
9344
+      /**
9345
+      * @name posX
9346
+      * @type {number}
9347
+      * @default 0
9348
+      */
9349
+
9350
+      Object.defineProperty(this, 'posX', {
9351
+        get: function get() {
9352
+          return _posX;
9353
+        },
9354
+        set: function set(value) {
9355
+          if (!isNaN(value)) {
9356
+            _posX = value;
9357
+          }
9358
+        }
9359
+      });
9360
+      var _posY = 0;
9361
+      /**
9362
+      * @name posY
9363
+      * @type {number}
9364
+      * @default 0
9365
+      */
9366
+
9367
+      Object.defineProperty(this, 'posY', {
9368
+        get: function get() {
9369
+          return _posY;
9370
+        },
9371
+        set: function set(value) {
9372
+          if (!isNaN(value)) {
9373
+            _posY = value;
9374
+          }
9375
+        }
9376
+      });
9377
+      var _autoPaging = false;
9378
+      /**
9379
+      * @name autoPaging
9380
+      * @type {boolean}
9381
+      * @default true
9382
+      */
9383
+
9384
+      Object.defineProperty(this, 'autoPaging', {
9385
+        get: function get() {
9386
+          return _autoPaging;
9387
+        },
9388
+        set: function set(value) {
9389
+          _autoPaging = Boolean(value);
9390
+        }
9391
+      });
9392
+      var lastBreak = 0;
9393
+      /**
9394
+      * @name lastBreak
9395
+      * @type {number}
9396
+      * @default 0
9397
+      */
9398
+
9399
+      Object.defineProperty(this, 'lastBreak', {
9400
+        get: function get() {
9401
+          return lastBreak;
9402
+        },
9403
+        set: function set(value) {
9404
+          lastBreak = value;
9405
+        }
9406
+      });
9407
+      var pageBreaks = [];
9408
+      /**
9409
+      * Y Position of page breaks.
9410
+      * @name pageBreaks
9411
+      * @type {number}
9412
+      * @default 0
9413
+      */
9414
+
9415
+      Object.defineProperty(this, 'pageBreaks', {
9416
+        get: function get() {
9417
+          return pageBreaks;
9418
+        },
9419
+        set: function set(value) {
9420
+          pageBreaks = value;
9421
+        }
9422
+      });
9423
+
9424
+      var _ctx = new ContextLayer();
9425
+      /**
9426
+      * @name ctx
9427
+      * @type {object}
9428
+      * @default {}
9429
+      */
9430
+
9431
+
9432
+      Object.defineProperty(this, 'ctx', {
9433
+        get: function get() {
9434
+          return _ctx;
9435
+        },
9436
+        set: function set(value) {
9437
+          if (value instanceof ContextLayer) {
9438
+            _ctx = value;
9439
+          }
9440
+        }
9441
+      });
9442
+      /**
9443
+      * @name path
9444
+      * @type {array}
9445
+      * @default []
9446
+      */
9447
+
9448
+      Object.defineProperty(this, 'path', {
9449
+        get: function get() {
9450
+          return _ctx.path;
9451
+        },
9452
+        set: function set(value) {
9453
+          _ctx.path = value;
9454
+        }
9455
+      });
9456
+      /**
9457
+      * @name ctxStack
9458
+      * @type {array}
9459
+      * @default []
9460
+      */
9461
+
9462
+      var _ctxStack = [];
9463
+      Object.defineProperty(this, 'ctxStack', {
9464
+        get: function get() {
9465
+          return _ctxStack;
9466
+        },
9467
+        set: function set(value) {
9468
+          _ctxStack = value;
9469
+        }
9470
+      });
9471
+      /**
9472
+      * Sets or returns the color, gradient, or pattern used to fill the drawing
9473
+      *
9474
+      * @name fillStyle
9475
+      * @default #000000
9476
+      * @property {(color|gradient|pattern)} value The color of the drawing. Default value is #000000<br />
9477
+      * A gradient object (linear or radial) used to fill the drawing (not supported by context2d)<br />
9478
+      * A pattern object to use to fill the drawing (not supported by context2d)
9479
+      */
9480
+
9481
+      Object.defineProperty(this, 'fillStyle', {
9482
+        get: function get() {
9483
+          return this.ctx.fillStyle;
9484
+        },
9485
+        set: function set(value) {
9486
+          var rgba;
9487
+          rgba = getRGBA(value);
9488
+          this.ctx.fillStyle = rgba.style;
9489
+          this.ctx.isFillTransparent = rgba.a === 0;
9490
+          this.ctx.fillOpacity = rgba.a;
9491
+          this.pdf.setFillColor(rgba.r, rgba.g, rgba.b, {
9492
+            a: rgba.a
9493
+          });
9494
+          this.pdf.setTextColor(rgba.r, rgba.g, rgba.b, {
9495
+            a: rgba.a
9496
+          });
9497
+        }
9498
+      });
9499
+      /**
9500
+      * Sets or returns the color, gradient, or pattern used for strokes
9501
+      *
9502
+      * @name strokeStyle
9503
+      * @default #000000
9504
+      * @property {color} color A CSS color value that indicates the stroke color of the drawing. Default value is #000000 (not supported by context2d)
9505
+      * @property {gradient} gradient A gradient object (linear or radial) used to create a gradient stroke (not supported by context2d)
9506
+      * @property {pattern} pattern A pattern object used to create a pattern stroke (not supported by context2d)
9507
+      */
9508
+
9509
+      Object.defineProperty(this, 'strokeStyle', {
9510
+        get: function get() {
9511
+          return this.ctx.strokeStyle;
9512
+        },
9513
+        set: function set(value) {
9514
+          var rgba = getRGBA(value);
9515
+          this.ctx.strokeStyle = rgba.style;
9516
+          this.ctx.isStrokeTransparent = rgba.a === 0;
9517
+          this.ctx.strokeOpacity = rgba.a;
9518
+
9519
+          if (rgba.a === 0) {
9520
+            this.pdf.setDrawColor(255, 255, 255);
9521
+          } else if (rgba.a === 1) {
9522
+            this.pdf.setDrawColor(rgba.r, rgba.g, rgba.b);
9523
+          } else {
9524
+            this.pdf.setDrawColor(rgba.r, rgba.g, rgba.b);
9525
+          }
9526
+        }
9527
+      });
9528
+      /**
9529
+      * Sets or returns the style of the end caps for a line
9530
+      *
9531
+      * @name lineCap
9532
+      * @default butt
9533
+      * @property {(butt|round|square)} lineCap butt A flat edge is added to each end of the line <br/>
9534
+      * round A rounded end cap is added to each end of the line<br/>
9535
+      * square A square end cap is added to each end of the line<br/>
9536
+      */
9537
+
9538
+      Object.defineProperty(this, 'lineCap', {
9539
+        get: function get() {
9540
+          return this.ctx.lineCap;
9541
+        },
9542
+        set: function set(value) {
9543
+          if (['butt', 'round', 'square'].indexOf(value) !== -1) {
9544
+            this.ctx.lineCap = value;
9545
+            this.pdf.setLineCap(value);
9546
+          }
9547
+        }
9548
+      });
9549
+      /**
9550
+      * Sets or returns the current line width
9551
+      *
9552
+      * @name lineWidth
9553
+      * @default 1
9554
+      * @property {number} lineWidth The current line width, in pixels
9555
+      */
9556
+
9557
+      Object.defineProperty(this, 'lineWidth', {
9558
+        get: function get() {
9559
+          return this.ctx.lineWidth;
9560
+        },
9561
+        set: function set(value) {
9562
+          if (!isNaN(value)) {
9563
+            this.ctx.lineWidth = value;
9564
+            this.pdf.setLineWidth(value);
9565
+          }
9566
+        }
9567
+      });
9568
+      /**
9569
+      * Sets or returns the type of corner created, when two lines meet
9570
+      */
9571
+
9572
+      Object.defineProperty(this, 'lineJoin', {
9573
+        get: function get() {
9574
+          return this.ctx.lineJoin;
9575
+        },
9576
+        set: function set(value) {
9577
+          if (['bevel', 'round', 'miter'].indexOf(value) !== -1) {
9578
+            this.ctx.lineJoin = value;
9579
+            this.pdf.setLineJoin(value);
9580
+          }
9581
+        }
9582
+      });
9583
+      /**
9584
+      * A number specifying the miter limit ratio in coordinate space units. Zero, negative, Infinity, and NaN values are ignored. The default value is 10.0.
9585
+      *
9586
+      * @name miterLimit
9587
+      * @default 10
9588
+      */
9589
+
9590
+      Object.defineProperty(this, 'miterLimit', {
9591
+        get: function get() {
9592
+          return this.ctx.miterLimit;
9593
+        },
9594
+        set: function set(value) {
9595
+          if (!isNaN(value)) {
9596
+            this.ctx.miterLimit = value;
9597
+            this.pdf.setMiterLimit(value);
9598
+          }
9599
+        }
9600
+      });
9601
+      Object.defineProperty(this, 'textBaseline', {
9602
+        get: function get() {
9603
+          return this.ctx.textBaseline;
9604
+        },
9605
+        set: function set(value) {
9606
+          this.ctx.textBaseline = value;
9607
+        }
9608
+      });
9609
+      Object.defineProperty(this, 'textAlign', {
9610
+        get: function get() {
9611
+          return this.ctx.textAlign;
9612
+        },
9613
+        set: function set(value) {
9614
+          if (['right', 'end', 'center', 'left', 'start'].indexOf(value) !== -1) {
9615
+            this.ctx.textAlign = value;
9616
+          }
9617
+        }
9618
+      });
9619
+      Object.defineProperty(this, 'font', {
9620
+        get: function get() {
9621
+          return this.ctx.font;
9622
+        },
9623
+        set: function set(value) {
9624
+          this.ctx.font = value;
9625
+          var rx, matches; //source: https://stackoverflow.com/a/10136041
9626
+
9627
+          rx = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i;
9628
+          matches = rx.exec(value);
9629
+
9630
+          if (matches !== null) {
9631
+            var fontStyle = matches[1];
9632
+            var fontVariant = matches[2];
9633
+            var fontWeight = matches[3];
9634
+            var fontSize = matches[4];
9635
+            var fontSizeUnit = matches[5];
9636
+            var fontFamily = matches[6];
9637
+          } else {
9638
+            return;
9639
+          }
9640
+
9641
+          if ('px' === fontSizeUnit) {
9642
+            fontSize = Math.floor(parseFloat(fontSize));
9643
+          } else if ('em' === fontSizeUnit) {
9644
+            fontSize = Math.floor(parseFloat(fontSize) * this.pdf.getFontSize());
9645
+          } else {
9646
+            fontSize = Math.floor(parseFloat(fontSize));
9647
+          }
9648
+
9649
+          this.pdf.setFontSize(fontSize);
9650
+          var style = '';
9651
+
9652
+          if (fontWeight === 'bold' || parseInt(fontWeight, 10) >= 700 || fontStyle === 'bold') {
9653
+            style = 'bold';
9654
+          }
9655
+
9656
+          if (fontStyle === 'italic') {
9657
+            style += 'italic';
9658
+          }
9659
+
9660
+          if (style.length === 0) {
9661
+            style = 'normal';
9662
+          }
9663
+
9664
+          var jsPdfFontName = '';
9665
+          var parts = fontFamily.toLowerCase().replace(/"|'/g, '').split(/\s*,\s*/);
9666
+          var fallbackFonts = {
9667
+            arial: 'Helvetica',
9668
+            verdana: 'Helvetica',
9669
+            helvetica: 'Helvetica',
9670
+            'sans-serif': 'Helvetica',
9671
+            fixed: 'Courier',
9672
+            monospace: 'Courier',
9673
+            terminal: 'Courier',
9674
+            courier: 'Courier',
9675
+            times: 'Times',
9676
+            cursive: 'Times',
9677
+            fantasy: 'Times',
9678
+            serif: 'Times'
9679
+          };
9680
+
9681
+          for (var i = 0; i < parts.length; i++) {
9682
+            if (this.pdf.internal.getFont(parts[i], style, {
9683
+              noFallback: true,
9684
+              disableWarning: true
9685
+            }) !== undefined) {
9686
+              jsPdfFontName = parts[i];
9687
+              break;
9688
+            } else if (style === 'bolditalic' && this.pdf.internal.getFont(parts[i], 'bold', {
9689
+              noFallback: true,
9690
+              disableWarning: true
9691
+            }) !== undefined) {
9692
+              jsPdfFontName = parts[i];
9693
+              style = 'bold';
9694
+            } else if (this.pdf.internal.getFont(parts[i], 'normal', {
9695
+              noFallback: true,
9696
+              disableWarning: true
9697
+            }) !== undefined) {
9698
+              jsPdfFontName = parts[i];
9699
+              style = 'normal';
9700
+              break;
9701
+            }
9702
+          }
9703
+
9704
+          if (jsPdfFontName === '') {
9705
+            for (var i = 0; i < parts.length; i++) {
9706
+              if (fallbackFonts[parts[i]]) {
9707
+                jsPdfFontName = fallbackFonts[parts[i]];
9708
+                break;
9709
+              }
9710
+            }
9711
+          }
9712
+
9713
+          jsPdfFontName = jsPdfFontName === '' ? 'Times' : jsPdfFontName;
9714
+          this.pdf.setFont(jsPdfFontName, style);
9715
+        }
9716
+      });
9717
+      Object.defineProperty(this, 'globalCompositeOperation', {
9718
+        get: function get() {
9719
+          return this.ctx.globalCompositeOperation;
9720
+        },
9721
+        set: function set(value) {
9722
+          this.ctx.globalCompositeOperation = value;
9723
+        }
9724
+      });
9725
+      Object.defineProperty(this, 'globalAlpha', {
9726
+        get: function get() {
9727
+          return this.ctx.globalAlpha;
9728
+        },
9729
+        set: function set(value) {
9730
+          this.ctx.globalAlpha = value;
9731
+        }
9732
+      }); // Not HTML API
9733
+
9734
+      Object.defineProperty(this, 'ignoreClearRect', {
9735
+        get: function get() {
9736
+          return this.ctx.ignoreClearRect;
9737
+        },
9738
+        set: function set(value) {
9739
+          this.ctx.ignoreClearRect = Boolean(value);
9740
+        }
9741
+      });
9742
+    };
9743
+
9744
+    Context2D.prototype.fill = function () {
9745
+      pathPreProcess.call(this, 'fill', false);
9746
+    };
9747
+    /**
9748
+    * Actually draws the path you have defined
9749
+    *
9750
+    * @name stroke
9751
+    * @function
9752
+    * @description The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods. The default color is black.
9753
+    */
9754
+
9755
+
9756
+    Context2D.prototype.stroke = function () {
9757
+      pathPreProcess.call(this, 'stroke', false);
9758
+    };
9759
+    /**
9760
+    * Begins a path, or resets the current 
9761
+    *
9762
+    * @name beginPath
9763
+    * @function 
9764
+    * @description The beginPath() method begins a path, or resets the current path.
9765
+    */
9766
+
9767
+
9768
+    Context2D.prototype.beginPath = function () {
9769
+      this.path = [{
9770
+        type: 'begin'
9771
+      }];
9772
+    };
9773
+    /**
9774
+    * Moves the path to the specified point in the canvas, without creating a line
9775
+    * 
9776
+    * @name moveTo
9777
+    * @function
9778
+    * @param x {Number} The x-coordinate of where to move the path to
9779
+    * @param y {Number} The y-coordinate of where to move the path to
9780
+    */
9781
+
9782
+
9783
+    Context2D.prototype.moveTo = function (x, y) {
9784
+      if (isNaN(x) || isNaN(y)) {
9785
+        console.error('jsPDF.context2d.moveTo: Invalid arguments', arguments);
9786
+        throw new Error('Invalid arguments passed to jsPDF.context2d.moveTo');
9787
+      }
9788
+
9789
+      var pt = this.ctx.transform.applyToPoint(new Point(x, y));
9790
+      this.path.push({
9791
+        type: 'mt',
9792
+        x: pt.x,
9793
+        y: pt.y
9794
+      });
9795
+      this.ctx.lastPoint = new Point(x, y);
9796
+    };
9797
+    /**
9798
+    * Creates a path from the current point back to the starting point
9799
+    * 
9800
+    * @name closePath
9801
+    * @function
9802
+    * @description The closePath() method creates a path from the current point back to the starting point.
9803
+    */
9804
+
9805
+
9806
+    Context2D.prototype.closePath = function () {
9807
+      var pathBegin = new Point(0, 0);
9808
+      var i = 0;
9809
+
9810
+      for (i = this.path.length - 1; i !== -1; i--) {
9811
+        if (this.path[i].type === 'begin') {
9812
+          if (_typeof(this.path[i + 1]) === 'object' && typeof this.path[i + 1].x === 'number') {
9813
+            pathBegin = new Point(this.path[i + 1].x, this.path[i + 1].y);
9814
+            this.path.push({
9815
+              type: 'lt',
9816
+              x: pathBegin.x,
9817
+              y: pathBegin.y
9818
+            });
9819
+            break;
9820
+          }
9821
+        }
9822
+      }
9823
+
9824
+      if (_typeof(this.path[i + 2]) === 'object' && typeof this.path[i + 2].x === 'number') {
9825
+        this.path.push(JSON.parse(JSON.stringify(this.path[i + 2])));
9826
+      }
9827
+
9828
+      this.path.push({
9829
+        type: 'close'
9830
+      });
9831
+      this.ctx.lastPoint = new Point(pathBegin.x, pathBegin.y);
9832
+    };
9833
+    /**
9834
+    * Adds a new point and creates a line to that point from the last specified point in the canvas
9835
+    * 
9836
+    * @name lineTo
9837
+    * @function
9838
+    * @param x The x-coordinate of where to create the line to
9839
+    * @param y The y-coordinate of where to create the line to
9840
+    * @description The lineTo() method adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).
9841
+    */
9842
+
9843
+
9844
+    Context2D.prototype.lineTo = function (x, y) {
9845
+      if (isNaN(x) || isNaN(y)) {
9846
+        console.error('jsPDF.context2d.lineTo: Invalid arguments', arguments);
9847
+        throw new Error('Invalid arguments passed to jsPDF.context2d.lineTo');
9848
+      }
9849
+
9850
+      var pt = this.ctx.transform.applyToPoint(new Point(x, y));
9851
+      this.path.push({
9852
+        type: 'lt',
9853
+        x: pt.x,
9854
+        y: pt.y
9855
+      });
9856
+      this.ctx.lastPoint = new Point(pt.x, pt.y);
9857
+    };
9858
+    /**
9859
+    * Clips a region of any shape and size from the original canvas
9860
+    * 
9861
+    * @name clip
9862
+    * @function
9863
+    * @description The clip() method clips a region of any shape and size from the original canvas.
9864
+    */
9865
+
9866
+
9867
+    Context2D.prototype.clip = function () {
9868
+      this.ctx.clip_path = JSON.parse(JSON.stringify(this.path));
9869
+      pathPreProcess.call(this, null, true);
9870
+    };
9871
+    /**
9872
+    * Creates a cubic Bézier curve
9873
+    *
9874
+    * @name quadraticCurveTo
9875
+    * @function
9876
+    * @param cpx {Number} The x-coordinate of the Bézier control point
9877
+    * @param cpy {Number} The y-coordinate of the Bézier control point
9878
+    * @param x {Number} The x-coordinate of the ending point
9879
+    * @param y {Number} The y-coordinate of the ending point
9880
+    * @description The quadraticCurveTo() method adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.<br /><br /> A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.
9881
+    */
9882
+
9883
+
9884
+    Context2D.prototype.quadraticCurveTo = function (cpx, cpy, x, y) {
9885
+      if (isNaN(x) || isNaN(y) || isNaN(cpx) || isNaN(cpy)) {
9886
+        console.error('jsPDF.context2d.quadraticCurveTo: Invalid arguments', arguments);
9887
+        throw new Error('Invalid arguments passed to jsPDF.context2d.quadraticCurveTo');
9888
+      }
9889
+
9890
+      var pt0 = this.ctx.transform.applyToPoint(new Point(x, y));
9891
+      var pt1 = this.ctx.transform.applyToPoint(new Point(cpx, cpy));
9892
+      this.path.push({
9893
+        type: 'qct',
9894
+        x1: pt1.x,
9895
+        y1: pt1.y,
9896
+        x: pt0.x,
9897
+        y: pt0.y
9898
+      });
9899
+      this.ctx.lastPoint = new Point(pt0.x, pt0.y);
9900
+    };
9901
+    /**
9902
+    * Creates a cubic Bézier curve
9903
+    *
9904
+    * @name bezierCurveTo
9905
+    * @function
9906
+    * @param cp1x {Number} The x-coordinate of the first Bézier control point
9907
+    * @param cp1y {Number} The y-coordinate of the first Bézier control point
9908
+    * @param cp2x {Number} The x-coordinate of the second Bézier control point
9909
+    * @param cp2y {Number} The y-coordinate of the second Bézier control point
9910
+    * @param x {Number} The x-coordinate of the ending point
9911
+    * @param y {Number} The y-coordinate of the ending point
9912
+    * @description The bezierCurveTo() method adds a point to the current path by using the specified control points that represent a cubic Bézier curve. <br /><br />A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve.  The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.
9913
+    */
9914
+
9915
+
9916
+    Context2D.prototype.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {
9917
+      if (isNaN(x) || isNaN(y) || isNaN(cp1x) || isNaN(cp1y) || isNaN(cp2x) || isNaN(cp2y)) {
9918
+        console.error('jsPDF.context2d.bezierCurveTo: Invalid arguments', arguments);
9919
+        throw new Error('Invalid arguments passed to jsPDF.context2d.bezierCurveTo');
9920
+      }
9921
+
9922
+      var pt0 = this.ctx.transform.applyToPoint(new Point(x, y));
9923
+      var pt1 = this.ctx.transform.applyToPoint(new Point(cp1x, cp1y));
9924
+      var pt2 = this.ctx.transform.applyToPoint(new Point(cp2x, cp2y));
9925
+      this.path.push({
9926
+        type: 'bct',
9927
+        x1: pt1.x,
9928
+        y1: pt1.y,
9929
+        x2: pt2.x,
9930
+        y2: pt2.y,
9931
+        x: pt0.x,
9932
+        y: pt0.y
9933
+      });
9934
+      this.ctx.lastPoint = new Point(pt0.x, pt0.y);
9935
+    };
9936
+    /**
9937
+    * Creates an arc/curve (used to create circles, or parts of circles)
9938
+    *
9939
+    * @name arc
9940
+    * @function
9941
+    * @param x {Number} The x-coordinate of the center of the circle
9942
+    * @param y {Number} The y-coordinate of the center of the circle
9943
+    * @param radius {Number} The radius of the circle
9944
+    * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
9945
+    * @param endAngle {Number} The ending angle, in radians
9946
+    * @param counterclockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
9947
+    * @description The arc() method creates an arc/curve (used to create circles, or parts of circles).
9948
+    */
9949
+
9950
+
9951
+    Context2D.prototype.arc = function (x, y, radius, startAngle, endAngle, counterclockwise) {
9952
+      if (isNaN(x) || isNaN(y) || isNaN(radius) || isNaN(startAngle) || isNaN(endAngle)) {
9953
+        console.error('jsPDF.context2d.arc: Invalid arguments', arguments);
9954
+        throw new Error('Invalid arguments passed to jsPDF.context2d.arc');
9955
+      }
9956
+
9957
+      counterclockwise = Boolean(counterclockwise);
9958
+
9959
+      if (!this.ctx.transform.isIdentity) {
9960
+        var xpt = this.ctx.transform.applyToPoint(new Point(x, y));
9961
+        x = xpt.x;
9962
+        y = xpt.y;
9963
+        var x_radPt = this.ctx.transform.applyToPoint(new Point(0, radius));
9964
+        var x_radPt0 = this.ctx.transform.applyToPoint(new Point(0, 0));
9965
+        radius = Math.sqrt(Math.pow(x_radPt.x - x_radPt0.x, 2) + Math.pow(x_radPt.y - x_radPt0.y, 2));
9966
+      }
9967
+
9968
+      if (Math.abs(endAngle - startAngle) >= 2 * Math.PI) {
9969
+        startAngle = 0;
9970
+        endAngle = 2 * Math.PI;
9971
+      }
9972
+
9973
+      this.path.push({
9974
+        type: 'arc',
9975
+        x: x,
9976
+        y: y,
9977
+        radius: radius,
9978
+        startAngle: startAngle,
9979
+        endAngle: endAngle,
9980
+        counterclockwise: counterclockwise
9981
+      }); // this.ctx.lastPoint(new Point(pt.x,pt.y));
9982
+    };
9983
+    /**
9984
+    * Creates an arc/curve between two tangents
9985
+    * 
9986
+    * @name arcTo
9987
+    * @function
9988
+    * @param x1 {Number} The x-coordinate of the first tangent
9989
+    * @param y1 {Number} The y-coordinate of the first tangent
9990
+    * @param x2 {Number} The x-coordinate of the second tangent
9991
+    * @param y2 {Number} The y-coordinate of the second tangent
9992
+    * @param radius The radius of the arc
9993
+    * @description The arcTo() method creates an arc/curve between two tangents on the canvas.
9994
+    */
9995
+
9996
+
9997
+    Context2D.prototype.arcTo = function (x1, y1, x2, y2, radius) {
9998
+      throw new Error('arcTo not implemented.');
9999
+    };
10000
+    /**
10001
+    * Creates a rectangle
10002
+    *
10003
+    * @name rect
10004
+    * @function
10005
+    * @param x {Number} The x-coordinate of the upper-left corner of the rectangle
10006
+    * @param y {Number} The y-coordinate of the upper-left corner of the rectangle
10007
+    * @param w {Number} The width of the rectangle, in pixels
10008
+    * @param h {Number} The height of the rectangle, in pixels
10009
+    * @description The rect() method creates a rectangle.
10010
+    */
10011
+
10012
+
10013
+    Context2D.prototype.rect = function (x, y, w, h) {
10014
+      if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
10015
+        console.error('jsPDF.context2d.rect: Invalid arguments', arguments);
10016
+        throw new Error('Invalid arguments passed to jsPDF.context2d.rect');
10017
+      }
10018
+
10019
+      this.moveTo(x, y);
10020
+      this.lineTo(x + w, y);
10021
+      this.lineTo(x + w, y + h);
10022
+      this.lineTo(x, y + h);
10023
+      this.lineTo(x, y);
10024
+      this.lineTo(x + w, y);
10025
+      this.lineTo(x, y);
10026
+    };
10027
+    /**
10028
+    * Draws a "filled" rectangle
10029
+    *
10030
+    * @name fillRect
10031
+    * @function
10032
+    * @param x {Number} The x-coordinate of the upper-left corner of the rectangle
10033
+    * @param y {Number} The y-coordinate of the upper-left corner of the rectangle
10034
+    * @param w {Number} The width of the rectangle, in pixels
10035
+    * @param h {Number} The height of the rectangle, in pixels
10036
+    * @description The fillRect() method draws a "filled" rectangle. The default color of the fill is black.
10037
+    */
10038
+
10039
+
10040
+    Context2D.prototype.fillRect = function (x, y, w, h) {
10041
+      if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
10042
+        console.error('jsPDF.context2d.fillRect: Invalid arguments', arguments);
10043
+        throw new Error('Invalid arguments passed to jsPDF.context2d.fillRect');
10044
+      }
10045
+
10046
+      if (isFillTransparent.call(this)) {
10047
+        return;
10048
+      }
10049
+
10050
+      var tmp = {};
10051
+
10052
+      if (this.lineCap !== 'butt') {
10053
+        tmp.lineCap = this.lineCap;
10054
+        this.lineCap = 'butt';
10055
+      }
10056
+
10057
+      if (this.lineJoin !== 'miter') {
10058
+        tmp.lineJoin = this.lineJoin;
10059
+        this.lineJoin = 'miter';
10060
+      }
10061
+
10062
+      this.beginPath();
10063
+      this.rect(x, y, w, h);
10064
+      this.fill();
10065
+
10066
+      if (tmp.hasOwnProperty('lineCap')) {
10067
+        this.lineCap = tmp.lineCap;
10068
+      }
10069
+
10070
+      if (tmp.hasOwnProperty('lineJoin')) {
10071
+        this.lineJoin = tmp.lineJoin;
10072
+      }
10073
+    };
10074
+    /**
10075
+    *     Draws a rectangle (no fill)
10076
+    *
10077
+    * @name strokeRect
10078
+    * @function
10079
+    * @param x {Number} The x-coordinate of the upper-left corner of the rectangle
10080
+    * @param y {Number} The y-coordinate of the upper-left corner of the rectangle
10081
+    * @param w {Number} The width of the rectangle, in pixels
10082
+    * @param h {Number} The height of the rectangle, in pixels
10083
+    * @description The strokeRect() method draws a rectangle (no fill). The default color of the stroke is black.
10084
+    */
10085
+
10086
+
10087
+    Context2D.prototype.strokeRect = function strokeRect(x, y, w, h) {
10088
+      if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
10089
+        console.error('jsPDF.context2d.strokeRect: Invalid arguments', arguments);
10090
+        throw new Error('Invalid arguments passed to jsPDF.context2d.strokeRect');
10091
+      }
10092
+
10093
+      if (isStrokeTransparent.call(this)) {
10094
+        return;
10095
+      }
10096
+
10097
+      this.beginPath();
10098
+      this.rect(x, y, w, h);
10099
+      this.stroke();
10100
+    };
10101
+    /**
10102
+    * Clears the specified pixels within a given rectangle
10103
+    *
10104
+    * @name clearRect
10105
+    * @function
10106
+    * @param x {Number} The x-coordinate of the upper-left corner of the rectangle
10107
+    * @param y {Number} The y-coordinate of the upper-left corner of the rectangle
10108
+    * @param w {Number} The width of the rectangle to clear, in pixels
10109
+    * @param h {Number} The height of the rectangle to clear, in pixels
10110
+    * @description We cannot clear PDF commands that were already written to PDF, so we use white instead. <br />
10111
+    * As a special case, read a special flag (ignoreClearRect) and do nothing if it is set.
10112
+    * This results in all calls to clearRect() to do nothing, and keep the canvas transparent.
10113
+    * This flag is stored in the save/restore context and is managed the same way as other drawing states.
10114
+    *
10115
+    */
10116
+
10117
+
10118
+    Context2D.prototype.clearRect = function (x, y, w, h) {
10119
+      if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
10120
+        console.error('jsPDF.context2d.clearRect: Invalid arguments', arguments);
10121
+        throw new Error('Invalid arguments passed to jsPDF.context2d.clearRect');
10122
+      }
10123
+
10124
+      if (this.ignoreClearRect) {
10125
+        return;
10126
+      }
10127
+
10128
+      this.fillStyle = '#ffffff';
10129
+      this.fillRect(x, y, w, h);
10130
+    };
10131
+    /**
10132
+    * Saves the state of the current context
10133
+    * 
10134
+    * @name save
10135
+    * @function
10136
+    */
10137
+
10138
+
10139
+    Context2D.prototype.save = function (doStackPush) {
10140
+      doStackPush = typeof doStackPush === 'boolean' ? doStackPush : true;
10141
+      var tmpPageNumber = this.pdf.internal.getCurrentPageInfo().pageNumber;
10142
+
10143
+      for (var i = 0; i < this.pdf.internal.getNumberOfPages(); i++) {
10144
+        this.pdf.setPage(i + 1);
10145
+        this.pdf.internal.out('q');
10146
+      }
10147
+
10148
+      this.pdf.setPage(tmpPageNumber);
10149
+
10150
+      if (doStackPush) {
10151
+        this.ctx.fontSize = this.pdf.internal.getFontSize();
10152
+        var ctx = new ContextLayer(this.ctx);
10153
+        this.ctxStack.push(this.ctx);
10154
+        this.ctx = ctx;
10155
+      }
10156
+    };
10157
+    /**
10158
+    * Returns previously saved path state and attributes
10159
+    * 
10160
+    * @name restore
10161
+    * @function
10162
+    */
10163
+
10164
+
10165
+    Context2D.prototype.restore = function (doStackPop) {
10166
+      doStackPop = typeof doStackPop === 'boolean' ? doStackPop : true;
10167
+      var tmpPageNumber = this.pdf.internal.getCurrentPageInfo().pageNumber;
10168
+
10169
+      for (var i = 0; i < this.pdf.internal.getNumberOfPages(); i++) {
10170
+        this.pdf.setPage(i + 1);
10171
+        this.pdf.internal.out('Q');
10172
+      }
10173
+
10174
+      this.pdf.setPage(tmpPageNumber);
10175
+
10176
+      if (doStackPop && this.ctxStack.length !== 0) {
10177
+        this.ctx = this.ctxStack.pop();
10178
+        this.fillStyle = this.ctx.fillStyle;
10179
+        this.strokeStyle = this.ctx.strokeStyle;
10180
+        this.font = this.ctx.font;
10181
+        this.lineCap = this.ctx.lineCap;
10182
+        this.lineWidth = this.ctx.lineWidth;
10183
+        this.lineJoin = this.ctx.lineJoin;
10184
+      }
10185
+    };
10186
+    /** 
10187
+    * @name toDataURL
10188
+    * @function
10189
+    */
10190
+
10191
+
10192
+    Context2D.prototype.toDataURL = function () {
10193
+      throw new Error('toDataUrl not implemented.');
10194
+    }; //helper functions
10195
+
10196
+    /**
10197
+    * Get the decimal values of r, g, b and a
10198
+    *
10199
+    * @name getRGBA
10200
+    * @function
10201
+    * @private
10202
+    * @ignore
10203
+    */
10204
+
10205
+
10206
+    var getRGBA = function getRGBA(style) {
10207
+      var rxRgb = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/;
10208
+      var rxRgba = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/;
10209
+      var rxTransparent = /transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/;
10210
+      var r, g, b, a;
10211
+
10212
+      if (style.isCanvasGradient === true) {
10213
+        style = style.getColor();
10214
+      }
10215
+
10216
+      if (!style) {
10217
+        return {
10218
+          r: 0,
10219
+          g: 0,
10220
+          b: 0,
10221
+          a: 0,
10222
+          style: style
10223
+        };
10224
+      }
10225
+
10226
+      if (rxTransparent.test(style)) {
10227
+        r = 0;
10228
+        g = 0;
10229
+        b = 0;
10230
+        a = 0;
10231
+      } else {
10232
+        var matches = rxRgb.exec(style);
10233
+
10234
+        if (matches !== null) {
10235
+          r = parseInt(matches[1]);
10236
+          g = parseInt(matches[2]);
10237
+          b = parseInt(matches[3]);
10238
+          a = 1;
10239
+        } else {
10240
+          matches = rxRgba.exec(style);
10241
+
10242
+          if (matches !== null) {
10243
+            r = parseInt(matches[1]);
10244
+            g = parseInt(matches[2]);
10245
+            b = parseInt(matches[3]);
10246
+            a = parseFloat(matches[4]);
10247
+          } else {
10248
+            a = 1;
10249
+
10250
+            if (typeof style === "string" && style.charAt(0) !== '#') {
10251
+              var rgbColor = new RGBColor(style);
10252
+
10253
+              if (rgbColor.ok) {
10254
+                style = rgbColor.toHex();
10255
+              } else {
10256
+                style = '#000000';
10257
+              }
10258
+            }
10259
+
10260
+            if (style.length === 4) {
10261
+              r = style.substring(1, 2);
10262
+              r += r;
10263
+              g = style.substring(2, 3);
10264
+              g += g;
10265
+              b = style.substring(3, 4);
10266
+              b += b;
10267
+            } else {
10268
+              r = style.substring(1, 3);
10269
+              g = style.substring(3, 5);
10270
+              b = style.substring(5, 7);
10271
+            }
10272
+
10273
+            r = parseInt(r, 16);
10274
+            g = parseInt(g, 16);
10275
+            b = parseInt(b, 16);
10276
+          }
10277
+        }
10278
+      }
10279
+
10280
+      return {
10281
+        r: r,
10282
+        g: g,
10283
+        b: b,
10284
+        a: a,
10285
+        style: style
10286
+      };
10287
+    };
10288
+    /**
10289
+    * @name isFillTransparent
10290
+    * @function 
10291
+    * @private
10292
+    * @ignore
10293
+    * @returns {Boolean}
10294
+    */
10295
+
10296
+
10297
+    var isFillTransparent = function isFillTransparent() {
10298
+      return this.ctx.isFillTransparent || this.globalAlpha == 0;
10299
+    };
10300
+    /**
10301
+    * @name isStrokeTransparent
10302
+    * @function 
10303
+    * @private
10304
+    * @ignore
10305
+    * @returns {Boolean}
10306
+    */
10307
+
10308
+
10309
+    var isStrokeTransparent = function isStrokeTransparent() {
10310
+      return Boolean(this.ctx.isStrokeTransparent || this.globalAlpha == 0);
10311
+    };
10312
+    /**
10313
+    * Draws "filled" text on the canvas
10314
+    * 
10315
+    * @name fillText
10316
+    * @function
10317
+    * @param text {String} Specifies the text that will be written on the canvas
10318
+    * @param x {Number} The x coordinate where to start painting the text (relative to the canvas)
10319
+    * @param y {Number} The y coordinate where to start painting the text (relative to the canvas)
10320
+    * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels
10321
+    * @description The fillText() method draws filled text on the canvas. The default color of the text is black.
10322
+    */
10323
+
10324
+
10325
+    Context2D.prototype.fillText = function (text, x, y, maxWidth) {
10326
+      if (isNaN(x) || isNaN(y) || typeof text !== 'string') {
10327
+        console.error('jsPDF.context2d.fillText: Invalid arguments', arguments);
10328
+        throw new Error('Invalid arguments passed to jsPDF.context2d.fillText');
10329
+      }
10330
+
10331
+      maxWidth = isNaN(maxWidth) ? undefined : maxWidth;
10332
+
10333
+      if (isFillTransparent.call(this)) {
10334
+        return;
10335
+      }
10336
+
10337
+      y = getBaseline.call(this, y);
10338
+      var degs = rad2deg(this.ctx.transform.rotation); // We only use X axis as scale hint 
10339
+
10340
+      var scale = this.ctx.transform.scaleX;
10341
+      putText.call(this, {
10342
+        text: text,
10343
+        x: x,
10344
+        y: y,
10345
+        scale: scale,
10346
+        angle: degs,
10347
+        align: this.textAlign,
10348
+        maxWidth: maxWidth
10349
+      });
10350
+    };
10351
+    /**
10352
+    * Draws text on the canvas (no fill)
10353
+    * 
10354
+    * @name strokeText
10355
+    * @function
10356
+    * @param text {String} Specifies the text that will be written on the canvas
10357
+    * @param x {Number} The x coordinate where to start painting the text (relative to the canvas)
10358
+    * @param y {Number} The y coordinate where to start painting the text (relative to the canvas)
10359
+    * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels
10360
+    * @description The strokeText() method draws text (with no fill) on the canvas. The default color of the text is black.
10361
+    */
10362
+
10363
+
10364
+    Context2D.prototype.strokeText = function (text, x, y, maxWidth) {
10365
+      if (isNaN(x) || isNaN(y) || typeof text !== 'string') {
10366
+        console.error('jsPDF.context2d.strokeText: Invalid arguments', arguments);
10367
+        throw new Error('Invalid arguments passed to jsPDF.context2d.strokeText');
10368
+      }
10369
+
10370
+      if (isStrokeTransparent.call(this)) {
10371
+        return;
10372
+      }
10373
+
10374
+      maxWidth = isNaN(maxWidth) ? undefined : maxWidth;
10375
+      y = getBaseline.call(this, y);
10376
+      var degs = rad2deg(this.ctx.transform.rotation);
10377
+      var scale = this.ctx.transform.scaleX;
10378
+      putText.call(this, {
10379
+        text: text,
10380
+        x: x,
10381
+        y: y,
10382
+        scale: scale,
10383
+        renderingMode: 'stroke',
10384
+        angle: degs,
10385
+        align: this.textAlign,
10386
+        maxWidth: maxWidth
10387
+      });
10388
+    };
10389
+    /**
10390
+    * Returns an object that contains the width of the specified text
10391
+    *
10392
+    * @name measureText
10393
+    * @function 
10394
+    * @param text {String} The text to be measured
10395
+    * @description The measureText() method returns an object that contains the width of the specified text, in pixels.
10396
+    * @returns {Number}
10397
+    */
10398
+
10399
+
10400
+    Context2D.prototype.measureText = function (text) {
10401
+      if (typeof text !== 'string') {
10402
+        console.error('jsPDF.context2d.measureText: Invalid arguments', arguments);
10403
+        throw new Error('Invalid arguments passed to jsPDF.context2d.measureText');
10404
+      }
10405
+
10406
+      var pdf = this.pdf;
10407
+      var k = this.pdf.internal.scaleFactor;
10408
+      var fontSize = pdf.internal.getFontSize();
10409
+      var txtWidth = pdf.getStringUnitWidth(text) * fontSize / pdf.internal.scaleFactor;
10410
+      txtWidth *= Math.round(k * 96 / 72 * 10000) / 10000;
10411
+
10412
+      var TextMetrics = function TextMetrics(options) {
10413
+        options = options || {};
10414
+
10415
+        var _width = options.width || 0;
10416
+
10417
+        Object.defineProperty(this, 'width', {
10418
+          get: function get() {
10419
+            return _width;
10420
+          }
10421
+        });
10422
+        return this;
10423
+      };
10424
+
10425
+      return new TextMetrics({
10426
+        width: txtWidth
10427
+      });
10428
+    }; //Transformations
10429
+
10430
+    /**
10431
+    * Scales the current drawing bigger or smaller
10432
+    * 
10433
+    * @name scale 
10434
+    * @function
10435
+    * @param scalewidth {Number} Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.)
10436
+    * @param scaleheight {Number} Scales the height of the current drawing (1=100%, 0.5=50%, 2=200%, etc.)
10437
+    * @description The scale() method scales the current drawing, bigger or smaller.
10438
+    */
10439
+
10440
+
10441
+    Context2D.prototype.scale = function (scalewidth, scaleheight) {
10442
+      if (isNaN(scalewidth) || isNaN(scaleheight)) {
10443
+        console.error('jsPDF.context2d.scale: Invalid arguments', arguments);
10444
+        throw new Error('Invalid arguments passed to jsPDF.context2d.scale');
10445
+      }
10446
+
10447
+      var matrix = new Matrix(scalewidth, 0.0, 0.0, scaleheight, 0.0, 0.0);
10448
+      this.ctx.transform = this.ctx.transform.multiply(matrix);
10449
+    };
10450
+    /**
10451
+    * Rotates the current drawing
10452
+    * 
10453
+    * @name rotate
10454
+    * @function
10455
+    * @param angle {Number} The rotation angle, in radians.
10456
+    * @description To calculate from degrees to radians: degrees*Math.PI/180. <br />
10457
+    * Example: to rotate 5 degrees, specify the following: 5*Math.PI/180
10458
+    */
10459
+
10460
+
10461
+    Context2D.prototype.rotate = function (angle) {
10462
+      if (isNaN(angle)) {
10463
+        console.error('jsPDF.context2d.rotate: Invalid arguments', arguments);
10464
+        throw new Error('Invalid arguments passed to jsPDF.context2d.rotate');
10465
+      }
10466
+
10467
+      var matrix = new Matrix(Math.cos(angle), Math.sin(angle), -Math.sin(angle), Math.cos(angle), 0.0, 0.0);
10468
+      this.ctx.transform = this.ctx.transform.multiply(matrix);
10469
+    };
10470
+    /**
10471
+    * Remaps the (0,0) position on the canvas
10472
+    * 
10473
+    * @name translate
10474
+    * @function
10475
+    * @param x {Number} The value to add to horizontal (x) coordinates
10476
+    * @param y {Number} The value to add to vertical (y) coordinates
10477
+    * @description The translate() method remaps the (0,0) position on the canvas.
10478
+    */
10479
+
10480
+
10481
+    Context2D.prototype.translate = function (x, y) {
10482
+      if (isNaN(x) || isNaN(y)) {
10483
+        console.error('jsPDF.context2d.translate: Invalid arguments', arguments);
10484
+        throw new Error('Invalid arguments passed to jsPDF.context2d.translate');
10485
+      }
10486
+
10487
+      var matrix = new Matrix(1.0, 0.0, 0.0, 1.0, x, y);
10488
+      this.ctx.transform = this.ctx.transform.multiply(matrix);
10489
+    };
10490
+    /**
10491
+    * Replaces the current transformation matrix for the drawing
10492
+    * 
10493
+    * @name transform
10494
+    * @function
10495
+    * @param a {Number} Horizontal scaling
10496
+    * @param b {Number} Horizontal skewing
10497
+    * @param c {Number} Vertical skewing
10498
+    * @param d {Number} Vertical scaling
10499
+    * @param e {Number} Horizontal moving
10500
+    * @param f {Number} Vertical moving
10501
+    * @description Each object on the canvas has a current transformation matrix.<br /><br />The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:<br /><br /><br /><br />a    c    e<br /><br />b    d    f<br /><br />0    0    1<br /><br />In other words, the transform() method lets you scale, rotate, move, and skew the current context.
10502
+    */
10503
+
10504
+
10505
+    Context2D.prototype.transform = function (a, b, c, d, e, f) {
10506
+      if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d) || isNaN(e) || isNaN(f)) {
10507
+        console.error('jsPDF.context2d.transform: Invalid arguments', arguments);
10508
+        throw new Error('Invalid arguments passed to jsPDF.context2d.transform');
10509
+      }
10510
+
10511
+      var matrix = new Matrix(a, b, c, d, e, f);
10512
+      this.ctx.transform = this.ctx.transform.multiply(matrix);
10513
+    };
10514
+    /**
10515
+    * Resets the current transform to the identity matrix. Then runs transform()
10516
+    * 
10517
+    * @name setTransform
10518
+    * @function
10519
+    * @param a {Number} Horizontal scaling
10520
+    * @param b {Number} Horizontal skewing
10521
+    * @param c {Number} Vertical skewing
10522
+    * @param d {Number} Vertical scaling
10523
+    * @param e {Number} Horizontal moving
10524
+    * @param f {Number} Vertical moving
10525
+    * @description Each object on the canvas has a current transformation matrix. <br /><br />The setTransform() method resets the current transform to the identity matrix, and then runs transform() with the same arguments.<br /><br />In other words, the setTransform() method lets you scale, rotate, move, and skew the current context.
10526
+    */
10527
+
10528
+
10529
+    Context2D.prototype.setTransform = function (a, b, c, d, e, f) {
10530
+      a = isNaN(a) ? 1 : a;
10531
+      b = isNaN(b) ? 0 : b;
10532
+      c = isNaN(c) ? 0 : c;
10533
+      d = isNaN(d) ? 1 : d;
10534
+      e = isNaN(e) ? 0 : e;
10535
+      f = isNaN(f) ? 0 : f;
10536
+      this.ctx.transform = new Matrix(a, b, c, d, e, f);
10537
+    };
10538
+    /**
10539
+    * Draws an image, canvas, or video onto the canvas
10540
+    * 
10541
+    * @function 
10542
+    * @param img {} Specifies the image, canvas, or video element to use
10543
+    * @param sx {Number} Optional. The x coordinate where to start clipping
10544
+    * @param sy {Number} Optional. The y coordinate where to start clipping
10545
+    * @param swidth {Number} Optional. The width of the clipped image
10546
+    * @param sheight {Number} Optional. The height of the clipped image
10547
+    * @param x {Number} The x coordinate where to place the image on the canvas
10548
+    * @param y {Number} The y coordinate where to place the image on the canvas
10549
+    * @param width {Number} Optional. The width of the image to use (stretch or reduce the image)
10550
+    * @param height {Number} Optional. The height of the image to use (stretch or reduce the image)
10551
+    */
10552
+
10553
+
10554
+    Context2D.prototype.drawImage = function (img, sx, sy, swidth, sheight, x, y, width, height) {
10555
+      var imageProperties = this.pdf.getImageProperties(img);
10556
+      var factorX = 1;
10557
+      var factorY = 1;
10558
+      var clipFactorX = 1;
10559
+      var clipFactorY = 1;
10560
+      var scaleFactorX = 1;
10561
+
10562
+      if (typeof swidth !== 'undefined' && typeof width !== 'undefined') {
10563
+        clipFactorX = width / swidth;
10564
+        clipFactorY = height / sheight;
10565
+        factorX = imageProperties.width / swidth * width / swidth;
10566
+        factorY = imageProperties.height / sheight * height / sheight;
10567
+      } //is sx and sy are set and x and y not, set x and y with values of sx and sy
10568
+
10569
+
10570
+      if (typeof x === 'undefined') {
10571
+        x = sx;
10572
+        y = sy;
10573
+        sx = 0;
10574
+        sy = 0;
10575
+      }
10576
+
10577
+      if (typeof swidth !== 'undefined' && typeof width === 'undefined') {
10578
+        width = swidth;
10579
+        height = sheight;
10580
+      }
10581
+
10582
+      if (typeof swidth === 'undefined' && typeof width === 'undefined') {
10583
+        width = imageProperties.width;
10584
+        height = imageProperties.height;
10585
+      }
10586
+
10587
+      var decomposedTransformationMatrix = this.ctx.transform.decompose();
10588
+      var angle = rad2deg(decomposedTransformationMatrix.rotate.shx);
10589
+      scaleFactorX = decomposedTransformationMatrix.scale.sx;
10590
+      scaleFactorX = decomposedTransformationMatrix.scale.sy;
10591
+      var matrix = new Matrix();
10592
+      matrix = matrix.multiply(decomposedTransformationMatrix.translate);
10593
+      matrix = matrix.multiply(decomposedTransformationMatrix.skew);
10594
+      matrix = matrix.multiply(decomposedTransformationMatrix.scale);
10595
+      var mP = matrix.applyToPoint(new Point(width, height));
10596
+      var xRect = matrix.applyToRectangle(new Rectangle(x - sx * clipFactorX, y - sy * clipFactorY, swidth * factorX, sheight * factorY));
10597
+      var pageArray = getPagesByPath.call(this, xRect);
10598
+      var pages = [];
10599
+
10600
+      for (var ii = 0; ii < pageArray.length; ii += 1) {
10601
+        if (pages.indexOf(pageArray[ii]) === -1) {
10602
+          pages.push(pageArray[ii]);
10603
+        }
10604
+      }
10605
+
10606
+      pages.sort();
10607
+      var clipPath;
10608
+
10609
+      if (this.autoPaging) {
10610
+        var min = pages[0];
10611
+        var max = pages[pages.length - 1];
10612
+
10613
+        for (var i = min; i < max + 1; i++) {
10614
+          this.pdf.setPage(i);
10615
+
10616
+          if (this.ctx.clip_path.length !== 0) {
10617
+            var tmpPaths = this.path;
10618
+            clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));
10619
+            this.path = pathPositionRedo(clipPath, this.posX, -1 * this.pdf.internal.pageSize.height * (i - 1) + this.posY);
10620
+            drawPaths.call(this, 'fill', true);
10621
+            this.path = tmpPaths;
10622
+          }
10623
+
10624
+          var tmpRect = JSON.parse(JSON.stringify(xRect));
10625
+          tmpRect = pathPositionRedo([tmpRect], this.posX, -1 * this.pdf.internal.pageSize.height * (i - 1) + this.posY)[0];
10626
+          this.pdf.addImage(img, 'jpg', tmpRect.x, tmpRect.y, tmpRect.w, tmpRect.h, null, null, angle);
10627
+        }
10628
+      } else {
10629
+        this.pdf.addImage(img, 'jpg', xRect.x, xRect.y, xRect.w, xRect.h, null, null, angle);
10630
+      }
10631
+    };
10632
+
10633
+    var getPagesByPath = function getPagesByPath(path, pageWrapX, pageWrapY) {
10634
+      var result = [];
10635
+      pageWrapX = pageWrapX || this.pdf.internal.pageSize.width;
10636
+      pageWrapY = pageWrapY || this.pdf.internal.pageSize.height;
10637
+
10638
+      switch (path.type) {
10639
+        default:
10640
+        case 'mt':
10641
+        case 'lt':
10642
+          result.push(Math.floor((path.y + this.posY) / pageWrapY) + 1);
10643
+          break;
10644
+
10645
+        case 'arc':
10646
+          result.push(Math.floor((path.y + this.posY - path.radius) / pageWrapY) + 1);
10647
+          result.push(Math.floor((path.y + this.posY + path.radius) / pageWrapY) + 1);
10648
+          break;
10649
+
10650
+        case 'qct':
10651
+          var rectOfQuadraticCurve = getQuadraticCurveBoundary(this.ctx.lastPoint.x, this.ctx.lastPoint.y, path.x1, path.y1, path.x, path.y);
10652
+          result.push(Math.floor(rectOfQuadraticCurve.y / pageWrapY) + 1);
10653
+          result.push(Math.floor((rectOfQuadraticCurve.y + rectOfQuadraticCurve.h) / pageWrapY) + 1);
10654
+          break;
10655
+
10656
+        case 'bct':
10657
+          var rectOfBezierCurve = getBezierCurveBoundary(this.ctx.lastPoint.x, this.ctx.lastPoint.y, path.x1, path.y1, path.x2, path.y2, path.x, path.y);
10658
+          result.push(Math.floor(rectOfBezierCurve.y / pageWrapY) + 1);
10659
+          result.push(Math.floor((rectOfBezierCurve.y + rectOfBezierCurve.h) / pageWrapY) + 1);
10660
+          break;
10661
+
10662
+        case 'rect':
10663
+          result.push(Math.floor((path.y + this.posY) / pageWrapY) + 1);
10664
+          result.push(Math.floor((path.y + path.h + this.posY) / pageWrapY) + 1);
10665
+      }
10666
+
10667
+      for (var i = 0; i < result.length; i += 1) {
10668
+        while (this.pdf.internal.getNumberOfPages() < result[i]) {
10669
+          addPage.call(this);
10670
+        }
10671
+      }
10672
+
10673
+      return result;
10674
+    };
10675
+
10676
+    var addPage = function addPage() {
10677
+      var fillStyle = this.fillStyle;
10678
+      var strokeStyle = this.strokeStyle;
10679
+      var font = this.font;
10680
+      var lineCap = this.lineCap;
10681
+      var lineWidth = this.lineWidth;
10682
+      var lineJoin = this.lineJoin;
10683
+      this.pdf.addPage();
10684
+      this.fillStyle = fillStyle;
10685
+      this.strokeStyle = strokeStyle;
10686
+      this.font = font;
10687
+      this.lineCap = lineCap;
10688
+      this.lineWidth = lineWidth;
10689
+      this.lineJoin = lineJoin;
10690
+    };
10691
+
10692
+    var pathPositionRedo = function pathPositionRedo(paths, x, y) {
10693
+      for (var i = 0; i < paths.length; i++) {
10694
+        switch (paths[i].type) {
10695
+          case 'bct':
10696
+            paths[i].x2 += x;
10697
+            paths[i].y2 += y;
10698
+
10699
+          case 'qct':
10700
+            paths[i].x1 += x;
10701
+            paths[i].y1 += y;
10702
+
10703
+          case 'mt':
10704
+          case 'lt':
10705
+          case 'arc':
10706
+          default:
10707
+            paths[i].x += x;
10708
+            paths[i].y += y;
10709
+        }
10710
+      }
10711
+
10712
+      return paths;
10713
+    };
10714
+
10715
+    var pathPreProcess = function pathPreProcess(rule, isClip) {
10716
+      var fillStyle = this.fillStyle;
10717
+      var strokeStyle = this.strokeStyle;
10718
+      var font = this.font;
10719
+      var lineCap = this.lineCap;
10720
+      var lineWidth = this.lineWidth;
10721
+      var lineJoin = this.lineJoin;
10722
+      var origPath = JSON.parse(JSON.stringify(this.path));
10723
+      var xPath = JSON.parse(JSON.stringify(this.path));
10724
+      var clipPath;
10725
+      var tmpPath;
10726
+      var pages = [];
10727
+
10728
+      for (var i = 0; i < xPath.length; i++) {
10729
+        if (typeof xPath[i].x !== "undefined") {
10730
+          var page = getPagesByPath.call(this, xPath[i]);
10731
+
10732
+          for (var ii = 0; ii < page.length; ii += 1) {
10733
+            if (pages.indexOf(page[ii]) === -1) {
10734
+              pages.push(page[ii]);
10735
+            }
10736
+          }
10737
+        }
10738
+      }
10739
+
10740
+      for (var i = 0; i < pages.length; i++) {
10741
+        while (this.pdf.internal.getNumberOfPages() < pages[i]) {
10742
+          addPage.call(this);
10743
+        }
10744
+      }
10745
+
10746
+      pages.sort();
10747
+
10748
+      if (this.autoPaging) {
10749
+        var min = pages[0];
10750
+        var max = pages[pages.length - 1];
10751
+
10752
+        for (var i = min; i < max + 1; i++) {
10753
+          this.pdf.setPage(i);
10754
+          this.fillStyle = fillStyle;
10755
+          this.strokeStyle = strokeStyle;
10756
+          this.lineCap = lineCap;
10757
+          this.lineWidth = lineWidth;
10758
+          this.lineJoin = lineJoin;
10759
+
10760
+          if (this.ctx.clip_path.length !== 0) {
10761
+            var tmpPaths = this.path;
10762
+            clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));
10763
+            this.path = pathPositionRedo(clipPath, this.posX, -1 * this.pdf.internal.pageSize.height * (i - 1) + this.posY);
10764
+            drawPaths.call(this, rule, true);
10765
+            this.path = tmpPaths;
10766
+          }
10767
+
10768
+          tmpPath = JSON.parse(JSON.stringify(origPath));
10769
+          this.path = pathPositionRedo(tmpPath, this.posX, -1 * this.pdf.internal.pageSize.height * (i - 1) + this.posY);
10770
+
10771
+          if (isClip === false || i === 0) {
10772
+            drawPaths.call(this, rule, isClip);
10773
+          }
10774
+        }
10775
+      } else {
10776
+        drawPaths.call(this, rule, isClip);
10777
+      }
10778
+
10779
+      this.path = origPath;
10780
+    };
10781
+    /**
10782
+    * Processes the paths
10783
+    *
10784
+    * @function 
10785
+    * @param rule {String}
10786
+    * @param isClip {Boolean}
10787
+    * @private
10788
+    * @ignore
10789
+    */
10790
+
10791
+
10792
+    var drawPaths = function drawPaths(rule, isClip) {
10793
+      if (rule === 'stroke' && !isClip && isStrokeTransparent.call(this)) {
10794
+        return;
10795
+      }
10796
+
10797
+      if (rule !== 'stroke' && !isClip && isFillTransparent.call(this)) {
10798
+        return;
10799
+      }
10800
+
10801
+      var moves = [];
10802
+      var alpha = this.ctx.globalAlpha;
10803
+
10804
+      if (this.ctx.fillOpacity < 1) {
10805
+        alpha = this.ctx.fillOpacity;
10806
+      }
10807
+
10808
+      var xPath = this.path;
10809
+
10810
+      for (var i = 0; i < xPath.length; i++) {
10811
+        var pt = xPath[i];
10812
+
10813
+        switch (pt.type) {
10814
+          case 'begin':
10815
+            moves.push({
10816
+              begin: true
10817
+            });
10818
+            break;
10819
+
10820
+          case 'close':
10821
+            moves.push({
10822
+              close: true
10823
+            });
10824
+            break;
10825
+
10826
+          case 'mt':
10827
+            moves.push({
10828
+              start: pt,
10829
+              deltas: [],
10830
+              abs: []
10831
+            });
10832
+            break;
10833
+
10834
+          case 'lt':
10835
+            var iii = moves.length;
10836
+
10837
+            if (!isNaN(xPath[i - 1].x)) {
10838
+              var delta = [pt.x - xPath[i - 1].x, pt.y - xPath[i - 1].y];
10839
+
10840
+              if (iii > 0) {
10841
+                for (iii; iii >= 0; iii--) {
10842
+                  if (moves[iii - 1].close !== true && moves[iii - 1].begin !== true) {
10843
+                    moves[iii - 1].deltas.push(delta);
10844
+                    moves[iii - 1].abs.push(pt);
10845
+                    break;
10846
+                  }
10847
+                }
10848
+              }
10849
+            }
10850
+
10851
+            break;
10852
+
10853
+          case 'bct':
10854
+            var delta = [pt.x1 - xPath[i - 1].x, pt.y1 - xPath[i - 1].y, pt.x2 - xPath[i - 1].x, pt.y2 - xPath[i - 1].y, pt.x - xPath[i - 1].x, pt.y - xPath[i - 1].y];
10855
+            moves[moves.length - 1].deltas.push(delta);
10856
+            break;
10857
+
10858
+          case 'qct':
10859
+            var x1 = xPath[i - 1].x + 2.0 / 3.0 * (pt.x1 - xPath[i - 1].x);
10860
+            var y1 = xPath[i - 1].y + 2.0 / 3.0 * (pt.y1 - xPath[i - 1].y);
10861
+            var x2 = pt.x + 2.0 / 3.0 * (pt.x1 - pt.x);
10862
+            var y2 = pt.y + 2.0 / 3.0 * (pt.y1 - pt.y);
10863
+            var x3 = pt.x;
10864
+            var y3 = pt.y;
10865
+            var delta = [x1 - xPath[i - 1].x, y1 - xPath[i - 1].y, x2 - xPath[i - 1].x, y2 - xPath[i - 1].y, x3 - xPath[i - 1].x, y3 - xPath[i - 1].y];
10866
+            moves[moves.length - 1].deltas.push(delta);
10867
+            break;
10868
+
10869
+          case 'arc':
10870
+            moves.push({
10871
+              deltas: [],
10872
+              abs: [],
10873
+              arc: true
10874
+            });
10875
+
10876
+            if (Array.isArray(moves[moves.length - 1].abs)) {
10877
+              moves[moves.length - 1].abs.push(pt);
10878
+            }
10879
+
10880
+            break;
10881
+        }
10882
+      }
10883
+
10884
+      var style;
10885
+
10886
+      if (!isClip) {
10887
+        if (rule === 'stroke') {
10888
+          style = 'stroke';
10889
+        } else {
10890
+          style = 'fill';
10891
+        }
10892
+      } else {
10893
+        style = null;
10894
+      }
10895
+
10896
+      for (var i = 0; i < moves.length; i++) {
10897
+        if (moves[i].arc) {
10898
+          var arcs = moves[i].abs;
10899
+
10900
+          for (var ii = 0; ii < arcs.length; ii++) {
10901
+            var arc = arcs[ii];
10902
+
10903
+            if (typeof arc.startAngle !== 'undefined') {
10904
+              var start = rad2deg(arc.startAngle);
10905
+              var end = rad2deg(arc.endAngle);
10906
+              var x = arc.x;
10907
+              var y = arc.y;
10908
+              drawArc.call(this, x, y, arc.radius, start, end, arc.counterclockwise, style, isClip);
10909
+            } else {
10910
+              drawLine.call(this, arc.x, arc.y);
10911
+            }
10912
+          }
10913
+        }
10914
+
10915
+        if (!moves[i].arc) {
10916
+          if (moves[i].close !== true && moves[i].begin !== true) {
10917
+            var x = moves[i].start.x;
10918
+            var y = moves[i].start.y;
10919
+            drawLines.call(this, moves[i].deltas, x, y, null, null);
10920
+          }
10921
+        }
10922
+      }
10923
+
10924
+      if (style) {
10925
+        putStyle.call(this, style);
10926
+      }
10927
+
10928
+      if (isClip) {
10929
+        doClip.call(this);
10930
+      }
10931
+    };
10932
+
10933
+    var getBaseline = function getBaseline(y) {
10934
+      var height = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor;
10935
+      var descent = height * (this.pdf.internal.getLineHeightFactor() - 1);
10936
+
10937
+      switch (this.ctx.textBaseline) {
10938
+        case 'bottom':
10939
+          return y - descent;
10940
+
10941
+        case 'top':
10942
+          return y + height - descent;
10943
+
10944
+        case 'hanging':
10945
+          return y + height - 2 * descent;
10946
+
10947
+        case 'middle':
10948
+          return y + height / 2 - descent;
10949
+
10950
+        case 'ideographic':
10951
+          // TODO not implemented
10952
+          return y;
10953
+
10954
+        case 'alphabetic':
10955
+        default:
10956
+          return y;
10957
+      }
10958
+    };
10959
+
10960
+    Context2D.prototype.createLinearGradient = function createLinearGradient() {
10961
+      var canvasGradient = function canvasGradient() {};
10962
+
10963
+      canvasGradient.colorStops = [];
10964
+
10965
+      canvasGradient.addColorStop = function (offset, color) {
10966
+        this.colorStops.push([offset, color]);
10967
+      };
10968
+
10969
+      canvasGradient.getColor = function () {
10970
+        if (this.colorStops.length === 0) {
10971
+          return '#000000';
10972
+        }
10973
+
10974
+        return this.colorStops[0][1];
10975
+      };
10976
+
10977
+      canvasGradient.isCanvasGradient = true;
10978
+      return canvasGradient;
10979
+    };
10980
+
10981
+    Context2D.prototype.createPattern = function createPattern() {
10982
+      return this.createLinearGradient();
10983
+    };
10984
+
10985
+    Context2D.prototype.createRadialGradient = function createRadialGradient() {
10986
+      return this.createLinearGradient();
10987
+    };
10988
+    /**
10989
+    *
10990
+    * @param x Edge point X
10991
+    * @param y Edge point Y
10992
+    * @param r Radius
10993
+    * @param a1 start angle
10994
+    * @param a2 end angle
10995
+    * @param counterclockwise
10996
+    * @param style
10997
+    * @param isClip
10998
+    */
10999
+
11000
+
11001
+    var drawArc = function drawArc(x, y, r, a1, a2, counterclockwise, style, isClip) {
11002
+      var k = this.pdf.internal.scaleFactor;
11003
+      var a1r = deg2rad(a1);
11004
+      var a2r = deg2rad(a2);
11005
+      var curves = createArc.call(this, r, a1r, a2r, counterclockwise);
11006
+
11007
+      for (var i = 0; i < curves.length; i++) {
11008
+        var curve = curves[i];
11009
+
11010
+        if (i === 0) {
11011
+          doMove.call(this, curve.x1 + x, curve.y1 + y);
11012
+        }
11013
+        drawCurve.call(this, x, y, curve.x2, curve.y2, curve.x3, curve.y3, curve.x4, curve.y4);
11014
+      }
11015
+
11016
+      if (!isClip) {
11017
+        putStyle.call(this, style);
11018
+      } else {
11019
+        doClip.call(this);
11020
+      }
11021
+    };
11022
+
11023
+    var putStyle = function putStyle(style) {
11024
+      switch (style) {
11025
+        case 'stroke':
11026
+          this.pdf.internal.out('S');
11027
+          break;
11028
+
11029
+        case 'fill':
11030
+          this.pdf.internal.out('f');
11031
+          break;
11032
+      }
11033
+    };
11034
+
11035
+    var doClip = function doClip() {
11036
+      this.pdf.clip();
11037
+    };
11038
+
11039
+    var doMove = function doMove(x, y) {
11040
+      this.pdf.internal.out(getHorizontalCoordinateString(x) + ' ' + getVerticalCoordinateString(y) + ' m');
11041
+    };
11042
+
11043
+    var putText = function putText(options) {
11044
+      var textAlign;
11045
+
11046
+      switch (options.align) {
11047
+        case 'right':
11048
+        case 'end':
11049
+          textAlign = 'right';
11050
+          break;
11051
+
11052
+        case 'center':
11053
+          textAlign = 'center';
11054
+          break;
11055
+
11056
+        case 'left':
11057
+        case 'start':
11058
+        default:
11059
+          textAlign = 'left';
11060
+          break;
11061
+      }
11062
+
11063
+      var pt = this.ctx.transform.applyToPoint(new Point(options.x, options.y));
11064
+      var decomposedTransformationMatrix = this.ctx.transform.decompose();
11065
+      var matrix = new Matrix();
11066
+      matrix = matrix.multiply(decomposedTransformationMatrix.translate);
11067
+      matrix = matrix.multiply(decomposedTransformationMatrix.skew);
11068
+      matrix = matrix.multiply(decomposedTransformationMatrix.scale);
11069
+      var textDimensions = this.pdf.getTextDimensions(options.text);
11070
+      var textRect = this.ctx.transform.applyToRectangle(new Rectangle(options.x, options.y, textDimensions.w, textDimensions.h));
11071
+      var textXRect = matrix.applyToRectangle(new Rectangle(options.x, options.y - textDimensions.h, textDimensions.w, textDimensions.h));
11072
+      var pageArray = getPagesByPath.call(this, textXRect);
11073
+      var pages = [];
11074
+
11075
+      for (var ii = 0; ii < pageArray.length; ii += 1) {
11076
+        if (pages.indexOf(pageArray[ii]) === -1) {
11077
+          pages.push(pageArray[ii]);
11078
+        }
11079
+      }
11080
+
11081
+      pages.sort();
11082
+      var clipPath;
11083
+
11084
+      if (this.autoPaging === true) {
11085
+        var min = pages[0];
11086
+        var max = pages[pages.length - 1];
11087
+
11088
+        for (var i = min; i < max + 1; i++) {
11089
+          this.pdf.setPage(i);
11090
+
11091
+          if (this.ctx.clip_path.length !== 0) {
11092
+            var tmpPaths = this.path;
11093
+            clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));
11094
+            this.path = pathPositionRedo(clipPath, this.posX, -1 * this.pdf.internal.pageSize.height * (i - 1) + this.posY);
11095
+            drawPaths.call(this, 'fill', true);
11096
+            this.path = tmpPaths;
11097
+          }
11098
+
11099
+          var tmpRect = JSON.parse(JSON.stringify(textRect));
11100
+          tmpRect = pathPositionRedo([tmpRect], this.posX, -1 * this.pdf.internal.pageSize.height * (i - 1) + this.posY)[0];
11101
+
11102
+          if (options.scale >= 0.01) {
11103
+            var oldSize = this.pdf.internal.getFontSize();
11104
+            this.pdf.setFontSize(oldSize * options.scale);
11105
+          }
11106
+
11107
+          this.pdf.text(options.text, tmpRect.x, tmpRect.y, {
11108
+            angle: options.angle,
11109
+            align: textAlign,
11110
+            renderingMode: options.renderingMode,
11111
+            maxWidth: options.maxWidth
11112
+          });
11113
+
11114
+          if (options.scale >= 0.01) {
11115
+            this.pdf.setFontSize(oldSize);
11116
+          }
11117
+        }
11118
+      } else {
11119
+        if (options.scale >= 0.01) {
11120
+          var oldSize = this.pdf.internal.getFontSize();
11121
+          this.pdf.setFontSize(oldSize * options.scale);
11122
+        }
11123
+
11124
+        this.pdf.text(options.text, pt.x + this.posX, pt.y + this.posY, {
11125
+          angle: options.angle,
11126
+          align: textAlign,
11127
+          renderingMode: options.renderingMode,
11128
+          maxWidth: options.maxWidth
11129
+        });
11130
+
11131
+        if (options.scale >= 0.01) {
11132
+          this.pdf.setFontSize(oldSize);
11133
+        }
11134
+      }
11135
+    };
11136
+
11137
+    var drawLine = function drawLine(x, y, prevX, prevY) {
11138
+      prevX = prevX || 0;
11139
+      prevY = prevY || 0;
11140
+      this.pdf.internal.out(getHorizontalCoordinateString(x + prevX) + ' ' + getVerticalCoordinateString(y + prevY) + ' l');
11141
+    };
11142
+
11143
+    var drawLines = function drawLines(lines, x, y) {
11144
+      return this.pdf.lines(lines, x, y, null, null);
11145
+    };
11146
+
11147
+    var drawCurve = function drawCurve(x, y, x1, y1, x2, y2, x3, y3) {
11148
+      this.pdf.internal.out([f2(getHorizontalCoordinate(x1 + x)), f2(getVerticalCoordinate(y1 + y)), f2(getHorizontalCoordinate(x2 + x)), f2(getVerticalCoordinate(y2 + y)), f2(getHorizontalCoordinate(x3 + x)), f2(getVerticalCoordinate(y3 + y)), 'c'].join(' '));
11149
+    };
11150
+    /**
11151
+    * Return a array of objects that represent bezier curves which approximate the circular arc centered at the origin, from startAngle to endAngle (radians) with the specified radius.
11152
+    *
11153
+    * Each bezier curve is an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points.
11154
+    * @function createArc
11155
+    */
11156
+
11157
+
11158
+    var createArc = function createArc(radius, startAngle, endAngle, anticlockwise) {
11159
+      var EPSILON = 0.00001; // Roughly 1/1000th of a degree, see below        // normalize startAngle, endAngle to [-2PI, 2PI]
11160
+
11161
+      var twoPI = Math.PI * 2;
11162
+      var startAngleN = startAngle;
11163
+
11164
+      if (startAngleN < twoPI || startAngleN > twoPI) {
11165
+        startAngleN = startAngleN % twoPI;
11166
+      }
11167
+
11168
+      var endAngleN = endAngle;
11169
+
11170
+      if (endAngleN < twoPI || endAngleN > twoPI) {
11171
+        endAngleN = endAngleN % twoPI;
11172
+      } // Compute the sequence of arc curves, up to PI/2 at a time.        // Total arc angle is less than 2PI.
11173
+
11174
+
11175
+      var curves = [];
11176
+      var piOverTwo = Math.PI / 2.0; //var sgn = (startAngle < endAngle) ? +1 : -1; // clockwise or counterclockwise
11177
+
11178
+      var sgn = anticlockwise ? -1 : +1;
11179
+      var a1 = startAngle;
11180
+
11181
+      for (var totalAngle = Math.min(twoPI, Math.abs(endAngleN - startAngleN)); totalAngle > EPSILON;) {
11182
+        var a2 = a1 + sgn * Math.min(totalAngle, piOverTwo);
11183
+        curves.push(createSmallArc.call(this, radius, a1, a2));
11184
+        totalAngle -= Math.abs(a2 - a1);
11185
+        a1 = a2;
11186
+      }
11187
+
11188
+      return curves;
11189
+    };
11190
+    /**
11191
+    * Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2. The arc's radius is r.
11192
+    *
11193
+    * Returns an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points.
11194
+    *
11195
+    * This algorithm is based on the approach described in: A. Riškus, "Approximation of a Cubic Bezier Curve by Circular Arcs and Vice Versa," Information Technology and Control, 35(4), 2006 pp. 371-378.
11196
+    */
11197
+
11198
+
11199
+    var createSmallArc = function createSmallArc(r, a1, a2) {
11200
+      var a = (a2 - a1) / 2.0;
11201
+      var x4 = r * Math.cos(a);
11202
+      var y4 = r * Math.sin(a);
11203
+      var x1 = x4;
11204
+      var y1 = -y4;
11205
+      var q1 = x1 * x1 + y1 * y1;
11206
+      var q2 = q1 + x1 * x4 + y1 * y4;
11207
+      var k2 = 4 / 3 * (Math.sqrt(2 * q1 * q2) - q2) / (x1 * y4 - y1 * x4);
11208
+      var x2 = x1 - k2 * y1;
11209
+      var y2 = y1 + k2 * x1;
11210
+      var x3 = x2;
11211
+      var y3 = -y2;
11212
+      var ar = a + a1;
11213
+      var cos_ar = Math.cos(ar);
11214
+      var sin_ar = Math.sin(ar);
11215
+      return {
11216
+        x1: r * Math.cos(a1),
11217
+        y1: r * Math.sin(a1),
11218
+        x2: x2 * cos_ar - y2 * sin_ar,
11219
+        y2: x2 * sin_ar + y2 * cos_ar,
11220
+        x3: x3 * cos_ar - y3 * sin_ar,
11221
+        y3: x3 * sin_ar + y3 * cos_ar,
11222
+        x4: r * Math.cos(a2),
11223
+        y4: r * Math.sin(a2)
11224
+      };
11225
+    };
11226
+
11227
+    var rad2deg = function rad2deg(value) {
11228
+      return value * 180 / Math.PI;
11229
+    };
11230
+
11231
+    var deg2rad = function deg2rad(deg) {
11232
+      return deg * Math.PI / 180;
11233
+    };
11234
+
11235
+    var getQuadraticCurveBoundary = function getQuadraticCurveBoundary(sx, sy, cpx, cpy, ex, ey) {
11236
+      var midX1 = sx + (cpx - sx) * 0.50;
11237
+      var midY1 = sy + (cpy - sy) * 0.50;
11238
+      var midX2 = ex + (cpx - ex) * 0.50;
11239
+      var midY2 = ey + (cpy - ey) * 0.50;
11240
+      var resultX1 = Math.min(sx, ex, midX1, midX2);
11241
+      var resultX2 = Math.max(sx, ex, midX1, midX2);
11242
+      var resultY1 = Math.min(sy, ey, midY1, midY2);
11243
+      var resultY2 = Math.max(sy, ey, midY1, midY2);
11244
+      return new Rectangle(resultX1, resultY1, resultX2 - resultX1, resultY2 - resultY1);
11245
+    }; //De Casteljau algorithm
11246
+
11247
+
11248
+    var getBezierCurveBoundary = function getBezierCurveBoundary(ax, ay, bx, by, cx, cy, dx, dy) {
11249
+      var tobx = bx - ax;
11250
+      var toby = by - ay;
11251
+      var tocx = cx - bx;
11252
+      var tocy = cy - by;
11253
+      var todx = dx - cx;
11254
+      var tody = dy - cy;
11255
+      var precision = 40;
11256
+      var d, px, py, qx, qy, rx, ry, tx, ty, sx, sy, x, y, i, minx, miny, maxx, maxy, toqx, toqy, torx, tory, totx, toty;
11257
+
11258
+      for (var i = 0; i < precision + 1; i++) {
11259
+        d = i / precision;
11260
+        px = ax + d * tobx;
11261
+        py = ay + d * toby;
11262
+        qx = bx + d * tocx;
11263
+        qy = by + d * tocy;
11264
+        rx = cx + d * todx;
11265
+        ry = cy + d * tody;
11266
+        toqx = qx - px;
11267
+        toqy = qy - py;
11268
+        torx = rx - qx;
11269
+        tory = ry - qy;
11270
+        sx = px + d * toqx;
11271
+        sy = py + d * toqy;
11272
+        tx = qx + d * torx;
11273
+        ty = qy + d * tory;
11274
+        totx = tx - sx;
11275
+        toty = ty - sy;
11276
+        x = sx + d * totx;
11277
+        y = sy + d * toty;
11278
+
11279
+        if (i == 0) {
11280
+          minx = x;
11281
+          miny = y;
11282
+          maxx = x;
11283
+          maxy = y;
11284
+        } else {
11285
+          minx = Math.min(minx, x);
11286
+          miny = Math.min(miny, y);
11287
+          maxx = Math.max(maxx, x);
11288
+          maxy = Math.max(maxy, y);
11289
+        }
11290
+      }
11291
+
11292
+      return new Rectangle(Math.round(minx), Math.round(miny), Math.round(maxx - minx), Math.round(maxy - miny));
11293
+    };
11294
+
11295
+    var Point = function Point(x, y) {
11296
+      var _x = x || 0;
11297
+
11298
+      Object.defineProperty(this, 'x', {
11299
+        enumerable: true,
11300
+        get: function get() {
11301
+          return _x;
11302
+        },
11303
+        set: function set(value) {
11304
+          if (!isNaN(value)) {
11305
+            _x = parseFloat(value);
11306
+          }
11307
+        }
11308
+      });
11309
+
11310
+      var _y = y || 0;
11311
+
11312
+      Object.defineProperty(this, 'y', {
11313
+        enumerable: true,
11314
+        get: function get() {
11315
+          return _y;
11316
+        },
11317
+        set: function set(value) {
11318
+          if (!isNaN(value)) {
11319
+            _y = parseFloat(value);
11320
+          }
11321
+        }
11322
+      });
11323
+      var _type = 'pt';
11324
+      Object.defineProperty(this, 'type', {
11325
+        enumerable: true,
11326
+        get: function get() {
11327
+          return _type;
11328
+        },
11329
+        set: function set(value) {
11330
+          _type = value.toString();
11331
+        }
11332
+      });
11333
+      return this;
11334
+    };
11335
+
11336
+    var Rectangle = function Rectangle(x, y, w, h) {
11337
+      Point.call(this, x, y);
11338
+      this.type = 'rect';
11339
+
11340
+      var _w = w || 0;
11341
+
11342
+      Object.defineProperty(this, 'w', {
11343
+        enumerable: true,
11344
+        get: function get() {
11345
+          return _w;
11346
+        },
11347
+        set: function set(value) {
11348
+          if (!isNaN(value)) {
11349
+            _w = parseFloat(value);
11350
+          }
11351
+        }
11352
+      });
11353
+
11354
+      var _h = h || 0;
11355
+
11356
+      Object.defineProperty(this, 'h', {
11357
+        enumerable: true,
11358
+        get: function get() {
11359
+          return _h;
11360
+        },
11361
+        set: function set(value) {
11362
+          if (!isNaN(value)) {
11363
+            _h = parseFloat(value);
11364
+          }
11365
+        }
11366
+      });
11367
+      return this;
11368
+    };
11369
+
11370
+    var Matrix = function Matrix(sx, shy, shx, sy, tx, ty) {
11371
+      var _matrix = [];
11372
+      Object.defineProperty(this, 'sx', {
11373
+        get: function get() {
11374
+          return _matrix[0];
11375
+        },
11376
+        set: function set(value) {
11377
+          _matrix[0] = Math.round(value * 100000) / 100000;
11378
+        }
11379
+      });
11380
+      Object.defineProperty(this, 'shy', {
11381
+        get: function get() {
11382
+          return _matrix[1];
11383
+        },
11384
+        set: function set(value) {
11385
+          _matrix[1] = Math.round(value * 100000) / 100000;
11386
+        }
11387
+      });
11388
+      Object.defineProperty(this, 'shx', {
11389
+        get: function get() {
11390
+          return _matrix[2];
11391
+        },
11392
+        set: function set(value) {
11393
+          _matrix[2] = Math.round(value * 100000) / 100000;
11394
+        }
11395
+      });
11396
+      Object.defineProperty(this, 'sy', {
11397
+        get: function get() {
11398
+          return _matrix[3];
11399
+        },
11400
+        set: function set(value) {
11401
+          _matrix[3] = Math.round(value * 100000) / 100000;
11402
+        }
11403
+      });
11404
+      Object.defineProperty(this, 'tx', {
11405
+        get: function get() {
11406
+          return _matrix[4];
11407
+        },
11408
+        set: function set(value) {
11409
+          _matrix[4] = Math.round(value * 100000) / 100000;
11410
+        }
11411
+      });
11412
+      Object.defineProperty(this, 'ty', {
11413
+        get: function get() {
11414
+          return _matrix[5];
11415
+        },
11416
+        set: function set(value) {
11417
+          _matrix[5] = Math.round(value * 100000) / 100000;
11418
+        }
11419
+      });
11420
+      Object.defineProperty(this, 'rotation', {
11421
+        get: function get() {
11422
+          return Math.atan2(this.shx, this.sx);
11423
+        }
11424
+      });
11425
+      Object.defineProperty(this, 'scaleX', {
11426
+        get: function get() {
11427
+          return this.decompose().scale.sx;
11428
+        }
11429
+      });
11430
+      Object.defineProperty(this, 'scaleY', {
11431
+        get: function get() {
11432
+          return this.decompose().scale.sy;
11433
+        }
11434
+      });
11435
+      Object.defineProperty(this, 'isIdentity', {
11436
+        get: function get() {
11437
+          if (this.sx !== 1) {
11438
+            return false;
11439
+          }
11440
+
11441
+          if (this.shy !== 0) {
11442
+            return false;
11443
+          }
11444
+
11445
+          if (this.shx !== 0) {
11446
+            return false;
11447
+          }
11448
+
11449
+          if (this.sy !== 1) {
11450
+            return false;
11451
+          }
11452
+
11453
+          if (this.tx !== 0) {
11454
+            return false;
11455
+          }
11456
+
11457
+          if (this.ty !== 0) {
11458
+            return false;
11459
+          }
11460
+
11461
+          return true;
11462
+        }
11463
+      });
11464
+      this.sx = !isNaN(sx) ? sx : 1;
11465
+      this.shy = !isNaN(shy) ? shy : 0;
11466
+      this.shx = !isNaN(shx) ? shx : 0;
11467
+      this.sy = !isNaN(sy) ? sy : 1;
11468
+      this.tx = !isNaN(tx) ? tx : 0;
11469
+      this.ty = !isNaN(ty) ? ty : 0;
11470
+      return this;
11471
+    };
11472
+    /**
11473
+    * Multiply the matrix with given Matrix
11474
+    * 
11475
+    * @function multiply
11476
+    * @param matrix
11477
+    * @returns {Matrix}
11478
+    * @private
11479
+    * @ignore
11480
+    */
11481
+
11482
+
11483
+    Matrix.prototype.multiply = function (matrix) {
11484
+      var sx = matrix.sx * this.sx + matrix.shy * this.shx;
11485
+      var shy = matrix.sx * this.shy + matrix.shy * this.sy;
11486
+      var shx = matrix.shx * this.sx + matrix.sy * this.shx;
11487
+      var sy = matrix.shx * this.shy + matrix.sy * this.sy;
11488
+      var tx = matrix.tx * this.sx + matrix.ty * this.shx + this.tx;
11489
+      var ty = matrix.tx * this.shy + matrix.ty * this.sy + this.ty;
11490
+      return new Matrix(sx, shy, shx, sy, tx, ty);
11491
+    };
11492
+    /**
11493
+    * @function decompose
11494
+    * @private
11495
+    * @ignore
11496
+    */
11497
+
11498
+
11499
+    Matrix.prototype.decompose = function () {
11500
+      var a = this.sx;
11501
+      var b = this.shy;
11502
+      var c = this.shx;
11503
+      var d = this.sy;
11504
+      var e = this.tx;
11505
+      var f = this.ty;
11506
+      var scaleX = Math.sqrt(a * a + b * b);
11507
+      a /= scaleX;
11508
+      b /= scaleX;
11509
+      var shear = a * c + b * d;
11510
+      c -= a * shear;
11511
+      d -= b * shear;
11512
+      var scaleY = Math.sqrt(c * c + d * d);
11513
+      c /= scaleY;
11514
+      d /= scaleY;
11515
+      shear /= scaleY;
11516
+
11517
+      if (a * d < b * c) {
11518
+        a = -a;
11519
+        b = -b;
11520
+        shear = -shear;
11521
+        scaleX = -scaleX;
11522
+      }
11523
+
11524
+      return {
11525
+        scale: new Matrix(scaleX, 0, 0, scaleY, 0, 0),
11526
+        translate: new Matrix(1, 0, 0, 1, e, f),
11527
+        rotate: new Matrix(a, b, -b, a, 0, 0),
11528
+        skew: new Matrix(1, 0, shear, 1, 0, 0)
11529
+      };
11530
+    };
11531
+    /**
11532
+    * @function applyToPoint
11533
+    * @private
11534
+    * @ignore
11535
+    */
11536
+
11537
+
11538
+    Matrix.prototype.applyToPoint = function (pt) {
11539
+      var x = pt.x * this.sx + pt.y * this.shx + this.tx;
11540
+      var y = pt.x * this.shy + pt.y * this.sy + this.ty;
11541
+      return new Point(x, y);
11542
+    };
11543
+    /**
11544
+    * @function applyToRectangle
11545
+    * @private
11546
+    * @ignore
11547
+    */
11548
+
11549
+
11550
+    Matrix.prototype.applyToRectangle = function (rect) {
11551
+      var pt1 = this.applyToPoint(rect);
11552
+      var pt2 = this.applyToPoint(new Point(rect.x + rect.w, rect.y + rect.h));
11553
+      return new Rectangle(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y);
11554
+    };
11555
+    /**
11556
+    * @function clone
11557
+    * @private
11558
+    * @ignore
11559
+    */
11560
+
11561
+
11562
+    Matrix.prototype.clone = function () {
11563
+      var sx = this.sx;
11564
+      var shy = this.shy;
11565
+      var shx = this.shx;
11566
+      var sy = this.sy;
11567
+      var tx = this.tx;
11568
+      var ty = this.ty;
11569
+      return new Matrix(sx, shy, shx, sy, tx, ty);
11570
+    };
11571
+  })(jsPDF.API, typeof self !== 'undefined' && self || typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || Function('return typeof this === "object" && this.content')() || Function('return this')());
11572
+
11573
+  /**
11574
+   * jsPDF filters PlugIn
11575
+   * Copyright (c) 2014 Aras Abbasi 
11576
+   *
11577
+   * Licensed under the MIT License.
11578
+   * http://opensource.org/licenses/mit-license
11579
+   */
11580
+  (function (jsPDFAPI) {
11581
+
11582
+    var ASCII85Encode = function ASCII85Encode(a) {
11583
+      var b, c, d, e, f, g, h, i, j, k;
11584
+
11585
+      for (!/[^\x00-\xFF]/.test(a), b = "\x00\x00\x00\x00".slice(a.length % 4 || 4), a += b, c = [], d = 0, e = a.length; e > d; d += 4) {
11586
+        f = (a.charCodeAt(d) << 24) + (a.charCodeAt(d + 1) << 16) + (a.charCodeAt(d + 2) << 8) + a.charCodeAt(d + 3), 0 !== f ? (k = f % 85, f = (f - k) / 85, j = f % 85, f = (f - j) / 85, i = f % 85, f = (f - i) / 85, h = f % 85, f = (f - h) / 85, g = f % 85, c.push(g + 33, h + 33, i + 33, j + 33, k + 33)) : c.push(122);
11587
+      }
11588
+
11589
+      return function (a, b) {
11590
+        for (var c = b; c > 0; c--) {
11591
+          a.pop();
11592
+        }
11593
+      }(c, b.length), String.fromCharCode.apply(String, c) + "~>";
11594
+    };
11595
+
11596
+    var ASCII85Decode = function ASCII85Decode(a) {
11597
+      var c,
11598
+          d,
11599
+          e,
11600
+          f,
11601
+          g,
11602
+          h = String,
11603
+          l = "length",
11604
+          w = 255,
11605
+          x = "charCodeAt",
11606
+          y = "slice",
11607
+          z = "replace";
11608
+
11609
+      for ("~>" === a[y](-2), a = a[y](0, -2)[z](/\s/g, "")[z]("z", "!!!!!"), c = "uuuuu"[y](a[l] % 5 || 5), a += c, e = [], f = 0, g = a[l]; g > f; f += 5) {
11610
+        d = 52200625 * (a[x](f) - 33) + 614125 * (a[x](f + 1) - 33) + 7225 * (a[x](f + 2) - 33) + 85 * (a[x](f + 3) - 33) + (a[x](f + 4) - 33), e.push(w & d >> 24, w & d >> 16, w & d >> 8, w & d);
11611
+      }
11612
+
11613
+      return function (a, b) {
11614
+        for (var c = b; c > 0; c--) {
11615
+          a.pop();
11616
+        }
11617
+      }(e, c[l]), h.fromCharCode.apply(h, e);
11618
+    };
11619
+    /**
11620
+    * TODO: Not Tested:
11621
+    //https://gist.github.com/revolunet/843889
11622
+    // LZW-compress a string
11623
+    var LZWEncode = function(s, options) {
11624
+      options = Object.assign({
11625
+        predictor: 1,
11626
+        colors: 1,
11627
+        bitsPerComponent: 8,
11628
+        columns: 1,
11629
+        earlyChange: 1
11630
+      }, options);
11631
+       var dict = {};
11632
+      var data = (s + "").split("");
11633
+      var out = [];
11634
+      var currChar;
11635
+      var phrase = data[0];
11636
+      var code = 256; //0xe000
11637
+      for (var i=1; i<data.length; i++) {
11638
+        currChar=data[i];
11639
+        if (dict['_' + phrase + currChar] != null) {
11640
+          phrase += currChar;
11641
+        }
11642
+        else {
11643
+          out.push(phrase.length > 1 ? dict['_'+phrase] : phrase.charCodeAt(0));
11644
+          dict['_' + phrase + currChar] = code;
11645
+          code++;
11646
+          phrase=currChar;
11647
+        }
11648
+      }
11649
+      out.push(phrase.length > 1 ? dict['_'+phrase] : phrase.charCodeAt(0));
11650
+      for (var i=0; i<out.length; i++) {
11651
+        out[i] = String.fromCharCode(out[i]);
11652
+      }
11653
+      return out.join("");
11654
+    }
11655
+     // Decompress an LZW-encoded string
11656
+    var LZWDecode = function(s, options) {
11657
+      options = Object.assign({
11658
+        predictor: 1,
11659
+        colors: 1,
11660
+        bitsPerComponent: 8,
11661
+        columns: 1,
11662
+        earlyChange: 1
11663
+      }, options);
11664
+       var dict = {};
11665
+      var data = (s + "").split("");
11666
+      var currChar = data[0];
11667
+      var oldPhrase = currChar;
11668
+      var out = [currChar];
11669
+      var code = 256;
11670
+      var phrase;
11671
+      for (var i=1; i<data.length; i++) {
11672
+        var currCode = data[i].charCodeAt(0);
11673
+        if (currCode < 256) {
11674
+          phrase = data[i];
11675
+        }
11676
+        else {
11677
+           phrase = dict['_'+currCode] ? dict['_'+currCode] : (oldPhrase + currChar);
11678
+        }
11679
+        out.push(phrase);
11680
+        currChar = phrase.charAt(0);
11681
+        dict['_'+code] = oldPhrase + currChar;
11682
+        code++;
11683
+        oldPhrase = phrase;
11684
+      }
11685
+      return out.join("");
11686
+    }
11687
+    */
11688
+
11689
+
11690
+    var ASCIIHexEncode = function ASCIIHexEncode(value) {
11691
+      var result = '';
11692
+      var i;
11693
+
11694
+      for (var i = 0; i < value.length; i += 1) {
11695
+        result += ("0" + value.charCodeAt(i).toString(16)).slice(-2);
11696
+      }
11697
+
11698
+      result += '>';
11699
+      return result;
11700
+    };
11701
+
11702
+    var ASCIIHexDecode = function ASCIIHexDecode(value) {
11703
+      var regexCheckIfHex = new RegExp(/^([0-9A-Fa-f]{2})+$/);
11704
+      value = value.replace(/\s/g, '');
11705
+
11706
+      if (value.indexOf(">") !== -1) {
11707
+        value = value.substr(0, value.indexOf(">"));
11708
+      }
11709
+
11710
+      if (value.length % 2) {
11711
+        value += "0";
11712
+      }
11713
+
11714
+      if (regexCheckIfHex.test(value) === false) {
11715
+        return "";
11716
+      }
11717
+
11718
+      var result = '';
11719
+      var i;
11720
+
11721
+      for (var i = 0; i < value.length; i += 2) {
11722
+        result += String.fromCharCode("0x" + (value[i] + value[i + 1]));
11723
+      }
11724
+
11725
+      return result;
11726
+    };
11727
+
11728
+    var FlateEncode = function FlateEncode(data, options) {
11729
+      options = Object.assign({
11730
+        predictor: 1,
11731
+        colors: 1,
11732
+        bitsPerComponent: 8,
11733
+        columns: 1
11734
+      }, options);
11735
+      var arr = [];
11736
+      var i = data.length;
11737
+      var adler32;
11738
+      var deflater;
11739
+
11740
+      while (i--) {
11741
+        arr[i] = data.charCodeAt(i);
11742
+      }
11743
+
11744
+      adler32 = jsPDFAPI.adler32cs.from(data);
11745
+      deflater = new Deflater(6);
11746
+      deflater.append(new Uint8Array(arr));
11747
+      data = deflater.flush();
11748
+      arr = new Uint8Array(data.length + 6);
11749
+      arr.set(new Uint8Array([120, 156])), arr.set(data, 2);
11750
+      arr.set(new Uint8Array([adler32 & 0xFF, adler32 >> 8 & 0xFF, adler32 >> 16 & 0xFF, adler32 >> 24 & 0xFF]), data.length + 2);
11751
+      data = String.fromCharCode.apply(null, arr);
11752
+      return data;
11753
+    };
11754
+
11755
+    jsPDFAPI.processDataByFilters = function (origData, filterChain) {
11756
+
11757
+      var i = 0;
11758
+      var data = origData || '';
11759
+      var reverseChain = [];
11760
+      filterChain = filterChain || [];
11761
+
11762
+      if (typeof filterChain === "string") {
11763
+        filterChain = [filterChain];
11764
+      }
11765
+
11766
+      for (i = 0; i < filterChain.length; i += 1) {
11767
+        switch (filterChain[i]) {
11768
+          case "ASCII85Decode":
11769
+          case "/ASCII85Decode":
11770
+            data = ASCII85Decode(data);
11771
+            reverseChain.push("/ASCII85Encode");
11772
+            break;
11773
+
11774
+          case "ASCII85Encode":
11775
+          case "/ASCII85Encode":
11776
+            data = ASCII85Encode(data);
11777
+            reverseChain.push("/ASCII85Decode");
11778
+            break;
11779
+
11780
+          case "ASCIIHexDecode":
11781
+          case "/ASCIIHexDecode":
11782
+            data = ASCIIHexDecode(data);
11783
+            reverseChain.push("/ASCIIHexEncode");
11784
+            break;
11785
+
11786
+          case "ASCIIHexEncode":
11787
+          case "/ASCIIHexEncode":
11788
+            data = ASCIIHexEncode(data);
11789
+            reverseChain.push("/ASCIIHexDecode");
11790
+            break;
11791
+
11792
+          case "FlateEncode":
11793
+          case "/FlateEncode":
11794
+            data = FlateEncode(data);
11795
+            reverseChain.push("/FlateDecode");
11796
+            break;
11797
+
11798
+          /**
11799
+          case "LZWDecode":
11800
+          case "/LZWDecode":
11801
+            data = LZWDecode(data);
11802
+            reverseChain.push("/LZWEncode");
11803
+            break;
11804
+          case "LZWEncode":
11805
+          case "/LZWEncode":
11806
+            data = LZWEncode(data);
11807
+            reverseChain.push("/LZWDecode");
11808
+            break;
11809
+          */
11810
+
11811
+          default:
11812
+            throw "The filter: \"" + filterChain[i] + "\" is not implemented";
11813
+        }
11814
+      }
11815
+
11816
+      return {
11817
+        data: data,
11818
+        reverseChain: reverseChain.reverse().join(" ")
11819
+      };
11820
+    };
11821
+  })(jsPDF.API);
11822
+
11823
+  /**
11824
+   * jsPDF fileloading PlugIn
11825
+   * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
11826
+   *
11827
+   * Licensed under the MIT License.
11828
+   * http://opensource.org/licenses/mit-license
11829
+   */
11830
+
11831
+  /**
11832
+  * @name fileloading
11833
+  * @module
11834
+  */
11835
+  (function (jsPDFAPI) {
11836
+    /**
11837
+    * @name loadFile
11838
+    * @function
11839
+    * @param {string} url
11840
+    * @param {boolean} sync
11841
+    * @param {function} callback
11842
+    * @returns {string|undefined} result
11843
+    */
11844
+
11845
+    jsPDFAPI.loadFile = function (url, sync, callback) {
11846
+      sync = sync || true;
11847
+
11848
+      callback = callback || function () {};
11849
+
11850
+      var result;
11851
+
11852
+      var xhr = function xhr(url, sync, callback) {
11853
+        var req = new XMLHttpRequest();
11854
+        var byteArray = [];
11855
+        var i = 0;
11856
+
11857
+        var sanitizeUnicode = function sanitizeUnicode(data) {
11858
+          var dataLength = data.length;
11859
+          var StringFromCharCode = String.fromCharCode; //Transform Unicode to ASCII
11860
+
11861
+          for (i = 0; i < dataLength; i += 1) {
11862
+            byteArray.push(StringFromCharCode(data.charCodeAt(i) & 0xff));
11863
+          }
11864
+
11865
+          return byteArray.join("");
11866
+        };
11867
+
11868
+        req.open('GET', url, !sync); // XHR binary charset opt by Marcus Granado 2006 [http://mgran.blogspot.com]
11869
+
11870
+        req.overrideMimeType('text\/plain; charset=x-user-defined');
11871
+
11872
+        if (sync === false) {
11873
+          req.onload = function () {
11874
+            return sanitizeUnicode(this.responseText);
11875
+          };
11876
+        }
11877
+
11878
+        req.send(null);
11879
+
11880
+        if (req.status !== 200) {
11881
+          console.warn('Unable to load file "' + url + '"');
11882
+          return;
11883
+        }
11884
+
11885
+        if (sync) {
11886
+          return sanitizeUnicode(req.responseText);
11887
+        }
11888
+      };
11889
+
11890
+      try {
11891
+        result = xhr(url, sync, callback);
11892
+      } catch (e) {
11893
+        result = undefined;
11894
+      }
11895
+
11896
+      return result;
11897
+    };
11898
+    /**
11899
+    * @name loadImageFile
11900
+    * @function
11901
+    * @param {string} path
11902
+    * @param {boolean} sync
11903
+    * @param {function} callback
11904
+    */
11905
+
11906
+
11907
+    jsPDFAPI.loadImageFile = jsPDFAPI.loadFile;
11908
+  })(jsPDF.API);
11909
+
11910
+  /**
11911
+   * Copyright (c) 2018 Erik Koopmans
11912
+   * Released under the MIT License.
11913
+   *
11914
+   * Licensed under the MIT License.
11915
+   * http://opensource.org/licenses/mit-license
11916
+   */
11917
+
11918
+  /**
11919
+   * jsPDF html PlugIn
11920
+   *
11921
+   * @name html
11922
+   * @module
11923
+   */
11924
+  (function (jsPDFAPI, global) {
11925
+    /**
11926
+    * Determine the type of a variable/object.
11927
+    * 
11928
+    * @private
11929
+    * @ignore
11930
+    */
11931
+
11932
+    var objType = function objType(obj) {
11933
+      var type = _typeof(obj);
11934
+
11935
+      if (type === 'undefined') return 'undefined';else if (type === 'string' || obj instanceof String) return 'string';else if (type === 'number' || obj instanceof Number) return 'number';else if (type === 'function' || obj instanceof Function) return 'function';else if (!!obj && obj.constructor === Array) return 'array';else if (obj && obj.nodeType === 1) return 'element';else if (type === 'object') return 'object';else return 'unknown';
11936
+    };
11937
+    /**
11938
+    * Create an HTML element with optional className, innerHTML, and style.
11939
+    * 
11940
+    * @private
11941
+    * @ignore
11942
+    */
11943
+
11944
+
11945
+    var createElement = function createElement(tagName, opt) {
11946
+      var el = document.createElement(tagName);
11947
+      if (opt.className) el.className = opt.className;
11948
+
11949
+      if (opt.innerHTML) {
11950
+        el.innerHTML = opt.innerHTML;
11951
+        var scripts = el.getElementsByTagName('script');
11952
+
11953
+        for (var i = scripts.length; i-- > 0; null) {
11954
+          scripts[i].parentNode.removeChild(scripts[i]);
11955
+        }
11956
+      }
11957
+
11958
+      for (var key in opt.style) {
11959
+        el.style[key] = opt.style[key];
11960
+      }
11961
+
11962
+      return el;
11963
+    };
11964
+    /**
11965
+    * Deep-clone a node and preserve contents/properties.
11966
+    * 
11967
+    * @private
11968
+    * @ignore
11969
+    */
11970
+
11971
+
11972
+    var cloneNode = function cloneNode(node, javascriptEnabled) {
11973
+      // Recursively clone the node.
11974
+      var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);
11975
+
11976
+      for (var child = node.firstChild; child; child = child.nextSibling) {
11977
+        if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') {
11978
+          clone.appendChild(cloneNode(child, javascriptEnabled));
11979
+        }
11980
+      }
11981
+
11982
+      if (node.nodeType === 1) {
11983
+        // Preserve contents/properties of special nodes.
11984
+        if (node.nodeName === 'CANVAS') {
11985
+          clone.width = node.width;
11986
+          clone.height = node.height;
11987
+          clone.getContext('2d').drawImage(node, 0, 0);
11988
+        } else if (node.nodeName === 'TEXTAREA' || node.nodeName === 'SELECT') {
11989
+          clone.value = node.value;
11990
+        } // Preserve the node's scroll position when it loads.
11991
+
11992
+
11993
+        clone.addEventListener('load', function () {
11994
+          clone.scrollTop = node.scrollTop;
11995
+          clone.scrollLeft = node.scrollLeft;
11996
+        }, true);
11997
+      } // Return the cloned node.
11998
+
11999
+
12000
+      return clone;
12001
+    };
12002
+    /* ----- CONSTRUCTOR ----- */
12003
+
12004
+
12005
+    var Worker = function Worker(opt) {
12006
+      // Create the root parent for the proto chain, and the starting Worker.
12007
+      var root = Object.assign(Worker.convert(Promise.resolve()), JSON.parse(JSON.stringify(Worker.template)));
12008
+      var self = Worker.convert(Promise.resolve(), root); // Set progress, optional settings, and return.
12009
+
12010
+      self = self.setProgress(1, Worker, 1, [Worker]);
12011
+      self = self.set(opt);
12012
+      return self;
12013
+    }; // Boilerplate for subclassing Promise.
12014
+
12015
+
12016
+    Worker.prototype = Object.create(Promise.prototype);
12017
+    Worker.prototype.constructor = Worker; // Converts/casts promises into Workers.
12018
+
12019
+    Worker.convert = function convert(promise, inherit) {
12020
+      // Uses prototypal inheritance to receive changes made to ancestors' properties.
12021
+      promise.__proto__ = inherit || Worker.prototype;
12022
+      return promise;
12023
+    };
12024
+
12025
+    Worker.template = {
12026
+      prop: {
12027
+        src: null,
12028
+        container: null,
12029
+        overlay: null,
12030
+        canvas: null,
12031
+        img: null,
12032
+        pdf: null,
12033
+        pageSize: null,
12034
+        callback: function callback() {}
12035
+      },
12036
+      progress: {
12037
+        val: 0,
12038
+        state: null,
12039
+        n: 0,
12040
+        stack: []
12041
+      },
12042
+      opt: {
12043
+        filename: 'file.pdf',
12044
+        margin: [0, 0, 0, 0],
12045
+        enableLinks: true,
12046
+        x: 0,
12047
+        y: 0,
12048
+        html2canvas: {},
12049
+        jsPDF: {}
12050
+      }
12051
+    };
12052
+    /* ----- FROM / TO ----- */
12053
+
12054
+    Worker.prototype.from = function from(src, type) {
12055
+      function getType(src) {
12056
+        switch (objType(src)) {
12057
+          case 'string':
12058
+            return 'string';
12059
+
12060
+          case 'element':
12061
+            return src.nodeName.toLowerCase === 'canvas' ? 'canvas' : 'element';
12062
+
12063
+          default:
12064
+            return 'unknown';
12065
+        }
12066
+      }
12067
+
12068
+      return this.then(function from_main() {
12069
+        type = type || getType(src);
12070
+
12071
+        switch (type) {
12072
+          case 'string':
12073
+            return this.set({
12074
+              src: createElement('div', {
12075
+                innerHTML: src
12076
+              })
12077
+            });
12078
+
12079
+          case 'element':
12080
+            return this.set({
12081
+              src: src
12082
+            });
12083
+
12084
+          case 'canvas':
12085
+            return this.set({
12086
+              canvas: src
12087
+            });
12088
+
12089
+          case 'img':
12090
+            return this.set({
12091
+              img: src
12092
+            });
12093
+
12094
+          default:
12095
+            return this.error('Unknown source type.');
12096
+        }
12097
+      });
12098
+    };
12099
+
12100
+    Worker.prototype.to = function to(target) {
12101
+      // Route the 'to' request to the appropriate method.
12102
+      switch (target) {
12103
+        case 'container':
12104
+          return this.toContainer();
12105
+
12106
+        case 'canvas':
12107
+          return this.toCanvas();
12108
+
12109
+        case 'img':
12110
+          return this.toImg();
12111
+
12112
+        case 'pdf':
12113
+          return this.toPdf();
12114
+
12115
+        default:
12116
+          return this.error('Invalid target.');
12117
+      }
12118
+    };
12119
+
12120
+    Worker.prototype.toContainer = function toContainer() {
12121
+      // Set up function prerequisites.
12122
+      var prereqs = [function checkSrc() {
12123
+        return this.prop.src || this.error('Cannot duplicate - no source HTML.');
12124
+      }, function checkPageSize() {
12125
+        return this.prop.pageSize || this.setPageSize();
12126
+      }];
12127
+      return this.thenList(prereqs).then(function toContainer_main() {
12128
+        // Define the CSS styles for the container and its overlay parent.
12129
+        var overlayCSS = {
12130
+          position: 'fixed',
12131
+          overflow: 'hidden',
12132
+          zIndex: 1000,
12133
+          left: '-100000px',
12134
+          right: 0,
12135
+          bottom: 0,
12136
+          top: 0
12137
+        };
12138
+        var containerCSS = {
12139
+          position: 'relative',
12140
+          display: 'inline-block',
12141
+          width: Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) + 'px',
12142
+          left: 0,
12143
+          right: 0,
12144
+          top: 0,
12145
+          margin: 'auto',
12146
+          backgroundColor: 'white'
12147
+        }; // Set the overlay to hidden (could be changed in the future to provide a print preview).
12148
+
12149
+        var source = cloneNode(this.prop.src, this.opt.html2canvas.javascriptEnabled);
12150
+
12151
+        if (source.tagName === 'BODY') {
12152
+          containerCSS.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + 'px';
12153
+        }
12154
+
12155
+        this.prop.overlay = createElement('div', {
12156
+          className: 'html2pdf__overlay',
12157
+          style: overlayCSS
12158
+        });
12159
+        this.prop.container = createElement('div', {
12160
+          className: 'html2pdf__container',
12161
+          style: containerCSS
12162
+        });
12163
+        this.prop.container.appendChild(source);
12164
+        this.prop.container.firstChild.appendChild(createElement('div', {
12165
+          style: {
12166
+            clear: 'both',
12167
+            border: '0 none transparent',
12168
+            margin: 0,
12169
+            padding: 0,
12170
+            height: 0
12171
+          }
12172
+        }));
12173
+        this.prop.container.style.float = 'none';
12174
+        this.prop.overlay.appendChild(this.prop.container);
12175
+        document.body.appendChild(this.prop.overlay);
12176
+        this.prop.container.firstChild.style.position = 'relative';
12177
+        this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + 'px';
12178
+      });
12179
+    };
12180
+
12181
+    Worker.prototype.toCanvas = function toCanvas() {
12182
+      // Set up function prerequisites.
12183
+      var prereqs = [function checkContainer() {
12184
+        return document.body.contains(this.prop.container) || this.toContainer();
12185
+      }]; // Fulfill prereqs then create the canvas.
12186
+
12187
+      return this.thenList(prereqs).then(function toCanvas_main() {
12188
+        // Handle old-fashioned 'onrendered' argument.
12189
+        var options = Object.assign({}, this.opt.html2canvas);
12190
+        delete options.onrendered;
12191
+
12192
+        if (!this.isHtml2CanvasLoaded()) {
12193
+          return;
12194
+        }
12195
+
12196
+        return html2canvas(this.prop.container, options);
12197
+      }).then(function toCanvas_post(canvas) {
12198
+        // Handle old-fashioned 'onrendered' argument.
12199
+        var onRendered = this.opt.html2canvas.onrendered || function () {};
12200
+
12201
+        onRendered(canvas);
12202
+        this.prop.canvas = canvas;
12203
+        document.body.removeChild(this.prop.overlay);
12204
+      });
12205
+    };
12206
+
12207
+    Worker.prototype.toContext2d = function toContext2d() {
12208
+      // Set up function prerequisites.
12209
+      var prereqs = [function checkContainer() {
12210
+        return document.body.contains(this.prop.container) || this.toContainer();
12211
+      }]; // Fulfill prereqs then create the canvas.
12212
+
12213
+      return this.thenList(prereqs).then(function toContext2d_main() {
12214
+        // Handle old-fashioned 'onrendered' argument.
12215
+        var pdf = this.opt.jsPDF;
12216
+        var options = Object.assign({
12217
+          async: true,
12218
+          allowTaint: true,
12219
+          backgroundColor: '#ffffff',
12220
+          imageTimeout: 15000,
12221
+          logging: true,
12222
+          proxy: null,
12223
+          removeContainer: true,
12224
+          foreignObjectRendering: false,
12225
+          useCORS: false
12226
+        }, this.opt.html2canvas);
12227
+        delete options.onrendered;
12228
+        pdf.context2d.autoPaging = true;
12229
+        pdf.context2d.posX = this.opt.x;
12230
+        pdf.context2d.posY = this.opt.y;
12231
+        options.windowHeight = options.windowHeight || 0;
12232
+        options.windowHeight = options.windowHeight == 0 ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : options.windowHeight;
12233
+
12234
+        if (!this.isHtml2CanvasLoaded()) {
12235
+          return;
12236
+        }
12237
+
12238
+        return html2canvas(this.prop.container, options);
12239
+      }).then(function toContext2d_post(canvas) {
12240
+        // Handle old-fashioned 'onrendered' argument.
12241
+        var onRendered = this.opt.html2canvas.onrendered || function () {};
12242
+
12243
+        onRendered(canvas);
12244
+        this.prop.canvas = canvas;
12245
+        document.body.removeChild(this.prop.overlay);
12246
+      });
12247
+    };
12248
+
12249
+    Worker.prototype.toImg = function toImg() {
12250
+      // Set up function prerequisites.
12251
+      var prereqs = [function checkCanvas() {
12252
+        return this.prop.canvas || this.toCanvas();
12253
+      }]; // Fulfill prereqs then create the image.
12254
+
12255
+      return this.thenList(prereqs).then(function toImg_main() {
12256
+        var imgData = this.prop.canvas.toDataURL('image/' + this.opt.image.type, this.opt.image.quality);
12257
+        this.prop.img = document.createElement('img');
12258
+        this.prop.img.src = imgData;
12259
+      });
12260
+    };
12261
+
12262
+    Worker.prototype.toPdf = function toPdf() {
12263
+      // Set up function prerequisites.
12264
+      var prereqs = [function checkContext2d() {
12265
+        return this.toContext2d();
12266
+      } //function checkCanvas() { return this.prop.canvas || this.toCanvas(); }
12267
+      ]; // Fulfill prereqs then create the image.
12268
+
12269
+      return this.thenList(prereqs).then(function toPdf_main() {
12270
+        // Create local copies of frequently used properties.
12271
+        this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
12272
+      });
12273
+    };
12274
+    /* ----- OUTPUT / SAVE ----- */
12275
+
12276
+
12277
+    Worker.prototype.output = function output(type, options, src) {
12278
+      // Redirect requests to the correct function (outputPdf / outputImg).
12279
+      src = src || 'pdf';
12280
+
12281
+      if (src.toLowerCase() === 'img' || src.toLowerCase() === 'image') {
12282
+        return this.outputImg(type, options);
12283
+      } else {
12284
+        return this.outputPdf(type, options);
12285
+      }
12286
+    };
12287
+
12288
+    Worker.prototype.outputPdf = function outputPdf(type, options) {
12289
+      // Set up function prerequisites.
12290
+      var prereqs = [function checkPdf() {
12291
+        return this.prop.pdf || this.toPdf();
12292
+      }]; // Fulfill prereqs then perform the appropriate output.
12293
+
12294
+      return this.thenList(prereqs).then(function outputPdf_main() {
12295
+        /* Currently implemented output types:
12296
+         *    https://rawgit.com/MrRio/jsPDF/master/docs/jspdf.js.html#line992
12297
+         *  save(options), arraybuffer, blob, bloburi/bloburl,
12298
+         *  datauristring/dataurlstring, dataurlnewwindow, datauri/dataurl
12299
+         */
12300
+        return this.prop.pdf.output(type, options);
12301
+      });
12302
+    };
12303
+
12304
+    Worker.prototype.outputImg = function outputImg(type, options) {
12305
+      // Set up function prerequisites.
12306
+      var prereqs = [function checkImg() {
12307
+        return this.prop.img || this.toImg();
12308
+      }]; // Fulfill prereqs then perform the appropriate output.
12309
+
12310
+      return this.thenList(prereqs).then(function outputImg_main() {
12311
+        switch (type) {
12312
+          case undefined:
12313
+          case 'img':
12314
+            return this.prop.img;
12315
+
12316
+          case 'datauristring':
12317
+          case 'dataurlstring':
12318
+            return this.prop.img.src;
12319
+
12320
+          case 'datauri':
12321
+          case 'dataurl':
12322
+            return document.location.href = this.prop.img.src;
12323
+
12324
+          default:
12325
+            throw 'Image output type "' + type + '" is not supported.';
12326
+        }
12327
+      });
12328
+    };
12329
+
12330
+    Worker.prototype.isHtml2CanvasLoaded = function () {
12331
+      var result = typeof global.html2canvas !== "undefined";
12332
+
12333
+      if (!result) {
12334
+        console.error("html2canvas not loaded.");
12335
+      }
12336
+
12337
+      return result;
12338
+    };
12339
+
12340
+    Worker.prototype.save = function save(filename) {
12341
+      // Set up function prerequisites.
12342
+      var prereqs = [function checkPdf() {
12343
+        return this.prop.pdf || this.toPdf();
12344
+      }];
12345
+
12346
+      if (!this.isHtml2CanvasLoaded()) {
12347
+        return;
12348
+      } // Fulfill prereqs, update the filename (if provided), and save the PDF.
12349
+
12350
+
12351
+      return this.thenList(prereqs).set(filename ? {
12352
+        filename: filename
12353
+      } : null).then(function save_main() {
12354
+        this.prop.pdf.save(this.opt.filename);
12355
+      });
12356
+    };
12357
+
12358
+    Worker.prototype.doCallback = function doCallback(filename) {
12359
+      // Set up function prerequisites.
12360
+      var prereqs = [function checkPdf() {
12361
+        return this.prop.pdf || this.toPdf();
12362
+      }];
12363
+
12364
+      if (!this.isHtml2CanvasLoaded()) {
12365
+        return;
12366
+      } // Fulfill prereqs, update the filename (if provided), and save the PDF.
12367
+
12368
+
12369
+      return this.thenList(prereqs).then(function doCallback_main() {
12370
+        this.prop.callback(this.prop.pdf);
12371
+      });
12372
+    };
12373
+    /* ----- SET / GET ----- */
12374
+
12375
+
12376
+    Worker.prototype.set = function set(opt) {
12377
+      // TODO: Implement ordered pairs?
12378
+      // Silently ignore invalid or empty input.
12379
+      if (objType(opt) !== 'object') {
12380
+        return this;
12381
+      } // Build an array of setter functions to queue.
12382
+
12383
+
12384
+      var fns = Object.keys(opt || {}).map(function (key) {
12385
+        if (key in Worker.template.prop) {
12386
+          // Set pre-defined properties.
12387
+          return function set_prop() {
12388
+            this.prop[key] = opt[key];
12389
+          };
12390
+        } else {
12391
+          switch (key) {
12392
+            case 'margin':
12393
+              return this.setMargin.bind(this, opt.margin);
12394
+
12395
+            case 'jsPDF':
12396
+              return function set_jsPDF() {
12397
+                this.opt.jsPDF = opt.jsPDF;
12398
+                return this.setPageSize();
12399
+              };
12400
+
12401
+            case 'pageSize':
12402
+              return this.setPageSize.bind(this, opt.pageSize);
12403
+
12404
+            default:
12405
+              // Set any other properties in opt.
12406
+              return function set_opt() {
12407
+                this.opt[key] = opt[key];
12408
+              };
12409
+          }
12410
+        }
12411
+      }, this); // Set properties within the promise chain.
12412
+
12413
+      return this.then(function set_main() {
12414
+        return this.thenList(fns);
12415
+      });
12416
+    };
12417
+
12418
+    Worker.prototype.get = function get(key, cbk) {
12419
+      return this.then(function get_main() {
12420
+        // Fetch the requested property, either as a predefined prop or in opt.
12421
+        var val = key in Worker.template.prop ? this.prop[key] : this.opt[key];
12422
+        return cbk ? cbk(val) : val;
12423
+      });
12424
+    };
12425
+
12426
+    Worker.prototype.setMargin = function setMargin(margin) {
12427
+      return this.then(function setMargin_main() {
12428
+        // Parse the margin property.
12429
+        switch (objType(margin)) {
12430
+          case 'number':
12431
+            margin = [margin, margin, margin, margin];
12432
+
12433
+          case 'array':
12434
+            if (margin.length === 2) {
12435
+              margin = [margin[0], margin[1], margin[0], margin[1]];
12436
+            }
12437
+
12438
+            if (margin.length === 4) {
12439
+              break;
12440
+            }
12441
+
12442
+          default:
12443
+            return this.error('Invalid margin array.');
12444
+        } // Set the margin property, then update pageSize.
12445
+
12446
+
12447
+        this.opt.margin = margin;
12448
+      }).then(this.setPageSize);
12449
+    };
12450
+
12451
+    Worker.prototype.setPageSize = function setPageSize(pageSize) {
12452
+      function toPx(val, k) {
12453
+        return Math.floor(val * k / 72 * 96);
12454
+      }
12455
+
12456
+      return this.then(function setPageSize_main() {
12457
+        // Retrieve page-size based on jsPDF settings, if not explicitly provided.
12458
+        pageSize = pageSize || jsPDF.getPageSize(this.opt.jsPDF); // Add 'inner' field if not present.
12459
+
12460
+        if (!pageSize.hasOwnProperty('inner')) {
12461
+          pageSize.inner = {
12462
+            width: pageSize.width - this.opt.margin[1] - this.opt.margin[3],
12463
+            height: pageSize.height - this.opt.margin[0] - this.opt.margin[2]
12464
+          };
12465
+          pageSize.inner.px = {
12466
+            width: toPx(pageSize.inner.width, pageSize.k),
12467
+            height: toPx(pageSize.inner.height, pageSize.k)
12468
+          };
12469
+          pageSize.inner.ratio = pageSize.inner.height / pageSize.inner.width;
12470
+        } // Attach pageSize to this.
12471
+
12472
+
12473
+        this.prop.pageSize = pageSize;
12474
+      });
12475
+    };
12476
+
12477
+    Worker.prototype.setProgress = function setProgress(val, state, n, stack) {
12478
+      // Immediately update all progress values.
12479
+      if (val != null) this.progress.val = val;
12480
+      if (state != null) this.progress.state = state;
12481
+      if (n != null) this.progress.n = n;
12482
+      if (stack != null) this.progress.stack = stack;
12483
+      this.progress.ratio = this.progress.val / this.progress.state; // Return this for command chaining.
12484
+
12485
+      return this;
12486
+    };
12487
+
12488
+    Worker.prototype.updateProgress = function updateProgress(val, state, n, stack) {
12489
+      // Immediately update all progress values, using setProgress.
12490
+      return this.setProgress(val ? this.progress.val + val : null, state ? state : null, n ? this.progress.n + n : null, stack ? this.progress.stack.concat(stack) : null);
12491
+    };
12492
+    /* ----- PROMISE MAPPING ----- */
12493
+
12494
+
12495
+    Worker.prototype.then = function then(onFulfilled, onRejected) {
12496
+      // Wrap `this` for encapsulation.
12497
+      var self = this;
12498
+      return this.thenCore(onFulfilled, onRejected, function then_main(onFulfilled, onRejected) {
12499
+        // Update progress while queuing, calling, and resolving `then`.
12500
+        self.updateProgress(null, null, 1, [onFulfilled]);
12501
+        return Promise.prototype.then.call(this, function then_pre(val) {
12502
+          self.updateProgress(null, onFulfilled);
12503
+          return val;
12504
+        }).then(onFulfilled, onRejected).then(function then_post(val) {
12505
+          self.updateProgress(1);
12506
+          return val;
12507
+        });
12508
+      });
12509
+    };
12510
+
12511
+    Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected, thenBase) {
12512
+      // Handle optional thenBase parameter.
12513
+      thenBase = thenBase || Promise.prototype.then; // Wrap `this` for encapsulation and bind it to the promise handlers.
12514
+
12515
+      var self = this;
12516
+
12517
+      if (onFulfilled) {
12518
+        onFulfilled = onFulfilled.bind(self);
12519
+      }
12520
+
12521
+      if (onRejected) {
12522
+        onRejected = onRejected.bind(self);
12523
+      } // Cast self into a Promise to avoid polyfills recursively defining `then`.
12524
+
12525
+
12526
+      var isNative = Promise.toString().indexOf('[native code]') !== -1 && Promise.name === 'Promise';
12527
+      var selfPromise = isNative ? self : Worker.convert(Object.assign({}, self), Promise.prototype); // Return the promise, after casting it into a Worker and preserving props.
12528
+
12529
+      var returnVal = thenBase.call(selfPromise, onFulfilled, onRejected);
12530
+      return Worker.convert(returnVal, self.__proto__);
12531
+    };
12532
+
12533
+    Worker.prototype.thenExternal = function thenExternal(onFulfilled, onRejected) {
12534
+      // Call `then` and return a standard promise (exits the Worker chain).
12535
+      return Promise.prototype.then.call(this, onFulfilled, onRejected);
12536
+    };
12537
+
12538
+    Worker.prototype.thenList = function thenList(fns) {
12539
+      // Queue a series of promise 'factories' into the promise chain.
12540
+      var self = this;
12541
+      fns.forEach(function thenList_forEach(fn) {
12542
+        self = self.thenCore(fn);
12543
+      });
12544
+      return self;
12545
+    };
12546
+
12547
+    Worker.prototype['catch'] = function (onRejected) {
12548
+      // Bind `this` to the promise handler, call `catch`, and return a Worker.
12549
+      if (onRejected) {
12550
+        onRejected = onRejected.bind(this);
12551
+      }
12552
+
12553
+      var returnVal = Promise.prototype['catch'].call(this, onRejected);
12554
+      return Worker.convert(returnVal, this);
12555
+    };
12556
+
12557
+    Worker.prototype.catchExternal = function catchExternal(onRejected) {
12558
+      // Call `catch` and return a standard promise (exits the Worker chain).
12559
+      return Promise.prototype['catch'].call(this, onRejected);
12560
+    };
12561
+
12562
+    Worker.prototype.error = function error(msg) {
12563
+      // Throw the error in the Promise chain.
12564
+      return this.then(function error_main() {
12565
+        throw new Error(msg);
12566
+      });
12567
+    };
12568
+    /* ----- ALIASES ----- */
12569
+
12570
+
12571
+    Worker.prototype.using = Worker.prototype.set;
12572
+    Worker.prototype.saveAs = Worker.prototype.save;
12573
+    Worker.prototype.export = Worker.prototype.output;
12574
+    Worker.prototype.run = Worker.prototype.then; // Get dimensions of a PDF page, as determined by jsPDF.
12575
+
12576
+    jsPDF.getPageSize = function (orientation, unit, format) {
12577
+      // Decode options object
12578
+      if (_typeof(orientation) === 'object') {
12579
+        var options = orientation;
12580
+        orientation = options.orientation;
12581
+        unit = options.unit || unit;
12582
+        format = options.format || format;
12583
+      } // Default options
12584
+
12585
+
12586
+      unit = unit || 'mm';
12587
+      format = format || 'a4';
12588
+      orientation = ('' + (orientation || 'P')).toLowerCase();
12589
+      var format_as_string = ('' + format).toLowerCase(); // Size in pt of various paper formats
12590
+
12591
+      var pageFormats = {
12592
+        'a0': [2383.94, 3370.39],
12593
+        'a1': [1683.78, 2383.94],
12594
+        'a2': [1190.55, 1683.78],
12595
+        'a3': [841.89, 1190.55],
12596
+        'a4': [595.28, 841.89],
12597
+        'a5': [419.53, 595.28],
12598
+        'a6': [297.64, 419.53],
12599
+        'a7': [209.76, 297.64],
12600
+        'a8': [147.40, 209.76],
12601
+        'a9': [104.88, 147.40],
12602
+        'a10': [73.70, 104.88],
12603
+        'b0': [2834.65, 4008.19],
12604
+        'b1': [2004.09, 2834.65],
12605
+        'b2': [1417.32, 2004.09],
12606
+        'b3': [1000.63, 1417.32],
12607
+        'b4': [708.66, 1000.63],
12608
+        'b5': [498.90, 708.66],
12609
+        'b6': [354.33, 498.90],
12610
+        'b7': [249.45, 354.33],
12611
+        'b8': [175.75, 249.45],
12612
+        'b9': [124.72, 175.75],
12613
+        'b10': [87.87, 124.72],
12614
+        'c0': [2599.37, 3676.54],
12615
+        'c1': [1836.85, 2599.37],
12616
+        'c2': [1298.27, 1836.85],
12617
+        'c3': [918.43, 1298.27],
12618
+        'c4': [649.13, 918.43],
12619
+        'c5': [459.21, 649.13],
12620
+        'c6': [323.15, 459.21],
12621
+        'c7': [229.61, 323.15],
12622
+        'c8': [161.57, 229.61],
12623
+        'c9': [113.39, 161.57],
12624
+        'c10': [79.37, 113.39],
12625
+        'dl': [311.81, 623.62],
12626
+        'letter': [612, 792],
12627
+        'government-letter': [576, 756],
12628
+        'legal': [612, 1008],
12629
+        'junior-legal': [576, 360],
12630
+        'ledger': [1224, 792],
12631
+        'tabloid': [792, 1224],
12632
+        'credit-card': [153, 243]
12633
+      }; // Unit conversion
12634
+
12635
+      switch (unit) {
12636
+        case 'pt':
12637
+          var k = 1;
12638
+          break;
12639
+
12640
+        case 'mm':
12641
+          var k = 72 / 25.4;
12642
+          break;
12643
+
12644
+        case 'cm':
12645
+          var k = 72 / 2.54;
12646
+          break;
12647
+
12648
+        case 'in':
12649
+          var k = 72;
12650
+          break;
12651
+
12652
+        case 'px':
12653
+          var k = 72 / 96;
12654
+          break;
12655
+
12656
+        case 'pc':
12657
+          var k = 12;
12658
+          break;
12659
+
12660
+        case 'em':
12661
+          var k = 12;
12662
+          break;
12663
+
12664
+        case 'ex':
12665
+          var k = 6;
12666
+          break;
12667
+
12668
+        default:
12669
+          throw 'Invalid unit: ' + unit;
12670
+      } // Dimensions are stored as user units and converted to points on output
12671
+
12672
+
12673
+      if (pageFormats.hasOwnProperty(format_as_string)) {
12674
+        var pageHeight = pageFormats[format_as_string][1] / k;
12675
+        var pageWidth = pageFormats[format_as_string][0] / k;
12676
+      } else {
12677
+        try {
12678
+          var pageHeight = format[1];
12679
+          var pageWidth = format[0];
12680
+        } catch (err) {
12681
+          throw new Error('Invalid format: ' + format);
12682
+        }
12683
+      } // Handle page orientation
12684
+
12685
+
12686
+      if (orientation === 'p' || orientation === 'portrait') {
12687
+        orientation = 'p';
12688
+
12689
+        if (pageWidth > pageHeight) {
12690
+          var tmp = pageWidth;
12691
+          pageWidth = pageHeight;
12692
+          pageHeight = tmp;
12693
+        }
12694
+      } else if (orientation === 'l' || orientation === 'landscape') {
12695
+        orientation = 'l';
12696
+
12697
+        if (pageHeight > pageWidth) {
12698
+          var tmp = pageWidth;
12699
+          pageWidth = pageHeight;
12700
+          pageHeight = tmp;
12701
+        }
12702
+      } else {
12703
+        throw 'Invalid orientation: ' + orientation;
12704
+      } // Return information (k is the unit conversion ratio from pts)
12705
+
12706
+
12707
+      var info = {
12708
+        'width': pageWidth,
12709
+        'height': pageHeight,
12710
+        'unit': unit,
12711
+        'k': k
12712
+      };
12713
+      return info;
12714
+    };
12715
+    /**
12716
+     * Generate a PDF from an HTML element or string using.
12717
+     *
12718
+     * @name html
12719
+     * @function
12720
+     * @param {Element|string} source The source element or HTML string.
12721
+     * @param {Object=} options An object of optional settings.
12722
+     * @description The Plugin needs html2canvas from niklasvh
12723
+     */
12724
+
12725
+
12726
+    jsPDFAPI.html = function (src, options) {
12727
+
12728
+      options = options || {};
12729
+
12730
+      options.callback = options.callback || function () {};
12731
+
12732
+      options.html2canvas = options.html2canvas || {};
12733
+      options.html2canvas.canvas = options.html2canvas.canvas || this.canvas;
12734
+      options.jsPDF = options.jsPDF || this; // Create a new worker with the given options.
12735
+
12736
+      var pdf = options.jsPDF;
12737
+      var worker = new Worker(options);
12738
+
12739
+      if (!options.worker) {
12740
+        // If worker is not set to true, perform the traditional 'simple' operation.
12741
+        return worker.from(src).doCallback();
12742
+      } else {
12743
+        // Otherwise, return the worker for new Promise-based operation.
12744
+        return worker;
12745
+      }
12746
+
12747
+      return this;
12748
+    };
12749
+  })(jsPDF.API, typeof window !== "undefined" && window || typeof global !== "undefined" && global);
12750
+
12751
+  /**
12752
+   * @license
12753
+   * ==================================================================== 
12754
+   * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
12755
+   * 
12756
+   * 
12757
+   * ====================================================================
12758
+   */
12759
+
12760
+  /*global jsPDF */
12761
+
12762
+  /**
12763
+   * jsPDF JavaScript plugin
12764
+   *
12765
+   * @name javascript
12766
+   * @module
12767
+  */
12768
+  (function (jsPDFAPI) {
12769
+
12770
+    var jsNamesObj, jsJsObj, text;
12771
+    /**
12772
+    * @name addJS
12773
+    * @function
12774
+    * @param {string} javascript The javascript to be embedded into the PDF-file.
12775
+    * @returns {jsPDF}
12776
+    */
12777
+
12778
+    jsPDFAPI.addJS = function (javascript) {
12779
+      text = javascript;
12780
+      this.internal.events.subscribe('postPutResources', function (javascript) {
12781
+        jsNamesObj = this.internal.newObject();
12782
+        this.internal.out('<<');
12783
+        this.internal.out('/Names [(EmbeddedJS) ' + (jsNamesObj + 1) + ' 0 R]');
12784
+        this.internal.out('>>');
12785
+        this.internal.out('endobj');
12786
+        jsJsObj = this.internal.newObject();
12787
+        this.internal.out('<<');
12788
+        this.internal.out('/S /JavaScript');
12789
+        this.internal.out('/JS (' + text + ')');
12790
+        this.internal.out('>>');
12791
+        this.internal.out('endobj');
12792
+      });
12793
+      this.internal.events.subscribe('putCatalog', function () {
12794
+        if (jsNamesObj !== undefined && jsJsObj !== undefined) {
12795
+          this.internal.out('/Names <</JavaScript ' + jsNamesObj + ' 0 R>>');
12796
+        }
12797
+      });
12798
+      return this;
12799
+    };
12800
+  })(jsPDF.API);
12801
+
12802
+  /**
12803
+   * @license
12804
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
12805
+   *
12806
+   * Licensed under the MIT License.
12807
+   * http://opensource.org/licenses/mit-license
12808
+   */
12809
+
12810
+  (function (jsPDFAPI) {
12811
+
12812
+    jsPDFAPI.events.push(['postPutResources', function () {
12813
+      var pdf = this;
12814
+      var rx = /^(\d+) 0 obj$/; // Write action goto objects for each page
12815
+      // this.outline.destsGoto = [];
12816
+      // for (var i = 0; i < totalPages; i++) {
12817
+      // var id = pdf.internal.newObject();
12818
+      // this.outline.destsGoto.push(id);
12819
+      // pdf.internal.write("<</D[" + (i * 2 + 3) + " 0 R /XYZ null
12820
+      // null null]/S/GoTo>> endobj");
12821
+      // }
12822
+      //
12823
+      // for (var i = 0; i < dests.length; i++) {
12824
+      // pdf.internal.write("(page_" + (i + 1) + ")" + dests[i] + " 0
12825
+      // R");
12826
+      // }
12827
+      //				
12828
+
12829
+      if (this.outline.root.children.length > 0) {
12830
+        var lines = pdf.outline.render().split(/\r\n/);
12831
+
12832
+        for (var i = 0; i < lines.length; i++) {
12833
+          var line = lines[i];
12834
+          var m = rx.exec(line);
12835
+
12836
+          if (m != null) {
12837
+            var oid = m[1];
12838
+            pdf.internal.newObjectDeferredBegin(oid, false);
12839
+          }
12840
+
12841
+          pdf.internal.write(line);
12842
+        }
12843
+      } // This code will write named destination for each page reference
12844
+      // (page_1, etc)
12845
+
12846
+
12847
+      if (this.outline.createNamedDestinations) {
12848
+        var totalPages = this.internal.pages.length; // WARNING: this assumes jsPDF starts on page 3 and pageIDs
12849
+        // follow 5, 7, 9, etc
12850
+        // Write destination objects for each page
12851
+
12852
+        var dests = [];
12853
+
12854
+        for (var i = 0; i < totalPages; i++) {
12855
+          var id = pdf.internal.newObject();
12856
+          dests.push(id);
12857
+          var info = pdf.internal.getPageInfo(i + 1);
12858
+          pdf.internal.write("<< /D[" + info.objId + " 0 R /XYZ null null null]>> endobj");
12859
+        } // assign a name for each destination
12860
+
12861
+
12862
+        var names2Oid = pdf.internal.newObject();
12863
+        pdf.internal.write('<< /Names [ ');
12864
+
12865
+        for (var i = 0; i < dests.length; i++) {
12866
+          pdf.internal.write("(page_" + (i + 1) + ")" + dests[i] + " 0 R");
12867
+        }
12868
+
12869
+        pdf.internal.write(' ] >>', 'endobj'); // var kids = pdf.internal.newObject();
12870
+        // pdf.internal.write('<< /Kids [ ' + names2Oid + ' 0 R');
12871
+        // pdf.internal.write(' ] >>', 'endobj');
12872
+
12873
+        var namesOid = pdf.internal.newObject();
12874
+        pdf.internal.write('<< /Dests ' + names2Oid + " 0 R");
12875
+        pdf.internal.write('>>', 'endobj');
12876
+      }
12877
+    }]);
12878
+    jsPDFAPI.events.push(['putCatalog', function () {
12879
+      var pdf = this;
12880
+
12881
+      if (pdf.outline.root.children.length > 0) {
12882
+        pdf.internal.write("/Outlines", this.outline.makeRef(this.outline.root));
12883
+
12884
+        if (this.outline.createNamedDestinations) {
12885
+          pdf.internal.write("/Names " + namesOid + " 0 R");
12886
+        } // Open with Bookmarks showing
12887
+        // pdf.internal.write("/PageMode /UseOutlines");
12888
+
12889
+      }
12890
+    }]);
12891
+    jsPDFAPI.events.push(['initialized', function () {
12892
+      var pdf = this;
12893
+      pdf.outline = {
12894
+        createNamedDestinations: false,
12895
+        root: {
12896
+          children: []
12897
+        }
12898
+      };
12899
+      /**
12900
+       * Options: pageNumber
12901
+       */
12902
+
12903
+      pdf.outline.add = function (parent, title, options) {
12904
+        var item = {
12905
+          title: title,
12906
+          options: options,
12907
+          children: []
12908
+        };
12909
+
12910
+        if (parent == null) {
12911
+          parent = this.root;
12912
+        }
12913
+
12914
+        parent.children.push(item);
12915
+        return item;
12916
+      };
12917
+
12918
+      pdf.outline.render = function () {
12919
+        this.ctx = {};
12920
+        this.ctx.val = '';
12921
+        this.ctx.pdf = pdf;
12922
+        this.genIds_r(this.root);
12923
+        this.renderRoot(this.root);
12924
+        this.renderItems(this.root);
12925
+        return this.ctx.val;
12926
+      };
12927
+
12928
+      pdf.outline.genIds_r = function (node) {
12929
+        node.id = pdf.internal.newObjectDeferred();
12930
+
12931
+        for (var i = 0; i < node.children.length; i++) {
12932
+          this.genIds_r(node.children[i]);
12933
+        }
12934
+      };
12935
+
12936
+      pdf.outline.renderRoot = function (node) {
12937
+        this.objStart(node);
12938
+        this.line('/Type /Outlines');
12939
+
12940
+        if (node.children.length > 0) {
12941
+          this.line('/First ' + this.makeRef(node.children[0]));
12942
+          this.line('/Last ' + this.makeRef(node.children[node.children.length - 1]));
12943
+        }
12944
+
12945
+        this.line('/Count ' + this.count_r({
12946
+          count: 0
12947
+        }, node));
12948
+        this.objEnd();
12949
+      };
12950
+
12951
+      pdf.outline.renderItems = function (node) {
12952
+        var getHorizontalCoordinateString = this.ctx.pdf.internal.getCoordinateString;
12953
+        var getVerticalCoordinateString = this.ctx.pdf.internal.getVerticalCoordinateString;
12954
+
12955
+        for (var i = 0; i < node.children.length; i++) {
12956
+          var item = node.children[i];
12957
+          this.objStart(item);
12958
+          this.line('/Title ' + this.makeString(item.title));
12959
+          this.line('/Parent ' + this.makeRef(node));
12960
+
12961
+          if (i > 0) {
12962
+            this.line('/Prev ' + this.makeRef(node.children[i - 1]));
12963
+          }
12964
+
12965
+          if (i < node.children.length - 1) {
12966
+            this.line('/Next ' + this.makeRef(node.children[i + 1]));
12967
+          }
12968
+
12969
+          if (item.children.length > 0) {
12970
+            this.line('/First ' + this.makeRef(item.children[0]));
12971
+            this.line('/Last ' + this.makeRef(item.children[item.children.length - 1]));
12972
+          }
12973
+
12974
+          var count = this.count = this.count_r({
12975
+            count: 0
12976
+          }, item);
12977
+
12978
+          if (count > 0) {
12979
+            this.line('/Count ' + count);
12980
+          }
12981
+
12982
+          if (item.options) {
12983
+            if (item.options.pageNumber) {
12984
+              // Explicit Destination
12985
+              //WARNING this assumes page ids are 3,5,7, etc.
12986
+              var info = pdf.internal.getPageInfo(item.options.pageNumber);
12987
+              this.line('/Dest ' + '[' + info.objId + ' 0 R /XYZ 0 ' + getVerticalCoordinateString(0) + ' 0]'); // this line does not work on all clients (pageNumber instead of page ref)
12988
+              //this.line('/Dest ' + '[' + (item.options.pageNumber - 1) + ' /XYZ 0 ' + this.ctx.pdf.internal.pageSize.getHeight() + ' 0]');
12989
+              // Named Destination
12990
+              // this.line('/Dest (page_' + (item.options.pageNumber) + ')');
12991
+              // Action Destination
12992
+              // var id = pdf.internal.newObject();
12993
+              // pdf.internal.write('<</D[' + (item.options.pageNumber - 1) + ' /XYZ null null null]/S/GoTo>> endobj');
12994
+              // this.line('/A ' + id + ' 0 R' );
12995
+            }
12996
+          }
12997
+
12998
+          this.objEnd();
12999
+        }
13000
+
13001
+        for (var i = 0; i < node.children.length; i++) {
13002
+          var item = node.children[i];
13003
+          this.renderItems(item);
13004
+        }
13005
+      };
13006
+
13007
+      pdf.outline.line = function (text) {
13008
+        this.ctx.val += text + '\r\n';
13009
+      };
13010
+
13011
+      pdf.outline.makeRef = function (node) {
13012
+        return node.id + ' 0 R';
13013
+      };
13014
+
13015
+      pdf.outline.makeString = function (val) {
13016
+        return '(' + pdf.internal.pdfEscape(val) + ')';
13017
+      };
13018
+
13019
+      pdf.outline.objStart = function (node) {
13020
+        this.ctx.val += '\r\n' + node.id + ' 0 obj' + '\r\n<<\r\n';
13021
+      };
13022
+
13023
+      pdf.outline.objEnd = function (node) {
13024
+        this.ctx.val += '>> \r\n' + 'endobj' + '\r\n';
13025
+      };
13026
+
13027
+      pdf.outline.count_r = function (ctx, node) {
13028
+        for (var i = 0; i < node.children.length; i++) {
13029
+          ctx.count++;
13030
+          this.count_r(ctx, node.children[i]);
13031
+        }
13032
+
13033
+        return ctx.count;
13034
+      };
13035
+    }]);
13036
+    return this;
13037
+  })(jsPDF.API);
13038
+
13039
+  /**
13040
+   * @license
13041
+   * 
13042
+   * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
13043
+   *
13044
+   * 
13045
+   * ====================================================================
13046
+   */
13047
+
13048
+  /**
13049
+  * jsPDF PNG PlugIn
13050
+  * @name png_support
13051
+  * @module
13052
+  */
13053
+  (function (jsPDFAPI) {
13054
+    /*
13055
+     * @see http://www.w3.org/TR/PNG-Chunks.html
13056
+     *
13057
+     Color    Allowed      Interpretation
13058
+     Type     Bit Depths
13059
+    	   0       1,2,4,8,16  Each pixel is a grayscale sample.
13060
+    	   2       8,16        Each pixel is an R,G,B triple.
13061
+    	   3       1,2,4,8     Each pixel is a palette index;
13062
+                           a PLTE chunk must appear.
13063
+    	   4       8,16        Each pixel is a grayscale sample,
13064
+                           followed by an alpha sample.
13065
+    	   6       8,16        Each pixel is an R,G,B triple,
13066
+                           followed by an alpha sample.
13067
+    */
13068
+
13069
+    /*
13070
+     * PNG filter method types
13071
+     *
13072
+     * @see http://www.w3.org/TR/PNG-Filters.html
13073
+     * @see http://www.libpng.org/pub/png/book/chapter09.html
13074
+     *
13075
+     * This is what the value 'Predictor' in decode params relates to
13076
+     *
13077
+     * 15 is "optimal prediction", which means the prediction algorithm can change from line to line.
13078
+     * In that case, you actually have to read the first byte off each line for the prediction algorthim (which should be 0-4, corresponding to PDF 10-14) and select the appropriate unprediction algorithm based on that byte.
13079
+     *
13080
+       0       None
13081
+       1       Sub
13082
+       2       Up
13083
+       3       Average
13084
+       4       Paeth
13085
+     */
13086
+
13087
+    var doesNotHavePngJS = function doesNotHavePngJS() {
13088
+      return typeof PNG !== 'function' || typeof FlateStream !== 'function';
13089
+    },
13090
+        canCompress = function canCompress(value) {
13091
+      return value !== jsPDFAPI.image_compression.NONE && hasCompressionJS();
13092
+    },
13093
+        hasCompressionJS = function hasCompressionJS() {
13094
+      var inst = typeof Deflater === 'function';
13095
+      if (!inst) throw new Error("requires deflate.js for compression");
13096
+      return inst;
13097
+    },
13098
+        compressBytes = function compressBytes(bytes, lineLength, colorsPerPixel, compression) {
13099
+      var level = 5,
13100
+          filter_method = filterUp;
13101
+
13102
+      switch (compression) {
13103
+        case jsPDFAPI.image_compression.FAST:
13104
+          level = 3;
13105
+          filter_method = filterSub;
13106
+          break;
13107
+
13108
+        case jsPDFAPI.image_compression.MEDIUM:
13109
+          level = 6;
13110
+          filter_method = filterAverage;
13111
+          break;
13112
+
13113
+        case jsPDFAPI.image_compression.SLOW:
13114
+          level = 9;
13115
+          filter_method = filterPaeth; //uses to sum to choose best filter for each line
13116
+
13117
+          break;
13118
+      }
13119
+
13120
+      bytes = applyPngFilterMethod(bytes, lineLength, colorsPerPixel, filter_method);
13121
+      var header = new Uint8Array(createZlibHeader(level));
13122
+      var checksum = adler32(bytes);
13123
+      var deflate = new Deflater(level);
13124
+      var a = deflate.append(bytes);
13125
+      var cBytes = deflate.flush();
13126
+      var len = header.length + a.length + cBytes.length;
13127
+      var cmpd = new Uint8Array(len + 4);
13128
+      cmpd.set(header);
13129
+      cmpd.set(a, header.length);
13130
+      cmpd.set(cBytes, header.length + a.length);
13131
+      cmpd[len++] = checksum >>> 24 & 0xff;
13132
+      cmpd[len++] = checksum >>> 16 & 0xff;
13133
+      cmpd[len++] = checksum >>> 8 & 0xff;
13134
+      cmpd[len++] = checksum & 0xff;
13135
+      return jsPDFAPI.arrayBufferToBinaryString(cmpd);
13136
+    },
13137
+        createZlibHeader = function createZlibHeader(bytes, level) {
13138
+      /*
13139
+       * @see http://www.ietf.org/rfc/rfc1950.txt for zlib header
13140
+       */
13141
+      var cm = 8;
13142
+      var cinfo = Math.LOG2E * Math.log(0x8000) - 8;
13143
+      var cmf = cinfo << 4 | cm;
13144
+      var hdr = cmf << 8;
13145
+      var flevel = Math.min(3, (level - 1 & 0xff) >> 1);
13146
+      hdr |= flevel << 6;
13147
+      hdr |= 0; //FDICT
13148
+
13149
+      hdr += 31 - hdr % 31;
13150
+      return [cmf, hdr & 0xff & 0xff];
13151
+    },
13152
+        adler32 = function adler32(array, param) {
13153
+      var adler = 1;
13154
+      var s1 = adler & 0xffff,
13155
+          s2 = adler >>> 16 & 0xffff;
13156
+      var len = array.length;
13157
+      var tlen;
13158
+      var i = 0;
13159
+
13160
+      while (len > 0) {
13161
+        tlen = len > param ? param : len;
13162
+        len -= tlen;
13163
+
13164
+        do {
13165
+          s1 += array[i++];
13166
+          s2 += s1;
13167
+        } while (--tlen);
13168
+
13169
+        s1 %= 65521;
13170
+        s2 %= 65521;
13171
+      }
13172
+
13173
+      return (s2 << 16 | s1) >>> 0;
13174
+    },
13175
+        applyPngFilterMethod = function applyPngFilterMethod(bytes, lineLength, colorsPerPixel, filter_method) {
13176
+      var lines = bytes.length / lineLength,
13177
+          result = new Uint8Array(bytes.length + lines),
13178
+          filter_methods = getFilterMethods(),
13179
+          i = 0,
13180
+          line,
13181
+          prevLine,
13182
+          offset;
13183
+
13184
+      for (; i < lines; i++) {
13185
+        offset = i * lineLength;
13186
+        line = bytes.subarray(offset, offset + lineLength);
13187
+
13188
+        if (filter_method) {
13189
+          result.set(filter_method(line, colorsPerPixel, prevLine), offset + i);
13190
+        } else {
13191
+          var j = 0,
13192
+              len = filter_methods.length,
13193
+              results = [];
13194
+
13195
+          for (; j < len; j++) {
13196
+            results[j] = filter_methods[j](line, colorsPerPixel, prevLine);
13197
+          }
13198
+
13199
+          var ind = getIndexOfSmallestSum(results.concat());
13200
+          result.set(results[ind], offset + i);
13201
+        }
13202
+
13203
+        prevLine = line;
13204
+      }
13205
+
13206
+      return result;
13207
+    },
13208
+        filterNone = function filterNone(line, colorsPerPixel, prevLine) {
13209
+      /*var result = new Uint8Array(line.length + 1);
13210
+      result[0] = 0;
13211
+      result.set(line, 1);*/
13212
+      var result = Array.apply([], line);
13213
+      result.unshift(0);
13214
+      return result;
13215
+    },
13216
+        filterSub = function filterSub(line, colorsPerPixel, prevLine) {
13217
+      var result = [],
13218
+          i = 0,
13219
+          len = line.length,
13220
+          left;
13221
+      result[0] = 1;
13222
+
13223
+      for (; i < len; i++) {
13224
+        left = line[i - colorsPerPixel] || 0;
13225
+        result[i + 1] = line[i] - left + 0x0100 & 0xff;
13226
+      }
13227
+
13228
+      return result;
13229
+    },
13230
+        filterUp = function filterUp(line, colorsPerPixel, prevLine) {
13231
+      var result = [],
13232
+          i = 0,
13233
+          len = line.length,
13234
+          up;
13235
+      result[0] = 2;
13236
+
13237
+      for (; i < len; i++) {
13238
+        up = prevLine && prevLine[i] || 0;
13239
+        result[i + 1] = line[i] - up + 0x0100 & 0xff;
13240
+      }
13241
+
13242
+      return result;
13243
+    },
13244
+        filterAverage = function filterAverage(line, colorsPerPixel, prevLine) {
13245
+      var result = [],
13246
+          i = 0,
13247
+          len = line.length,
13248
+          left,
13249
+          up;
13250
+      result[0] = 3;
13251
+
13252
+      for (; i < len; i++) {
13253
+        left = line[i - colorsPerPixel] || 0;
13254
+        up = prevLine && prevLine[i] || 0;
13255
+        result[i + 1] = line[i] + 0x0100 - (left + up >>> 1) & 0xff;
13256
+      }
13257
+
13258
+      return result;
13259
+    },
13260
+        filterPaeth = function filterPaeth(line, colorsPerPixel, prevLine) {
13261
+      var result = [],
13262
+          i = 0,
13263
+          len = line.length,
13264
+          left,
13265
+          up,
13266
+          upLeft,
13267
+          paeth;
13268
+      result[0] = 4;
13269
+
13270
+      for (; i < len; i++) {
13271
+        left = line[i - colorsPerPixel] || 0;
13272
+        up = prevLine && prevLine[i] || 0;
13273
+        upLeft = prevLine && prevLine[i - colorsPerPixel] || 0;
13274
+        paeth = paethPredictor(left, up, upLeft);
13275
+        result[i + 1] = line[i] - paeth + 0x0100 & 0xff;
13276
+      }
13277
+
13278
+      return result;
13279
+    },
13280
+        paethPredictor = function paethPredictor(left, up, upLeft) {
13281
+      var p = left + up - upLeft,
13282
+          pLeft = Math.abs(p - left),
13283
+          pUp = Math.abs(p - up),
13284
+          pUpLeft = Math.abs(p - upLeft);
13285
+      return pLeft <= pUp && pLeft <= pUpLeft ? left : pUp <= pUpLeft ? up : upLeft;
13286
+    },
13287
+        getFilterMethods = function getFilterMethods() {
13288
+      return [filterNone, filterSub, filterUp, filterAverage, filterPaeth];
13289
+    },
13290
+        getIndexOfSmallestSum = function getIndexOfSmallestSum(arrays) {
13291
+      var i = 0,
13292
+          len = arrays.length,
13293
+          sum,
13294
+          min,
13295
+          ind;
13296
+
13297
+      while (i < len) {
13298
+        sum = absSum(arrays[i].slice(1));
13299
+
13300
+        if (sum < min || !min) {
13301
+          min = sum;
13302
+          ind = i;
13303
+        }
13304
+
13305
+        i++;
13306
+      }
13307
+
13308
+      return ind;
13309
+    },
13310
+        absSum = function absSum(array) {
13311
+      var i = 0,
13312
+          len = array.length,
13313
+          sum = 0;
13314
+
13315
+      while (i < len) {
13316
+        sum += Math.abs(array[i++]);
13317
+      }
13318
+
13319
+      return sum;
13320
+    },
13321
+        getPredictorFromCompression = function getPredictorFromCompression(compression) {
13322
+      var predictor;
13323
+
13324
+      switch (compression) {
13325
+        case jsPDFAPI.image_compression.FAST:
13326
+          predictor = 11;
13327
+          break;
13328
+
13329
+        case jsPDFAPI.image_compression.MEDIUM:
13330
+          predictor = 13;
13331
+          break;
13332
+
13333
+        case jsPDFAPI.image_compression.SLOW:
13334
+          predictor = 14;
13335
+          break;
13336
+
13337
+        default:
13338
+          predictor = 12;
13339
+          break;
13340
+      }
13341
+
13342
+      return predictor;
13343
+    };
13344
+    /**
13345
+    *
13346
+    * @name processPNG
13347
+    * @function
13348
+    * @ignore
13349
+    */
13350
+
13351
+
13352
+    jsPDFAPI.processPNG = function (imageData, imageIndex, alias, compression, dataAsBinaryString) {
13353
+
13354
+      var colorSpace = this.color_spaces.DEVICE_RGB,
13355
+          decode = this.decode.FLATE_DECODE,
13356
+          bpc = 8,
13357
+          img,
13358
+          dp,
13359
+          trns,
13360
+          colors,
13361
+          pal,
13362
+          smask;
13363
+      /*	if(this.isString(imageData)) {
13364
+      		}*/
13365
+
13366
+      if (this.isArrayBuffer(imageData)) imageData = new Uint8Array(imageData);
13367
+
13368
+      if (this.isArrayBufferView(imageData)) {
13369
+        if (doesNotHavePngJS()) throw new Error("PNG support requires png.js and zlib.js");
13370
+        img = new PNG(imageData);
13371
+        imageData = img.imgData;
13372
+        bpc = img.bits;
13373
+        colorSpace = img.colorSpace;
13374
+        colors = img.colors; //logImg(img);
13375
+
13376
+        /*
13377
+         * colorType 6 - Each pixel is an R,G,B triple, followed by an alpha sample.
13378
+         *
13379
+         * colorType 4 - Each pixel is a grayscale sample, followed by an alpha sample.
13380
+         *
13381
+         * Extract alpha to create two separate images, using the alpha as a sMask
13382
+         */
13383
+
13384
+        if ([4, 6].indexOf(img.colorType) !== -1) {
13385
+          /*
13386
+           * processes 8 bit RGBA and grayscale + alpha images
13387
+           */
13388
+          if (img.bits === 8) {
13389
+            var pixels = img.pixelBitlength == 32 ? new Uint32Array(img.decodePixels().buffer) : img.pixelBitlength == 16 ? new Uint16Array(img.decodePixels().buffer) : new Uint8Array(img.decodePixels().buffer),
13390
+                len = pixels.length,
13391
+                imgData = new Uint8Array(len * img.colors),
13392
+                alphaData = new Uint8Array(len),
13393
+                pDiff = img.pixelBitlength - img.bits,
13394
+                i = 0,
13395
+                n = 0,
13396
+                pixel,
13397
+                pbl;
13398
+
13399
+            for (; i < len; i++) {
13400
+              pixel = pixels[i];
13401
+              pbl = 0;
13402
+
13403
+              while (pbl < pDiff) {
13404
+                imgData[n++] = pixel >>> pbl & 0xff;
13405
+                pbl = pbl + img.bits;
13406
+              }
13407
+
13408
+              alphaData[i] = pixel >>> pbl & 0xff;
13409
+            }
13410
+          }
13411
+          /*
13412
+           * processes 16 bit RGBA and grayscale + alpha images
13413
+           */
13414
+
13415
+
13416
+          if (img.bits === 16) {
13417
+            var pixels = new Uint32Array(img.decodePixels().buffer),
13418
+                len = pixels.length,
13419
+                imgData = new Uint8Array(len * (32 / img.pixelBitlength) * img.colors),
13420
+                alphaData = new Uint8Array(len * (32 / img.pixelBitlength)),
13421
+                hasColors = img.colors > 1,
13422
+                i = 0,
13423
+                n = 0,
13424
+                a = 0,
13425
+                pixel;
13426
+
13427
+            while (i < len) {
13428
+              pixel = pixels[i++];
13429
+              imgData[n++] = pixel >>> 0 & 0xFF;
13430
+
13431
+              if (hasColors) {
13432
+                imgData[n++] = pixel >>> 16 & 0xFF;
13433
+                pixel = pixels[i++];
13434
+                imgData[n++] = pixel >>> 0 & 0xFF;
13435
+              }
13436
+
13437
+              alphaData[a++] = pixel >>> 16 & 0xFF;
13438
+            }
13439
+
13440
+            bpc = 8;
13441
+          }
13442
+
13443
+          if (canCompress(compression)) {
13444
+            imageData = compressBytes(imgData, img.width * img.colors, img.colors, compression);
13445
+            smask = compressBytes(alphaData, img.width, 1, compression);
13446
+          } else {
13447
+            imageData = imgData;
13448
+            smask = alphaData;
13449
+            decode = null;
13450
+          }
13451
+        }
13452
+        /*
13453
+         * Indexed png. Each pixel is a palette index.
13454
+         */
13455
+
13456
+
13457
+        if (img.colorType === 3) {
13458
+          colorSpace = this.color_spaces.INDEXED;
13459
+          pal = img.palette;
13460
+
13461
+          if (img.transparency.indexed) {
13462
+            var trans = img.transparency.indexed;
13463
+            var total = 0,
13464
+                i = 0,
13465
+                len = trans.length;
13466
+
13467
+            for (; i < len; ++i) {
13468
+              total += trans[i];
13469
+            }
13470
+
13471
+            total = total / 255;
13472
+            /*
13473
+             * a single color is specified as 100% transparent (0),
13474
+             * so we set trns to use a /Mask with that index
13475
+             */
13476
+
13477
+            if (total === len - 1 && trans.indexOf(0) !== -1) {
13478
+              trns = [trans.indexOf(0)];
13479
+              /*
13480
+               * there's more than one colour within the palette that specifies
13481
+               * a transparency value less than 255, so we unroll the pixels to create an image sMask
13482
+               */
13483
+            } else if (total !== len) {
13484
+              var pixels = img.decodePixels(),
13485
+                  alphaData = new Uint8Array(pixels.length),
13486
+                  i = 0,
13487
+                  len = pixels.length;
13488
+
13489
+              for (; i < len; i++) {
13490
+                alphaData[i] = trans[pixels[i]];
13491
+              }
13492
+
13493
+              smask = compressBytes(alphaData, img.width, 1);
13494
+            }
13495
+          }
13496
+        }
13497
+
13498
+        var predictor = getPredictorFromCompression(compression);
13499
+        if (decode === this.decode.FLATE_DECODE) dp = '/Predictor ' + predictor + ' /Colors ' + colors + ' /BitsPerComponent ' + bpc + ' /Columns ' + img.width;else //remove 'Predictor' as it applies to the type of png filter applied to its IDAT - we only apply with compression
13500
+          dp = '/Colors ' + colors + ' /BitsPerComponent ' + bpc + ' /Columns ' + img.width;
13501
+        if (this.isArrayBuffer(imageData) || this.isArrayBufferView(imageData)) imageData = this.arrayBufferToBinaryString(imageData);
13502
+        if (smask && this.isArrayBuffer(smask) || this.isArrayBufferView(smask)) smask = this.arrayBufferToBinaryString(smask);
13503
+        return this.createImageInfo(imageData, img.width, img.height, colorSpace, bpc, decode, imageIndex, alias, dp, trns, pal, smask, predictor);
13504
+      }
13505
+
13506
+      throw new Error("Unsupported PNG image data, try using JPEG instead.");
13507
+    };
13508
+  })(jsPDF.API);
13509
+
13510
+  /**
13511
+   * @license
13512
+   * Copyright (c) 2017 Aras Abbasi 
13513
+   *
13514
+   * Licensed under the MIT License.
13515
+   * http://opensource.org/licenses/mit-license
13516
+   */
13517
+
13518
+  /**
13519
+  * jsPDF gif Support PlugIn
13520
+  *
13521
+  * @name gif_support
13522
+  * @module
13523
+  */
13524
+  (function (jsPDFAPI) {
13525
+
13526
+    jsPDFAPI.processGIF89A = function (imageData, imageIndex, alias, compression, dataAsBinaryString) {
13527
+      var reader = new GifReader(imageData);
13528
+      var width = reader.width,
13529
+          height = reader.height;
13530
+      var qu = 100;
13531
+      var pixels = [];
13532
+      reader.decodeAndBlitFrameRGBA(0, pixels);
13533
+      var rawImageData = {
13534
+        data: pixels,
13535
+        width: width,
13536
+        height: height
13537
+      };
13538
+      var encoder = new JPEGEncoder(qu);
13539
+      var data = encoder.encode(rawImageData, qu);
13540
+      return jsPDFAPI.processJPEG.call(this, data, imageIndex, alias, compression);
13541
+    };
13542
+
13543
+    jsPDFAPI.processGIF87A = jsPDFAPI.processGIF89A;
13544
+  })(jsPDF.API);
13545
+
13546
+  /**
13547
+   * Copyright (c) 2018 Aras Abbasi 
13548
+   *
13549
+   * Licensed under the MIT License.
13550
+   * http://opensource.org/licenses/mit-license
13551
+   */
13552
+
13553
+  /**
13554
+  * jsPDF bmp Support PlugIn
13555
+  * @name bmp_support
13556
+  * @module
13557
+  */
13558
+  (function (jsPDFAPI) {
13559
+
13560
+    jsPDFAPI.processBMP = function (imageData, imageIndex, alias, compression, dataAsBinaryString) {
13561
+      var reader = new BmpDecoder(imageData, false);
13562
+      var width = reader.width,
13563
+          height = reader.height;
13564
+      var qu = 100;
13565
+      var pixels = reader.getData();
13566
+      var rawImageData = {
13567
+        data: pixels,
13568
+        width: width,
13569
+        height: height
13570
+      };
13571
+      var encoder = new JPEGEncoder(qu);
13572
+      var data = encoder.encode(rawImageData, qu);
13573
+      return jsPDFAPI.processJPEG.call(this, data, imageIndex, alias, compression);
13574
+    };
13575
+  })(jsPDF.API);
13576
+
13577
+  /**
13578
+   * @license
13579
+   * Licensed under the MIT License.
13580
+   * http://opensource.org/licenses/mit-license
13581
+   */
13582
+
13583
+  /**
13584
+   * jsPDF setLanguage Plugin
13585
+   *
13586
+   * @name setLanguage
13587
+   * @module
13588
+   */
13589
+  (function (jsPDFAPI) {
13590
+    /**
13591
+    * Add Language Tag to the generated PDF
13592
+    *
13593
+    * @name setLanguage
13594
+    * @function 
13595
+    * @param {string} langCode The Language code as ISO-639-1 (e.g. 'en') or as country language code (e.g. 'en-GB'). 
13596
+    * @returns {jsPDF}
13597
+    * @example
13598
+    * var doc = new jsPDF()
13599
+    * doc.text(10, 10, 'This is a test')
13600
+    * doc.setLanguage("en-US")
13601
+    * doc.save('english.pdf')
13602
+    */
13603
+
13604
+    jsPDFAPI.setLanguage = function (langCode) {
13605
+
13606
+      var langCodes = {
13607
+        "af": "Afrikaans",
13608
+        "sq": "Albanian",
13609
+        "ar": "Arabic (Standard)",
13610
+        "ar-DZ": "Arabic (Algeria)",
13611
+        "ar-BH": "Arabic (Bahrain)",
13612
+        "ar-EG": "Arabic (Egypt)",
13613
+        "ar-IQ": "Arabic (Iraq)",
13614
+        "ar-JO": "Arabic (Jordan)",
13615
+        "ar-KW": "Arabic (Kuwait)",
13616
+        "ar-LB": "Arabic (Lebanon)",
13617
+        "ar-LY": "Arabic (Libya)",
13618
+        "ar-MA": "Arabic (Morocco)",
13619
+        "ar-OM": "Arabic (Oman)",
13620
+        "ar-QA": "Arabic (Qatar)",
13621
+        "ar-SA": "Arabic (Saudi Arabia)",
13622
+        "ar-SY": "Arabic (Syria)",
13623
+        "ar-TN": "Arabic (Tunisia)",
13624
+        "ar-AE": "Arabic (U.A.E.)",
13625
+        "ar-YE": "Arabic (Yemen)",
13626
+        "an": "Aragonese",
13627
+        "hy": "Armenian",
13628
+        "as": "Assamese",
13629
+        "ast": "Asturian",
13630
+        "az": "Azerbaijani",
13631
+        "eu": "Basque",
13632
+        "be": "Belarusian",
13633
+        "bn": "Bengali",
13634
+        "bs": "Bosnian",
13635
+        "br": "Breton",
13636
+        "bg": "Bulgarian",
13637
+        "my": "Burmese",
13638
+        "ca": "Catalan",
13639
+        "ch": "Chamorro",
13640
+        "ce": "Chechen",
13641
+        "zh": "Chinese",
13642
+        "zh-HK": "Chinese (Hong Kong)",
13643
+        "zh-CN": "Chinese (PRC)",
13644
+        "zh-SG": "Chinese (Singapore)",
13645
+        "zh-TW": "Chinese (Taiwan)",
13646
+        "cv": "Chuvash",
13647
+        "co": "Corsican",
13648
+        "cr": "Cree",
13649
+        "hr": "Croatian",
13650
+        "cs": "Czech",
13651
+        "da": "Danish",
13652
+        "nl": "Dutch (Standard)",
13653
+        "nl-BE": "Dutch (Belgian)",
13654
+        "en": "English",
13655
+        "en-AU": "English (Australia)",
13656
+        "en-BZ": "English (Belize)",
13657
+        "en-CA": "English (Canada)",
13658
+        "en-IE": "English (Ireland)",
13659
+        "en-JM": "English (Jamaica)",
13660
+        "en-NZ": "English (New Zealand)",
13661
+        "en-PH": "English (Philippines)",
13662
+        "en-ZA": "English (South Africa)",
13663
+        "en-TT": "English (Trinidad & Tobago)",
13664
+        "en-GB": "English (United Kingdom)",
13665
+        "en-US": "English (United States)",
13666
+        "en-ZW": "English (Zimbabwe)",
13667
+        "eo": "Esperanto",
13668
+        "et": "Estonian",
13669
+        "fo": "Faeroese",
13670
+        "fj": "Fijian",
13671
+        "fi": "Finnish",
13672
+        "fr": "French (Standard)",
13673
+        "fr-BE": "French (Belgium)",
13674
+        "fr-CA": "French (Canada)",
13675
+        "fr-FR": "French (France)",
13676
+        "fr-LU": "French (Luxembourg)",
13677
+        "fr-MC": "French (Monaco)",
13678
+        "fr-CH": "French (Switzerland)",
13679
+        "fy": "Frisian",
13680
+        "fur": "Friulian",
13681
+        "gd": "Gaelic (Scots)",
13682
+        "gd-IE": "Gaelic (Irish)",
13683
+        "gl": "Galacian",
13684
+        "ka": "Georgian",
13685
+        "de": "German (Standard)",
13686
+        "de-AT": "German (Austria)",
13687
+        "de-DE": "German (Germany)",
13688
+        "de-LI": "German (Liechtenstein)",
13689
+        "de-LU": "German (Luxembourg)",
13690
+        "de-CH": "German (Switzerland)",
13691
+        "el": "Greek",
13692
+        "gu": "Gujurati",
13693
+        "ht": "Haitian",
13694
+        "he": "Hebrew",
13695
+        "hi": "Hindi",
13696
+        "hu": "Hungarian",
13697
+        "is": "Icelandic",
13698
+        "id": "Indonesian",
13699
+        "iu": "Inuktitut",
13700
+        "ga": "Irish",
13701
+        "it": "Italian (Standard)",
13702
+        "it-CH": "Italian (Switzerland)",
13703
+        "ja": "Japanese",
13704
+        "kn": "Kannada",
13705
+        "ks": "Kashmiri",
13706
+        "kk": "Kazakh",
13707
+        "km": "Khmer",
13708
+        "ky": "Kirghiz",
13709
+        "tlh": "Klingon",
13710
+        "ko": "Korean",
13711
+        "ko-KP": "Korean (North Korea)",
13712
+        "ko-KR": "Korean (South Korea)",
13713
+        "la": "Latin",
13714
+        "lv": "Latvian",
13715
+        "lt": "Lithuanian",
13716
+        "lb": "Luxembourgish",
13717
+        "mk": "FYRO Macedonian",
13718
+        "ms": "Malay",
13719
+        "ml": "Malayalam",
13720
+        "mt": "Maltese",
13721
+        "mi": "Maori",
13722
+        "mr": "Marathi",
13723
+        "mo": "Moldavian",
13724
+        "nv": "Navajo",
13725
+        "ng": "Ndonga",
13726
+        "ne": "Nepali",
13727
+        "no": "Norwegian",
13728
+        "nb": "Norwegian (Bokmal)",
13729
+        "nn": "Norwegian (Nynorsk)",
13730
+        "oc": "Occitan",
13731
+        "or": "Oriya",
13732
+        "om": "Oromo",
13733
+        "fa": "Persian",
13734
+        "fa-IR": "Persian/Iran",
13735
+        "pl": "Polish",
13736
+        "pt": "Portuguese",
13737
+        "pt-BR": "Portuguese (Brazil)",
13738
+        "pa": "Punjabi",
13739
+        "pa-IN": "Punjabi (India)",
13740
+        "pa-PK": "Punjabi (Pakistan)",
13741
+        "qu": "Quechua",
13742
+        "rm": "Rhaeto-Romanic",
13743
+        "ro": "Romanian",
13744
+        "ro-MO": "Romanian (Moldavia)",
13745
+        "ru": "Russian",
13746
+        "ru-MO": "Russian (Moldavia)",
13747
+        "sz": "Sami (Lappish)",
13748
+        "sg": "Sango",
13749
+        "sa": "Sanskrit",
13750
+        "sc": "Sardinian",
13751
+        "sd": "Sindhi",
13752
+        "si": "Singhalese",
13753
+        "sr": "Serbian",
13754
+        "sk": "Slovak",
13755
+        "sl": "Slovenian",
13756
+        "so": "Somani",
13757
+        "sb": "Sorbian",
13758
+        "es": "Spanish",
13759
+        "es-AR": "Spanish (Argentina)",
13760
+        "es-BO": "Spanish (Bolivia)",
13761
+        "es-CL": "Spanish (Chile)",
13762
+        "es-CO": "Spanish (Colombia)",
13763
+        "es-CR": "Spanish (Costa Rica)",
13764
+        "es-DO": "Spanish (Dominican Republic)",
13765
+        "es-EC": "Spanish (Ecuador)",
13766
+        "es-SV": "Spanish (El Salvador)",
13767
+        "es-GT": "Spanish (Guatemala)",
13768
+        "es-HN": "Spanish (Honduras)",
13769
+        "es-MX": "Spanish (Mexico)",
13770
+        "es-NI": "Spanish (Nicaragua)",
13771
+        "es-PA": "Spanish (Panama)",
13772
+        "es-PY": "Spanish (Paraguay)",
13773
+        "es-PE": "Spanish (Peru)",
13774
+        "es-PR": "Spanish (Puerto Rico)",
13775
+        "es-ES": "Spanish (Spain)",
13776
+        "es-UY": "Spanish (Uruguay)",
13777
+        "es-VE": "Spanish (Venezuela)",
13778
+        "sx": "Sutu",
13779
+        "sw": "Swahili",
13780
+        "sv": "Swedish",
13781
+        "sv-FI": "Swedish (Finland)",
13782
+        "sv-SV": "Swedish (Sweden)",
13783
+        "ta": "Tamil",
13784
+        "tt": "Tatar",
13785
+        "te": "Teluga",
13786
+        "th": "Thai",
13787
+        "tig": "Tigre",
13788
+        "ts": "Tsonga",
13789
+        "tn": "Tswana",
13790
+        "tr": "Turkish",
13791
+        "tk": "Turkmen",
13792
+        "uk": "Ukrainian",
13793
+        "hsb": "Upper Sorbian",
13794
+        "ur": "Urdu",
13795
+        "ve": "Venda",
13796
+        "vi": "Vietnamese",
13797
+        "vo": "Volapuk",
13798
+        "wa": "Walloon",
13799
+        "cy": "Welsh",
13800
+        "xh": "Xhosa",
13801
+        "ji": "Yiddish",
13802
+        "zu": "Zulu"
13803
+      };
13804
+
13805
+      if (this.internal.languageSettings === undefined) {
13806
+        this.internal.languageSettings = {};
13807
+        this.internal.languageSettings.isSubscribed = false;
13808
+      }
13809
+
13810
+      if (langCodes[langCode] !== undefined) {
13811
+        this.internal.languageSettings.languageCode = langCode;
13812
+
13813
+        if (this.internal.languageSettings.isSubscribed === false) {
13814
+          this.internal.events.subscribe("putCatalog", function () {
13815
+            this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")");
13816
+          });
13817
+          this.internal.languageSettings.isSubscribed = true;
13818
+        }
13819
+      }
13820
+
13821
+      return this;
13822
+    };
13823
+  })(jsPDF.API);
13824
+
13825
+  /** @license
13826
+   * MIT license.
13827
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
13828
+   *               2014 Diego Casorran, https://github.com/diegocr
13829
+   *
13830
+   * 
13831
+   * ====================================================================
13832
+   */
13833
+
13834
+  /**
13835
+  * jsPDF split_text_to_size plugin 
13836
+  * 
13837
+  * @name split_text_to_size
13838
+  * @module
13839
+  */
13840
+  (function (API) {
13841
+    /**
13842
+     * Returns an array of length matching length of the 'word' string, with each
13843
+     * cell occupied by the width of the char in that position.
13844
+     * 
13845
+     * @name getCharWidthsArray
13846
+     * @function
13847
+     * @param {string} text
13848
+     * @param {Object} options
13849
+     * @returns {Array}
13850
+     */
13851
+
13852
+    var getCharWidthsArray = API.getCharWidthsArray = function (text, options) {
13853
+      options = options || {};
13854
+      var activeFont = options.font || this.internal.getFont();
13855
+      var fontSize = options.fontSize || this.internal.getFontSize();
13856
+      var charSpace = options.charSpace || this.internal.getCharSpace();
13857
+      var widths = options.widths ? options.widths : activeFont.metadata.Unicode.widths;
13858
+      var widthsFractionOf = widths.fof ? widths.fof : 1;
13859
+      var kerning = options.kerning ? options.kerning : activeFont.metadata.Unicode.kerning;
13860
+      var kerningFractionOf = kerning.fof ? kerning.fof : 1;
13861
+      var i;
13862
+      var l;
13863
+      var char_code;
13864
+      var prior_char_code = 0; //for kerning
13865
+
13866
+      var default_char_width = widths[0] || widthsFractionOf;
13867
+      var output = [];
13868
+
13869
+      for (i = 0, l = text.length; i < l; i++) {
13870
+        char_code = text.charCodeAt(i);
13871
+
13872
+        if (typeof activeFont.metadata.widthOfString === "function") {
13873
+          output.push((activeFont.metadata.widthOfGlyph(activeFont.metadata.characterToGlyph(char_code)) + charSpace * (1000 / fontSize) || 0) / 1000);
13874
+        } else {
13875
+          output.push((widths[char_code] || default_char_width) / widthsFractionOf + (kerning[char_code] && kerning[char_code][prior_char_code] || 0) / kerningFractionOf);
13876
+        }
13877
+
13878
+        prior_char_code = char_code;
13879
+      }
13880
+
13881
+      return output;
13882
+    };
13883
+    /**
13884
+     * Calculate the sum of a number-array
13885
+     * 
13886
+     * @name getArraySum
13887
+     * @public
13888
+     * @function
13889
+     * @param {Array} array Array of numbers
13890
+     * @returns {number}
13891
+     */
13892
+
13893
+
13894
+    var getArraySum = API.getArraySum = function (array) {
13895
+      var i = array.length,
13896
+          output = 0;
13897
+
13898
+      while (i) {
13899
+        i--;
13900
+        output += array[i];
13901
+      }
13902
+
13903
+      return output;
13904
+    };
13905
+    /**
13906
+    * Returns a widths of string in a given font, if the font size is set as 1 point.
13907
+    *
13908
+    * In other words, this is "proportional" value. For 1 unit of font size, the length
13909
+    * of the string will be that much.
13910
+    * 
13911
+    * Multiply by font size to get actual width in *points*
13912
+    * Then divide by 72 to get inches or divide by (72/25.6) to get 'mm' etc.
13913
+    * 
13914
+    * @name getStringUnitWidth
13915
+    * @public
13916
+    * @function
13917
+    * @param {string} text
13918
+    * @param {string} options
13919
+    * @returns {number} result
13920
+    */
13921
+
13922
+
13923
+    var getStringUnitWidth = API.getStringUnitWidth = function (text, options) {
13924
+      options = options || {};
13925
+      var fontSize = options.fontSize || this.internal.getFontSize();
13926
+      var font = options.font || this.internal.getFont();
13927
+      var charSpace = options.charSpace || this.internal.getCharSpace();
13928
+      var result = 0;
13929
+
13930
+      if (typeof font.metadata.widthOfString === "function") {
13931
+        result = font.metadata.widthOfString(text, fontSize, charSpace) / fontSize;
13932
+      } else {
13933
+        result = getArraySum(getCharWidthsArray.apply(this, arguments));
13934
+      }
13935
+
13936
+      return result;
13937
+    };
13938
+    /**
13939
+    returns array of lines
13940
+    */
13941
+
13942
+
13943
+    var splitLongWord = function splitLongWord(word, widths_array, firstLineMaxLen, maxLen) {
13944
+      var answer = []; // 1st, chop off the piece that can fit on the hanging line.
13945
+
13946
+      var i = 0,
13947
+          l = word.length,
13948
+          workingLen = 0;
13949
+
13950
+      while (i !== l && workingLen + widths_array[i] < firstLineMaxLen) {
13951
+        workingLen += widths_array[i];
13952
+        i++;
13953
+      } // this is first line.
13954
+
13955
+
13956
+      answer.push(word.slice(0, i)); // 2nd. Split the rest into maxLen pieces.
13957
+
13958
+      var startOfLine = i;
13959
+      workingLen = 0;
13960
+
13961
+      while (i !== l) {
13962
+        if (workingLen + widths_array[i] > maxLen) {
13963
+          answer.push(word.slice(startOfLine, i));
13964
+          workingLen = 0;
13965
+          startOfLine = i;
13966
+        }
13967
+
13968
+        workingLen += widths_array[i];
13969
+        i++;
13970
+      }
13971
+
13972
+      if (startOfLine !== i) {
13973
+        answer.push(word.slice(startOfLine, i));
13974
+      }
13975
+
13976
+      return answer;
13977
+    }; // Note, all sizing inputs for this function must be in "font measurement units"
13978
+    // By default, for PDF, it's "point".
13979
+
13980
+
13981
+    var splitParagraphIntoLines = function splitParagraphIntoLines(text, maxlen, options) {
13982
+      // at this time works only on Western scripts, ones with space char
13983
+      // separating the words. Feel free to expand.
13984
+      if (!options) {
13985
+        options = {};
13986
+      }
13987
+
13988
+      var line = [],
13989
+          lines = [line],
13990
+          line_length = options.textIndent || 0,
13991
+          separator_length = 0,
13992
+          current_word_length = 0,
13993
+          word,
13994
+          widths_array,
13995
+          words = text.split(' '),
13996
+          spaceCharWidth = getCharWidthsArray.apply(this, [' ', options])[0],
13997
+          i,
13998
+          l,
13999
+          tmp,
14000
+          lineIndent;
14001
+
14002
+      if (options.lineIndent === -1) {
14003
+        lineIndent = words[0].length + 2;
14004
+      } else {
14005
+        lineIndent = options.lineIndent || 0;
14006
+      }
14007
+
14008
+      if (lineIndent) {
14009
+        var pad = Array(lineIndent).join(" "),
14010
+            wrds = [];
14011
+        words.map(function (wrd) {
14012
+          wrd = wrd.split(/\s*\n/);
14013
+
14014
+          if (wrd.length > 1) {
14015
+            wrds = wrds.concat(wrd.map(function (wrd, idx) {
14016
+              return (idx && wrd.length ? "\n" : "") + wrd;
14017
+            }));
14018
+          } else {
14019
+            wrds.push(wrd[0]);
14020
+          }
14021
+        });
14022
+        words = wrds;
14023
+        lineIndent = getStringUnitWidth.apply(this, [pad, options]);
14024
+      }
14025
+
14026
+      for (i = 0, l = words.length; i < l; i++) {
14027
+        var force = 0;
14028
+        word = words[i];
14029
+
14030
+        if (lineIndent && word[0] == "\n") {
14031
+          word = word.substr(1);
14032
+          force = 1;
14033
+        }
14034
+
14035
+        widths_array = getCharWidthsArray.apply(this, [word, options]);
14036
+        current_word_length = getArraySum(widths_array);
14037
+
14038
+        if (line_length + separator_length + current_word_length > maxlen || force) {
14039
+          if (current_word_length > maxlen) {
14040
+            // this happens when you have space-less long URLs for example.
14041
+            // we just chop these to size. We do NOT insert hiphens
14042
+            tmp = splitLongWord.apply(this, [word, widths_array, maxlen - (line_length + separator_length), maxlen]); // first line we add to existing line object
14043
+
14044
+            line.push(tmp.shift()); // it's ok to have extra space indicator there
14045
+            // last line we make into new line object
14046
+
14047
+            line = [tmp.pop()]; // lines in the middle we apped to lines object as whole lines
14048
+
14049
+            while (tmp.length) {
14050
+              lines.push([tmp.shift()]); // single fragment occupies whole line
14051
+            }
14052
+
14053
+            current_word_length = getArraySum(widths_array.slice(word.length - (line[0] ? line[0].length : 0)));
14054
+          } else {
14055
+            // just put it on a new line
14056
+            line = [word];
14057
+          } // now we attach new line to lines
14058
+
14059
+
14060
+          lines.push(line);
14061
+          line_length = current_word_length + lineIndent;
14062
+          separator_length = spaceCharWidth;
14063
+        } else {
14064
+          line.push(word);
14065
+          line_length += separator_length + current_word_length;
14066
+          separator_length = spaceCharWidth;
14067
+        }
14068
+      }
14069
+
14070
+      if (lineIndent) {
14071
+        var postProcess = function postProcess(ln, idx) {
14072
+          return (idx ? pad : '') + ln.join(" ");
14073
+        };
14074
+      } else {
14075
+        var postProcess = function postProcess(ln) {
14076
+          return ln.join(" ");
14077
+        };
14078
+      }
14079
+
14080
+      return lines.map(postProcess);
14081
+    };
14082
+    /**
14083
+    * Splits a given string into an array of strings. Uses 'size' value
14084
+    * (in measurement units declared as default for the jsPDF instance)
14085
+    * and the font's "widths" and "Kerning" tables, where available, to
14086
+    * determine display length of a given string for a given font.
14087
+    * 
14088
+    * We use character's 100% of unit size (height) as width when Width
14089
+    * table or other default width is not available.
14090
+    * 
14091
+    * @name splitTextToSize
14092
+    * @public
14093
+    * @function
14094
+    * @param {string} text Unencoded, regular JavaScript (Unicode, UTF-16 / UCS-2) string.
14095
+    * @param {number} size Nominal number, measured in units default to this instance of jsPDF.
14096
+    * @param {Object} options Optional flags needed for chopper to do the right thing.
14097
+    * @returns {Array} array Array with strings chopped to size.
14098
+    */
14099
+
14100
+
14101
+    API.splitTextToSize = function (text, maxlen, options) {
14102
+
14103
+      options = options || {};
14104
+
14105
+      var fsize = options.fontSize || this.internal.getFontSize(),
14106
+          newOptions = function (options) {
14107
+        var widths = {
14108
+          0: 1
14109
+        },
14110
+            kerning = {};
14111
+
14112
+        if (!options.widths || !options.kerning) {
14113
+          var f = this.internal.getFont(options.fontName, options.fontStyle),
14114
+              encoding = 'Unicode'; // NOT UTF8, NOT UTF16BE/LE, NOT UCS2BE/LE
14115
+          // Actual JavaScript-native String's 16bit char codes used.
14116
+          // no multi-byte logic here
14117
+
14118
+          if (f.metadata[encoding]) {
14119
+            return {
14120
+              widths: f.metadata[encoding].widths || widths,
14121
+              kerning: f.metadata[encoding].kerning || kerning
14122
+            };
14123
+          } else {
14124
+            return {
14125
+              font: f.metadata,
14126
+              fontSize: this.internal.getFontSize(),
14127
+              charSpace: this.internal.getCharSpace()
14128
+            };
14129
+          }
14130
+        } else {
14131
+          return {
14132
+            widths: options.widths,
14133
+            kerning: options.kerning
14134
+          };
14135
+        } // then use default values
14136
+
14137
+
14138
+        return {
14139
+          widths: widths,
14140
+          kerning: kerning
14141
+        };
14142
+      }.call(this, options); // first we split on end-of-line chars
14143
+
14144
+
14145
+      var paragraphs;
14146
+
14147
+      if (Array.isArray(text)) {
14148
+        paragraphs = text;
14149
+      } else {
14150
+        paragraphs = text.split(/\r?\n/);
14151
+      } // now we convert size (max length of line) into "font size units"
14152
+      // at present time, the "font size unit" is always 'point'
14153
+      // 'proportional' means, "in proportion to font size"
14154
+
14155
+
14156
+      var fontUnit_maxLen = 1.0 * this.internal.scaleFactor * maxlen / fsize; // at this time, fsize is always in "points" regardless of the default measurement unit of the doc.
14157
+      // this may change in the future?
14158
+      // until then, proportional_maxlen is likely to be in 'points'
14159
+      // If first line is to be indented (shorter or longer) than maxLen
14160
+      // we indicate that by using CSS-style "text-indent" option.
14161
+      // here it's in font units too (which is likely 'points')
14162
+      // it can be negative (which makes the first line longer than maxLen)
14163
+
14164
+      newOptions.textIndent = options.textIndent ? options.textIndent * 1.0 * this.internal.scaleFactor / fsize : 0;
14165
+      newOptions.lineIndent = options.lineIndent;
14166
+      var i,
14167
+          l,
14168
+          output = [];
14169
+
14170
+      for (i = 0, l = paragraphs.length; i < l; i++) {
14171
+        output = output.concat(splitParagraphIntoLines.apply(this, [paragraphs[i], fontUnit_maxLen, newOptions]));
14172
+      }
14173
+
14174
+      return output;
14175
+    };
14176
+  })(jsPDF.API);
14177
+
14178
+  /** @license
14179
+   jsPDF standard_fonts_metrics plugin
14180
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
14181
+   * MIT license.
14182
+   * 
14183
+   * ====================================================================
14184
+   */
14185
+
14186
+  (function (API) {
14187
+    /*
14188
+    # reference (Python) versions of 'compress' and 'uncompress'
14189
+    # only 'uncompress' function is featured lower as JavaScript
14190
+    # if you want to unit test "roundtrip", just transcribe the reference
14191
+    # 'compress' function from Python into JavaScript
14192
+    
14193
+    def compress(data):
14194
+    
14195
+    	keys =   '0123456789abcdef'
14196
+    	values = 'klmnopqrstuvwxyz'
14197
+    	mapping = dict(zip(keys, values))
14198
+    	vals = []
14199
+    	for key in data.keys():
14200
+    		value = data[key]
14201
+    		try:
14202
+    			keystring = hex(key)[2:]
14203
+    			keystring = keystring[:-1] + mapping[keystring[-1:]]
14204
+    		except:
14205
+    			keystring = key.join(["'","'"])
14206
+    			#print('Keystring is %s' % keystring)
14207
+    
14208
+    		try:
14209
+    			if value < 0:
14210
+    				valuestring = hex(value)[3:]
14211
+    				numberprefix = '-'
14212
+    			else:
14213
+    				valuestring = hex(value)[2:]
14214
+    				numberprefix = ''
14215
+    			valuestring = numberprefix + valuestring[:-1] + mapping[valuestring[-1:]]
14216
+    		except:
14217
+    			if type(value) == dict:
14218
+    				valuestring = compress(value)
14219
+    			else:
14220
+    				raise Exception("Don't know what to do with value type %s" % type(value))
14221
+    
14222
+    		vals.append(keystring+valuestring)
14223
+    	
14224
+    	return '{' + ''.join(vals) + '}'
14225
+    
14226
+    def uncompress(data):
14227
+    
14228
+    	decoded = '0123456789abcdef'
14229
+    	encoded = 'klmnopqrstuvwxyz'
14230
+    	mapping = dict(zip(encoded, decoded))
14231
+    
14232
+    	sign = +1
14233
+    	stringmode = False
14234
+    	stringparts = []
14235
+    
14236
+    	output = {}
14237
+    
14238
+    	activeobject = output
14239
+    	parentchain = []
14240
+    
14241
+    	keyparts = ''
14242
+    	valueparts = ''
14243
+    
14244
+    	key = None
14245
+    
14246
+    	ending = set(encoded)
14247
+    
14248
+    	i = 1
14249
+    	l = len(data) - 1 # stripping starting, ending {}
14250
+    	while i != l: # stripping {}
14251
+    		# -, {, }, ' are special.
14252
+    
14253
+    		ch = data[i]
14254
+    		i += 1
14255
+    
14256
+    		if ch == "'":
14257
+    			if stringmode:
14258
+    				# end of string mode
14259
+    				stringmode = False
14260
+    				key = ''.join(stringparts)
14261
+    			else:
14262
+    				# start of string mode
14263
+    				stringmode = True
14264
+    				stringparts = []
14265
+    		elif stringmode == True:
14266
+    			#print("Adding %s to stringpart" % ch)
14267
+    			stringparts.append(ch)
14268
+    
14269
+    		elif ch == '{':
14270
+    			# start of object
14271
+    			parentchain.append( [activeobject, key] )
14272
+    			activeobject = {}
14273
+    			key = None
14274
+    			#DEBUG = True
14275
+    		elif ch == '}':
14276
+    			# end of object
14277
+    			parent, key = parentchain.pop()
14278
+    			parent[key] = activeobject
14279
+    			key = None
14280
+    			activeobject = parent
14281
+    			#DEBUG = False
14282
+    
14283
+    		elif ch == '-':
14284
+    			sign = -1
14285
+    		else:
14286
+    			# must be number
14287
+    			if key == None:
14288
+    				#debug("In Key. It is '%s', ch is '%s'" % (keyparts, ch))
14289
+    				if ch in ending:
14290
+    					#debug("End of key")
14291
+    					keyparts += mapping[ch]
14292
+    					key = int(keyparts, 16) * sign
14293
+    					sign = +1
14294
+    					keyparts = ''
14295
+    				else:
14296
+    					keyparts += ch
14297
+    			else:
14298
+    				#debug("In value. It is '%s', ch is '%s'" % (valueparts, ch))
14299
+    				if ch in ending:
14300
+    					#debug("End of value")
14301
+    					valueparts += mapping[ch]
14302
+    					activeobject[key] = int(valueparts, 16) * sign
14303
+    					sign = +1
14304
+    					key = None
14305
+    					valueparts = ''
14306
+    				else:
14307
+    					valueparts += ch
14308
+    
14309
+    			#debug(activeobject)
14310
+    
14311
+    	return output
14312
+    
14313
+    */
14314
+
14315
+    /**
14316
+    Uncompresses data compressed into custom, base16-like format. 
14317
+    @public
14318
+    @function
14319
+    @param
14320
+    @returns {Type}
14321
+    */
14322
+
14323
+    var uncompress = function uncompress(data) {
14324
+      var decoded = '0123456789abcdef',
14325
+          encoded = 'klmnopqrstuvwxyz',
14326
+          mapping = {};
14327
+
14328
+      for (var i = 0; i < encoded.length; i++) {
14329
+        mapping[encoded[i]] = decoded[i];
14330
+      }
14331
+
14332
+      var undef,
14333
+          output = {},
14334
+          sign = 1,
14335
+          stringparts // undef. will be [] in string mode
14336
+      ,
14337
+          activeobject = output,
14338
+          parentchain = [],
14339
+          parent_key_pair,
14340
+          keyparts = '',
14341
+          valueparts = '',
14342
+          key // undef. will be Truthy when Key is resolved.
14343
+      ,
14344
+          datalen = data.length - 1 // stripping ending }
14345
+      ,
14346
+          ch;
14347
+      i = 1; // stripping starting {
14348
+
14349
+      while (i != datalen) {
14350
+        // - { } ' are special.
14351
+        ch = data[i];
14352
+        i += 1;
14353
+
14354
+        if (ch == "'") {
14355
+          if (stringparts) {
14356
+            // end of string mode
14357
+            key = stringparts.join('');
14358
+            stringparts = undef;
14359
+          } else {
14360
+            // start of string mode
14361
+            stringparts = [];
14362
+          }
14363
+        } else if (stringparts) {
14364
+          stringparts.push(ch);
14365
+        } else if (ch == '{') {
14366
+          // start of object
14367
+          parentchain.push([activeobject, key]);
14368
+          activeobject = {};
14369
+          key = undef;
14370
+        } else if (ch == '}') {
14371
+          // end of object
14372
+          parent_key_pair = parentchain.pop();
14373
+          parent_key_pair[0][parent_key_pair[1]] = activeobject;
14374
+          key = undef;
14375
+          activeobject = parent_key_pair[0];
14376
+        } else if (ch == '-') {
14377
+          sign = -1;
14378
+        } else {
14379
+          // must be number
14380
+          if (key === undef) {
14381
+            if (mapping.hasOwnProperty(ch)) {
14382
+              keyparts += mapping[ch];
14383
+              key = parseInt(keyparts, 16) * sign;
14384
+              sign = +1;
14385
+              keyparts = '';
14386
+            } else {
14387
+              keyparts += ch;
14388
+            }
14389
+          } else {
14390
+            if (mapping.hasOwnProperty(ch)) {
14391
+              valueparts += mapping[ch];
14392
+              activeobject[key] = parseInt(valueparts, 16) * sign;
14393
+              sign = +1;
14394
+              key = undef;
14395
+              valueparts = '';
14396
+            } else {
14397
+              valueparts += ch;
14398
+            }
14399
+          }
14400
+        }
14401
+      } // end while
14402
+
14403
+
14404
+      return output;
14405
+    }; // encoding = 'Unicode' 
14406
+    // NOT UTF8, NOT UTF16BE/LE, NOT UCS2BE/LE. NO clever BOM behavior
14407
+    // Actual 16bit char codes used.
14408
+    // no multi-byte logic here
14409
+    // Unicode characters to WinAnsiEncoding:
14410
+    // {402: 131, 8211: 150, 8212: 151, 8216: 145, 8217: 146, 8218: 130, 8220: 147, 8221: 148, 8222: 132, 8224: 134, 8225: 135, 8226: 149, 8230: 133, 8364: 128, 8240:137, 8249: 139, 8250: 155, 710: 136, 8482: 153, 338: 140, 339: 156, 732: 152, 352: 138, 353: 154, 376: 159, 381: 142, 382: 158}
14411
+    // as you can see, all Unicode chars are outside of 0-255 range. No char code conflicts.
14412
+    // this means that you can give Win cp1252 encoded strings to jsPDF for rendering directly
14413
+    // as well as give strings with some (supported by these fonts) Unicode characters and 
14414
+    // these will be mapped to win cp1252 
14415
+    // for example, you can send char code (cp1252) 0x80 or (unicode) 0x20AC, getting "Euro" glyph displayed in both cases.
14416
+
14417
+
14418
+    var encodingBlock = {
14419
+      'codePages': ['WinAnsiEncoding'],
14420
+      'WinAnsiEncoding': uncompress("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")
14421
+    },
14422
+        encodings = {
14423
+      'Unicode': {
14424
+        'Courier': encodingBlock,
14425
+        'Courier-Bold': encodingBlock,
14426
+        'Courier-BoldOblique': encodingBlock,
14427
+        'Courier-Oblique': encodingBlock,
14428
+        'Helvetica': encodingBlock,
14429
+        'Helvetica-Bold': encodingBlock,
14430
+        'Helvetica-BoldOblique': encodingBlock,
14431
+        'Helvetica-Oblique': encodingBlock,
14432
+        'Times-Roman': encodingBlock,
14433
+        'Times-Bold': encodingBlock,
14434
+        'Times-BoldItalic': encodingBlock,
14435
+        'Times-Italic': encodingBlock //	, 'Symbol'
14436
+        //	, 'ZapfDingbats'
14437
+
14438
+      }
14439
+    },
14440
+        fontMetrics = {
14441
+      'Unicode': {
14442
+        // all sizing numbers are n/fontMetricsFractionOf = one font size unit
14443
+        // this means that if fontMetricsFractionOf = 1000, and letter A's width is 476, it's
14444
+        // width is 476/1000 or 47.6% of its height (regardless of font size)
14445
+        // At this time this value applies to "widths" and "kerning" numbers.
14446
+        // char code 0 represents "default" (average) width - use it for chars missing in this table.
14447
+        // key 'fof' represents the "fontMetricsFractionOf" value
14448
+        'Courier-Oblique': uncompress("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
14449
+        'Times-BoldItalic': uncompress("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),
14450
+        'Helvetica-Bold': uncompress("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
14451
+        'Courier': uncompress("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
14452
+        'Courier-BoldOblique': uncompress("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
14453
+        'Times-Bold': uncompress("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),
14454
+        'Symbol': uncompress("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),
14455
+        'Helvetica': uncompress("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),
14456
+        'Helvetica-BoldOblique': uncompress("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
14457
+        'ZapfDingbats': uncompress("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),
14458
+        'Courier-Bold': uncompress("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
14459
+        'Times-Italic': uncompress("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),
14460
+        'Times-Roman': uncompress("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),
14461
+        'Helvetica-Oblique': uncompress("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")
14462
+      }
14463
+    };
14464
+    /*
14465
+    This event handler is fired when a new jsPDF object is initialized
14466
+    This event handler appends metrics data to standard fonts within
14467
+    that jsPDF instance. The metrics are mapped over Unicode character
14468
+    codes, NOT CIDs or other codes matching the StandardEncoding table of the
14469
+    standard PDF fonts.
14470
+    Future:
14471
+    Also included is the encoding maping table, converting Unicode (UCS-2, UTF-16)
14472
+    char codes to StandardEncoding character codes. The encoding table is to be used
14473
+    somewhere around "pdfEscape" call.
14474
+    */
14475
+
14476
+    API.events.push(['addFont', function (data) {
14477
+      var font = data.font;
14478
+      var metrics,
14479
+          unicode_section,
14480
+          encoding = 'Unicode',
14481
+          encodingBlock;
14482
+      metrics = fontMetrics[encoding][font.postScriptName];
14483
+
14484
+      if (metrics) {
14485
+        if (font.metadata[encoding]) {
14486
+          unicode_section = font.metadata[encoding];
14487
+        } else {
14488
+          unicode_section = font.metadata[encoding] = {};
14489
+        }
14490
+
14491
+        unicode_section.widths = metrics.widths;
14492
+        unicode_section.kerning = metrics.kerning;
14493
+      }
14494
+
14495
+      encodingBlock = encodings[encoding][font.postScriptName];
14496
+
14497
+      if (encodingBlock) {
14498
+        if (font.metadata[encoding]) {
14499
+          unicode_section = font.metadata[encoding];
14500
+        } else {
14501
+          unicode_section = font.metadata[encoding] = {};
14502
+        }
14503
+
14504
+        unicode_section.encoding = encodingBlock;
14505
+
14506
+        if (encodingBlock.codePages && encodingBlock.codePages.length) {
14507
+          font.encoding = encodingBlock.codePages[0];
14508
+        }
14509
+      }
14510
+    }]); // end of adding event handler
14511
+  })(jsPDF.API);
14512
+
14513
+  /**
14514
+   * @license
14515
+   * Licensed under the MIT License.
14516
+   * http://opensource.org/licenses/mit-license
14517
+   */
14518
+
14519
+  /**
14520
+  * @name ttfsupport
14521
+  * @module
14522
+  */
14523
+  (function (jsPDF, global) {
14524
+
14525
+    jsPDF.API.events.push(['addFont', function (data) {
14526
+      var font = data.font;
14527
+      var instance = data.instance;
14528
+
14529
+      if (typeof instance !== "undefined" && instance.existsFileInVFS(font.postScriptName)) {
14530
+        var file = instance.getFileFromVFS(font.postScriptName);
14531
+
14532
+        if (typeof file !== "string") {
14533
+          throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + font.postScriptName + "').");
14534
+        }
14535
+
14536
+        font.metadata = jsPDF.API.TTFFont.open(font.postScriptName, font.fontName, file, font.encoding);
14537
+        font.metadata.Unicode = font.metadata.Unicode || {
14538
+          encoding: {},
14539
+          kerning: {},
14540
+          widths: []
14541
+        };
14542
+        font.metadata.glyIdsUsed = [0];
14543
+      } else if (font.isStandardFont === false) {
14544
+        throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + font.postScriptName + "').");
14545
+      }
14546
+    }]); // end of adding event handler
14547
+  })(jsPDF, typeof self !== "undefined" && self || typeof global !== "undefined" && global || typeof window !== "undefined" && window || Function("return this")());
14548
+
14549
+  /** @license
14550
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
14551
+   * 
14552
+   * 
14553
+   * ====================================================================
14554
+   */
14555
+
14556
+  (function (jsPDFAPI) {
14557
+    /**
14558
+    * Parses SVG XML and converts only some of the SVG elements into
14559
+    * PDF elements.
14560
+    *
14561
+    * Supports:
14562
+    * paths
14563
+    * 
14564
+    * @name addSvg
14565
+    * @public
14566
+    * @function 
14567
+    * @param {string} SVG-Data as Text
14568
+    * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page
14569
+    * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
14570
+    * @param {number} width of SVG (in units declared at inception of PDF document)
14571
+    * @param {number} height of SVG (in units declared at inception of PDF document)
14572
+    * @returns {Object} jsPDF-instance
14573
+    */
14574
+
14575
+    jsPDFAPI.addSvg = function (svgtext, x, y, w, h) {
14576
+      // 'this' is _jsPDF object returned when jsPDF is inited (new jsPDF())
14577
+      var undef;
14578
+
14579
+      if (x === undef || y === undef) {
14580
+        throw new Error("addSVG needs values for 'x' and 'y'");
14581
+      }
14582
+
14583
+      function InjectCSS(cssbody, document) {
14584
+        var styletag = document.createElement('style');
14585
+        styletag.type = 'text/css';
14586
+
14587
+        if (styletag.styleSheet) {
14588
+          // ie
14589
+          styletag.styleSheet.cssText = cssbody;
14590
+        } else {
14591
+          // others
14592
+          styletag.appendChild(document.createTextNode(cssbody));
14593
+        }
14594
+
14595
+        document.getElementsByTagName("head")[0].appendChild(styletag);
14596
+      }
14597
+
14598
+      function createWorkerNode(document) {
14599
+        var frameID = 'childframe' // Date.now().toString() + '_' + (Math.random() * 100).toString()
14600
+        ,
14601
+            frame = document.createElement('iframe');
14602
+        InjectCSS('.jsPDF_sillysvg_iframe {display:none;position:absolute;}', document);
14603
+        frame.name = frameID;
14604
+        frame.setAttribute("width", 0);
14605
+        frame.setAttribute("height", 0);
14606
+        frame.setAttribute("frameborder", "0");
14607
+        frame.setAttribute("scrolling", "no");
14608
+        frame.setAttribute("seamless", "seamless");
14609
+        frame.setAttribute("class", "jsPDF_sillysvg_iframe");
14610
+        document.body.appendChild(frame);
14611
+        return frame;
14612
+      }
14613
+
14614
+      function attachSVGToWorkerNode(svgtext, frame) {
14615
+        var framedoc = (frame.contentWindow || frame.contentDocument).document;
14616
+        framedoc.write(svgtext);
14617
+        framedoc.close();
14618
+        return framedoc.getElementsByTagName('svg')[0];
14619
+      }
14620
+
14621
+      function convertPathToPDFLinesArgs(path) {
14622
+        // - starting coordinate pair
14623
+        // - array of arrays of vector shifts (2-len for line, 6 len for bezier)
14624
+        // - scale array [horizontal, vertical] ratios
14625
+        // - style (stroke, fill, both)
14626
+
14627
+        var x = parseFloat(path[1]),
14628
+            y = parseFloat(path[2]),
14629
+            vectors = [],
14630
+            position = 3,
14631
+            len = path.length;
14632
+
14633
+        while (position < len) {
14634
+          if (path[position] === 'c') {
14635
+            vectors.push([parseFloat(path[position + 1]), parseFloat(path[position + 2]), parseFloat(path[position + 3]), parseFloat(path[position + 4]), parseFloat(path[position + 5]), parseFloat(path[position + 6])]);
14636
+            position += 7;
14637
+          } else if (path[position] === 'l') {
14638
+            vectors.push([parseFloat(path[position + 1]), parseFloat(path[position + 2])]);
14639
+            position += 3;
14640
+          } else {
14641
+            position += 1;
14642
+          }
14643
+        }
14644
+
14645
+        return [x, y, vectors];
14646
+      }
14647
+
14648
+      var workernode = createWorkerNode(document),
14649
+          svgnode = attachSVGToWorkerNode(svgtext, workernode),
14650
+          scale = [1, 1],
14651
+          svgw = parseFloat(svgnode.getAttribute('width')),
14652
+          svgh = parseFloat(svgnode.getAttribute('height'));
14653
+
14654
+      if (svgw && svgh) {
14655
+        // setting both w and h makes image stretch to size.
14656
+        // this may distort the image, but fits your demanded size
14657
+        if (w && h) {
14658
+          scale = [w / svgw, h / svgh];
14659
+        } // if only one is set, that value is set as max and SVG
14660
+        // is scaled proportionately.
14661
+        else if (w) {
14662
+            scale = [w / svgw, w / svgw];
14663
+          } else if (h) {
14664
+            scale = [h / svgh, h / svgh];
14665
+          }
14666
+      }
14667
+
14668
+      var i,
14669
+          l,
14670
+          tmp,
14671
+          linesargs,
14672
+          items = svgnode.childNodes;
14673
+
14674
+      for (i = 0, l = items.length; i < l; i++) {
14675
+        tmp = items[i];
14676
+
14677
+        if (tmp.tagName && tmp.tagName.toUpperCase() === 'PATH') {
14678
+          linesargs = convertPathToPDFLinesArgs(tmp.getAttribute("d").split(' ')); // path start x coordinate
14679
+
14680
+          linesargs[0] = linesargs[0] * scale[0] + x; // where x is upper left X of image
14681
+          // path start y coordinate
14682
+
14683
+          linesargs[1] = linesargs[1] * scale[1] + y; // where y is upper left Y of image
14684
+          // the rest of lines are vectors. these will adjust with scale value auto.
14685
+
14686
+          this.lines.call(this, linesargs[2] // lines
14687
+          , linesargs[0] // starting x
14688
+          , linesargs[1] // starting y
14689
+          , scale);
14690
+        }
14691
+      } // clean up
14692
+      // workernode.parentNode.removeChild(workernode)
14693
+
14694
+
14695
+      return this;
14696
+    }; //fallback
14697
+
14698
+
14699
+    jsPDFAPI.addSVG = jsPDFAPI.addSvg;
14700
+    /**
14701
+    * Parses SVG XML and saves it as image into the PDF.
14702
+    *
14703
+    * Depends on canvas-element and canvg
14704
+    *
14705
+    * @name addSvgAsImage
14706
+    * @public
14707
+    * @function
14708
+    * @param {string} SVG-Data as Text
14709
+    * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page
14710
+    * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
14711
+    * @param {number} width of SVG-Image (in units declared at inception of PDF document)
14712
+    * @param {number} height of SVG-Image (in units declared at inception of PDF document)
14713
+    * @param {string} alias of SVG-Image (if used multiple times)
14714
+    * @param {string} compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'
14715
+    * @param {number} rotation of the image in degrees (0-359)
14716
+    * 
14717
+    * @returns jsPDF jsPDF-instance
14718
+    */
14719
+
14720
+    jsPDFAPI.addSvgAsImage = function (svg, x, y, w, h, alias, compression, rotation) {
14721
+      if (isNaN(x) || isNaN(y)) {
14722
+        console.error('jsPDF.addSvgAsImage: Invalid coordinates', arguments);
14723
+        throw new Error('Invalid coordinates passed to jsPDF.addSvgAsImage');
14724
+      }
14725
+
14726
+      if (isNaN(w) || isNaN(h)) {
14727
+        console.error('jsPDF.addSvgAsImage: Invalid measurements', arguments);
14728
+        throw new Error('Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage');
14729
+      }
14730
+
14731
+      var canvas = document.createElement('canvas');
14732
+      canvas.width = w;
14733
+      canvas.height = h;
14734
+      var ctx = canvas.getContext('2d');
14735
+      ctx.fillStyle = '#fff'; /// set white fill style
14736
+
14737
+      ctx.fillRect(0, 0, canvas.width, canvas.height); //load a svg snippet in the canvas with id = 'drawingArea'
14738
+
14739
+      canvg(canvas, svg, {
14740
+        ignoreMouse: true,
14741
+        ignoreAnimation: true,
14742
+        ignoreDimensions: true,
14743
+        ignoreClear: true
14744
+      });
14745
+      this.addImage(canvas.toDataURL("image/jpeg", 1.0), x, y, w, h, compression, rotation);
14746
+      return this;
14747
+    };
14748
+  })(jsPDF.API);
14749
+
14750
+  /** 
14751
+   * @license
14752
+   * ==================================================================== 
14753
+   * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
14754
+   * 
14755
+   * 
14756
+   * ====================================================================
14757
+   */
14758
+
14759
+  /**
14760
+   * jsPDF total_pages plugin
14761
+   * @name total_pages
14762
+   * @module
14763
+   */
14764
+  (function (jsPDFAPI) {
14765
+    /**
14766
+    * @name putTotalPages
14767
+    * @function
14768
+    * @param {string} pageExpression Regular Expression
14769
+    * @returns {jsPDF} jsPDF-instance
14770
+    */
14771
+
14772
+    jsPDFAPI.putTotalPages = function (pageExpression) {
14773
+
14774
+      var replaceExpression;
14775
+      var totalNumberOfPages = 0;
14776
+
14777
+      if (parseInt(this.internal.getFont().id.substr(1), 10) < 15) {
14778
+        replaceExpression = new RegExp(pageExpression, 'g');
14779
+        totalNumberOfPages = this.internal.getNumberOfPages();
14780
+      } else {
14781
+        replaceExpression = new RegExp(this.pdfEscape16(pageExpression, this.internal.getFont()), 'g');
14782
+        totalNumberOfPages = this.pdfEscape16(this.internal.getNumberOfPages() + '', this.internal.getFont());
14783
+      }
14784
+
14785
+      for (var n = 1; n <= this.internal.getNumberOfPages(); n++) {
14786
+        for (var i = 0; i < this.internal.pages[n].length; i++) {
14787
+          this.internal.pages[n][i] = this.internal.pages[n][i].replace(replaceExpression, totalNumberOfPages);
14788
+        }
14789
+      }
14790
+
14791
+      return this;
14792
+    };
14793
+  })(jsPDF.API);
14794
+
14795
+  /**
14796
+   * jsPDF viewerPreferences Plugin
14797
+   * @author Aras Abbasi (github.com/arasabbasi)
14798
+   * Licensed under the MIT License.
14799
+   * http://opensource.org/licenses/mit-license
14800
+   */
14801
+
14802
+  /**
14803
+  * Adds the ability to set ViewerPreferences and by thus
14804
+  * controlling the way the document is to be presented on the
14805
+  * screen or in print.
14806
+  * @name viewerpreferences
14807
+  * @module
14808
+  */
14809
+  (function (jsPDFAPI) {
14810
+    /**
14811
+     * Set the ViewerPreferences of the generated PDF
14812
+     *
14813
+     * @name viewerPreferences
14814
+    * @function
14815
+    * @public
14816
+     * @param {Object} options Array with the ViewerPreferences<br />
14817
+     * Example: doc.viewerPreferences({"FitWindow":true});<br />
14818
+     * <br />
14819
+     * You can set following preferences:<br />
14820
+     * <br/>
14821
+     * <b>HideToolbar</b> <i>(boolean)</i><br />
14822
+     * Default value: false<br />
14823
+     * <br />
14824
+     * <b>HideMenubar</b> <i>(boolean)</i><br />
14825
+     * Default value: false.<br />
14826
+     * <br />
14827
+     * <b>HideWindowUI</b> <i>(boolean)</i><br />
14828
+     * Default value: false.<br />
14829
+     * <br />
14830
+     * <b>FitWindow</b> <i>(boolean)</i><br />
14831
+     * Default value: false.<br />
14832
+     * <br />
14833
+     * <b>CenterWindow</b> <i>(boolean)</i><br />
14834
+     * Default value: false<br />
14835
+     * <br />
14836
+     * <b>DisplayDocTitle</b> <i>(boolean)</i><br />
14837
+     * Default value: false.<br />
14838
+     * <br />
14839
+     * <b>NonFullScreenPageMode</b> <i>(string)</i><br />
14840
+     * Possible values: UseNone, UseOutlines, UseThumbs, UseOC<br />
14841
+     * Default value: UseNone<br/>
14842
+     * <br />
14843
+     * <b>Direction</b> <i>(string)</i><br />
14844
+     * Possible values: L2R, R2L<br />
14845
+     * Default value: L2R.<br />
14846
+     * <br />
14847
+     * <b>ViewArea</b> <i>(string)</i><br />
14848
+     * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />
14849
+     * Default value: CropBox.<br />
14850
+     * <br />
14851
+     * <b>ViewClip</b> <i>(string)</i><br />
14852
+     * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />
14853
+     * Default value: CropBox<br />
14854
+     * <br />
14855
+     * <b>PrintArea</b> <i>(string)</i><br />
14856
+     * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />
14857
+     * Default value: CropBox<br />
14858
+     * <br />
14859
+     * <b>PrintClip</b> <i>(string)</i><br />
14860
+     * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />
14861
+     * Default value: CropBox.<br />
14862
+     * <br />
14863
+     * <b>PrintScaling</b> <i>(string)</i><br />
14864
+     * Possible values: AppDefault, None<br />
14865
+     * Default value: AppDefault.<br />
14866
+     * <br />
14867
+     * <b>Duplex</b> <i>(string)</i><br />
14868
+     * Possible values: Simplex, DuplexFlipLongEdge, DuplexFlipShortEdge
14869
+     * Default value: none<br />
14870
+     * <br />
14871
+     * <b>PickTrayByPDFSize</b> <i>(boolean)</i><br />
14872
+     * Default value: false<br />
14873
+     * <br />
14874
+     * <b>PrintPageRange</b> <i>(Array)</i><br />
14875
+     * Example: [[1,5], [7,9]]<br />
14876
+     * Default value: as defined by PDF viewer application<br />
14877
+     * <br />
14878
+     * <b>NumCopies</b> <i>(Number)</i><br />
14879
+     * Possible values: 1, 2, 3, 4, 5<br />
14880
+     * Default value: 1<br />
14881
+     * <br />
14882
+     * For more information see the PDF Reference, sixth edition on Page 577
14883
+     * @param {boolean} doReset True to reset the settings
14884
+     * @function
14885
+     * @returns jsPDF jsPDF-instance
14886
+     * @example
14887
+     * var doc = new jsPDF()
14888
+     * doc.text('This is a test', 10, 10)
14889
+     * doc.viewerPreferences({'FitWindow': true}, true)
14890
+     * doc.save("viewerPreferences.pdf")
14891
+     *
14892
+     * // Example printing 10 copies, using cropbox, and hiding UI.
14893
+     * doc.viewerPreferences({
14894
+     *   'HideWindowUI': true,
14895
+     *   'PrintArea': 'CropBox',
14896
+     *   'NumCopies': 10
14897
+     * })
14898
+     */
14899
+
14900
+    jsPDFAPI.viewerPreferences = function (options, doReset) {
14901
+      options = options || {};
14902
+      doReset = doReset || false;
14903
+      var configuration;
14904
+      var configurationTemplate = {
14905
+        "HideToolbar": {
14906
+          defaultValue: false,
14907
+          value: false,
14908
+          type: "boolean",
14909
+          explicitSet: false,
14910
+          valueSet: [true, false],
14911
+          pdfVersion: 1.3
14912
+        },
14913
+        "HideMenubar": {
14914
+          defaultValue: false,
14915
+          value: false,
14916
+          type: "boolean",
14917
+          explicitSet: false,
14918
+          valueSet: [true, false],
14919
+          pdfVersion: 1.3
14920
+        },
14921
+        "HideWindowUI": {
14922
+          defaultValue: false,
14923
+          value: false,
14924
+          type: "boolean",
14925
+          explicitSet: false,
14926
+          valueSet: [true, false],
14927
+          pdfVersion: 1.3
14928
+        },
14929
+        "FitWindow": {
14930
+          defaultValue: false,
14931
+          value: false,
14932
+          type: "boolean",
14933
+          explicitSet: false,
14934
+          valueSet: [true, false],
14935
+          pdfVersion: 1.3
14936
+        },
14937
+        "CenterWindow": {
14938
+          defaultValue: false,
14939
+          value: false,
14940
+          type: "boolean",
14941
+          explicitSet: false,
14942
+          valueSet: [true, false],
14943
+          pdfVersion: 1.3
14944
+        },
14945
+        "DisplayDocTitle": {
14946
+          defaultValue: false,
14947
+          value: false,
14948
+          type: "boolean",
14949
+          explicitSet: false,
14950
+          valueSet: [true, false],
14951
+          pdfVersion: 1.4
14952
+        },
14953
+        "NonFullScreenPageMode": {
14954
+          defaultValue: "UseNone",
14955
+          value: "UseNone",
14956
+          type: "name",
14957
+          explicitSet: false,
14958
+          valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"],
14959
+          pdfVersion: 1.3
14960
+        },
14961
+        "Direction": {
14962
+          defaultValue: "L2R",
14963
+          value: "L2R",
14964
+          type: "name",
14965
+          explicitSet: false,
14966
+          valueSet: ["L2R", "R2L"],
14967
+          pdfVersion: 1.3
14968
+        },
14969
+        "ViewArea": {
14970
+          defaultValue: "CropBox",
14971
+          value: "CropBox",
14972
+          type: "name",
14973
+          explicitSet: false,
14974
+          valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
14975
+          pdfVersion: 1.4
14976
+        },
14977
+        "ViewClip": {
14978
+          defaultValue: "CropBox",
14979
+          value: "CropBox",
14980
+          type: "name",
14981
+          explicitSet: false,
14982
+          valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
14983
+          pdfVersion: 1.4
14984
+        },
14985
+        "PrintArea": {
14986
+          defaultValue: "CropBox",
14987
+          value: "CropBox",
14988
+          type: "name",
14989
+          explicitSet: false,
14990
+          valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
14991
+          pdfVersion: 1.4
14992
+        },
14993
+        "PrintClip": {
14994
+          defaultValue: "CropBox",
14995
+          value: "CropBox",
14996
+          type: "name",
14997
+          explicitSet: false,
14998
+          valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
14999
+          pdfVersion: 1.4
15000
+        },
15001
+        "PrintScaling": {
15002
+          defaultValue: "AppDefault",
15003
+          value: "AppDefault",
15004
+          type: "name",
15005
+          explicitSet: false,
15006
+          valueSet: ["AppDefault", "None"],
15007
+          pdfVersion: 1.6
15008
+        },
15009
+        "Duplex": {
15010
+          defaultValue: "",
15011
+          value: "none",
15012
+          type: "name",
15013
+          explicitSet: false,
15014
+          valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"],
15015
+          pdfVersion: 1.7
15016
+        },
15017
+        "PickTrayByPDFSize": {
15018
+          defaultValue: false,
15019
+          value: false,
15020
+          type: "boolean",
15021
+          explicitSet: false,
15022
+          valueSet: [true, false],
15023
+          pdfVersion: 1.7
15024
+        },
15025
+        "PrintPageRange": {
15026
+          defaultValue: "",
15027
+          value: "",
15028
+          type: "array",
15029
+          explicitSet: false,
15030
+          valueSet: null,
15031
+          pdfVersion: 1.7
15032
+        },
15033
+        "NumCopies": {
15034
+          defaultValue: 1,
15035
+          value: 1,
15036
+          type: "integer",
15037
+          explicitSet: false,
15038
+          valueSet: null,
15039
+          pdfVersion: 1.7
15040
+        }
15041
+      };
15042
+      var configurationKeys = Object.keys(configurationTemplate);
15043
+      var rangeArray = [];
15044
+      var i = 0;
15045
+      var j = 0;
15046
+      var k = 0;
15047
+      var isValid = true;
15048
+      var method;
15049
+      var value;
15050
+
15051
+      function arrayContainsElement(array, element) {
15052
+        var iterator;
15053
+        var result = false;
15054
+
15055
+        for (iterator = 0; iterator < array.length; iterator += 1) {
15056
+          if (array[iterator] === element) {
15057
+            result = true;
15058
+          }
15059
+        }
15060
+
15061
+        return result;
15062
+      }
15063
+
15064
+      if (this.internal.viewerpreferences === undefined) {
15065
+        this.internal.viewerpreferences = {};
15066
+        this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(configurationTemplate));
15067
+        this.internal.viewerpreferences.isSubscribed = false;
15068
+      }
15069
+
15070
+      configuration = this.internal.viewerpreferences.configuration;
15071
+
15072
+      if (options === "reset" || doReset === true) {
15073
+        var len = configurationKeys.length;
15074
+
15075
+        for (k = 0; k < len; k += 1) {
15076
+          configuration[configurationKeys[k]].value = configuration[configurationKeys[k]].defaultValue;
15077
+          configuration[configurationKeys[k]].explicitSet = false;
15078
+        }
15079
+      }
15080
+
15081
+      if (_typeof(options) === "object") {
15082
+        for (method in options) {
15083
+          value = options[method];
15084
+
15085
+          if (arrayContainsElement(configurationKeys, method) && value !== undefined) {
15086
+            if (configuration[method].type === "boolean" && typeof value === "boolean") {
15087
+              configuration[method].value = value;
15088
+            } else if (configuration[method].type === "name" && arrayContainsElement(configuration[method].valueSet, value)) {
15089
+              configuration[method].value = value;
15090
+            } else if (configuration[method].type === "integer" && Number.isInteger(value)) {
15091
+              configuration[method].value = value;
15092
+            } else if (configuration[method].type === "array") {
15093
+              for (i = 0; i < value.length; i += 1) {
15094
+                isValid = true;
15095
+
15096
+                if (value[i].length === 1 && typeof value[i][0] === "number") {
15097
+                  rangeArray.push(String(value[i] - 1));
15098
+                } else if (value[i].length > 1) {
15099
+                  for (j = 0; j < value[i].length; j += 1) {
15100
+                    if (typeof value[i][j] !== "number") {
15101
+                      isValid = false;
15102
+                    }
15103
+                  }
15104
+
15105
+                  if (isValid === true) {
15106
+                    rangeArray.push([value[i][0] - 1, value[i][1] - 1].join(" "));
15107
+                  }
15108
+                }
15109
+              }
15110
+
15111
+              configuration[method].value = "[" + rangeArray.join(" ") + "]";
15112
+            } else {
15113
+              configuration[method].value = configuration[method].defaultValue;
15114
+            }
15115
+
15116
+            configuration[method].explicitSet = true;
15117
+          }
15118
+        }
15119
+      }
15120
+
15121
+      if (this.internal.viewerpreferences.isSubscribed === false) {
15122
+        this.internal.events.subscribe("putCatalog", function () {
15123
+          var pdfDict = [];
15124
+          var vPref;
15125
+
15126
+          for (vPref in configuration) {
15127
+            if (configuration[vPref].explicitSet === true) {
15128
+              if (configuration[vPref].type === "name") {
15129
+                pdfDict.push("/" + vPref + " /" + configuration[vPref].value);
15130
+              } else {
15131
+                pdfDict.push("/" + vPref + " " + configuration[vPref].value);
15132
+              }
15133
+            }
15134
+          }
15135
+
15136
+          if (pdfDict.length !== 0) {
15137
+            this.internal.write("/ViewerPreferences\n<<\n" + pdfDict.join("\n") + "\n>>");
15138
+          }
15139
+        });
15140
+        this.internal.viewerpreferences.isSubscribed = true;
15141
+      }
15142
+
15143
+      this.internal.viewerpreferences.configuration = configuration;
15144
+      return this;
15145
+    };
15146
+  })(jsPDF.API);
15147
+
15148
+  /** ==================================================================== 
15149
+   * jsPDF XMP metadata plugin
15150
+   * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
15151
+   * 
15152
+   * 
15153
+   * ====================================================================
15154
+   */
15155
+
15156
+  /*global jsPDF */
15157
+
15158
+  /**
15159
+  * @name xmp_metadata
15160
+  * @module
15161
+  */
15162
+  (function (jsPDFAPI) {
15163
+
15164
+    var xmpmetadata = "";
15165
+    var xmpnamespaceuri = "";
15166
+    var metadata_object_number = "";
15167
+    /**
15168
+    * Adds XMP formatted metadata to PDF
15169
+    *
15170
+    * @name addMetadata
15171
+    * @function
15172
+    * @param {String} metadata The actual metadata to be added. The metadata shall be stored as XMP simple value. Note that if the metadata string contains XML markup characters "<", ">" or "&", those characters should be written using XML entities.
15173
+    * @param {String} namespaceuri Sets the namespace URI for the metadata. Last character should be slash or hash.
15174
+    * @returns {jsPDF} jsPDF-instance
15175
+    */
15176
+
15177
+    jsPDFAPI.addMetadata = function (metadata, namespaceuri) {
15178
+      xmpnamespaceuri = namespaceuri || "http://jspdf.default.namespaceuri/"; //The namespace URI for an XMP name shall not be empty
15179
+
15180
+      xmpmetadata = metadata;
15181
+      this.internal.events.subscribe('postPutResources', function () {
15182
+        if (!xmpmetadata) {
15183
+          metadata_object_number = "";
15184
+        } else {
15185
+          var xmpmeta_beginning = '<x:xmpmeta xmlns:x="adobe:ns:meta/">';
15186
+          var rdf_beginning = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + xmpnamespaceuri + '"><jspdf:metadata>';
15187
+          var rdf_ending = '</jspdf:metadata></rdf:Description></rdf:RDF>';
15188
+          var xmpmeta_ending = '</x:xmpmeta>';
15189
+          var utf8_xmpmeta_beginning = unescape(encodeURIComponent(xmpmeta_beginning));
15190
+          var utf8_rdf_beginning = unescape(encodeURIComponent(rdf_beginning));
15191
+          var utf8_metadata = unescape(encodeURIComponent(xmpmetadata));
15192
+          var utf8_rdf_ending = unescape(encodeURIComponent(rdf_ending));
15193
+          var utf8_xmpmeta_ending = unescape(encodeURIComponent(xmpmeta_ending));
15194
+          var total_len = utf8_rdf_beginning.length + utf8_metadata.length + utf8_rdf_ending.length + utf8_xmpmeta_beginning.length + utf8_xmpmeta_ending.length;
15195
+          metadata_object_number = this.internal.newObject();
15196
+          this.internal.write('<< /Type /Metadata /Subtype /XML /Length ' + total_len + ' >>');
15197
+          this.internal.write('stream');
15198
+          this.internal.write(utf8_xmpmeta_beginning + utf8_rdf_beginning + utf8_metadata + utf8_rdf_ending + utf8_xmpmeta_ending);
15199
+          this.internal.write('endstream');
15200
+          this.internal.write('endobj');
15201
+        }
15202
+      });
15203
+      this.internal.events.subscribe('putCatalog', function () {
15204
+        if (metadata_object_number) {
15205
+          this.internal.write('/Metadata ' + metadata_object_number + ' 0 R');
15206
+        }
15207
+      });
15208
+      return this;
15209
+    };
15210
+  })(jsPDF.API);
15211
+
15212
+  /**
15213
+  * @name utf8
15214
+  * @module
15215
+  */
15216
+  (function (jsPDF, global) {
15217
+
15218
+    var jsPDFAPI = jsPDF.API;
15219
+    /**************************************************/
15220
+
15221
+    /* function : toHex                               */
15222
+
15223
+    /* comment : Replace str with a hex string.       */
15224
+
15225
+    /**************************************************/
15226
+
15227
+    function toHex(str) {
15228
+      var hex = '';
15229
+
15230
+      for (var i = 0; i < str.length; i++) {
15231
+        hex += '' + str.charCodeAt(i).toString(16);
15232
+      }
15233
+
15234
+      return hex;
15235
+    }
15236
+    /***************************************************************************************************/
15237
+
15238
+    /* function : pdfEscape16                                                                          */
15239
+
15240
+    /* comment : The character id of a 2-byte string is converted to a hexadecimal number by obtaining */
15241
+
15242
+    /*   the corresponding glyph id and width, and then adding padding to the string.                  */
15243
+
15244
+    /***************************************************************************************************/
15245
+
15246
+
15247
+    var pdfEscape16 = jsPDFAPI.pdfEscape16 = function (text, font) {
15248
+      var widths = font.metadata.Unicode.widths;
15249
+      var padz = ["", "0", "00", "000", "0000"];
15250
+      var ar = [""];
15251
+
15252
+      for (var i = 0, l = text.length, t; i < l; ++i) {
15253
+        t = font.metadata.characterToGlyph(text.charCodeAt(i));
15254
+        font.metadata.glyIdsUsed.push(t);
15255
+        font.metadata.toUnicode[t] = text.charCodeAt(i);
15256
+
15257
+        if (widths.indexOf(t) == -1) {
15258
+          widths.push(t);
15259
+          widths.push([parseInt(font.metadata.widthOfGlyph(t), 10)]);
15260
+        }
15261
+
15262
+        if (t == '0') {
15263
+          //Spaces are not allowed in cmap.
15264
+          return ar.join("");
15265
+        } else {
15266
+          t = t.toString(16);
15267
+          ar.push(padz[4 - t.length], t);
15268
+        }
15269
+      }
15270
+
15271
+      return ar.join("");
15272
+    };
15273
+
15274
+    var toUnicodeCmap = function toUnicodeCmap(map) {
15275
+      var code, codes, range, unicode, unicodeMap, _i, _len;
15276
+
15277
+      unicodeMap = '/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n  /Registry (Adobe)\n  /Ordering (UCS)\n  /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange';
15278
+      codes = Object.keys(map).sort(function (a, b) {
15279
+        return a - b;
15280
+      });
15281
+      range = [];
15282
+
15283
+      for (_i = 0, _len = codes.length; _i < _len; _i++) {
15284
+        code = codes[_i];
15285
+
15286
+        if (range.length >= 100) {
15287
+          unicodeMap += "\n" + range.length + " beginbfchar\n" + range.join('\n') + "\nendbfchar";
15288
+          range = [];
15289
+        }
15290
+
15291
+        unicode = ('0000' + map[code].toString(16)).slice(-4);
15292
+        code = ('0000' + (+code).toString(16)).slice(-4);
15293
+        range.push("<" + code + "><" + unicode + ">");
15294
+      }
15295
+
15296
+      if (range.length) {
15297
+        unicodeMap += "\n" + range.length + " beginbfchar\n" + range.join('\n') + "\nendbfchar\n";
15298
+      }
15299
+
15300
+      unicodeMap += 'endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend';
15301
+      return unicodeMap;
15302
+    };
15303
+
15304
+    var identityHFunction = function identityHFunction(font, out, newObject, putStream) {
15305
+      if (font.metadata instanceof jsPDF.API.TTFFont && font.encoding === 'Identity-H') {
15306
+        //Tag with Identity-H
15307
+        var widths = font.metadata.Unicode.widths;
15308
+        var data = font.metadata.subset.encode(font.metadata.glyIdsUsed, 1);
15309
+        var pdfOutput = data;
15310
+        var pdfOutput2 = "";
15311
+
15312
+        for (var i = 0; i < pdfOutput.length; i++) {
15313
+          pdfOutput2 += String.fromCharCode(pdfOutput[i]);
15314
+        }
15315
+
15316
+        var fontTable = newObject();
15317
+        putStream({
15318
+          data: pdfOutput2,
15319
+          addLength1: true
15320
+        });
15321
+        out('endobj');
15322
+        var cmap = newObject();
15323
+        var cmapData = toUnicodeCmap(font.metadata.toUnicode);
15324
+        putStream({
15325
+          data: cmapData,
15326
+          addLength1: true
15327
+        });
15328
+        out('endobj');
15329
+        var fontDescriptor = newObject();
15330
+        out('<<');
15331
+        out('/Type /FontDescriptor');
15332
+        out('/FontName /' + font.fontName);
15333
+        out('/FontFile2 ' + fontTable + ' 0 R');
15334
+        out('/FontBBox ' + jsPDF.API.PDFObject.convert(font.metadata.bbox));
15335
+        out('/Flags ' + font.metadata.flags);
15336
+        out('/StemV ' + font.metadata.stemV);
15337
+        out('/ItalicAngle ' + font.metadata.italicAngle);
15338
+        out('/Ascent ' + font.metadata.ascender);
15339
+        out('/Descent ' + font.metadata.decender);
15340
+        out('/CapHeight ' + font.metadata.capHeight);
15341
+        out('>>');
15342
+        out('endobj');
15343
+        var DescendantFont = newObject();
15344
+        out('<<');
15345
+        out('/Type /Font');
15346
+        out('/BaseFont /' + font.fontName);
15347
+        out('/FontDescriptor ' + fontDescriptor + ' 0 R');
15348
+        out('/W ' + jsPDF.API.PDFObject.convert(widths));
15349
+        out('/CIDToGIDMap /Identity');
15350
+        out('/DW 1000');
15351
+        out('/Subtype /CIDFontType2');
15352
+        out('/CIDSystemInfo');
15353
+        out('<<');
15354
+        out('/Supplement 0');
15355
+        out('/Registry (Adobe)');
15356
+        out('/Ordering (' + font.encoding + ')');
15357
+        out('>>');
15358
+        out('>>');
15359
+        out('endobj');
15360
+        font.objectNumber = newObject();
15361
+        out('<<');
15362
+        out('/Type /Font');
15363
+        out('/Subtype /Type0');
15364
+        out('/ToUnicode ' + cmap + ' 0 R');
15365
+        out('/BaseFont /' + font.fontName);
15366
+        out('/Encoding /' + font.encoding);
15367
+        out('/DescendantFonts [' + DescendantFont + ' 0 R]');
15368
+        out('>>');
15369
+        out('endobj');
15370
+        font.isAlreadyPutted = true;
15371
+      }
15372
+    };
15373
+
15374
+    jsPDFAPI.events.push(['putFont', function (args) {
15375
+      identityHFunction(args.font, args.out, args.newObject, args.putStream);
15376
+    }]);
15377
+
15378
+    var winAnsiEncodingFunction = function winAnsiEncodingFunction(font, out, newObject, putStream) {
15379
+      if (font.metadata instanceof jsPDF.API.TTFFont && font.encoding === 'WinAnsiEncoding') {
15380
+        //Tag with WinAnsi encoding
15381
+        var widths = font.metadata.Unicode.widths;
15382
+        var data = font.metadata.rawData;
15383
+        var pdfOutput = data;
15384
+        var pdfOutput2 = "";
15385
+
15386
+        for (var i = 0; i < pdfOutput.length; i++) {
15387
+          pdfOutput2 += String.fromCharCode(pdfOutput[i]);
15388
+        }
15389
+
15390
+        var fontTable = newObject();
15391
+        putStream({
15392
+          data: pdfOutput2,
15393
+          addLength1: true
15394
+        });
15395
+        out('endobj');
15396
+        var cmap = newObject();
15397
+        var cmapData = toUnicodeCmap(font.metadata.toUnicode);
15398
+        putStream({
15399
+          data: cmapData,
15400
+          addLength1: true
15401
+        });
15402
+        out('endobj');
15403
+        var fontDescriptor = newObject();
15404
+        out('<<');
15405
+        out('/Descent ' + font.metadata.decender);
15406
+        out('/CapHeight ' + font.metadata.capHeight);
15407
+        out('/StemV ' + font.metadata.stemV);
15408
+        out('/Type /FontDescriptor');
15409
+        out('/FontFile2 ' + fontTable + ' 0 R');
15410
+        out('/Flags 96');
15411
+        out('/FontBBox ' + jsPDF.API.PDFObject.convert(font.metadata.bbox));
15412
+        out('/FontName /' + font.fontName);
15413
+        out('/ItalicAngle ' + font.metadata.italicAngle);
15414
+        out('/Ascent ' + font.metadata.ascender);
15415
+        out('>>');
15416
+        out('endobj');
15417
+        font.objectNumber = newObject();
15418
+
15419
+        for (var i = 0; i < font.metadata.hmtx.widths.length; i++) {
15420
+          font.metadata.hmtx.widths[i] = parseInt(font.metadata.hmtx.widths[i] * (1000 / font.metadata.head.unitsPerEm)); //Change the width of Em units to Point units.
15421
+        }
15422
+
15423
+        out('<</Subtype/TrueType/Type/Font/ToUnicode ' + cmap + ' 0 R/BaseFont/' + font.fontName + '/FontDescriptor ' + fontDescriptor + ' 0 R' + '/Encoding/' + font.encoding + ' /FirstChar 29 /LastChar 255 /Widths ' + jsPDF.API.PDFObject.convert(font.metadata.hmtx.widths) + '>>');
15424
+        out('endobj');
15425
+        font.isAlreadyPutted = true;
15426
+      }
15427
+    };
15428
+
15429
+    jsPDFAPI.events.push(['putFont', function (args) {
15430
+      winAnsiEncodingFunction(args.font, args.out, args.newObject, args.putStream);
15431
+    }]);
15432
+
15433
+    var utf8TextFunction = function utf8TextFunction(args) {
15434
+      var text = args.text || '';
15435
+      var x = args.x;
15436
+      var y = args.y;
15437
+      var options = args.options || {};
15438
+      var mutex = args.mutex || {};
15439
+      var pdfEscape = mutex.pdfEscape;
15440
+      var activeFontKey = mutex.activeFontKey;
15441
+      var fonts = mutex.fonts;
15442
+      var key,
15443
+          fontSize = mutex.activeFontSize;
15444
+      var str = '',
15445
+          s = 0,
15446
+          cmapConfirm;
15447
+      var strText = '';
15448
+      var key = activeFontKey;
15449
+      var encoding = fonts[key].encoding;
15450
+
15451
+      if (fonts[key].encoding !== 'Identity-H') {
15452
+        return {
15453
+          text: text,
15454
+          x: x,
15455
+          y: y,
15456
+          options: options,
15457
+          mutex: mutex
15458
+        };
15459
+      }
15460
+      strText = text;
15461
+      key = activeFontKey;
15462
+
15463
+      if (Object.prototype.toString.call(text) === '[object Array]') {
15464
+        strText = text[0];
15465
+      }
15466
+
15467
+      for (s = 0; s < strText.length; s += 1) {
15468
+        if (fonts[key].metadata.hasOwnProperty('cmap')) {
15469
+          cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)];
15470
+          /*
15471
+          if (Object.prototype.toString.call(text) === '[object Array]') {
15472
+            var i = 0;
15473
+           // for (i = 0; i < text.length; i += 1) {
15474
+                if (Object.prototype.toString.call(text[s]) === '[object Array]') {
15475
+                    cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s][0].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id
15476
+                } else {
15477
+                    
15478
+                }
15479
+            //}
15480
+            
15481
+          } else {
15482
+            cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id
15483
+          }*/
15484
+        }
15485
+
15486
+        if (!cmapConfirm) {
15487
+          if (strText[s].charCodeAt(0) < 256 && fonts[key].metadata.hasOwnProperty('Unicode')) {
15488
+            str += strText[s];
15489
+          } else {
15490
+            str += '';
15491
+          }
15492
+        } else {
15493
+          str += strText[s];
15494
+        }
15495
+      }
15496
+
15497
+      var result = '';
15498
+
15499
+      if (parseInt(key.slice(1)) < 14 || encoding === 'WinAnsiEncoding') {
15500
+        //For the default 13 font
15501
+        result = toHex(pdfEscape(str, key));
15502
+      } else if (encoding === 'Identity-H') {
15503
+        result = pdfEscape16(str, fonts[key]);
15504
+      }
15505
+
15506
+      mutex.isHex = true;
15507
+      return {
15508
+        text: result,
15509
+        x: x,
15510
+        y: y,
15511
+        options: options,
15512
+        mutex: mutex
15513
+      };
15514
+    };
15515
+
15516
+    var utf8EscapeFunction = function utf8EscapeFunction(parms) {
15517
+      var text = parms.text || '',
15518
+          x = parms.x,
15519
+          y = parms.y,
15520
+          options = parms.options,
15521
+          mutex = parms.mutex;
15522
+      var lang = options.lang;
15523
+      var tmpText = [];
15524
+      var args = {
15525
+        text: text,
15526
+        x: x,
15527
+        y: y,
15528
+        options: options,
15529
+        mutex: mutex
15530
+      };
15531
+
15532
+      if (Object.prototype.toString.call(text) === '[object Array]') {
15533
+        var i = 0;
15534
+
15535
+        for (i = 0; i < text.length; i += 1) {
15536
+          if (Object.prototype.toString.call(text[i]) === '[object Array]') {
15537
+            if (text[i].length === 3) {
15538
+              tmpText.push([utf8TextFunction(Object.assign({}, args, {
15539
+                text: text[i][0]
15540
+              })).text, text[i][1], text[i][2]]);
15541
+            } else {
15542
+              tmpText.push(utf8TextFunction(Object.assign({}, args, {
15543
+                text: text[i]
15544
+              })).text);
15545
+            }
15546
+          } else {
15547
+            tmpText.push(utf8TextFunction(Object.assign({}, args, {
15548
+              text: text[i]
15549
+            })).text);
15550
+          }
15551
+        }
15552
+
15553
+        parms.text = tmpText;
15554
+      } else {
15555
+        parms.text = utf8TextFunction(Object.assign({}, args, {
15556
+          text: text
15557
+        })).text;
15558
+      }
15559
+    };
15560
+
15561
+    jsPDFAPI.events.push(['postProcessText', utf8EscapeFunction]);
15562
+  })(jsPDF, typeof self !== "undefined" && self || typeof global !== "undefined" && global || typeof window !== "undefined" && window || Function("return this")());
15563
+
15564
+  /**
15565
+   * jsPDF virtual FileSystem functionality
15566
+   *
15567
+   * Licensed under the MIT License.
15568
+   * http://opensource.org/licenses/mit-license
15569
+   */
15570
+
15571
+  /**
15572
+  * Use the vFS to handle files
15573
+  * 
15574
+  * @name vFS
15575
+  * @module
15576
+  */
15577
+  (function (jsPDFAPI) {
15578
+
15579
+    var _initializeVFS = function _initializeVFS(instance) {
15580
+      if (typeof instance === "undefined") {
15581
+        return false;
15582
+      }
15583
+
15584
+      if (typeof instance.vFS === "undefined") {
15585
+        instance.vFS = {};
15586
+      }
15587
+
15588
+      return true;
15589
+    };
15590
+    /** 
15591
+    * Check if the file exists in the vFS
15592
+    * 
15593
+    * @name existsFileInVFS
15594
+    * @function 
15595
+    * @param {string} Possible filename in the vFS.
15596
+    * @returns {boolean}
15597
+    * @example
15598
+    * doc.existsFileInVFS("someFile.txt");
15599
+    */
15600
+
15601
+
15602
+    jsPDFAPI.existsFileInVFS = function (filename) {
15603
+      if (_initializeVFS(this.internal)) {
15604
+        return typeof this.internal.vFS[filename] !== "undefined";
15605
+      }
15606
+
15607
+      return false;
15608
+    };
15609
+    /**
15610
+    * Add a file to the vFS
15611
+    *
15612
+    * @name addFileToVFS
15613
+    * @function 
15614
+    * @param {string} filename The name of the file which should be added.
15615
+    * @param {string} filecontent The content of the file.
15616
+    * @returns {jsPDF}
15617
+    * @example
15618
+    * doc.addFileToVFS("someFile.txt", "BADFACE1");
15619
+    */
15620
+
15621
+
15622
+    jsPDFAPI.addFileToVFS = function (filename, filecontent) {
15623
+      _initializeVFS(this.internal);
15624
+
15625
+      this.internal.vFS[filename] = filecontent;
15626
+      return this;
15627
+    };
15628
+    /** 
15629
+    * Get the file from the vFS
15630
+    * 
15631
+    * @name getFileFromVFS
15632
+    * @function 
15633
+    * @param {string} The name of the file which gets requested.
15634
+    * @returns {string} 
15635
+    * @example
15636
+    * doc.getFileFromVFS("someFile.txt");
15637
+    */
15638
+
15639
+
15640
+    jsPDFAPI.getFileFromVFS = function (filename) {
15641
+      _initializeVFS(this.internal);
15642
+
15643
+      if (typeof this.internal.vFS[filename] !== "undefined") {
15644
+        return this.internal.vFS[filename];
15645
+      }
15646
+
15647
+      return null;
15648
+    };
15649
+  })(jsPDF.API);
15650
+
15651
+  /**
15652
+   * jsPDF addHTML PlugIn
15653
+   * Copyright (c) 2014 Diego Casorran
15654
+   *
15655
+   * Licensed under the MIT License.
15656
+   * http://opensource.org/licenses/mit-license
15657
+   */
15658
+  (function (jsPDFAPI) {
15659
+    /**
15660
+     * Renders an HTML element to canvas object which added to the PDF
15661
+     *
15662
+     * This feature requires [html2canvas](https://github.com/niklasvh/html2canvas)
15663
+     * or [rasterizeHTML](https://github.com/cburgmer/rasterizeHTML.js)
15664
+     *
15665
+     * @returns {jsPDF}
15666
+     * @name addHTML
15667
+     * @param element {Mixed} HTML Element, or anything supported by html2canvas.
15668
+     * @param x {Number} starting X coordinate in jsPDF instance's declared units.
15669
+     * @param y {Number} starting Y coordinate in jsPDF instance's declared units.
15670
+     * @param options {Object} Additional options, check the code below.
15671
+     * @param callback {Function} to call when the rendering has finished.
15672
+     * NOTE: Every parameter is optional except 'element' and 'callback', in such
15673
+     *       case the image is positioned at 0x0 covering the whole PDF document
15674
+     *       size. Ie, to easily take screenshots of webpages saving them to PDF.
15675
+     * @deprecated This is being replace with a vector-supporting API. See
15676
+     * [this link](https://cdn.rawgit.com/MrRio/jsPDF/master/examples/html2pdf/showcase_supported_html.html)
15677
+     */
15678
+
15679
+    jsPDFAPI.addHTML = function (element, x, y, options, callback) {
15680
+
15681
+      if (typeof html2canvas === 'undefined' && typeof rasterizeHTML === 'undefined') throw new Error('You need either ' + 'https://github.com/niklasvh/html2canvas' + ' or https://github.com/cburgmer/rasterizeHTML.js');
15682
+
15683
+      if (typeof x !== 'number') {
15684
+        options = x;
15685
+        callback = y;
15686
+      }
15687
+
15688
+      if (typeof options === 'function') {
15689
+        callback = options;
15690
+        options = null;
15691
+      }
15692
+
15693
+      if (typeof callback !== 'function') {
15694
+        callback = function callback() {};
15695
+      }
15696
+
15697
+      var I = this.internal,
15698
+          K = I.scaleFactor,
15699
+          W = I.pageSize.getWidth(),
15700
+          H = I.pageSize.getHeight();
15701
+      options = options || {};
15702
+
15703
+      options.onrendered = function (obj) {
15704
+        x = parseInt(x) || 0;
15705
+        y = parseInt(y) || 0;
15706
+        var dim = options.dim || {};
15707
+        var margin = Object.assign({
15708
+          top: 0,
15709
+          right: 0,
15710
+          bottom: 0,
15711
+          left: 0,
15712
+          useFor: 'content'
15713
+        }, options.margin);
15714
+        var h = dim.h || Math.min(H, obj.height / K);
15715
+        var w = dim.w || Math.min(W, obj.width / K) - x;
15716
+        var format = options.format || 'JPEG';
15717
+        var imageCompression = options.imageCompression || 'SLOW';
15718
+        var notFittingHeight = obj.height > H - margin.top - margin.bottom;
15719
+
15720
+        if (notFittingHeight && options.pagesplit) {
15721
+          var cropArea = function cropArea(parmObj, parmX, parmY, parmWidth, parmHeight) {
15722
+            var canvas = document.createElement('canvas');
15723
+            canvas.height = parmHeight;
15724
+            canvas.width = parmWidth;
15725
+            var ctx = canvas.getContext('2d');
15726
+            ctx.mozImageSmoothingEnabled = false;
15727
+            ctx.webkitImageSmoothingEnabled = false;
15728
+            ctx.msImageSmoothingEnabled = false;
15729
+            ctx.imageSmoothingEnabled = false;
15730
+            ctx.fillStyle = options.backgroundColor || '#ffffff';
15731
+            ctx.fillRect(0, 0, parmWidth, parmHeight);
15732
+            ctx.drawImage(parmObj, parmX, parmY, parmWidth, parmHeight, 0, 0, parmWidth, parmHeight);
15733
+            return canvas;
15734
+          };
15735
+
15736
+          var crop = function () {
15737
+            var cy = 0;
15738
+            var cx = 0;
15739
+            var position = {};
15740
+            var isOverWide = false;
15741
+            var width;
15742
+            var height;
15743
+
15744
+            while (1) {
15745
+              cx = 0;
15746
+              position.top = cy !== 0 ? margin.top : y;
15747
+              position.left = cy !== 0 ? margin.left : x;
15748
+              isOverWide = (W - margin.left - margin.right) * K < obj.width;
15749
+
15750
+              if (margin.useFor === "content") {
15751
+                if (cy === 0) {
15752
+                  width = Math.min((W - margin.left) * K, obj.width);
15753
+                  height = Math.min((H - margin.top) * K, obj.height - cy);
15754
+                } else {
15755
+                  width = Math.min(W * K, obj.width);
15756
+                  height = Math.min(H * K, obj.height - cy);
15757
+                  position.top = 0;
15758
+                }
15759
+              } else {
15760
+                width = Math.min((W - margin.left - margin.right) * K, obj.width);
15761
+                height = Math.min((H - margin.bottom - margin.top) * K, obj.height - cy);
15762
+              }
15763
+
15764
+              if (isOverWide) {
15765
+                while (1) {
15766
+                  if (margin.useFor === "content") {
15767
+                    if (cx === 0) {
15768
+                      width = Math.min((W - margin.left) * K, obj.width);
15769
+                    } else {
15770
+                      width = Math.min(W * K, obj.width - cx);
15771
+                      position.left = 0;
15772
+                    }
15773
+                  }
15774
+
15775
+                  var canvas = cropArea(obj, cx, cy, width, height);
15776
+                  var args = [canvas, position.left, position.top, canvas.width / K, canvas.height / K, format, null, imageCompression];
15777
+                  this.addImage.apply(this, args);
15778
+                  cx += width;
15779
+
15780
+                  if (cx >= obj.width) {
15781
+                    break;
15782
+                  }
15783
+
15784
+                  this.addPage();
15785
+                }
15786
+              } else {
15787
+                var canvas = cropArea(obj, 0, cy, width, height);
15788
+                var args = [canvas, position.left, position.top, canvas.width / K, canvas.height / K, format, null, imageCompression];
15789
+                this.addImage.apply(this, args);
15790
+              }
15791
+
15792
+              cy += height;
15793
+
15794
+              if (cy >= obj.height) {
15795
+                break;
15796
+              }
15797
+
15798
+              this.addPage();
15799
+            }
15800
+
15801
+            callback(w, cy, null, args);
15802
+          }.bind(this);
15803
+
15804
+          if (obj.nodeName === 'CANVAS') {
15805
+            var img = new Image();
15806
+            img.onload = crop;
15807
+            img.src = obj.toDataURL("image/png");
15808
+            obj = img;
15809
+          } else {
15810
+            crop();
15811
+          }
15812
+        } else {
15813
+          var alias = Math.random().toString(35);
15814
+          var args = [obj, x, y, w, h, format, alias, imageCompression];
15815
+          this.addImage.apply(this, args);
15816
+          callback(w, h, alias, args);
15817
+        }
15818
+      }.bind(this);
15819
+
15820
+      if (typeof html2canvas !== 'undefined' && !options.rstz) {
15821
+        return html2canvas(element, options);
15822
+      }
15823
+
15824
+      if (typeof rasterizeHTML !== 'undefined') {
15825
+        var meth = 'drawDocument';
15826
+
15827
+        if (typeof element === 'string') {
15828
+          meth = /^http/.test(element) ? 'drawURL' : 'drawHTML';
15829
+        }
15830
+
15831
+        options.width = options.width || W * K;
15832
+        return rasterizeHTML[meth](element, void 0, options).then(function (r) {
15833
+          options.onrendered(r.image);
15834
+        }, function (e) {
15835
+          callback(null, e);
15836
+        });
15837
+      }
15838
+
15839
+      return null;
15840
+    };
15841
+  })(jsPDF.API);
15842
+
15843
+  /**
15844
+   * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
15845
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
15846
+   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
15847
+   *               2014 Diego Casorran, https://github.com/diegocr
15848
+   *               2014 Daniel Husar, https://github.com/danielhusar
15849
+   *               2014 Wolfgang Gassler, https://github.com/woolfg
15850
+   *               2014 Steven Spungin, https://github.com/flamenco
15851
+   *
15852
+   * @license
15853
+   * 
15854
+   * ====================================================================
15855
+   */
15856
+  (function (jsPDFAPI) {
15857
+    var clone, _DrillForContent, FontNameDB, FontStyleMap, TextAlignMap, FontWeightMap, FloatMap, ClearMap, GetCSS, PurgeWhiteSpace, Renderer, ResolveFont, ResolveUnitedNumber, UnitedNumberMap, elementHandledElsewhere, images, loadImgs, checkForFooter, process, tableToJson;
15858
+
15859
+    clone = function () {
15860
+      return function (obj) {
15861
+        Clone.prototype = obj;
15862
+        return new Clone();
15863
+      };
15864
+
15865
+      function Clone() {}
15866
+    }();
15867
+
15868
+    PurgeWhiteSpace = function PurgeWhiteSpace(array) {
15869
+      var fragment, i, l, lTrimmed, r, rTrimmed, trailingSpace;
15870
+      i = 0;
15871
+      l = array.length;
15872
+      fragment = void 0;
15873
+      lTrimmed = false;
15874
+      rTrimmed = false;
15875
+
15876
+      while (!lTrimmed && i !== l) {
15877
+        fragment = array[i] = array[i].trimLeft();
15878
+
15879
+        if (fragment) {
15880
+          lTrimmed = true;
15881
+        }
15882
+
15883
+        i++;
15884
+      }
15885
+
15886
+      i = l - 1;
15887
+
15888
+      while (l && !rTrimmed && i !== -1) {
15889
+        fragment = array[i] = array[i].trimRight();
15890
+
15891
+        if (fragment) {
15892
+          rTrimmed = true;
15893
+        }
15894
+
15895
+        i--;
15896
+      }
15897
+
15898
+      r = /\s+$/g;
15899
+      trailingSpace = true;
15900
+      i = 0;
15901
+
15902
+      while (i !== l) {
15903
+        // Leave the line breaks intact
15904
+        if (array[i] != "\u2028") {
15905
+          fragment = array[i].replace(/\s+/g, " ");
15906
+
15907
+          if (trailingSpace) {
15908
+            fragment = fragment.trimLeft();
15909
+          }
15910
+
15911
+          if (fragment) {
15912
+            trailingSpace = r.test(fragment);
15913
+          }
15914
+
15915
+          array[i] = fragment;
15916
+        }
15917
+
15918
+        i++;
15919
+      }
15920
+
15921
+      return array;
15922
+    };
15923
+
15924
+    Renderer = function Renderer(pdf, x, y, settings) {
15925
+      this.pdf = pdf;
15926
+      this.x = x;
15927
+      this.y = y;
15928
+      this.settings = settings; //list of functions which are called after each element-rendering process
15929
+
15930
+      this.watchFunctions = [];
15931
+      this.init();
15932
+      return this;
15933
+    };
15934
+
15935
+    ResolveFont = function ResolveFont(css_font_family_string) {
15936
+      var name, part, parts;
15937
+      name = void 0;
15938
+      parts = css_font_family_string.split(",");
15939
+      part = parts.shift();
15940
+
15941
+      while (!name && part) {
15942
+        name = FontNameDB[part.trim().toLowerCase()];
15943
+        part = parts.shift();
15944
+      }
15945
+
15946
+      return name;
15947
+    };
15948
+
15949
+    ResolveUnitedNumber = function ResolveUnitedNumber(css_line_height_string) {
15950
+      //IE8 issues
15951
+      css_line_height_string = css_line_height_string === "auto" ? "0px" : css_line_height_string;
15952
+
15953
+      if (css_line_height_string.indexOf("em") > -1 && !isNaN(Number(css_line_height_string.replace("em", "")))) {
15954
+        css_line_height_string = Number(css_line_height_string.replace("em", "")) * 18.719 + "px";
15955
+      }
15956
+
15957
+      if (css_line_height_string.indexOf("pt") > -1 && !isNaN(Number(css_line_height_string.replace("pt", "")))) {
15958
+        css_line_height_string = Number(css_line_height_string.replace("pt", "")) * 1.333 + "px";
15959
+      }
15960
+
15961
+      var normal, undef, value;
15962
+      undef = void 0;
15963
+      normal = 16.00;
15964
+      value = UnitedNumberMap[css_line_height_string];
15965
+
15966
+      if (value) {
15967
+        return value;
15968
+      }
15969
+
15970
+      value = {
15971
+        "xx-small": 9,
15972
+        "x-small": 11,
15973
+        small: 13,
15974
+        medium: 16,
15975
+        large: 19,
15976
+        "x-large": 23,
15977
+        "xx-large": 28,
15978
+        auto: 0
15979
+      }[css_line_height_string];
15980
+
15981
+      if (value !== undef) {
15982
+        return UnitedNumberMap[css_line_height_string] = value / normal;
15983
+      }
15984
+
15985
+      if (value = parseFloat(css_line_height_string)) {
15986
+        return UnitedNumberMap[css_line_height_string] = value / normal;
15987
+      }
15988
+
15989
+      value = css_line_height_string.match(/([\d\.]+)(px)/);
15990
+
15991
+      if (Array.isArray(value) && value.length === 3) {
15992
+        return UnitedNumberMap[css_line_height_string] = parseFloat(value[1]) / normal;
15993
+      }
15994
+
15995
+      return UnitedNumberMap[css_line_height_string] = 1;
15996
+    };
15997
+
15998
+    GetCSS = function GetCSS(element) {
15999
+      var css, tmp, computedCSSElement;
16000
+
16001
+      computedCSSElement = function (el) {
16002
+        var compCSS;
16003
+
16004
+        compCSS = function (el) {
16005
+          if (document.defaultView && document.defaultView.getComputedStyle) {
16006
+            return document.defaultView.getComputedStyle(el, null);
16007
+          } else if (el.currentStyle) {
16008
+            return el.currentStyle;
16009
+          } else {
16010
+            return el.style;
16011
+          }
16012
+        }(el);
16013
+
16014
+        return function (prop) {
16015
+          prop = prop.replace(/-\D/g, function (match) {
16016
+            return match.charAt(1).toUpperCase();
16017
+          });
16018
+          return compCSS[prop];
16019
+        };
16020
+      }(element);
16021
+
16022
+      css = {};
16023
+      tmp = void 0;
16024
+      css["font-family"] = ResolveFont(computedCSSElement("font-family")) || "times";
16025
+      css["font-style"] = FontStyleMap[computedCSSElement("font-style")] || "normal";
16026
+      css["text-align"] = TextAlignMap[computedCSSElement("text-align")] || "left";
16027
+      tmp = FontWeightMap[computedCSSElement("font-weight")] || "normal";
16028
+
16029
+      if (tmp === "bold") {
16030
+        if (css["font-style"] === "normal") {
16031
+          css["font-style"] = tmp;
16032
+        } else {
16033
+          css["font-style"] = tmp + css["font-style"];
16034
+        }
16035
+      }
16036
+
16037
+      css["font-size"] = ResolveUnitedNumber(computedCSSElement("font-size")) || 1;
16038
+      css["line-height"] = ResolveUnitedNumber(computedCSSElement("line-height")) || 1;
16039
+      css["display"] = computedCSSElement("display") === "inline" ? "inline" : "block";
16040
+      tmp = css["display"] === "block";
16041
+      css["margin-top"] = tmp && ResolveUnitedNumber(computedCSSElement("margin-top")) || 0;
16042
+      css["margin-bottom"] = tmp && ResolveUnitedNumber(computedCSSElement("margin-bottom")) || 0;
16043
+      css["padding-top"] = tmp && ResolveUnitedNumber(computedCSSElement("padding-top")) || 0;
16044
+      css["padding-bottom"] = tmp && ResolveUnitedNumber(computedCSSElement("padding-bottom")) || 0;
16045
+      css["margin-left"] = tmp && ResolveUnitedNumber(computedCSSElement("margin-left")) || 0;
16046
+      css["margin-right"] = tmp && ResolveUnitedNumber(computedCSSElement("margin-right")) || 0;
16047
+      css["padding-left"] = tmp && ResolveUnitedNumber(computedCSSElement("padding-left")) || 0;
16048
+      css["padding-right"] = tmp && ResolveUnitedNumber(computedCSSElement("padding-right")) || 0;
16049
+      css["page-break-before"] = computedCSSElement("page-break-before") || "auto"; //float and clearing of floats
16050
+
16051
+      css["float"] = FloatMap[computedCSSElement("cssFloat")] || "none";
16052
+      css["clear"] = ClearMap[computedCSSElement("clear")] || "none";
16053
+      css["color"] = computedCSSElement("color");
16054
+      return css;
16055
+    };
16056
+
16057
+    elementHandledElsewhere = function elementHandledElsewhere(element, renderer, elementHandlers) {
16058
+      var handlers, i, isHandledElsewhere, l, classNames;
16059
+      isHandledElsewhere = false;
16060
+      i = void 0;
16061
+      l = void 0;
16062
+      handlers = elementHandlers["#" + element.id];
16063
+
16064
+      if (handlers) {
16065
+        if (typeof handlers === "function") {
16066
+          isHandledElsewhere = handlers(element, renderer);
16067
+        } else {
16068
+          i = 0;
16069
+          l = handlers.length;
16070
+
16071
+          while (!isHandledElsewhere && i !== l) {
16072
+            isHandledElsewhere = handlers[i](element, renderer);
16073
+            i++;
16074
+          }
16075
+        }
16076
+      }
16077
+
16078
+      handlers = elementHandlers[element.nodeName];
16079
+
16080
+      if (!isHandledElsewhere && handlers) {
16081
+        if (typeof handlers === "function") {
16082
+          isHandledElsewhere = handlers(element, renderer);
16083
+        } else {
16084
+          i = 0;
16085
+          l = handlers.length;
16086
+
16087
+          while (!isHandledElsewhere && i !== l) {
16088
+            isHandledElsewhere = handlers[i](element, renderer);
16089
+            i++;
16090
+          }
16091
+        }
16092
+      } // Try class names
16093
+
16094
+
16095
+      classNames = typeof element.className === 'string' ? element.className.split(' ') : [];
16096
+
16097
+      for (i = 0; i < classNames.length; i++) {
16098
+        handlers = elementHandlers['.' + classNames[i]];
16099
+
16100
+        if (!isHandledElsewhere && handlers) {
16101
+          if (typeof handlers === "function") {
16102
+            isHandledElsewhere = handlers(element, renderer);
16103
+          } else {
16104
+            i = 0;
16105
+            l = handlers.length;
16106
+
16107
+            while (!isHandledElsewhere && i !== l) {
16108
+              isHandledElsewhere = handlers[i](element, renderer);
16109
+              i++;
16110
+            }
16111
+          }
16112
+        }
16113
+      }
16114
+
16115
+      return isHandledElsewhere;
16116
+    };
16117
+
16118
+    tableToJson = function tableToJson(table, renderer) {
16119
+      var data, headers, i, j, rowData, tableRow, table_obj, table_with, cell, l;
16120
+      data = [];
16121
+      headers = [];
16122
+      i = 0;
16123
+      l = table.rows[0].cells.length;
16124
+      table_with = table.clientWidth;
16125
+
16126
+      while (i < l) {
16127
+        cell = table.rows[0].cells[i];
16128
+        headers[i] = {
16129
+          name: cell.textContent.toLowerCase().replace(/\s+/g, ''),
16130
+          prompt: cell.textContent.replace(/\r?\n/g, ''),
16131
+          width: cell.clientWidth / table_with * renderer.pdf.internal.pageSize.getWidth()
16132
+        };
16133
+        i++;
16134
+      }
16135
+
16136
+      i = 1;
16137
+
16138
+      while (i < table.rows.length) {
16139
+        tableRow = table.rows[i];
16140
+        rowData = {};
16141
+        j = 0;
16142
+
16143
+        while (j < tableRow.cells.length) {
16144
+          rowData[headers[j].name] = tableRow.cells[j].textContent.replace(/\r?\n/g, '');
16145
+          j++;
16146
+        }
16147
+
16148
+        data.push(rowData);
16149
+        i++;
16150
+      }
16151
+
16152
+      return table_obj = {
16153
+        rows: data,
16154
+        headers: headers
16155
+      };
16156
+    };
16157
+
16158
+    var SkipNode = {
16159
+      SCRIPT: 1,
16160
+      STYLE: 1,
16161
+      NOSCRIPT: 1,
16162
+      OBJECT: 1,
16163
+      EMBED: 1,
16164
+      SELECT: 1
16165
+    };
16166
+    var listCount = 1;
16167
+
16168
+    _DrillForContent = function DrillForContent(element, renderer, elementHandlers) {
16169
+      var cn, cns, fragmentCSS, i, isBlock, l, table2json, cb;
16170
+      cns = element.childNodes;
16171
+      cn = void 0;
16172
+      fragmentCSS = GetCSS(element);
16173
+      isBlock = fragmentCSS.display === "block";
16174
+
16175
+      if (isBlock) {
16176
+        renderer.setBlockBoundary();
16177
+        renderer.setBlockStyle(fragmentCSS);
16178
+      }
16179
+      i = 0;
16180
+      l = cns.length;
16181
+
16182
+      while (i < l) {
16183
+        cn = cns[i];
16184
+
16185
+        if (_typeof(cn) === "object") {
16186
+          //execute all watcher functions to e.g. reset floating
16187
+          renderer.executeWatchFunctions(cn);
16188
+          /*** HEADER rendering **/
16189
+
16190
+          if (cn.nodeType === 1 && cn.nodeName === 'HEADER') {
16191
+            var header = cn; //store old top margin
16192
+
16193
+            var oldMarginTop = renderer.pdf.margins_doc.top; //subscribe for new page event and render header first on every page
16194
+
16195
+            renderer.pdf.internal.events.subscribe('addPage', function (pageInfo) {
16196
+              //set current y position to old margin
16197
+              renderer.y = oldMarginTop; //render all child nodes of the header element
16198
+
16199
+              _DrillForContent(header, renderer, elementHandlers); //set margin to old margin + rendered header + 10 space to prevent overlapping
16200
+              //important for other plugins (e.g. table) to start rendering at correct position after header
16201
+
16202
+
16203
+              renderer.pdf.margins_doc.top = renderer.y + 10;
16204
+              renderer.y += 10;
16205
+            }, false);
16206
+          }
16207
+
16208
+          if (cn.nodeType === 8 && cn.nodeName === "#comment") {
16209
+            if (~cn.textContent.indexOf("ADD_PAGE")) {
16210
+              renderer.pdf.addPage();
16211
+              renderer.y = renderer.pdf.margins_doc.top;
16212
+            }
16213
+          } else if (cn.nodeType === 1 && !SkipNode[cn.nodeName]) {
16214
+            /*** IMAGE RENDERING ***/
16215
+            var cached_image;
16216
+
16217
+            if (cn.nodeName === "IMG") {
16218
+              var url = cn.getAttribute("src");
16219
+              cached_image = images[renderer.pdf.sHashCode(url) || url];
16220
+            }
16221
+
16222
+            if (cached_image) {
16223
+              if (renderer.pdf.internal.pageSize.getHeight() - renderer.pdf.margins_doc.bottom < renderer.y + cn.height && renderer.y > renderer.pdf.margins_doc.top) {
16224
+                renderer.pdf.addPage();
16225
+                renderer.y = renderer.pdf.margins_doc.top; //check if we have to set back some values due to e.g. header rendering for new page
16226
+
16227
+                renderer.executeWatchFunctions(cn);
16228
+              }
16229
+
16230
+              var imagesCSS = GetCSS(cn);
16231
+              var imageX = renderer.x;
16232
+              var fontToUnitRatio = 12 / renderer.pdf.internal.scaleFactor; //define additional paddings, margins which have to be taken into account for margin calculations
16233
+
16234
+              var additionalSpaceLeft = (imagesCSS["margin-left"] + imagesCSS["padding-left"]) * fontToUnitRatio;
16235
+              var additionalSpaceRight = (imagesCSS["margin-right"] + imagesCSS["padding-right"]) * fontToUnitRatio;
16236
+              var additionalSpaceTop = (imagesCSS["margin-top"] + imagesCSS["padding-top"]) * fontToUnitRatio;
16237
+              var additionalSpaceBottom = (imagesCSS["margin-bottom"] + imagesCSS["padding-bottom"]) * fontToUnitRatio; //if float is set to right, move the image to the right border
16238
+              //add space if margin is set
16239
+
16240
+              if (imagesCSS['float'] !== undefined && imagesCSS['float'] === 'right') {
16241
+                imageX += renderer.settings.width - cn.width - additionalSpaceRight;
16242
+              } else {
16243
+                imageX += additionalSpaceLeft;
16244
+              }
16245
+
16246
+              renderer.pdf.addImage(cached_image, imageX, renderer.y + additionalSpaceTop, cn.width, cn.height);
16247
+              cached_image = undefined; //if the float prop is specified we have to float the text around the image
16248
+
16249
+              if (imagesCSS['float'] === 'right' || imagesCSS['float'] === 'left') {
16250
+                //add functiont to set back coordinates after image rendering
16251
+                renderer.watchFunctions.push(function (diffX, thresholdY, diffWidth, el) {
16252
+                  //undo drawing box adaptions which were set by floating
16253
+                  if (renderer.y >= thresholdY) {
16254
+                    renderer.x += diffX;
16255
+                    renderer.settings.width += diffWidth;
16256
+                    return true;
16257
+                  } else if (el && el.nodeType === 1 && !SkipNode[el.nodeName] && renderer.x + el.width > renderer.pdf.margins_doc.left + renderer.pdf.margins_doc.width) {
16258
+                    renderer.x += diffX;
16259
+                    renderer.y = thresholdY;
16260
+                    renderer.settings.width += diffWidth;
16261
+                    return true;
16262
+                  } else {
16263
+                    return false;
16264
+                  }
16265
+                }.bind(this, imagesCSS['float'] === 'left' ? -cn.width - additionalSpaceLeft - additionalSpaceRight : 0, renderer.y + cn.height + additionalSpaceTop + additionalSpaceBottom, cn.width)); //reset floating by clear:both divs
16266
+                //just set cursorY after the floating element
16267
+
16268
+                renderer.watchFunctions.push(function (yPositionAfterFloating, pages, el) {
16269
+                  if (renderer.y < yPositionAfterFloating && pages === renderer.pdf.internal.getNumberOfPages()) {
16270
+                    if (el.nodeType === 1 && GetCSS(el).clear === 'both') {
16271
+                      renderer.y = yPositionAfterFloating;
16272
+                      return true;
16273
+                    } else {
16274
+                      return false;
16275
+                    }
16276
+                  } else {
16277
+                    return true;
16278
+                  }
16279
+                }.bind(this, renderer.y + cn.height, renderer.pdf.internal.getNumberOfPages())); //if floating is set we decrease the available width by the image width
16280
+
16281
+                renderer.settings.width -= cn.width + additionalSpaceLeft + additionalSpaceRight; //if left just add the image width to the X coordinate
16282
+
16283
+                if (imagesCSS['float'] === 'left') {
16284
+                  renderer.x += cn.width + additionalSpaceLeft + additionalSpaceRight;
16285
+                }
16286
+              } else {
16287
+                //if no floating is set, move the rendering cursor after the image height
16288
+                renderer.y += cn.height + additionalSpaceTop + additionalSpaceBottom;
16289
+              }
16290
+              /*** TABLE RENDERING ***/
16291
+
16292
+            } else if (cn.nodeName === "TABLE") {
16293
+              table2json = tableToJson(cn, renderer);
16294
+              renderer.y += 10;
16295
+              renderer.pdf.table(renderer.x, renderer.y, table2json.rows, table2json.headers, {
16296
+                autoSize: false,
16297
+                printHeaders: elementHandlers.printHeaders,
16298
+                margins: renderer.pdf.margins_doc,
16299
+                css: GetCSS(cn)
16300
+              });
16301
+              renderer.y = renderer.pdf.lastCellPos.y + renderer.pdf.lastCellPos.h + 20;
16302
+            } else if (cn.nodeName === "OL" || cn.nodeName === "UL") {
16303
+              listCount = 1;
16304
+
16305
+              if (!elementHandledElsewhere(cn, renderer, elementHandlers)) {
16306
+                _DrillForContent(cn, renderer, elementHandlers);
16307
+              }
16308
+
16309
+              renderer.y += 10;
16310
+            } else if (cn.nodeName === "LI") {
16311
+              var temp = renderer.x;
16312
+              renderer.x += 20 / renderer.pdf.internal.scaleFactor;
16313
+              renderer.y += 3;
16314
+
16315
+              if (!elementHandledElsewhere(cn, renderer, elementHandlers)) {
16316
+                _DrillForContent(cn, renderer, elementHandlers);
16317
+              }
16318
+
16319
+              renderer.x = temp;
16320
+            } else if (cn.nodeName === "BR") {
16321
+              renderer.y += fragmentCSS["font-size"] * renderer.pdf.internal.scaleFactor;
16322
+              renderer.addText("\u2028", clone(fragmentCSS));
16323
+            } else {
16324
+              if (!elementHandledElsewhere(cn, renderer, elementHandlers)) {
16325
+                _DrillForContent(cn, renderer, elementHandlers);
16326
+              }
16327
+            }
16328
+          } else if (cn.nodeType === 3) {
16329
+            var value = cn.nodeValue;
16330
+
16331
+            if (cn.nodeValue && cn.parentNode.nodeName === "LI") {
16332
+              if (cn.parentNode.parentNode.nodeName === "OL") {
16333
+                value = listCount++ + '. ' + value;
16334
+              } else {
16335
+                var fontSize = fragmentCSS["font-size"];
16336
+                var offsetX = (3 - fontSize * 0.75) * renderer.pdf.internal.scaleFactor;
16337
+                var offsetY = fontSize * 0.75 * renderer.pdf.internal.scaleFactor;
16338
+                var radius = fontSize * 1.74 / renderer.pdf.internal.scaleFactor;
16339
+
16340
+                cb = function cb(x, y) {
16341
+                  this.pdf.circle(x + offsetX, y + offsetY, radius, 'FD');
16342
+                };
16343
+              }
16344
+            } // Only add the text if the text node is in the body element
16345
+            // Add compatibility with IE11
16346
+
16347
+
16348
+            if (!!(cn.ownerDocument.body.compareDocumentPosition(cn) & 16)) {
16349
+              renderer.addText(value, fragmentCSS);
16350
+            }
16351
+          } else if (typeof cn === "string") {
16352
+            renderer.addText(cn, fragmentCSS);
16353
+          }
16354
+        }
16355
+
16356
+        i++;
16357
+      }
16358
+
16359
+      elementHandlers.outY = renderer.y;
16360
+
16361
+      if (isBlock) {
16362
+        return renderer.setBlockBoundary(cb);
16363
+      }
16364
+    };
16365
+
16366
+    images = {};
16367
+
16368
+    loadImgs = function loadImgs(element, renderer, elementHandlers, cb) {
16369
+      var imgs = element.getElementsByTagName('img'),
16370
+          l = imgs.length,
16371
+          found_images,
16372
+          x = 0;
16373
+
16374
+      function done() {
16375
+        renderer.pdf.internal.events.publish('imagesLoaded');
16376
+        cb(found_images);
16377
+      }
16378
+
16379
+      function loadImage(url, width, height) {
16380
+        if (!url) return;
16381
+        var img = new Image();
16382
+        found_images = ++x;
16383
+        img.crossOrigin = '';
16384
+
16385
+        img.onerror = img.onload = function () {
16386
+          if (img.complete) {
16387
+            //to support data urls in images, set width and height
16388
+            //as those values are not recognized automatically
16389
+            if (img.src.indexOf('data:image/') === 0) {
16390
+              img.width = width || img.width || 0;
16391
+              img.height = height || img.height || 0;
16392
+            } //if valid image add to known images array
16393
+
16394
+
16395
+            if (img.width + img.height) {
16396
+              var hash = renderer.pdf.sHashCode(url) || url;
16397
+              images[hash] = images[hash] || img;
16398
+            }
16399
+          }
16400
+
16401
+          if (! --x) {
16402
+            done();
16403
+          }
16404
+        };
16405
+
16406
+        img.src = url;
16407
+      }
16408
+
16409
+      while (l--) {
16410
+        loadImage(imgs[l].getAttribute("src"), imgs[l].width, imgs[l].height);
16411
+      }
16412
+
16413
+      return x || done();
16414
+    };
16415
+
16416
+    checkForFooter = function checkForFooter(elem, renderer, elementHandlers) {
16417
+      //check if we can found a <footer> element
16418
+      var footer = elem.getElementsByTagName("footer");
16419
+
16420
+      if (footer.length > 0) {
16421
+        footer = footer[0]; //bad hack to get height of footer
16422
+        //creat dummy out and check new y after fake rendering
16423
+
16424
+        var oldOut = renderer.pdf.internal.write;
16425
+        var oldY = renderer.y;
16426
+
16427
+        renderer.pdf.internal.write = function () {};
16428
+
16429
+        _DrillForContent(footer, renderer, elementHandlers);
16430
+
16431
+        var footerHeight = Math.ceil(renderer.y - oldY) + 5;
16432
+        renderer.y = oldY;
16433
+        renderer.pdf.internal.write = oldOut; //add 20% to prevent overlapping
16434
+
16435
+        renderer.pdf.margins_doc.bottom += footerHeight; //Create function render header on every page
16436
+
16437
+        var renderFooter = function renderFooter(pageInfo) {
16438
+          var pageNumber = pageInfo !== undefined ? pageInfo.pageNumber : 1; //set current y position to old margin
16439
+
16440
+          var oldPosition = renderer.y; //render all child nodes of the header element
16441
+
16442
+          renderer.y = renderer.pdf.internal.pageSize.getHeight() - renderer.pdf.margins_doc.bottom;
16443
+          renderer.pdf.margins_doc.bottom -= footerHeight; //check if we have to add page numbers
16444
+
16445
+          var spans = footer.getElementsByTagName('span');
16446
+
16447
+          for (var i = 0; i < spans.length; ++i) {
16448
+            //if we find some span element with class pageCounter, set the page
16449
+            if ((" " + spans[i].className + " ").replace(/[\n\t]/g, " ").indexOf(" pageCounter ") > -1) {
16450
+              spans[i].innerHTML = pageNumber;
16451
+            } //if we find some span element with class totalPages, set a variable which is replaced after rendering of all pages
16452
+
16453
+
16454
+            if ((" " + spans[i].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1) {
16455
+              spans[i].innerHTML = '###jsPDFVarTotalPages###';
16456
+            }
16457
+          } //render footer content
16458
+
16459
+
16460
+          _DrillForContent(footer, renderer, elementHandlers); //set bottom margin to previous height including the footer height
16461
+
16462
+
16463
+          renderer.pdf.margins_doc.bottom += footerHeight; //important for other plugins (e.g. table) to start rendering at correct position after header
16464
+
16465
+          renderer.y = oldPosition;
16466
+        }; //check if footer contains totalPages which should be replace at the disoposal of the document
16467
+
16468
+
16469
+        var spans = footer.getElementsByTagName('span');
16470
+
16471
+        for (var i = 0; i < spans.length; ++i) {
16472
+          if ((" " + spans[i].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1) {
16473
+            renderer.pdf.internal.events.subscribe('htmlRenderingFinished', renderer.pdf.putTotalPages.bind(renderer.pdf, '###jsPDFVarTotalPages###'), true);
16474
+          }
16475
+        } //register event to render footer on every new page
16476
+
16477
+
16478
+        renderer.pdf.internal.events.subscribe('addPage', renderFooter, false); //render footer on first page
16479
+
16480
+        renderFooter(); //prevent footer rendering
16481
+
16482
+        SkipNode['FOOTER'] = 1;
16483
+      }
16484
+    };
16485
+
16486
+    process = function process(pdf, element, x, y, settings, callback) {
16487
+      if (!element) return false;
16488
+      if (typeof element !== "string" && !element.parentNode) element = '' + element.innerHTML;
16489
+
16490
+      if (typeof element === "string") {
16491
+        element = function (element) {
16492
+          var $frame, $hiddendiv, framename, visuallyhidden;
16493
+          framename = "jsPDFhtmlText" + Date.now().toString() + (Math.random() * 1000).toFixed(0);
16494
+          visuallyhidden = "position: absolute !important;" + "clip: rect(1px 1px 1px 1px); /* IE6, IE7 */" + "clip: rect(1px, 1px, 1px, 1px);" + "padding:0 !important;" + "border:0 !important;" + "height: 1px !important;" + "width: 1px !important; " + "top:auto;" + "left:-100px;" + "overflow: hidden;";
16495
+          $hiddendiv = document.createElement('div');
16496
+          $hiddendiv.style.cssText = visuallyhidden;
16497
+          $hiddendiv.innerHTML = "<iframe style=\"height:1px;width:1px\" name=\"" + framename + "\" />";
16498
+          document.body.appendChild($hiddendiv);
16499
+          $frame = window.frames[framename];
16500
+          $frame.document.open();
16501
+          $frame.document.writeln(element);
16502
+          $frame.document.close();
16503
+          return $frame.document.body;
16504
+        }(element.replace(/<\/?script[^>]*?>/gi, ''));
16505
+      }
16506
+
16507
+      var r = new Renderer(pdf, x, y, settings),
16508
+          out; // 1. load images
16509
+      // 2. prepare optional footer elements
16510
+      // 3. render content
16511
+
16512
+      loadImgs.call(this, element, r, settings.elementHandlers, function (found_images) {
16513
+        checkForFooter(element, r, settings.elementHandlers);
16514
+
16515
+        _DrillForContent(element, r, settings.elementHandlers); //send event dispose for final taks (e.g. footer totalpage replacement)
16516
+
16517
+
16518
+        r.pdf.internal.events.publish('htmlRenderingFinished');
16519
+        out = r.dispose();
16520
+        if (typeof callback === 'function') callback(out);else if (found_images) console.error('jsPDF Warning: rendering issues? provide a callback to fromHTML!');
16521
+      });
16522
+      return out || {
16523
+        x: r.x,
16524
+        y: r.y
16525
+      };
16526
+    };
16527
+
16528
+    Renderer.prototype.init = function () {
16529
+      this.paragraph = {
16530
+        text: [],
16531
+        style: []
16532
+      };
16533
+      return this.pdf.internal.write("q");
16534
+    };
16535
+
16536
+    Renderer.prototype.dispose = function () {
16537
+      this.pdf.internal.write("Q");
16538
+      return {
16539
+        x: this.x,
16540
+        y: this.y,
16541
+        ready: true
16542
+      };
16543
+    }; //Checks if we have to execute some watcher functions
16544
+    //e.g. to end text floating around an image
16545
+
16546
+
16547
+    Renderer.prototype.executeWatchFunctions = function (el) {
16548
+      var ret = false;
16549
+      var narray = [];
16550
+
16551
+      if (this.watchFunctions.length > 0) {
16552
+        for (var i = 0; i < this.watchFunctions.length; ++i) {
16553
+          if (this.watchFunctions[i](el) === true) {
16554
+            ret = true;
16555
+          } else {
16556
+            narray.push(this.watchFunctions[i]);
16557
+          }
16558
+        }
16559
+
16560
+        this.watchFunctions = narray;
16561
+      }
16562
+
16563
+      return ret;
16564
+    };
16565
+
16566
+    Renderer.prototype.splitFragmentsIntoLines = function (fragments, styles) {
16567
+      var currentLineLength, defaultFontSize, ff, fontMetrics, fontMetricsCache, fragment, fragmentChopped, fragmentLength, fragmentSpecificMetrics, fs, k, line, lines, maxLineLength, style;
16568
+      defaultFontSize = 12;
16569
+      k = this.pdf.internal.scaleFactor;
16570
+      fontMetricsCache = {};
16571
+      ff = void 0;
16572
+      fs = void 0;
16573
+      fontMetrics = void 0;
16574
+      fragment = void 0;
16575
+      style = void 0;
16576
+      fragmentSpecificMetrics = void 0;
16577
+      fragmentLength = void 0;
16578
+      fragmentChopped = void 0;
16579
+      line = [];
16580
+      lines = [line];
16581
+      currentLineLength = 0;
16582
+      maxLineLength = this.settings.width;
16583
+
16584
+      while (fragments.length) {
16585
+        fragment = fragments.shift();
16586
+        style = styles.shift();
16587
+
16588
+        if (fragment) {
16589
+          ff = style["font-family"];
16590
+          fs = style["font-style"];
16591
+          fontMetrics = fontMetricsCache[ff + fs];
16592
+
16593
+          if (!fontMetrics) {
16594
+            fontMetrics = this.pdf.internal.getFont(ff, fs).metadata.Unicode;
16595
+            fontMetricsCache[ff + fs] = fontMetrics;
16596
+          }
16597
+
16598
+          fragmentSpecificMetrics = {
16599
+            widths: fontMetrics.widths,
16600
+            kerning: fontMetrics.kerning,
16601
+            fontSize: style["font-size"] * defaultFontSize,
16602
+            textIndent: currentLineLength
16603
+          };
16604
+          fragmentLength = this.pdf.getStringUnitWidth(fragment, fragmentSpecificMetrics) * fragmentSpecificMetrics.fontSize / k;
16605
+
16606
+          if (fragment == "\u2028") {
16607
+            line = [];
16608
+            lines.push(line);
16609
+          } else if (currentLineLength + fragmentLength > maxLineLength) {
16610
+            fragmentChopped = this.pdf.splitTextToSize(fragment, maxLineLength, fragmentSpecificMetrics);
16611
+            line.push([fragmentChopped.shift(), style]);
16612
+
16613
+            while (fragmentChopped.length) {
16614
+              line = [[fragmentChopped.shift(), style]];
16615
+              lines.push(line);
16616
+            }
16617
+
16618
+            currentLineLength = this.pdf.getStringUnitWidth(line[0][0], fragmentSpecificMetrics) * fragmentSpecificMetrics.fontSize / k;
16619
+          } else {
16620
+            line.push([fragment, style]);
16621
+            currentLineLength += fragmentLength;
16622
+          }
16623
+        }
16624
+      } //if text alignment was set, set margin/indent of each line
16625
+
16626
+
16627
+      if (style['text-align'] !== undefined && (style['text-align'] === 'center' || style['text-align'] === 'right' || style['text-align'] === 'justify')) {
16628
+        for (var i = 0; i < lines.length; ++i) {
16629
+          var length = this.pdf.getStringUnitWidth(lines[i][0][0], fragmentSpecificMetrics) * fragmentSpecificMetrics.fontSize / k; //if there is more than on line we have to clone the style object as all lines hold a reference on this object
16630
+
16631
+          if (i > 0) {
16632
+            lines[i][0][1] = clone(lines[i][0][1]);
16633
+          }
16634
+
16635
+          var space = maxLineLength - length;
16636
+
16637
+          if (style['text-align'] === 'right') {
16638
+            lines[i][0][1]['margin-left'] = space; //if alignment is not right, it has to be center so split the space to the left and the right
16639
+          } else if (style['text-align'] === 'center') {
16640
+            lines[i][0][1]['margin-left'] = space / 2; //if justify was set, calculate the word spacing and define in by using the css property
16641
+          } else if (style['text-align'] === 'justify') {
16642
+            var countSpaces = lines[i][0][0].split(' ').length - 1;
16643
+            lines[i][0][1]['word-spacing'] = space / countSpaces; //ignore the last line in justify mode
16644
+
16645
+            if (i === lines.length - 1) {
16646
+              lines[i][0][1]['word-spacing'] = 0;
16647
+            }
16648
+          }
16649
+        }
16650
+      }
16651
+
16652
+      return lines;
16653
+    };
16654
+
16655
+    Renderer.prototype.RenderTextFragment = function (text, style) {
16656
+      var defaultFontSize, font, maxLineHeight;
16657
+      maxLineHeight = 0;
16658
+      defaultFontSize = 12;
16659
+
16660
+      if (this.pdf.internal.pageSize.getHeight() - this.pdf.margins_doc.bottom < this.y + this.pdf.internal.getFontSize()) {
16661
+        this.pdf.internal.write("ET", "Q");
16662
+        this.pdf.addPage();
16663
+        this.y = this.pdf.margins_doc.top;
16664
+        this.pdf.internal.write("q", "BT", this.getPdfColor(style.color), this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td"); //move cursor by one line on new page
16665
+
16666
+        maxLineHeight = Math.max(maxLineHeight, style["line-height"], style["font-size"]);
16667
+        this.pdf.internal.write(0, (-1 * defaultFontSize * maxLineHeight).toFixed(2), "Td");
16668
+      }
16669
+
16670
+      font = this.pdf.internal.getFont(style["font-family"], style["font-style"]); // text color
16671
+
16672
+      var pdfTextColor = this.getPdfColor(style["color"]);
16673
+
16674
+      if (pdfTextColor !== this.lastTextColor) {
16675
+        this.pdf.internal.write(pdfTextColor);
16676
+        this.lastTextColor = pdfTextColor;
16677
+      } //set the word spacing for e.g. justify style
16678
+
16679
+
16680
+      if (style['word-spacing'] !== undefined && style['word-spacing'] > 0) {
16681
+        this.pdf.internal.write(style['word-spacing'].toFixed(2), "Tw");
16682
+      }
16683
+
16684
+      this.pdf.internal.write("/" + font.id, (defaultFontSize * style["font-size"]).toFixed(2), "Tf", "(" + this.pdf.internal.pdfEscape(text) + ") Tj"); //set the word spacing back to neutral => 0
16685
+
16686
+      if (style['word-spacing'] !== undefined) {
16687
+        this.pdf.internal.write(0, "Tw");
16688
+      }
16689
+    }; // Accepts #FFFFFF, rgb(int,int,int), or CSS Color Name
16690
+
16691
+
16692
+    Renderer.prototype.getPdfColor = function (style) {
16693
+      var textColor;
16694
+      var r, g, b;
16695
+      var rx = /rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/;
16696
+      var m = rx.exec(style);
16697
+
16698
+      if (m != null) {
16699
+        r = parseInt(m[1]);
16700
+        g = parseInt(m[2]);
16701
+        b = parseInt(m[3]);
16702
+      } else {
16703
+        if (typeof style === "string" && style.charAt(0) != '#') {
16704
+          var rgbColor = new RGBColor(style);
16705
+
16706
+          if (rgbColor.ok) {
16707
+            style = rgbColor.toHex();
16708
+          } else {
16709
+            style = '#000000';
16710
+          }
16711
+        }
16712
+
16713
+        r = style.substring(1, 3);
16714
+        r = parseInt(r, 16);
16715
+        g = style.substring(3, 5);
16716
+        g = parseInt(g, 16);
16717
+        b = style.substring(5, 7);
16718
+        b = parseInt(b, 16);
16719
+      }
16720
+
16721
+      if (typeof r === 'string' && /^#[0-9A-Fa-f]{6}$/.test(r)) {
16722
+        var hex = parseInt(r.substr(1), 16);
16723
+        r = hex >> 16 & 255;
16724
+        g = hex >> 8 & 255;
16725
+        b = hex & 255;
16726
+      }
16727
+
16728
+      var f3 = this.f3;
16729
+
16730
+      if (r === 0 && g === 0 && b === 0 || typeof g === 'undefined') {
16731
+        textColor = f3(r / 255) + ' g';
16732
+      } else {
16733
+        textColor = [f3(r / 255), f3(g / 255), f3(b / 255), 'rg'].join(' ');
16734
+      }
16735
+
16736
+      return textColor;
16737
+    };
16738
+
16739
+    Renderer.prototype.f3 = function (number) {
16740
+      return number.toFixed(3); // Ie, %.3f
16741
+    }, Renderer.prototype.renderParagraph = function (cb) {
16742
+      var blockstyle, defaultFontSize, fontToUnitRatio, fragments, i, l, line, lines, maxLineHeight, out, paragraphspacing_after, paragraphspacing_before, priorblockstyle, styles, fontSize;
16743
+      fragments = PurgeWhiteSpace(this.paragraph.text);
16744
+      styles = this.paragraph.style;
16745
+      blockstyle = this.paragraph.blockstyle;
16746
+      priorblockstyle = this.paragraph.priorblockstyle || {};
16747
+      this.paragraph = {
16748
+        text: [],
16749
+        style: [],
16750
+        blockstyle: {},
16751
+        priorblockstyle: blockstyle
16752
+      };
16753
+
16754
+      if (!fragments.join("").trim()) {
16755
+        return;
16756
+      }
16757
+
16758
+      lines = this.splitFragmentsIntoLines(fragments, styles);
16759
+      line = void 0;
16760
+      maxLineHeight = void 0;
16761
+      defaultFontSize = 12;
16762
+      fontToUnitRatio = defaultFontSize / this.pdf.internal.scaleFactor;
16763
+      this.priorMarginBottom = this.priorMarginBottom || 0;
16764
+      paragraphspacing_before = (Math.max((blockstyle["margin-top"] || 0) - this.priorMarginBottom, 0) + (blockstyle["padding-top"] || 0)) * fontToUnitRatio;
16765
+      paragraphspacing_after = ((blockstyle["margin-bottom"] || 0) + (blockstyle["padding-bottom"] || 0)) * fontToUnitRatio;
16766
+      this.priorMarginBottom = blockstyle["margin-bottom"] || 0;
16767
+
16768
+      if (blockstyle['page-break-before'] === 'always') {
16769
+        this.pdf.addPage();
16770
+        this.y = 0;
16771
+        paragraphspacing_before = ((blockstyle["margin-top"] || 0) + (blockstyle["padding-top"] || 0)) * fontToUnitRatio;
16772
+      }
16773
+
16774
+      out = this.pdf.internal.write;
16775
+      i = void 0;
16776
+      l = void 0;
16777
+      this.y += paragraphspacing_before;
16778
+      out("q", "BT 0 g", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td"); //stores the current indent of cursor position
16779
+
16780
+      var currentIndent = 0;
16781
+
16782
+      while (lines.length) {
16783
+        line = lines.shift();
16784
+        maxLineHeight = 0;
16785
+        i = 0;
16786
+        l = line.length;
16787
+
16788
+        while (i !== l) {
16789
+          if (line[i][0].trim()) {
16790
+            maxLineHeight = Math.max(maxLineHeight, line[i][1]["line-height"], line[i][1]["font-size"]);
16791
+            fontSize = line[i][1]["font-size"] * 7;
16792
+          }
16793
+
16794
+          i++;
16795
+        } //if we have to move the cursor to adapt the indent
16796
+
16797
+
16798
+        var indentMove = 0;
16799
+        var wantedIndent = 0; //if a margin was added (by e.g. a text-alignment), move the cursor
16800
+
16801
+        if (line[0][1]["margin-left"] !== undefined && line[0][1]["margin-left"] > 0) {
16802
+          wantedIndent = this.pdf.internal.getCoordinateString(line[0][1]["margin-left"]);
16803
+          indentMove = wantedIndent - currentIndent;
16804
+          currentIndent = wantedIndent;
16805
+        }
16806
+
16807
+        var indentMore = Math.max(blockstyle["margin-left"] || 0, 0) * fontToUnitRatio; //move the cursor
16808
+
16809
+        out(indentMove + indentMore, (-1 * defaultFontSize * maxLineHeight).toFixed(2), "Td");
16810
+        i = 0;
16811
+        l = line.length;
16812
+
16813
+        while (i !== l) {
16814
+          if (line[i][0]) {
16815
+            this.RenderTextFragment(line[i][0], line[i][1]);
16816
+          }
16817
+
16818
+          i++;
16819
+        }
16820
+
16821
+        this.y += maxLineHeight * fontToUnitRatio; //if some watcher function was executed successful, so e.g. margin and widths were changed,
16822
+        //reset line drawing and calculate position and lines again
16823
+        //e.g. to stop text floating around an image
16824
+
16825
+        if (this.executeWatchFunctions(line[0][1]) && lines.length > 0) {
16826
+          var localFragments = [];
16827
+          var localStyles = []; //create fragment array of
16828
+
16829
+          lines.forEach(function (localLine) {
16830
+            var i = 0;
16831
+            var l = localLine.length;
16832
+
16833
+            while (i !== l) {
16834
+              if (localLine[i][0]) {
16835
+                localFragments.push(localLine[i][0] + ' ');
16836
+                localStyles.push(localLine[i][1]);
16837
+              }
16838
+
16839
+              ++i;
16840
+            }
16841
+          }); //split lines again due to possible coordinate changes
16842
+
16843
+          lines = this.splitFragmentsIntoLines(PurgeWhiteSpace(localFragments), localStyles); //reposition the current cursor
16844
+
16845
+          out("ET", "Q");
16846
+          out("q", "BT 0 g", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td");
16847
+        }
16848
+      }
16849
+
16850
+      if (cb && typeof cb === "function") {
16851
+        cb.call(this, this.x - 9, this.y - fontSize / 2);
16852
+      }
16853
+
16854
+      out("ET", "Q");
16855
+      return this.y += paragraphspacing_after;
16856
+    };
16857
+
16858
+    Renderer.prototype.setBlockBoundary = function (cb) {
16859
+      return this.renderParagraph(cb);
16860
+    };
16861
+
16862
+    Renderer.prototype.setBlockStyle = function (css) {
16863
+      return this.paragraph.blockstyle = css;
16864
+    };
16865
+
16866
+    Renderer.prototype.addText = function (text, css) {
16867
+      this.paragraph.text.push(text);
16868
+      return this.paragraph.style.push(css);
16869
+    };
16870
+
16871
+    FontNameDB = {
16872
+      helvetica: "helvetica",
16873
+      "sans-serif": "helvetica",
16874
+      "times new roman": "times",
16875
+      serif: "times",
16876
+      times: "times",
16877
+      monospace: "courier",
16878
+      courier: "courier"
16879
+    };
16880
+    FontWeightMap = {
16881
+      100: "normal",
16882
+      200: "normal",
16883
+      300: "normal",
16884
+      400: "normal",
16885
+      500: "bold",
16886
+      600: "bold",
16887
+      700: "bold",
16888
+      800: "bold",
16889
+      900: "bold",
16890
+      normal: "normal",
16891
+      bold: "bold",
16892
+      bolder: "bold",
16893
+      lighter: "normal"
16894
+    };
16895
+    FontStyleMap = {
16896
+      normal: "normal",
16897
+      italic: "italic",
16898
+      oblique: "italic"
16899
+    };
16900
+    TextAlignMap = {
16901
+      left: "left",
16902
+      right: "right",
16903
+      center: "center",
16904
+      justify: "justify"
16905
+    };
16906
+    FloatMap = {
16907
+      none: 'none',
16908
+      right: 'right',
16909
+      left: 'left'
16910
+    };
16911
+    ClearMap = {
16912
+      none: 'none',
16913
+      both: 'both'
16914
+    };
16915
+    UnitedNumberMap = {
16916
+      normal: 1
16917
+    };
16918
+    /**
16919
+     * Converts HTML-formatted text into formatted PDF text.
16920
+     *
16921
+     * Notes:
16922
+     * 2012-07-18
16923
+     * Plugin relies on having browser, DOM around. The HTML is pushed into dom and traversed.
16924
+     * Plugin relies on jQuery for CSS extraction.
16925
+     * Targeting HTML output from Markdown templating, which is a very simple
16926
+     * markup - div, span, em, strong, p. No br-based paragraph separation supported explicitly (but still may work.)
16927
+     * Images, tables are NOT supported.
16928
+     *
16929
+     * @public
16930
+     * @function
16931
+     * @param HTML {String|Object} HTML-formatted text, or pointer to DOM element that is to be rendered into PDF.
16932
+     * @param x {Number} starting X coordinate in jsPDF instance's declared units.
16933
+     * @param y {Number} starting Y coordinate in jsPDF instance's declared units.
16934
+     * @param settings {Object} Additional / optional variables controlling parsing, rendering.
16935
+     * @returns {Object} jsPDF instance
16936
+     */
16937
+
16938
+    jsPDFAPI.fromHTML = function (HTML, x, y, settings, callback, margins) {
16939
+
16940
+      this.margins_doc = margins || {
16941
+        top: 0,
16942
+        bottom: 0
16943
+      };
16944
+      if (!settings) settings = {};
16945
+      if (!settings.elementHandlers) settings.elementHandlers = {};
16946
+      return process(this, HTML, isNaN(x) ? 4 : x, isNaN(y) ? 4 : y, settings, callback);
16947
+    };
16948
+  })(jsPDF.API);
16949
+
16950
+  /**
16951
+   * html2pdf.js
16952
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
16953
+   *
16954
+   * Licensed under the MIT License.
16955
+   * http://opensource.org/licenses/mit-license
16956
+   */
16957
+  (function (jsPDFAPI, globalObj) {
16958
+    globalObj.html2pdf = function (html, pdf, callback) {
16959
+      var canvas = pdf.canvas;
16960
+
16961
+      if (!canvas) {
16962
+        alert('jsPDF canvas plugin not installed');
16963
+        return;
16964
+      }
16965
+
16966
+      canvas.pdf = pdf;
16967
+      pdf.annotations = {
16968
+        _nameMap: [],
16969
+        createAnnotation: function createAnnotation(href, bounds) {
16970
+          var x = pdf.context2d._wrapX(bounds.left);
16971
+
16972
+          var y = pdf.context2d._wrapY(bounds.top);
16973
+
16974
+          var page = pdf.context2d._page(bounds.top);
16975
+
16976
+          var options;
16977
+          var index = href.indexOf('#');
16978
+
16979
+          if (index >= 0) {
16980
+            options = {
16981
+              name: href.substring(index + 1)
16982
+            };
16983
+          } else {
16984
+            options = {
16985
+              url: href
16986
+            };
16987
+          }
16988
+
16989
+          pdf.link(x, y, bounds.right - bounds.left, bounds.bottom - bounds.top, options);
16990
+        },
16991
+        setName: function setName(name, bounds) {
16992
+          var x = pdf.context2d._wrapX(bounds.left);
16993
+
16994
+          var y = pdf.context2d._wrapY(bounds.top);
16995
+
16996
+          var page = pdf.context2d._page(bounds.top);
16997
+
16998
+          this._nameMap[name] = {
16999
+            page: page,
17000
+            x: x,
17001
+            y: y
17002
+          };
17003
+        }
17004
+      };
17005
+      canvas.annotations = pdf.annotations;
17006
+
17007
+      pdf.context2d._pageBreakAt = function (y) {
17008
+        this.pageBreaks.push(y);
17009
+      };
17010
+
17011
+      pdf.context2d._gotoPage = function (pageOneBased) {
17012
+        while (pdf.internal.getNumberOfPages() < pageOneBased) {
17013
+          pdf.addPage();
17014
+        }
17015
+
17016
+        pdf.setPage(pageOneBased);
17017
+      };
17018
+
17019
+      var htmlElement;
17020
+      var height;
17021
+
17022
+      if (typeof html === 'string') {
17023
+        // remove all scripts
17024
+        html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
17025
+        var iframe = document.createElement('iframe'); //iframe.style.width = canvas.width;
17026
+        //iframe.src = "";
17027
+        //iframe.document.domain =
17028
+
17029
+        document.body.appendChild(iframe);
17030
+        var doc;
17031
+        var body;
17032
+        doc = iframe.contentDocument;
17033
+
17034
+        if (doc == undefined || doc == null) {
17035
+          doc = iframe.contentWindow.document;
17036
+        } //iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:500px');
17037
+
17038
+
17039
+        doc.open();
17040
+        doc.write(html);
17041
+        doc.close();
17042
+        htmlElement = doc.body;
17043
+        body = doc.body || {}, html = doc.documentElement || {};
17044
+        height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
17045
+      } else {
17046
+        htmlElement = html;
17047
+        body = html.body || {}, height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
17048
+      }
17049
+
17050
+      height = pdf.internal.pageSize.getHeight();
17051
+      var options = {
17052
+        async: true,
17053
+        allowTaint: true,
17054
+        backgroundColor: '#ffffff',
17055
+        canvas: canvas,
17056
+        imageTimeout: 15000,
17057
+        logging: true,
17058
+        proxy: null,
17059
+        removeContainer: true,
17060
+        foreignObjectRendering: false,
17061
+        useCORS: false,
17062
+        windowHeight: height,
17063
+        scrollY: height
17064
+      };
17065
+      pdf.context2d.pageWrapYEnabled = true;
17066
+      pdf.context2d.pageWrapY = pdf.internal.pageSize.getHeight();
17067
+      var promise = html2canvas(htmlElement, options).then(function (canvas) {
17068
+        if (callback) {
17069
+          if (iframe) {
17070
+            iframe.parentElement.removeChild(iframe);
17071
+          }
17072
+
17073
+          callback(pdf);
17074
+        }
17075
+      });
17076
+    };
17077
+  })(jsPDF.API, typeof window !== "undefined" && window || typeof global !== "undefined" && global);
17078
+  /*rollup-keeper-start*/
17079
+
17080
+
17081
+  window.tmp = html2pdf;
17082
+  /*rollup-keeper-end*/
17083
+
17084
+  /* Blob.js
17085
+   * A Blob, File, FileReader & URL implementation.
17086
+   * 2018-08-09
17087
+   *
17088
+   * By Eli Grey, http://eligrey.com
17089
+   * By Jimmy Wärting, https://github.com/jimmywarting
17090
+   * License: MIT
17091
+   *   See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
17092
+   */
17093
+
17094
+  (function (global) {
17095
+    var BlobBuilder = global.BlobBuilder || global.WebKitBlobBuilder || global.MSBlobBuilder || global.MozBlobBuilder;
17096
+
17097
+    global.URL = global.URL || global.webkitURL || function (href, a) {
17098
+      a = document.createElement('a');
17099
+      a.href = href;
17100
+      return a;
17101
+    };
17102
+
17103
+    var origBlob = global.Blob;
17104
+    var createObjectURL = URL.createObjectURL;
17105
+    var revokeObjectURL = URL.revokeObjectURL;
17106
+    var strTag = global.Symbol && global.Symbol.toStringTag;
17107
+    var blobSupported = false;
17108
+    var blobSupportsArrayBufferView = false;
17109
+    var arrayBufferSupported = !!global.ArrayBuffer;
17110
+    var blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob;
17111
+
17112
+    try {
17113
+      // Check if Blob constructor is supported
17114
+      blobSupported = new Blob(['ä']).size === 2; // Check if Blob constructor supports ArrayBufferViews
17115
+      // Fails in Safari 6, so we need to map to ArrayBuffers there.
17116
+
17117
+      blobSupportsArrayBufferView = new Blob([new Uint8Array([1, 2])]).size === 2;
17118
+    } catch (e) {}
17119
+    /**
17120
+     * Helper function that maps ArrayBufferViews to ArrayBuffers
17121
+     * Used by BlobBuilder constructor and old browsers that didn't
17122
+     * support it in the Blob constructor.
17123
+     */
17124
+
17125
+
17126
+    function mapArrayBufferViews(ary) {
17127
+      return ary.map(function (chunk) {
17128
+        if (chunk.buffer instanceof ArrayBuffer) {
17129
+          var buf = chunk.buffer; // if this is a subarray, make a copy so we only
17130
+          // include the subarray region from the underlying buffer
17131
+
17132
+          if (chunk.byteLength !== buf.byteLength) {
17133
+            var copy = new Uint8Array(chunk.byteLength);
17134
+            copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
17135
+            buf = copy.buffer;
17136
+          }
17137
+
17138
+          return buf;
17139
+        }
17140
+
17141
+        return chunk;
17142
+      });
17143
+    }
17144
+
17145
+    function BlobBuilderConstructor(ary, options) {
17146
+      options = options || {};
17147
+      var bb = new BlobBuilder();
17148
+      mapArrayBufferViews(ary).forEach(function (part) {
17149
+        bb.append(part);
17150
+      });
17151
+      return options.type ? bb.getBlob(options.type) : bb.getBlob();
17152
+    }
17153
+
17154
+    function BlobConstructor(ary, options) {
17155
+      return new origBlob(mapArrayBufferViews(ary), options || {});
17156
+    }
17157
+
17158
+    if (global.Blob) {
17159
+      BlobBuilderConstructor.prototype = Blob.prototype;
17160
+      BlobConstructor.prototype = Blob.prototype;
17161
+    }
17162
+
17163
+    function FakeBlobBuilder() {
17164
+      function toUTF8Array(str) {
17165
+        var utf8 = [];
17166
+
17167
+        for (var i = 0; i < str.length; i++) {
17168
+          var charcode = str.charCodeAt(i);
17169
+          if (charcode < 0x80) utf8.push(charcode);else if (charcode < 0x800) {
17170
+            utf8.push(0xc0 | charcode >> 6, 0x80 | charcode & 0x3f);
17171
+          } else if (charcode < 0xd800 || charcode >= 0xe000) {
17172
+            utf8.push(0xe0 | charcode >> 12, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f);
17173
+          } // surrogate pair
17174
+          else {
17175
+              i++; // UTF-16 encodes 0x10000-0x10FFFF by
17176
+              // subtracting 0x10000 and splitting the
17177
+              // 20 bits of 0x0-0xFFFFF into two halves
17178
+
17179
+              charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);
17180
+              utf8.push(0xf0 | charcode >> 18, 0x80 | charcode >> 12 & 0x3f, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f);
17181
+            }
17182
+        }
17183
+
17184
+        return utf8;
17185
+      }
17186
+
17187
+      function fromUtf8Array(array) {
17188
+        var out, i, len, c;
17189
+        var char2, char3;
17190
+        out = "";
17191
+        len = array.length;
17192
+        i = 0;
17193
+
17194
+        while (i < len) {
17195
+          c = array[i++];
17196
+
17197
+          switch (c >> 4) {
17198
+            case 0:
17199
+            case 1:
17200
+            case 2:
17201
+            case 3:
17202
+            case 4:
17203
+            case 5:
17204
+            case 6:
17205
+            case 7:
17206
+              // 0xxxxxxx
17207
+              out += String.fromCharCode(c);
17208
+              break;
17209
+
17210
+            case 12:
17211
+            case 13:
17212
+              // 110x xxxx   10xx xxxx
17213
+              char2 = array[i++];
17214
+              out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);
17215
+              break;
17216
+
17217
+            case 14:
17218
+              // 1110 xxxx  10xx xxxx  10xx xxxx
17219
+              char2 = array[i++];
17220
+              char3 = array[i++];
17221
+              out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);
17222
+              break;
17223
+          }
17224
+        }
17225
+
17226
+        return out;
17227
+      }
17228
+
17229
+      function isDataView(obj) {
17230
+        return obj && DataView.prototype.isPrototypeOf(obj);
17231
+      }
17232
+
17233
+      function bufferClone(buf) {
17234
+        var view = new Array(buf.byteLength);
17235
+        var array = new Uint8Array(buf);
17236
+        var i = view.length;
17237
+
17238
+        while (i--) {
17239
+          view[i] = array[i];
17240
+        }
17241
+
17242
+        return view;
17243
+      }
17244
+
17245
+      function encodeByteArray(input) {
17246
+        var byteToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
17247
+        var output = [];
17248
+
17249
+        for (var i = 0; i < input.length; i += 3) {
17250
+          var byte1 = input[i];
17251
+          var haveByte2 = i + 1 < input.length;
17252
+          var byte2 = haveByte2 ? input[i + 1] : 0;
17253
+          var haveByte3 = i + 2 < input.length;
17254
+          var byte3 = haveByte3 ? input[i + 2] : 0;
17255
+          var outByte1 = byte1 >> 2;
17256
+          var outByte2 = (byte1 & 0x03) << 4 | byte2 >> 4;
17257
+          var outByte3 = (byte2 & 0x0F) << 2 | byte3 >> 6;
17258
+          var outByte4 = byte3 & 0x3F;
17259
+
17260
+          if (!haveByte3) {
17261
+            outByte4 = 64;
17262
+
17263
+            if (!haveByte2) {
17264
+              outByte3 = 64;
17265
+            }
17266
+          }
17267
+
17268
+          output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);
17269
+        }
17270
+
17271
+        return output.join('');
17272
+      }
17273
+
17274
+      var create = Object.create || function (a) {
17275
+        function c() {}
17276
+
17277
+        c.prototype = a;
17278
+        return new c();
17279
+      };
17280
+
17281
+      if (arrayBufferSupported) {
17282
+        var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];
17283
+
17284
+        var isArrayBufferView = ArrayBuffer.isView || function (obj) {
17285
+          return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
17286
+        };
17287
+      }
17288
+      /********************************************************/
17289
+
17290
+      /*                   Blob constructor                   */
17291
+
17292
+      /********************************************************/
17293
+
17294
+
17295
+      function Blob(chunks, opts) {
17296
+        chunks = chunks || [];
17297
+
17298
+        for (var i = 0, len = chunks.length; i < len; i++) {
17299
+          var chunk = chunks[i];
17300
+
17301
+          if (chunk instanceof Blob) {
17302
+            chunks[i] = chunk._buffer;
17303
+          } else if (typeof chunk === 'string') {
17304
+            chunks[i] = toUTF8Array(chunk);
17305
+          } else if (arrayBufferSupported && (ArrayBuffer.prototype.isPrototypeOf(chunk) || isArrayBufferView(chunk))) {
17306
+            chunks[i] = bufferClone(chunk);
17307
+          } else if (arrayBufferSupported && isDataView(chunk)) {
17308
+            chunks[i] = bufferClone(chunk.buffer);
17309
+          } else {
17310
+            chunks[i] = toUTF8Array(String(chunk));
17311
+          }
17312
+        }
17313
+
17314
+        this._buffer = [].concat.apply([], chunks);
17315
+        this.size = this._buffer.length;
17316
+        this.type = opts ? opts.type || '' : '';
17317
+      }
17318
+
17319
+      Blob.prototype.slice = function (start, end, type) {
17320
+        var slice = this._buffer.slice(start || 0, end || this._buffer.length);
17321
+
17322
+        return new Blob([slice], {
17323
+          type: type
17324
+        });
17325
+      };
17326
+
17327
+      Blob.prototype.toString = function () {
17328
+        return '[object Blob]';
17329
+      };
17330
+      /********************************************************/
17331
+
17332
+      /*                   File constructor                   */
17333
+
17334
+      /********************************************************/
17335
+
17336
+
17337
+      function File(chunks, name, opts) {
17338
+        opts = opts || {};
17339
+        var a = Blob.call(this, chunks, opts) || this;
17340
+        a.name = name;
17341
+        a.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date();
17342
+        a.lastModified = +a.lastModifiedDate;
17343
+        return a;
17344
+      }
17345
+
17346
+      File.prototype = create(Blob.prototype);
17347
+      File.prototype.constructor = File;
17348
+      if (Object.setPrototypeOf) Object.setPrototypeOf(File, Blob);else {
17349
+        try {
17350
+          File.__proto__ = Blob;
17351
+        } catch (e) {}
17352
+      }
17353
+
17354
+      File.prototype.toString = function () {
17355
+        return '[object File]';
17356
+      };
17357
+      /********************************************************/
17358
+
17359
+      /*                FileReader constructor                */
17360
+
17361
+      /********************************************************/
17362
+
17363
+
17364
+      function FileReader() {
17365
+        if (!(this instanceof FileReader)) throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
17366
+        var delegate = document.createDocumentFragment();
17367
+        this.addEventListener = delegate.addEventListener;
17368
+
17369
+        this.dispatchEvent = function (evt) {
17370
+          var local = this['on' + evt.type];
17371
+          if (typeof local === 'function') local(evt);
17372
+          delegate.dispatchEvent(evt);
17373
+        };
17374
+
17375
+        this.removeEventListener = delegate.removeEventListener;
17376
+      }
17377
+
17378
+      function _read(fr, blob, kind) {
17379
+        if (!(blob instanceof Blob)) throw new TypeError("Failed to execute '" + kind + "' on 'FileReader': parameter 1 is not of type 'Blob'.");
17380
+        fr.result = '';
17381
+        setTimeout(function () {
17382
+          this.readyState = FileReader.LOADING;
17383
+          fr.dispatchEvent(new Event('load'));
17384
+          fr.dispatchEvent(new Event('loadend'));
17385
+        });
17386
+      }
17387
+
17388
+      FileReader.EMPTY = 0;
17389
+      FileReader.LOADING = 1;
17390
+      FileReader.DONE = 2;
17391
+      FileReader.prototype.error = null;
17392
+      FileReader.prototype.onabort = null;
17393
+      FileReader.prototype.onerror = null;
17394
+      FileReader.prototype.onload = null;
17395
+      FileReader.prototype.onloadend = null;
17396
+      FileReader.prototype.onloadstart = null;
17397
+      FileReader.prototype.onprogress = null;
17398
+
17399
+      FileReader.prototype.readAsDataURL = function (blob) {
17400
+        _read(this, blob, 'readAsDataURL');
17401
+
17402
+        this.result = 'data:' + blob.type + ';base64,' + encodeByteArray(blob._buffer);
17403
+      };
17404
+
17405
+      FileReader.prototype.readAsText = function (blob) {
17406
+        _read(this, blob, 'readAsText');
17407
+
17408
+        this.result = fromUtf8Array(blob._buffer);
17409
+      };
17410
+
17411
+      FileReader.prototype.readAsArrayBuffer = function (blob) {
17412
+        _read(this, blob, 'readAsText');
17413
+
17414
+        this.result = blob._buffer.slice();
17415
+      };
17416
+
17417
+      FileReader.prototype.abort = function () {};
17418
+      /********************************************************/
17419
+
17420
+      /*                         URL                          */
17421
+
17422
+      /********************************************************/
17423
+
17424
+
17425
+      URL.createObjectURL = function (blob) {
17426
+        return blob instanceof Blob ? 'data:' + blob.type + ';base64,' + encodeByteArray(blob._buffer) : createObjectURL.call(URL, blob);
17427
+      };
17428
+
17429
+      URL.revokeObjectURL = function (url) {
17430
+        revokeObjectURL && revokeObjectURL.call(URL, url);
17431
+      };
17432
+      /********************************************************/
17433
+
17434
+      /*                         XHR                          */
17435
+
17436
+      /********************************************************/
17437
+
17438
+
17439
+      var _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send;
17440
+
17441
+      if (_send) {
17442
+        XMLHttpRequest.prototype.send = function (data) {
17443
+          if (data instanceof Blob) {
17444
+            this.setRequestHeader('Content-Type', data.type);
17445
+
17446
+            _send.call(this, fromUtf8Array(data._buffer));
17447
+          } else {
17448
+            _send.call(this, data);
17449
+          }
17450
+        };
17451
+      }
17452
+
17453
+      global.FileReader = FileReader;
17454
+      global.File = File;
17455
+      global.Blob = Blob;
17456
+    }
17457
+
17458
+    if (strTag) {
17459
+      try {
17460
+        File.prototype[strTag] = 'File';
17461
+        Blob.prototype[strTag] = 'Blob';
17462
+        FileReader.prototype[strTag] = 'FileReader';
17463
+      } catch (e) {}
17464
+    }
17465
+
17466
+    function fixFileAndXHR() {
17467
+      var isIE = !!global.ActiveXObject || '-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style; // Monkey patched 
17468
+      // IE don't set Content-Type header on XHR whose body is a typed Blob
17469
+      // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6047383
17470
+
17471
+      var _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send;
17472
+
17473
+      if (isIE && _send) {
17474
+        XMLHttpRequest.prototype.send = function (data) {
17475
+          if (data instanceof Blob) {
17476
+            this.setRequestHeader('Content-Type', data.type);
17477
+
17478
+            _send.call(this, data);
17479
+          } else {
17480
+            _send.call(this, data);
17481
+          }
17482
+        };
17483
+      }
17484
+
17485
+      try {
17486
+        new File([], '');
17487
+      } catch (e) {
17488
+        try {
17489
+          var klass = new Function('class File extends Blob {' + 'constructor(chunks, name, opts) {' + 'opts = opts || {};' + 'super(chunks, opts || {});' + 'this.name = name;' + 'this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;' + 'this.lastModified = +this.lastModifiedDate;' + '}};' + 'return new File([], ""), File')();
17490
+          global.File = klass;
17491
+        } catch (e) {
17492
+          var klass = function klass(b, d, c) {
17493
+            var blob = new Blob(b, c);
17494
+            var t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date();
17495
+            blob.name = d;
17496
+            blob.lastModifiedDate = t;
17497
+            blob.lastModified = +t;
17498
+
17499
+            blob.toString = function () {
17500
+              return '[object File]';
17501
+            };
17502
+
17503
+            if (strTag) blob[strTag] = 'File';
17504
+            return blob;
17505
+          };
17506
+
17507
+          global.File = klass;
17508
+        }
17509
+      }
17510
+    }
17511
+
17512
+    if (blobSupported) {
17513
+      fixFileAndXHR();
17514
+      global.Blob = blobSupportsArrayBufferView ? global.Blob : BlobConstructor;
17515
+    } else if (blobBuilderSupported) {
17516
+      fixFileAndXHR();
17517
+      global.Blob = BlobBuilderConstructor;
17518
+    } else {
17519
+      FakeBlobBuilder();
17520
+    }
17521
+  })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')());
17522
+
17523
+  /* FileSaver.js
17524
+   * A saveAs() FileSaver implementation.
17525
+   * 1.3.8
17526
+   * 2018-03-22 14:03:47
17527
+   *
17528
+   * By Eli Grey, https://eligrey.com
17529
+   * License: MIT
17530
+   *   See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
17531
+   */
17532
+
17533
+  /*global self */
17534
+
17535
+  /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
17536
+
17537
+  /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/src/FileSaver.js */
17538
+  var saveAs = saveAs || function (view) {
17539
+
17540
+    if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
17541
+      return;
17542
+    }
17543
+
17544
+    var doc = view.document // only get URL when necessary in case Blob.js hasn't overridden it yet
17545
+    ,
17546
+        get_URL = function () {
17547
+      return view.URL || view.webkitURL || view;
17548
+    },
17549
+        save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a"),
17550
+        can_use_save_link = "download" in save_link,
17551
+        click = function (node) {
17552
+      var event = new MouseEvent("click");
17553
+      node.dispatchEvent(event);
17554
+    },
17555
+        is_safari = /constructor/i.test(view.HTMLElement) || view.safari,
17556
+        is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent),
17557
+        setImmediate = view.setImmediate || view.setTimeout,
17558
+        throw_outside = function (ex) {
17559
+      setImmediate(function () {
17560
+        throw ex;
17561
+      }, 0);
17562
+    },
17563
+        force_saveable_type = "application/octet-stream" // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
17564
+    ,
17565
+        arbitrary_revoke_timeout = 1000 * 40 // in ms
17566
+    ,
17567
+        revoke = function (file) {
17568
+      var revoker = function () {
17569
+        if (typeof file === "string") {
17570
+          // file is an object URL
17571
+          get_URL().revokeObjectURL(file);
17572
+        } else {
17573
+          // file is a File
17574
+          file.remove();
17575
+        }
17576
+      };
17577
+
17578
+      setTimeout(revoker, arbitrary_revoke_timeout);
17579
+    },
17580
+        dispatch = function (filesaver, event_types, event) {
17581
+      event_types = [].concat(event_types);
17582
+      var i = event_types.length;
17583
+
17584
+      while (i--) {
17585
+        var listener = filesaver["on" + event_types[i]];
17586
+
17587
+        if (typeof listener === "function") {
17588
+          try {
17589
+            listener.call(filesaver, event || filesaver);
17590
+          } catch (ex) {
17591
+            throw_outside(ex);
17592
+          }
17593
+        }
17594
+      }
17595
+    },
17596
+        auto_bom = function (blob) {
17597
+      // prepend BOM for UTF-8 XML and text/* types (including HTML)
17598
+      // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
17599
+      if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
17600
+        return new Blob([String.fromCharCode(0xFEFF), blob], {
17601
+          type: blob.type
17602
+        });
17603
+      }
17604
+
17605
+      return blob;
17606
+    },
17607
+        FileSaver = function (blob, name, no_auto_bom) {
17608
+      if (!no_auto_bom) {
17609
+        blob = auto_bom(blob);
17610
+      } // First try a.download, then web filesystem, then object URLs
17611
+
17612
+
17613
+      var filesaver = this,
17614
+          type = blob.type,
17615
+          force = type === force_saveable_type,
17616
+          object_url,
17617
+          dispatch_all = function () {
17618
+        dispatch(filesaver, "writestart progress write writeend".split(" "));
17619
+      } // on any filesys errors revert to saving with object URLs
17620
+      ,
17621
+          fs_error = function () {
17622
+        if ((is_chrome_ios || force && is_safari) && view.FileReader) {
17623
+          // Safari doesn't allow downloading of blob urls
17624
+          var reader = new FileReader();
17625
+
17626
+          reader.onloadend = function () {
17627
+            var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
17628
+            var popup = view.open(url, '_blank');
17629
+            if (!popup) view.location.href = url;
17630
+            url = undefined; // release reference before dispatching
17631
+
17632
+            filesaver.readyState = filesaver.DONE;
17633
+            dispatch_all();
17634
+          };
17635
+
17636
+          reader.readAsDataURL(blob);
17637
+          filesaver.readyState = filesaver.INIT;
17638
+          return;
17639
+        } // don't create more object URLs than needed
17640
+
17641
+
17642
+        if (!object_url) {
17643
+          object_url = get_URL().createObjectURL(blob);
17644
+        }
17645
+
17646
+        if (force) {
17647
+          view.location.href = object_url;
17648
+        } else {
17649
+          var opened = view.open(object_url, "_blank");
17650
+
17651
+          if (!opened) {
17652
+            // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
17653
+            view.location.href = object_url;
17654
+          }
17655
+        }
17656
+
17657
+        filesaver.readyState = filesaver.DONE;
17658
+        dispatch_all();
17659
+        revoke(object_url);
17660
+      };
17661
+
17662
+      filesaver.readyState = filesaver.INIT;
17663
+
17664
+      if (can_use_save_link) {
17665
+        object_url = get_URL().createObjectURL(blob);
17666
+        setImmediate(function () {
17667
+          save_link.href = object_url;
17668
+          save_link.download = name;
17669
+          click(save_link);
17670
+          dispatch_all();
17671
+          revoke(object_url);
17672
+          filesaver.readyState = filesaver.DONE;
17673
+        }, 0);
17674
+        return;
17675
+      }
17676
+
17677
+      fs_error();
17678
+    },
17679
+        FS_proto = FileSaver.prototype,
17680
+        saveAs = function (blob, name, no_auto_bom) {
17681
+      return new FileSaver(blob, name || blob.name || "download", no_auto_bom);
17682
+    }; // IE 10+ (native saveAs)
17683
+
17684
+
17685
+    if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
17686
+      return function (blob, name, no_auto_bom) {
17687
+        name = name || blob.name || "download";
17688
+
17689
+        if (!no_auto_bom) {
17690
+          blob = auto_bom(blob);
17691
+        }
17692
+
17693
+        return navigator.msSaveOrOpenBlob(blob, name);
17694
+      };
17695
+    } // todo: detect chrome extensions & packaged apps
17696
+    //save_link.target = "_blank";
17697
+
17698
+
17699
+    FS_proto.abort = function () {};
17700
+
17701
+    FS_proto.readyState = FS_proto.INIT = 0;
17702
+    FS_proto.WRITING = 1;
17703
+    FS_proto.DONE = 2;
17704
+    FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null;
17705
+    return saveAs;
17706
+  }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || undefined);
17707
+
17708
+  // (c) Dean McNamee <dean@gmail.com>, 2013.
17709
+  //
17710
+  // https://github.com/deanm/omggif
17711
+  //
17712
+  // 
17713
+  //
17714
+  // omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
17715
+  // including animation and compression.  It does not rely on any specific
17716
+  // underlying system, so should run in the browser, Node, or Plask.
17717
+  function GifWriter(buf, width, height, gopts) {
17718
+    var p = 0;
17719
+    var gopts = gopts === undefined ? {} : gopts;
17720
+    var loop_count = gopts.loop === undefined ? null : gopts.loop;
17721
+    var global_palette = gopts.palette === undefined ? null : gopts.palette;
17722
+    if (width <= 0 || height <= 0 || width > 65535 || height > 65535) throw "Width/Height invalid.";
17723
+
17724
+    function check_palette_and_num_colors(palette) {
17725
+      var num_colors = palette.length;
17726
+      if (num_colors < 2 || num_colors > 256 || num_colors & num_colors - 1) throw "Invalid code/color length, must be power of 2 and 2 .. 256.";
17727
+      return num_colors;
17728
+    } // - Header.
17729
+
17730
+
17731
+    buf[p++] = 0x47;
17732
+    buf[p++] = 0x49;
17733
+    buf[p++] = 0x46; // GIF
17734
+
17735
+    buf[p++] = 0x38;
17736
+    buf[p++] = 0x39;
17737
+    buf[p++] = 0x61; // 89a
17738
+    // Handling of Global Color Table (palette) and background index.
17739
+
17740
+    var gp_num_colors_pow2 = 0;
17741
+    var background = 0;
17742
+
17743
+    if (global_palette !== null) {
17744
+      var gp_num_colors = check_palette_and_num_colors(global_palette);
17745
+
17746
+      while (gp_num_colors >>= 1) ++gp_num_colors_pow2;
17747
+
17748
+      gp_num_colors = 1 << gp_num_colors_pow2;
17749
+      --gp_num_colors_pow2;
17750
+
17751
+      if (gopts.background !== undefined) {
17752
+        background = gopts.background;
17753
+        if (background >= gp_num_colors) throw "Background index out of range."; // The GIF spec states that a background index of 0 should be ignored, so
17754
+        // this is probably a mistake and you really want to set it to another
17755
+        // slot in the palette.  But actually in the end most browsers, etc end
17756
+        // up ignoring this almost completely (including for dispose background).
17757
+
17758
+        if (background === 0) throw "Background index explicitly passed as 0.";
17759
+      }
17760
+    } // - Logical Screen Descriptor.
17761
+    // NOTE(deanm): w/h apparently ignored by implementations, but set anyway.
17762
+
17763
+
17764
+    buf[p++] = width & 0xff;
17765
+    buf[p++] = width >> 8 & 0xff;
17766
+    buf[p++] = height & 0xff;
17767
+    buf[p++] = height >> 8 & 0xff; // NOTE: Indicates 0-bpp original color resolution (unused?).
17768
+
17769
+    buf[p++] = (global_palette !== null ? 0x80 : 0) | // Global Color Table Flag.
17770
+    gp_num_colors_pow2; // NOTE: No sort flag (unused?).
17771
+
17772
+    buf[p++] = background; // Background Color Index.
17773
+
17774
+    buf[p++] = 0; // Pixel aspect ratio (unused?).
17775
+    // - Global Color Table
17776
+
17777
+    if (global_palette !== null) {
17778
+      for (var i = 0, il = global_palette.length; i < il; ++i) {
17779
+        var rgb = global_palette[i];
17780
+        buf[p++] = rgb >> 16 & 0xff;
17781
+        buf[p++] = rgb >> 8 & 0xff;
17782
+        buf[p++] = rgb & 0xff;
17783
+      }
17784
+    }
17785
+
17786
+    if (loop_count !== null) {
17787
+      // Netscape block for looping.
17788
+      if (loop_count < 0 || loop_count > 65535) throw "Loop count invalid."; // Extension code, label, and length.
17789
+
17790
+      buf[p++] = 0x21;
17791
+      buf[p++] = 0xff;
17792
+      buf[p++] = 0x0b; // NETSCAPE2.0
17793
+
17794
+      buf[p++] = 0x4e;
17795
+      buf[p++] = 0x45;
17796
+      buf[p++] = 0x54;
17797
+      buf[p++] = 0x53;
17798
+      buf[p++] = 0x43;
17799
+      buf[p++] = 0x41;
17800
+      buf[p++] = 0x50;
17801
+      buf[p++] = 0x45;
17802
+      buf[p++] = 0x32;
17803
+      buf[p++] = 0x2e;
17804
+      buf[p++] = 0x30; // Sub-block
17805
+
17806
+      buf[p++] = 0x03;
17807
+      buf[p++] = 0x01;
17808
+      buf[p++] = loop_count & 0xff;
17809
+      buf[p++] = loop_count >> 8 & 0xff;
17810
+      buf[p++] = 0x00; // Terminator.
17811
+    }
17812
+
17813
+    var ended = false;
17814
+
17815
+    this.addFrame = function (x, y, w, h, indexed_pixels, opts) {
17816
+      if (ended === true) {
17817
+        --p;
17818
+        ended = false;
17819
+      } // Un-end.
17820
+
17821
+
17822
+      opts = opts === undefined ? {} : opts; // TODO(deanm): Bounds check x, y.  Do they need to be within the virtual
17823
+      // canvas width/height, I imagine?
17824
+
17825
+      if (x < 0 || y < 0 || x > 65535 || y > 65535) throw "x/y invalid.";
17826
+      if (w <= 0 || h <= 0 || w > 65535 || h > 65535) throw "Width/Height invalid.";
17827
+      if (indexed_pixels.length < w * h) throw "Not enough pixels for the frame size.";
17828
+      var using_local_palette = true;
17829
+      var palette = opts.palette;
17830
+
17831
+      if (palette === undefined || palette === null) {
17832
+        using_local_palette = false;
17833
+        palette = global_palette;
17834
+      }
17835
+
17836
+      if (palette === undefined || palette === null) throw "Must supply either a local or global palette.";
17837
+      var num_colors = check_palette_and_num_colors(palette); // Compute the min_code_size (power of 2), destroying num_colors.
17838
+
17839
+      var min_code_size = 0;
17840
+
17841
+      while (num_colors >>= 1) ++min_code_size;
17842
+
17843
+      num_colors = 1 << min_code_size; // Now we can easily get it back.
17844
+
17845
+      var delay = opts.delay === undefined ? 0 : opts.delay; // From the spec:
17846
+      //     0 -   No disposal specified. The decoder is
17847
+      //           not required to take any action.
17848
+      //     1 -   Do not dispose. The graphic is to be left
17849
+      //           in place.
17850
+      //     2 -   Restore to background color. The area used by the
17851
+      //           graphic must be restored to the background color.
17852
+      //     3 -   Restore to previous. The decoder is required to
17853
+      //           restore the area overwritten by the graphic with
17854
+      //           what was there prior to rendering the graphic.
17855
+      //  4-7 -    To be defined.
17856
+      // NOTE(deanm): Dispose background doesn't really work, apparently most
17857
+      // browsers ignore the background palette index and clear to transparency.
17858
+
17859
+      var disposal = opts.disposal === undefined ? 0 : opts.disposal;
17860
+      if (disposal < 0 || disposal > 3) // 4-7 is reserved.
17861
+        throw "Disposal out of range.";
17862
+      var use_transparency = false;
17863
+      var transparent_index = 0;
17864
+
17865
+      if (opts.transparent !== undefined && opts.transparent !== null) {
17866
+        use_transparency = true;
17867
+        transparent_index = opts.transparent;
17868
+        if (transparent_index < 0 || transparent_index >= num_colors) throw "Transparent color index.";
17869
+      }
17870
+
17871
+      if (disposal !== 0 || use_transparency || delay !== 0) {
17872
+        // - Graphics Control Extension
17873
+        buf[p++] = 0x21;
17874
+        buf[p++] = 0xf9; // Extension / Label.
17875
+
17876
+        buf[p++] = 4; // Byte size.
17877
+
17878
+        buf[p++] = disposal << 2 | (use_transparency === true ? 1 : 0);
17879
+        buf[p++] = delay & 0xff;
17880
+        buf[p++] = delay >> 8 & 0xff;
17881
+        buf[p++] = transparent_index; // Transparent color index.
17882
+
17883
+        buf[p++] = 0; // Block Terminator.
17884
+      } // - Image Descriptor
17885
+
17886
+
17887
+      buf[p++] = 0x2c; // Image Seperator.
17888
+
17889
+      buf[p++] = x & 0xff;
17890
+      buf[p++] = x >> 8 & 0xff; // Left.
17891
+
17892
+      buf[p++] = y & 0xff;
17893
+      buf[p++] = y >> 8 & 0xff; // Top.
17894
+
17895
+      buf[p++] = w & 0xff;
17896
+      buf[p++] = w >> 8 & 0xff;
17897
+      buf[p++] = h & 0xff;
17898
+      buf[p++] = h >> 8 & 0xff; // NOTE: No sort flag (unused?).
17899
+      // TODO(deanm): Support interlace.
17900
+
17901
+      buf[p++] = using_local_palette === true ? 0x80 | min_code_size - 1 : 0; // - Local Color Table
17902
+
17903
+      if (using_local_palette === true) {
17904
+        for (var i = 0, il = palette.length; i < il; ++i) {
17905
+          var rgb = palette[i];
17906
+          buf[p++] = rgb >> 16 & 0xff;
17907
+          buf[p++] = rgb >> 8 & 0xff;
17908
+          buf[p++] = rgb & 0xff;
17909
+        }
17910
+      }
17911
+
17912
+      p = GifWriterOutputLZWCodeStream(buf, p, min_code_size < 2 ? 2 : min_code_size, indexed_pixels);
17913
+    };
17914
+
17915
+    this.end = function () {
17916
+      if (ended === false) {
17917
+        buf[p++] = 0x3b; // Trailer.
17918
+
17919
+        ended = true;
17920
+      }
17921
+
17922
+      return p;
17923
+    };
17924
+  } // Main compression routine, palette indexes -> LZW code stream.
17925
+  // |index_stream| must have at least one entry.
17926
+
17927
+
17928
+  function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) {
17929
+    buf[p++] = min_code_size;
17930
+    var cur_subblock = p++; // Pointing at the length field.
17931
+
17932
+    var clear_code = 1 << min_code_size;
17933
+    var code_mask = clear_code - 1;
17934
+    var eoi_code = clear_code + 1;
17935
+    var next_code = eoi_code + 1;
17936
+    var cur_code_size = min_code_size + 1; // Number of bits per code.
17937
+
17938
+    var cur_shift = 0; // We have at most 12-bit codes, so we should have to hold a max of 19
17939
+    // bits here (and then we would write out).
17940
+
17941
+    var cur = 0;
17942
+
17943
+    function emit_bytes_to_buffer(bit_block_size) {
17944
+      while (cur_shift >= bit_block_size) {
17945
+        buf[p++] = cur & 0xff;
17946
+        cur >>= 8;
17947
+        cur_shift -= 8;
17948
+
17949
+        if (p === cur_subblock + 256) {
17950
+          // Finished a subblock.
17951
+          buf[cur_subblock] = 255;
17952
+          cur_subblock = p++;
17953
+        }
17954
+      }
17955
+    }
17956
+
17957
+    function emit_code(c) {
17958
+      cur |= c << cur_shift;
17959
+      cur_shift += cur_code_size;
17960
+      emit_bytes_to_buffer(8);
17961
+    } // I am not an expert on the topic, and I don't want to write a thesis.
17962
+    // However, it is good to outline here the basic algorithm and the few data
17963
+    // structures and optimizations here that make this implementation fast.
17964
+    // The basic idea behind LZW is to build a table of previously seen runs
17965
+    // addressed by a short id (herein called output code).  All data is
17966
+    // referenced by a code, which represents one or more values from the
17967
+    // original input stream.  All input bytes can be referenced as the same
17968
+    // value as an output code.  So if you didn't want any compression, you
17969
+    // could more or less just output the original bytes as codes (there are
17970
+    // some details to this, but it is the idea).  In order to achieve
17971
+    // compression, values greater then the input range (codes can be up to
17972
+    // 12-bit while input only 8-bit) represent a sequence of previously seen
17973
+    // inputs.  The decompressor is able to build the same mapping while
17974
+    // decoding, so there is always a shared common knowledge between the
17975
+    // encoding and decoder, which is also important for "timing" aspects like
17976
+    // how to handle variable bit width code encoding.
17977
+    //
17978
+    // One obvious but very important consequence of the table system is there
17979
+    // is always a unique id (at most 12-bits) to map the runs.  'A' might be
17980
+    // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc.  This relationship
17981
+    // can be used for an effecient lookup strategy for the code mapping.  We
17982
+    // need to know if a run has been seen before, and be able to map that run
17983
+    // to the output code.  Since we start with known unique ids (input bytes),
17984
+    // and then from those build more unique ids (table entries), we can
17985
+    // continue this chain (almost like a linked list) to always have small
17986
+    // integer values that represent the current byte chains in the encoder.
17987
+    // This means instead of tracking the input bytes (AAAABCD) to know our
17988
+    // current state, we can track the table entry for AAAABC (it is guaranteed
17989
+    // to exist by the nature of the algorithm) and the next character D.
17990
+    // Therefor the tuple of (table_entry, byte) is guaranteed to also be
17991
+    // unique.  This allows us to create a simple lookup key for mapping input
17992
+    // sequences to codes (table indices) without having to store or search
17993
+    // any of the code sequences.  So if 'AAAA' has a table entry of 12, the
17994
+    // tuple of ('AAAA', K) for any input byte K will be unique, and can be our
17995
+    // key.  This leads to a integer value at most 20-bits, which can always
17996
+    // fit in an SMI value and be used as a fast sparse array / object key.
17997
+    // Output code for the current contents of the index buffer.
17998
+
17999
+
18000
+    var ib_code = index_stream[0] & code_mask; // Load first input index.
18001
+
18002
+    var code_table = {}; // Key'd on our 20-bit "tuple".
18003
+
18004
+    emit_code(clear_code); // Spec says first code should be a clear code.
18005
+    // First index already loaded, process the rest of the stream.
18006
+
18007
+    for (var i = 1, il = index_stream.length; i < il; ++i) {
18008
+      var k = index_stream[i] & code_mask;
18009
+      var cur_key = ib_code << 8 | k; // (prev, k) unique tuple.
18010
+
18011
+      var cur_code = code_table[cur_key]; // buffer + k.
18012
+      // Check if we have to create a new code table entry.
18013
+
18014
+      if (cur_code === undefined) {
18015
+        // We don't have buffer + k.
18016
+        // Emit index buffer (without k).
18017
+        // This is an inline version of emit_code, because this is the core
18018
+        // writing routine of the compressor (and V8 cannot inline emit_code
18019
+        // because it is a closure here in a different context).  Additionally
18020
+        // we can call emit_byte_to_buffer less often, because we can have
18021
+        // 30-bits (from our 31-bit signed SMI), and we know our codes will only
18022
+        // be 12-bits, so can safely have 18-bits there without overflow.
18023
+        // emit_code(ib_code);
18024
+        cur |= ib_code << cur_shift;
18025
+        cur_shift += cur_code_size;
18026
+
18027
+        while (cur_shift >= 8) {
18028
+          buf[p++] = cur & 0xff;
18029
+          cur >>= 8;
18030
+          cur_shift -= 8;
18031
+
18032
+          if (p === cur_subblock + 256) {
18033
+            // Finished a subblock.
18034
+            buf[cur_subblock] = 255;
18035
+            cur_subblock = p++;
18036
+          }
18037
+        }
18038
+
18039
+        if (next_code === 4096) {
18040
+          // Table full, need a clear.
18041
+          emit_code(clear_code);
18042
+          next_code = eoi_code + 1;
18043
+          cur_code_size = min_code_size + 1;
18044
+          code_table = {};
18045
+        } else {
18046
+          // Table not full, insert a new entry.
18047
+          // Increase our variable bit code sizes if necessary.  This is a bit
18048
+          // tricky as it is based on "timing" between the encoding and
18049
+          // decoder.  From the encoders perspective this should happen after
18050
+          // we've already emitted the index buffer and are about to create the
18051
+          // first table entry that would overflow our current code bit size.
18052
+          if (next_code >= 1 << cur_code_size) ++cur_code_size;
18053
+          code_table[cur_key] = next_code++; // Insert into code table.
18054
+        }
18055
+
18056
+        ib_code = k; // Index buffer to single input k.
18057
+      } else {
18058
+        ib_code = cur_code; // Index buffer to sequence in code table.
18059
+      }
18060
+    }
18061
+
18062
+    emit_code(ib_code); // There will still be something in the index buffer.
18063
+
18064
+    emit_code(eoi_code); // End Of Information.
18065
+    // Flush / finalize the sub-blocks stream to the buffer.
18066
+
18067
+    emit_bytes_to_buffer(1); // Finish the sub-blocks, writing out any unfinished lengths and
18068
+    // terminating with a sub-block of length 0.  If we have already started
18069
+    // but not yet used a sub-block it can just become the terminator.
18070
+
18071
+    if (cur_subblock + 1 === p) {
18072
+      // Started but unused.
18073
+      buf[cur_subblock] = 0;
18074
+    } else {
18075
+      // Started and used, write length and additional terminator block.
18076
+      buf[cur_subblock] = p - cur_subblock - 1;
18077
+      buf[p++] = 0;
18078
+    }
18079
+
18080
+    return p;
18081
+  }
18082
+
18083
+  function GifReader(buf) {
18084
+    var p = 0; // - Header (GIF87a or GIF89a).
18085
+
18086
+    if (buf[p++] !== 0x47 || buf[p++] !== 0x49 || buf[p++] !== 0x46 || buf[p++] !== 0x38 || (buf[p++] + 1 & 0xfd) !== 0x38 || buf[p++] !== 0x61) {
18087
+      throw "Invalid GIF 87a/89a header.";
18088
+    } // - Logical Screen Descriptor.
18089
+
18090
+
18091
+    var width = buf[p++] | buf[p++] << 8;
18092
+    var height = buf[p++] | buf[p++] << 8;
18093
+    var pf0 = buf[p++]; // <Packed Fields>.
18094
+
18095
+    var global_palette_flag = pf0 >> 7;
18096
+    var num_global_colors_pow2 = pf0 & 0x7;
18097
+    var num_global_colors = 1 << num_global_colors_pow2 + 1;
18098
+    var background = buf[p++];
18099
+    buf[p++]; // Pixel aspect ratio (unused?).
18100
+
18101
+    var global_palette_offset = null;
18102
+
18103
+    if (global_palette_flag) {
18104
+      global_palette_offset = p;
18105
+      p += num_global_colors * 3; // Seek past palette.
18106
+    }
18107
+
18108
+    var no_eof = true;
18109
+    var frames = [];
18110
+    var delay = 0;
18111
+    var transparent_index = null;
18112
+    var disposal = 0; // 0 - No disposal specified.
18113
+
18114
+    var loop_count = null;
18115
+    this.width = width;
18116
+    this.height = height;
18117
+
18118
+    while (no_eof && p < buf.length) {
18119
+      switch (buf[p++]) {
18120
+        case 0x21:
18121
+          // Graphics Control Extension Block
18122
+          switch (buf[p++]) {
18123
+            case 0xff:
18124
+              // Application specific block
18125
+              // Try if it's a Netscape block (with animation loop counter).
18126
+              if (buf[p] !== 0x0b || // 21 FF already read, check block size.
18127
+              // NETSCAPE2.0
18128
+              buf[p + 1] == 0x4e && buf[p + 2] == 0x45 && buf[p + 3] == 0x54 && buf[p + 4] == 0x53 && buf[p + 5] == 0x43 && buf[p + 6] == 0x41 && buf[p + 7] == 0x50 && buf[p + 8] == 0x45 && buf[p + 9] == 0x32 && buf[p + 10] == 0x2e && buf[p + 11] == 0x30 && // Sub-block
18129
+              buf[p + 12] == 0x03 && buf[p + 13] == 0x01 && buf[p + 16] == 0) {
18130
+                p += 14;
18131
+                loop_count = buf[p++] | buf[p++] << 8;
18132
+                p++; // Skip terminator.
18133
+              } else {
18134
+                // We don't know what it is, just try to get past it.
18135
+                p += 12;
18136
+
18137
+                while (true) {
18138
+                  // Seek through subblocks.
18139
+                  var block_size = buf[p++];
18140
+                  if (block_size === 0) break;
18141
+                  p += block_size;
18142
+                }
18143
+              }
18144
+
18145
+              break;
18146
+
18147
+            case 0xf9:
18148
+              // Graphics Control Extension
18149
+              if (buf[p++] !== 0x4 || buf[p + 4] !== 0) throw "Invalid graphics extension block.";
18150
+              var pf1 = buf[p++];
18151
+              delay = buf[p++] | buf[p++] << 8;
18152
+              transparent_index = buf[p++];
18153
+              if ((pf1 & 1) === 0) transparent_index = null;
18154
+              disposal = pf1 >> 2 & 0x7;
18155
+              p++; // Skip terminator.
18156
+
18157
+              break;
18158
+
18159
+            case 0xfe:
18160
+              // Comment Extension.
18161
+              while (true) {
18162
+                // Seek through subblocks.
18163
+                var block_size = buf[p++];
18164
+                if (block_size === 0) break; // console.log(buf.slice(p, p+block_size).toString('ascii'));
18165
+
18166
+                p += block_size;
18167
+              }
18168
+
18169
+              break;
18170
+
18171
+            default:
18172
+              throw "Unknown graphic control label: 0x" + buf[p - 1].toString(16);
18173
+          }
18174
+
18175
+          break;
18176
+
18177
+        case 0x2c:
18178
+          // Image Descriptor.
18179
+          var x = buf[p++] | buf[p++] << 8;
18180
+          var y = buf[p++] | buf[p++] << 8;
18181
+          var w = buf[p++] | buf[p++] << 8;
18182
+          var h = buf[p++] | buf[p++] << 8;
18183
+          var pf2 = buf[p++];
18184
+          var local_palette_flag = pf2 >> 7;
18185
+          var interlace_flag = pf2 >> 6 & 1;
18186
+          var num_local_colors_pow2 = pf2 & 0x7;
18187
+          var num_local_colors = 1 << num_local_colors_pow2 + 1;
18188
+          var palette_offset = global_palette_offset;
18189
+          var has_local_palette = false;
18190
+
18191
+          if (local_palette_flag) {
18192
+            var has_local_palette = true;
18193
+            palette_offset = p; // Override with local palette.
18194
+
18195
+            p += num_local_colors * 3; // Seek past palette.
18196
+          }
18197
+
18198
+          var data_offset = p;
18199
+          p++; // codesize
18200
+
18201
+          while (true) {
18202
+            var block_size = buf[p++];
18203
+            if (block_size === 0) break;
18204
+            p += block_size;
18205
+          }
18206
+
18207
+          frames.push({
18208
+            x: x,
18209
+            y: y,
18210
+            width: w,
18211
+            height: h,
18212
+            has_local_palette: has_local_palette,
18213
+            palette_offset: palette_offset,
18214
+            data_offset: data_offset,
18215
+            data_length: p - data_offset,
18216
+            transparent_index: transparent_index,
18217
+            interlaced: !!interlace_flag,
18218
+            delay: delay,
18219
+            disposal: disposal
18220
+          });
18221
+          break;
18222
+
18223
+        case 0x3b:
18224
+          // Trailer Marker (end of file).
18225
+          no_eof = false;
18226
+          break;
18227
+
18228
+        default:
18229
+          throw "Unknown gif block: 0x" + buf[p - 1].toString(16);
18230
+          break;
18231
+      }
18232
+    }
18233
+
18234
+    this.numFrames = function () {
18235
+      return frames.length;
18236
+    };
18237
+
18238
+    this.loopCount = function () {
18239
+      return loop_count;
18240
+    };
18241
+
18242
+    this.frameInfo = function (frame_num) {
18243
+      if (frame_num < 0 || frame_num >= frames.length) throw "Frame index out of range.";
18244
+      return frames[frame_num];
18245
+    };
18246
+
18247
+    this.decodeAndBlitFrameBGRA = function (frame_num, pixels) {
18248
+      var frame = this.frameInfo(frame_num);
18249
+      var num_pixels = frame.width * frame.height;
18250
+      var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.
18251
+
18252
+      GifReaderLZWOutputIndexStream(buf, frame.data_offset, index_stream, num_pixels);
18253
+      var palette_offset = frame.palette_offset; // NOTE(deanm): It seems to be much faster to compare index to 256 than
18254
+      // to === null.  Not sure why, but CompareStub_EQ_STRICT shows up high in
18255
+      // the profile, not sure if it's related to using a Uint8Array.
18256
+
18257
+      var trans = frame.transparent_index;
18258
+      if (trans === null) trans = 256; // We are possibly just blitting to a portion of the entire frame.
18259
+      // That is a subrect within the framerect, so the additional pixels
18260
+      // must be skipped over after we finished a scanline.
18261
+
18262
+      var framewidth = frame.width;
18263
+      var framestride = width - framewidth;
18264
+      var xleft = framewidth; // Number of subrect pixels left in scanline.
18265
+      // Output indicies of the top left and bottom right corners of the subrect.
18266
+
18267
+      var opbeg = (frame.y * width + frame.x) * 4;
18268
+      var opend = ((frame.y + frame.height) * width + frame.x) * 4;
18269
+      var op = opbeg;
18270
+      var scanstride = framestride * 4; // Use scanstride to skip past the rows when interlacing.  This is skipping
18271
+      // 7 rows for the first two passes, then 3 then 1.
18272
+
18273
+      if (frame.interlaced === true) {
18274
+        scanstride += (framewidth + framestride) * 4 * 7; // Pass 1.
18275
+      }
18276
+
18277
+      var interlaceskip = 8; // Tracking the row interval in the current pass.
18278
+
18279
+      for (var i = 0, il = index_stream.length; i < il; ++i) {
18280
+        var index = index_stream[i];
18281
+
18282
+        if (xleft === 0) {
18283
+          // Beginning of new scan line
18284
+          op += scanstride;
18285
+          xleft = framewidth;
18286
+
18287
+          if (op >= opend) {
18288
+            // Catch the wrap to switch passes when interlacing.
18289
+            scanstride = framestride + (framewidth + framestride) * 4 * (interlaceskip - 1); // interlaceskip / 2 * 4 is interlaceskip << 1.
18290
+
18291
+            op = opbeg + (framewidth + framestride) * (interlaceskip << 1);
18292
+            interlaceskip >>= 1;
18293
+          }
18294
+        }
18295
+
18296
+        if (index === trans) {
18297
+          op += 4;
18298
+        } else {
18299
+          var r = buf[palette_offset + index * 3];
18300
+          var g = buf[palette_offset + index * 3 + 1];
18301
+          var b = buf[palette_offset + index * 3 + 2];
18302
+          pixels[op++] = b;
18303
+          pixels[op++] = g;
18304
+          pixels[op++] = r;
18305
+          pixels[op++] = 255;
18306
+        }
18307
+
18308
+        --xleft;
18309
+      }
18310
+    }; // I will go to copy and paste hell one day...
18311
+
18312
+
18313
+    this.decodeAndBlitFrameRGBA = function (frame_num, pixels) {
18314
+      var frame = this.frameInfo(frame_num);
18315
+      var num_pixels = frame.width * frame.height;
18316
+      var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.
18317
+
18318
+      GifReaderLZWOutputIndexStream(buf, frame.data_offset, index_stream, num_pixels);
18319
+      var palette_offset = frame.palette_offset; // NOTE(deanm): It seems to be much faster to compare index to 256 than
18320
+      // to === null.  Not sure why, but CompareStub_EQ_STRICT shows up high in
18321
+      // the profile, not sure if it's related to using a Uint8Array.
18322
+
18323
+      var trans = frame.transparent_index;
18324
+      if (trans === null) trans = 256; // We are possibly just blitting to a portion of the entire frame.
18325
+      // That is a subrect within the framerect, so the additional pixels
18326
+      // must be skipped over after we finished a scanline.
18327
+
18328
+      var framewidth = frame.width;
18329
+      var framestride = width - framewidth;
18330
+      var xleft = framewidth; // Number of subrect pixels left in scanline.
18331
+      // Output indicies of the top left and bottom right corners of the subrect.
18332
+
18333
+      var opbeg = (frame.y * width + frame.x) * 4;
18334
+      var opend = ((frame.y + frame.height) * width + frame.x) * 4;
18335
+      var op = opbeg;
18336
+      var scanstride = framestride * 4; // Use scanstride to skip past the rows when interlacing.  This is skipping
18337
+      // 7 rows for the first two passes, then 3 then 1.
18338
+
18339
+      if (frame.interlaced === true) {
18340
+        scanstride += (framewidth + framestride) * 4 * 7; // Pass 1.
18341
+      }
18342
+
18343
+      var interlaceskip = 8; // Tracking the row interval in the current pass.
18344
+
18345
+      for (var i = 0, il = index_stream.length; i < il; ++i) {
18346
+        var index = index_stream[i];
18347
+
18348
+        if (xleft === 0) {
18349
+          // Beginning of new scan line
18350
+          op += scanstride;
18351
+          xleft = framewidth;
18352
+
18353
+          if (op >= opend) {
18354
+            // Catch the wrap to switch passes when interlacing.
18355
+            scanstride = framestride + (framewidth + framestride) * 4 * (interlaceskip - 1); // interlaceskip / 2 * 4 is interlaceskip << 1.
18356
+
18357
+            op = opbeg + (framewidth + framestride) * (interlaceskip << 1);
18358
+            interlaceskip >>= 1;
18359
+          }
18360
+        }
18361
+
18362
+        if (index === trans) {
18363
+          op += 4;
18364
+        } else {
18365
+          var r = buf[palette_offset + index * 3];
18366
+          var g = buf[palette_offset + index * 3 + 1];
18367
+          var b = buf[palette_offset + index * 3 + 2];
18368
+          pixels[op++] = r;
18369
+          pixels[op++] = g;
18370
+          pixels[op++] = b;
18371
+          pixels[op++] = 255;
18372
+        }
18373
+
18374
+        --xleft;
18375
+      }
18376
+    };
18377
+  }
18378
+
18379
+  function GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) {
18380
+    var min_code_size = code_stream[p++];
18381
+    var clear_code = 1 << min_code_size;
18382
+    var eoi_code = clear_code + 1;
18383
+    var next_code = eoi_code + 1;
18384
+    var cur_code_size = min_code_size + 1; // Number of bits per code.
18385
+    // NOTE: This shares the same name as the encoder, but has a different
18386
+    // meaning here.  Here this masks each code coming from the code stream.
18387
+
18388
+    var code_mask = (1 << cur_code_size) - 1;
18389
+    var cur_shift = 0;
18390
+    var cur = 0;
18391
+    var op = 0; // Output pointer.
18392
+
18393
+    var subblock_size = code_stream[p++]; // TODO(deanm): Would using a TypedArray be any faster?  At least it would
18394
+    // solve the fast mode / backing store uncertainty.
18395
+    // var code_table = Array(4096);
18396
+
18397
+    var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits.
18398
+
18399
+    var prev_code = null; // Track code-1.
18400
+
18401
+    while (true) {
18402
+      // Read up to two bytes, making sure we always 12-bits for max sized code.
18403
+      while (cur_shift < 16) {
18404
+        if (subblock_size === 0) break; // No more data to be read.
18405
+
18406
+        cur |= code_stream[p++] << cur_shift;
18407
+        cur_shift += 8;
18408
+
18409
+        if (subblock_size === 1) {
18410
+          // Never let it get to 0 to hold logic above.
18411
+          subblock_size = code_stream[p++]; // Next subblock.
18412
+        } else {
18413
+          --subblock_size;
18414
+        }
18415
+      } // TODO(deanm): We should never really get here, we should have received
18416
+      // and EOI.
18417
+
18418
+
18419
+      if (cur_shift < cur_code_size) break;
18420
+      var code = cur & code_mask;
18421
+      cur >>= cur_code_size;
18422
+      cur_shift -= cur_code_size; // TODO(deanm): Maybe should check that the first code was a clear code,
18423
+      // at least this is what you're supposed to do.  But actually our encoder
18424
+      // now doesn't emit a clear code first anyway.
18425
+
18426
+      if (code === clear_code) {
18427
+        // We don't actually have to clear the table.  This could be a good idea
18428
+        // for greater error checking, but we don't really do any anyway.  We
18429
+        // will just track it with next_code and overwrite old entries.
18430
+        next_code = eoi_code + 1;
18431
+        cur_code_size = min_code_size + 1;
18432
+        code_mask = (1 << cur_code_size) - 1; // Don't update prev_code ?
18433
+
18434
+        prev_code = null;
18435
+        continue;
18436
+      } else if (code === eoi_code) {
18437
+        break;
18438
+      } // We have a similar situation as the decoder, where we want to store
18439
+      // variable length entries (code table entries), but we want to do in a
18440
+      // faster manner than an array of arrays.  The code below stores sort of a
18441
+      // linked list within the code table, and then "chases" through it to
18442
+      // construct the dictionary entries.  When a new entry is created, just the
18443
+      // last byte is stored, and the rest (prefix) of the entry is only
18444
+      // referenced by its table entry.  Then the code chases through the
18445
+      // prefixes until it reaches a single byte code.  We have to chase twice,
18446
+      // first to compute the length, and then to actually copy the data to the
18447
+      // output (backwards, since we know the length).  The alternative would be
18448
+      // storing something in an intermediate stack, but that doesn't make any
18449
+      // more sense.  I implemented an approach where it also stored the length
18450
+      // in the code table, although it's a bit tricky because you run out of
18451
+      // bits (12 + 12 + 8), but I didn't measure much improvements (the table
18452
+      // entries are generally not the long).  Even when I created benchmarks for
18453
+      // very long table entries the complexity did not seem worth it.
18454
+      // The code table stores the prefix entry in 12 bits and then the suffix
18455
+      // byte in 8 bits, so each entry is 20 bits.
18456
+
18457
+
18458
+      var chase_code = code < next_code ? code : prev_code; // Chase what we will output, either {CODE} or {CODE-1}.
18459
+
18460
+      var chase_length = 0;
18461
+      var chase = chase_code;
18462
+
18463
+      while (chase > clear_code) {
18464
+        chase = code_table[chase] >> 8;
18465
+        ++chase_length;
18466
+      }
18467
+
18468
+      var k = chase;
18469
+      var op_end = op + chase_length + (chase_code !== code ? 1 : 0);
18470
+
18471
+      if (op_end > output_length) {
18472
+        console.log("Warning, gif stream longer than expected.");
18473
+        return;
18474
+      } // Already have the first byte from the chase, might as well write it fast.
18475
+
18476
+
18477
+      output[op++] = k;
18478
+      op += chase_length;
18479
+      var b = op; // Track pointer, writing backwards.
18480
+
18481
+      if (chase_code !== code) // The case of emitting {CODE-1} + k.
18482
+        output[op++] = k;
18483
+      chase = chase_code;
18484
+
18485
+      while (chase_length--) {
18486
+        chase = code_table[chase];
18487
+        output[--b] = chase & 0xff; // Write backwards.
18488
+
18489
+        chase >>= 8; // Pull down to the prefix code.
18490
+      }
18491
+
18492
+      if (prev_code !== null && next_code < 4096) {
18493
+        code_table[next_code++] = prev_code << 8 | k; // TODO(deanm): Figure out this clearing vs code growth logic better.  I
18494
+        // have an feeling that it should just happen somewhere else, for now it
18495
+        // is awkward between when we grow past the max and then hit a clear code.
18496
+        // For now just check if we hit the max 12-bits (then a clear code should
18497
+        // follow, also of course encoded in 12-bits).
18498
+
18499
+        if (next_code >= code_mask + 1 && cur_code_size < 12) {
18500
+          ++cur_code_size;
18501
+          code_mask = code_mask << 1 | 1;
18502
+        }
18503
+      }
18504
+
18505
+      prev_code = code;
18506
+    }
18507
+
18508
+    if (op !== output_length) {
18509
+      console.log("Warning, gif stream shorter than expected.");
18510
+    }
18511
+
18512
+    return output;
18513
+  }
18514
+
18515
+  try {
18516
+    exports.GifWriter = GifWriter;
18517
+    exports.GifReader = GifReader;
18518
+  } catch (e) {} // CommonJS.
18519
+
18520
+  /*rollup-keeper-start*/
18521
+
18522
+
18523
+  window.tmp = GifReader;
18524
+  /*rollup-keeper-end*/
18525
+
18526
+  /*
18527
+   * Copyright (c) 2012 chick307 <chick307@gmail.com>
18528
+   *
18529
+   * Licensed under the MIT License.
18530
+   * http://opensource.org/licenses/mit-license
18531
+   */
18532
+  (function (jsPDF, callback) {
18533
+    jsPDF.API.adler32cs = callback();
18534
+  })(jsPDF, function () {
18535
+    var _hasArrayBuffer = typeof ArrayBuffer === 'function' && typeof Uint8Array === 'function';
18536
+
18537
+    var _Buffer = null,
18538
+        _isBuffer = function () {
18539
+      if (!_hasArrayBuffer) return function _isBuffer() {
18540
+        return false;
18541
+      };
18542
+
18543
+      try {
18544
+        var buffer = {};
18545
+        if (typeof buffer.Buffer === 'function') _Buffer = buffer.Buffer;
18546
+      } catch (error) {}
18547
+
18548
+      return function _isBuffer(value) {
18549
+        return value instanceof ArrayBuffer || _Buffer !== null && value instanceof _Buffer;
18550
+      };
18551
+    }();
18552
+
18553
+    var _utf8ToBinary = function () {
18554
+      if (_Buffer !== null) {
18555
+        return function _utf8ToBinary(utf8String) {
18556
+          return new _Buffer(utf8String, 'utf8').toString('binary');
18557
+        };
18558
+      } else {
18559
+        return function _utf8ToBinary(utf8String) {
18560
+          return unescape(encodeURIComponent(utf8String));
18561
+        };
18562
+      }
18563
+    }();
18564
+
18565
+    var MOD = 65521;
18566
+
18567
+    var _update = function _update(checksum, binaryString) {
18568
+      var a = checksum & 0xFFFF,
18569
+          b = checksum >>> 16;
18570
+
18571
+      for (var i = 0, length = binaryString.length; i < length; i++) {
18572
+        a = (a + (binaryString.charCodeAt(i) & 0xFF)) % MOD;
18573
+        b = (b + a) % MOD;
18574
+      }
18575
+
18576
+      return (b << 16 | a) >>> 0;
18577
+    };
18578
+
18579
+    var _updateUint8Array = function _updateUint8Array(checksum, uint8Array) {
18580
+      var a = checksum & 0xFFFF,
18581
+          b = checksum >>> 16;
18582
+
18583
+      for (var i = 0, length = uint8Array.length; i < length; i++) {
18584
+        a = (a + uint8Array[i]) % MOD;
18585
+        b = (b + a) % MOD;
18586
+      }
18587
+
18588
+      return (b << 16 | a) >>> 0;
18589
+    };
18590
+
18591
+    var exports = {};
18592
+
18593
+    var Adler32 = exports.Adler32 = function () {
18594
+      var ctor = function Adler32(checksum) {
18595
+        if (!(this instanceof ctor)) {
18596
+          throw new TypeError('Constructor cannot called be as a function.');
18597
+        }
18598
+
18599
+        if (!isFinite(checksum = checksum == null ? 1 : +checksum)) {
18600
+          throw new Error('First arguments needs to be a finite number.');
18601
+        }
18602
+
18603
+        this.checksum = checksum >>> 0;
18604
+      };
18605
+
18606
+      var proto = ctor.prototype = {};
18607
+      proto.constructor = ctor;
18608
+
18609
+      ctor.from = function (from) {
18610
+        from.prototype = proto;
18611
+        return from;
18612
+      }(function from(binaryString) {
18613
+        if (!(this instanceof ctor)) {
18614
+          throw new TypeError('Constructor cannot called be as a function.');
18615
+        }
18616
+
18617
+        if (binaryString == null) throw new Error('First argument needs to be a string.');
18618
+        this.checksum = _update(1, binaryString.toString());
18619
+      });
18620
+
18621
+      ctor.fromUtf8 = function (fromUtf8) {
18622
+        fromUtf8.prototype = proto;
18623
+        return fromUtf8;
18624
+      }(function fromUtf8(utf8String) {
18625
+        if (!(this instanceof ctor)) {
18626
+          throw new TypeError('Constructor cannot called be as a function.');
18627
+        }
18628
+
18629
+        if (utf8String == null) throw new Error('First argument needs to be a string.');
18630
+
18631
+        var binaryString = _utf8ToBinary(utf8String.toString());
18632
+
18633
+        this.checksum = _update(1, binaryString);
18634
+      });
18635
+
18636
+      if (_hasArrayBuffer) {
18637
+        ctor.fromBuffer = function (fromBuffer) {
18638
+          fromBuffer.prototype = proto;
18639
+          return fromBuffer;
18640
+        }(function fromBuffer(buffer) {
18641
+          if (!(this instanceof ctor)) {
18642
+            throw new TypeError('Constructor cannot called be as a function.');
18643
+          }
18644
+
18645
+          if (!_isBuffer(buffer)) throw new Error('First argument needs to be ArrayBuffer.');
18646
+          var array = new Uint8Array(buffer);
18647
+          return this.checksum = _updateUint8Array(1, array);
18648
+        });
18649
+      }
18650
+
18651
+      proto.update = function update(binaryString) {
18652
+        if (binaryString == null) throw new Error('First argument needs to be a string.');
18653
+        binaryString = binaryString.toString();
18654
+        return this.checksum = _update(this.checksum, binaryString);
18655
+      };
18656
+
18657
+      proto.updateUtf8 = function updateUtf8(utf8String) {
18658
+        if (utf8String == null) throw new Error('First argument needs to be a string.');
18659
+
18660
+        var binaryString = _utf8ToBinary(utf8String.toString());
18661
+
18662
+        return this.checksum = _update(this.checksum, binaryString);
18663
+      };
18664
+
18665
+      if (_hasArrayBuffer) {
18666
+        proto.updateBuffer = function updateBuffer(buffer) {
18667
+          if (!_isBuffer(buffer)) throw new Error('First argument needs to be ArrayBuffer.');
18668
+          var array = new Uint8Array(buffer);
18669
+          return this.checksum = _updateUint8Array(this.checksum, array);
18670
+        };
18671
+      }
18672
+
18673
+      proto.clone = function clone() {
18674
+        return new Adler32(this.checksum);
18675
+      };
18676
+
18677
+      return ctor;
18678
+    }();
18679
+
18680
+    exports.from = function from(binaryString) {
18681
+      if (binaryString == null) throw new Error('First argument needs to be a string.');
18682
+      return _update(1, binaryString.toString());
18683
+    };
18684
+
18685
+    exports.fromUtf8 = function fromUtf8(utf8String) {
18686
+      if (utf8String == null) throw new Error('First argument needs to be a string.');
18687
+
18688
+      var binaryString = _utf8ToBinary(utf8String.toString());
18689
+
18690
+      return _update(1, binaryString);
18691
+    };
18692
+
18693
+    if (_hasArrayBuffer) {
18694
+      exports.fromBuffer = function fromBuffer(buffer) {
18695
+        if (!_isBuffer(buffer)) throw new Error('First argument need to be ArrayBuffer.');
18696
+        var array = new Uint8Array(buffer);
18697
+        return _updateUint8Array(1, array);
18698
+      };
18699
+    }
18700
+
18701
+    return exports;
18702
+  });
18703
+
18704
+  /**
18705
+  * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
18706
+  * MIT License
18707
+  */
18708
+  (function (jsPDF) {
18709
+    /**
18710
+     * Table of Unicode types.
18711
+     *
18712
+     * Generated by:
18713
+     *
18714
+     * var bidi = require("./bidi/index");
18715
+     * var bidi_accumulate = bidi.slice(0, 256).concat(bidi.slice(0x0500, 0x0500 + 256 * 3)).
18716
+     * concat(bidi.slice(0x2000, 0x2000 + 256)).concat(bidi.slice(0xFB00, 0xFB00 + 256)).
18717
+     * concat(bidi.slice(0xFE00, 0xFE00 + 2 * 256));
18718
+     *
18719
+     * for( var i = 0; i < bidi_accumulate.length; i++) {
18720
+     * 	if(bidi_accumulate[i] === undefined || bidi_accumulate[i] === 'ON')
18721
+     * 		bidi_accumulate[i] = 'N'; //mark as neutral to conserve space and substitute undefined
18722
+     * }
18723
+     * var bidiAccumulateStr = 'return [ "' + bidi_accumulate.toString().replace(/,/g, '", "') + '" ];';
18724
+     * require("fs").writeFile('unicode-types.js', bidiAccumulateStr);
18725
+     *
18726
+     * Based on:
18727
+     * https://github.com/mathiasbynens/unicode-8.0.0
18728
+     */
18729
+
18730
+    var bidiUnicodeTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"];
18731
+    /**
18732
+     * Unicode Bidi algorithm compliant Bidi engine.
18733
+     * For reference see http://unicode.org/reports/tr9/
18734
+    */
18735
+
18736
+    /**
18737
+     * constructor ( options )
18738
+     *
18739
+     * Initializes Bidi engine
18740
+     *
18741
+     * @param {Object} See 'setOptions' below for detailed description.
18742
+     * options are cashed between invocation of 'doBidiReorder' method
18743
+     *
18744
+     * sample usage pattern of BidiEngine:
18745
+     * var opt = {
18746
+     * 	isInputVisual: true,
18747
+     * 	isInputRtl: false,
18748
+     * 	isOutputVisual: false,
18749
+     * 	isOutputRtl: false,
18750
+     * 	isSymmetricSwapping: true
18751
+     * }
18752
+     * var sourceToTarget = [], levels = [];
18753
+     * var bidiEng = Globalize.bidiEngine(opt);
18754
+     * var src = "text string to be reordered";
18755
+     * var ret = bidiEng.doBidiReorder(src, sourceToTarget, levels);
18756
+     */
18757
+
18758
+    jsPDF.__bidiEngine__ = jsPDF.prototype.__bidiEngine__ = function (options) {
18759
+      var _UNICODE_TYPES = _bidiUnicodeTypes;
18760
+      var _STATE_TABLE_LTR = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 0x11, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 0x15, 0x15, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]];
18761
+      var _STATE_TABLE_RTL = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 0x21, 3, 1, 1]];
18762
+      var _TYPE_NAMES_MAP = {
18763
+        "L": 0,
18764
+        "R": 1,
18765
+        "EN": 2,
18766
+        "AN": 3,
18767
+        "N": 4,
18768
+        "B": 5,
18769
+        "S": 6
18770
+      };
18771
+      var _UNICODE_RANGES_MAP = {
18772
+        0: 0,
18773
+        5: 1,
18774
+        6: 2,
18775
+        7: 3,
18776
+        0x20: 4,
18777
+        0xFB: 5,
18778
+        0xFE: 6,
18779
+        0xFF: 7
18780
+      };
18781
+      var _SWAP_TABLE = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "\xAB", "\xBB", "\xAB", "\u2039", "\u203A", "\u2039", "\u2045", "\u2046", "\u2045", "\u207D", "\u207E", "\u207D", "\u208D", "\u208E", "\u208D", "\u2264", "\u2265", "\u2264", "\u2329", "\u232A", "\u2329", "\uFE59", "\uFE5A", "\uFE59", "\uFE5B", "\uFE5C", "\uFE5B", "\uFE5D", "\uFE5E", "\uFE5D", "\uFE64", "\uFE65", "\uFE64"];
18782
+
18783
+      var _LTR_RANGES_REG_EXPR = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/);
18784
+
18785
+      var _lastArabic = false,
18786
+          _hasUbatB,
18787
+          _hasUbatS,
18788
+          DIR_LTR = 0,
18789
+          DIR_RTL = 1,
18790
+          _isInVisual,
18791
+          _isInRtl,
18792
+          _isOutVisual,
18793
+          _isOutRtl,
18794
+          _isSymmetricSwapping,
18795
+          _dir = DIR_LTR;
18796
+
18797
+      this.__bidiEngine__ = {};
18798
+
18799
+      var _init = function _init(text, sourceToTargetMap) {
18800
+        if (sourceToTargetMap) {
18801
+          for (var i = 0; i < text.length; i++) {
18802
+            sourceToTargetMap[i] = i;
18803
+          }
18804
+        }
18805
+
18806
+        if (_isInRtl === undefined) {
18807
+          _isInRtl = _isContextualDirRtl(text);
18808
+        }
18809
+
18810
+        if (_isOutRtl === undefined) {
18811
+          _isOutRtl = _isContextualDirRtl(text);
18812
+        }
18813
+      }; // for reference see 3.2 in http://unicode.org/reports/tr9/
18814
+      //
18815
+
18816
+
18817
+      var _getCharType = function _getCharType(ch) {
18818
+        var charCode = ch.charCodeAt(),
18819
+            range = charCode >> 8,
18820
+            rangeIdx = _UNICODE_RANGES_MAP[range];
18821
+
18822
+        if (rangeIdx !== undefined) {
18823
+          return _UNICODE_TYPES[rangeIdx * 256 + (charCode & 0xFF)];
18824
+        } else if (range === 0xFC || range === 0xFD) {
18825
+          return "AL";
18826
+        } else if (_LTR_RANGES_REG_EXPR.test(range)) {
18827
+          //unlikely case
18828
+          return "L";
18829
+        } else if (range === 8) {
18830
+          // even less likely
18831
+          return "R";
18832
+        }
18833
+
18834
+        return "N"; //undefined type, mark as neutral
18835
+      };
18836
+
18837
+      var _isContextualDirRtl = function _isContextualDirRtl(text) {
18838
+        for (var i = 0, charType; i < text.length; i++) {
18839
+          charType = _getCharType(text.charAt(i));
18840
+
18841
+          if (charType === "L") {
18842
+            return false;
18843
+          } else if (charType === "R") {
18844
+            return true;
18845
+          }
18846
+        }
18847
+
18848
+        return false;
18849
+      }; // for reference see 3.3.4 & 3.3.5 in http://unicode.org/reports/tr9/
18850
+      //
18851
+
18852
+
18853
+      var _resolveCharType = function _resolveCharType(chars, types, resolvedTypes, index) {
18854
+        var cType = types[index],
18855
+            wType,
18856
+            nType,
18857
+            i,
18858
+            len;
18859
+
18860
+        switch (cType) {
18861
+          case "L":
18862
+          case "R":
18863
+            _lastArabic = false;
18864
+            break;
18865
+
18866
+          case "N":
18867
+          case "AN":
18868
+            break;
18869
+
18870
+          case "EN":
18871
+            if (_lastArabic) {
18872
+              cType = "AN";
18873
+            }
18874
+
18875
+            break;
18876
+
18877
+          case "AL":
18878
+            _lastArabic = true;
18879
+            cType = "R";
18880
+            break;
18881
+
18882
+          case "WS":
18883
+            cType = "N";
18884
+            break;
18885
+
18886
+          case "CS":
18887
+            if (index < 1 || index + 1 >= types.length || (wType = resolvedTypes[index - 1]) !== "EN" && wType !== "AN" || (nType = types[index + 1]) !== "EN" && nType !== "AN") {
18888
+              cType = "N";
18889
+            } else if (_lastArabic) {
18890
+              nType = "AN";
18891
+            }
18892
+
18893
+            cType = nType === wType ? nType : "N";
18894
+            break;
18895
+
18896
+          case "ES":
18897
+            wType = index > 0 ? resolvedTypes[index - 1] : "B";
18898
+            cType = wType === "EN" && index + 1 < types.length && types[index + 1] === "EN" ? "EN" : "N";
18899
+            break;
18900
+
18901
+          case "ET":
18902
+            if (index > 0 && resolvedTypes[index - 1] === "EN") {
18903
+              cType = "EN";
18904
+              break;
18905
+            } else if (_lastArabic) {
18906
+              cType = "N";
18907
+              break;
18908
+            }
18909
+
18910
+            i = index + 1;
18911
+            len = types.length;
18912
+
18913
+            while (i < len && types[i] === "ET") {
18914
+              i++;
18915
+            }
18916
+
18917
+            if (i < len && types[i] === "EN") {
18918
+              cType = "EN";
18919
+            } else {
18920
+              cType = "N";
18921
+            }
18922
+
18923
+            break;
18924
+
18925
+          case "NSM":
18926
+            if (_isInVisual && !_isInRtl) {
18927
+              //V->L
18928
+              len = types.length;
18929
+              i = index + 1;
18930
+
18931
+              while (i < len && types[i] === "NSM") {
18932
+                i++;
18933
+              }
18934
+
18935
+              if (i < len) {
18936
+                var c = chars[index];
18937
+                var rtlCandidate = c >= 0x0591 && c <= 0x08FF || c === 0xFB1E;
18938
+                wType = types[i];
18939
+
18940
+                if (rtlCandidate && (wType === "R" || wType === "AL")) {
18941
+                  cType = "R";
18942
+                  break;
18943
+                }
18944
+              }
18945
+            }
18946
+
18947
+            if (index < 1 || (wType = types[index - 1]) === "B") {
18948
+              cType = "N";
18949
+            } else {
18950
+              cType = resolvedTypes[index - 1];
18951
+            }
18952
+
18953
+            break;
18954
+
18955
+          case "B":
18956
+            _lastArabic = false;
18957
+            _hasUbatB = true;
18958
+            cType = _dir;
18959
+            break;
18960
+
18961
+          case "S":
18962
+            _hasUbatS = true;
18963
+            cType = "N";
18964
+            break;
18965
+
18966
+          case "LRE":
18967
+          case "RLE":
18968
+          case "LRO":
18969
+          case "RLO":
18970
+          case "PDF":
18971
+            _lastArabic = false;
18972
+            break;
18973
+
18974
+          case "BN":
18975
+            cType = "N";
18976
+            break;
18977
+        }
18978
+
18979
+        return cType;
18980
+      };
18981
+
18982
+      var _handleUbatS = function _handleUbatS(types, levels, length) {
18983
+        for (var i = 0; i < length; i++) {
18984
+          if (types[i] === "S") {
18985
+            levels[i] = _dir;
18986
+
18987
+            for (var j = i - 1; j >= 0; j--) {
18988
+              if (types[j] === "WS") {
18989
+                levels[j] = _dir;
18990
+              } else {
18991
+                break;
18992
+              }
18993
+            }
18994
+          }
18995
+        }
18996
+      };
18997
+
18998
+      var _invertString = function _invertString(text, sourceToTargetMap, levels) {
18999
+        var charArray = text.split("");
19000
+
19001
+        if (levels) {
19002
+          _computeLevels(charArray, levels, {
19003
+            hiLevel: _dir
19004
+          });
19005
+        }
19006
+
19007
+        charArray.reverse();
19008
+        sourceToTargetMap && sourceToTargetMap.reverse();
19009
+        return charArray.join("");
19010
+      }; // For reference see 3.3 in http://unicode.org/reports/tr9/
19011
+      //
19012
+
19013
+
19014
+      var _computeLevels = function _computeLevels(chars, levels, params) {
19015
+        var action,
19016
+            condition,
19017
+            i,
19018
+            index,
19019
+            newLevel,
19020
+            prevState,
19021
+            condPos = -1,
19022
+            len = chars.length,
19023
+            newState = 0,
19024
+            resolvedTypes = [],
19025
+            stateTable = _dir ? _STATE_TABLE_RTL : _STATE_TABLE_LTR,
19026
+            types = [];
19027
+        _lastArabic = false;
19028
+        _hasUbatB = false;
19029
+        _hasUbatS = false;
19030
+
19031
+        for (i = 0; i < len; i++) {
19032
+          types[i] = _getCharType(chars[i]);
19033
+        }
19034
+
19035
+        for (index = 0; index < len; index++) {
19036
+          prevState = newState;
19037
+          resolvedTypes[index] = _resolveCharType(chars, types, resolvedTypes, index);
19038
+          newState = stateTable[prevState][_TYPE_NAMES_MAP[resolvedTypes[index]]];
19039
+          action = newState & 0xF0;
19040
+          newState &= 0x0F;
19041
+          levels[index] = newLevel = stateTable[newState][5];
19042
+
19043
+          if (action > 0) {
19044
+            if (action === 0x10) {
19045
+              for (i = condPos; i < index; i++) {
19046
+                levels[i] = 1;
19047
+              }
19048
+
19049
+              condPos = -1;
19050
+            } else {
19051
+              condPos = -1;
19052
+            }
19053
+          }
19054
+
19055
+          condition = stateTable[newState][6];
19056
+
19057
+          if (condition) {
19058
+            if (condPos === -1) {
19059
+              condPos = index;
19060
+            }
19061
+          } else {
19062
+            if (condPos > -1) {
19063
+              for (i = condPos; i < index; i++) {
19064
+                levels[i] = newLevel;
19065
+              }
19066
+
19067
+              condPos = -1;
19068
+            }
19069
+          }
19070
+
19071
+          if (types[index] === "B") {
19072
+            levels[index] = 0;
19073
+          }
19074
+
19075
+          params.hiLevel |= newLevel;
19076
+        }
19077
+
19078
+        if (_hasUbatS) {
19079
+          _handleUbatS(types, levels, len);
19080
+        }
19081
+      }; // for reference see 3.4 in http://unicode.org/reports/tr9/
19082
+      //
19083
+
19084
+
19085
+      var _invertByLevel = function _invertByLevel(level, charArray, sourceToTargetMap, levels, params) {
19086
+        if (params.hiLevel < level) {
19087
+          return;
19088
+        }
19089
+
19090
+        if (level === 1 && _dir === DIR_RTL && !_hasUbatB) {
19091
+          charArray.reverse();
19092
+          sourceToTargetMap && sourceToTargetMap.reverse();
19093
+          return;
19094
+        }
19095
+
19096
+        var ch,
19097
+            high,
19098
+            end,
19099
+            low,
19100
+            len = charArray.length,
19101
+            start = 0;
19102
+
19103
+        while (start < len) {
19104
+          if (levels[start] >= level) {
19105
+            end = start + 1;
19106
+
19107
+            while (end < len && levels[end] >= level) {
19108
+              end++;
19109
+            }
19110
+
19111
+            for (low = start, high = end - 1; low < high; low++, high--) {
19112
+              ch = charArray[low];
19113
+              charArray[low] = charArray[high];
19114
+              charArray[high] = ch;
19115
+
19116
+              if (sourceToTargetMap) {
19117
+                ch = sourceToTargetMap[low];
19118
+                sourceToTargetMap[low] = sourceToTargetMap[high];
19119
+                sourceToTargetMap[high] = ch;
19120
+              }
19121
+            }
19122
+
19123
+            start = end;
19124
+          }
19125
+
19126
+          start++;
19127
+        }
19128
+      }; // for reference see 7 & BD16 in http://unicode.org/reports/tr9/
19129
+      //
19130
+
19131
+
19132
+      var _symmetricSwap = function _symmetricSwap(charArray, levels, params) {
19133
+        if (params.hiLevel !== 0 && _isSymmetricSwapping) {
19134
+          for (var i = 0, index; i < charArray.length; i++) {
19135
+            if (levels[i] === 1) {
19136
+              index = _SWAP_TABLE.indexOf(charArray[i]);
19137
+
19138
+              if (index >= 0) {
19139
+                charArray[i] = _SWAP_TABLE[index + 1];
19140
+              }
19141
+            }
19142
+          }
19143
+        }
19144
+      };
19145
+
19146
+      var _reorder = function _reorder(text, sourceToTargetMap, levels) {
19147
+        var charArray = text.split(""),
19148
+            params = {
19149
+          hiLevel: _dir
19150
+        };
19151
+
19152
+        if (!levels) {
19153
+          levels = [];
19154
+        }
19155
+
19156
+        _computeLevels(charArray, levels, params);
19157
+
19158
+        _symmetricSwap(charArray, levels, params);
19159
+
19160
+        _invertByLevel(DIR_RTL + 1, charArray, sourceToTargetMap, levels, params);
19161
+
19162
+        _invertByLevel(DIR_RTL, charArray, sourceToTargetMap, levels, params);
19163
+
19164
+        return charArray.join("");
19165
+      }; // doBidiReorder( text, sourceToTargetMap, levels )
19166
+      // Performs Bidi reordering by implementing Unicode Bidi algorithm.
19167
+      // Returns reordered string
19168
+      // @text [String]:
19169
+      // - input string to be reordered, this is input parameter
19170
+      // $sourceToTargetMap [Array] (optional)
19171
+      // - resultant mapping between input and output strings, this is output parameter
19172
+      // $levels [Array] (optional)
19173
+      // - array of calculated Bidi levels, , this is output parameter
19174
+
19175
+
19176
+      this.__bidiEngine__.doBidiReorder = function (text, sourceToTargetMap, levels) {
19177
+        _init(text, sourceToTargetMap);
19178
+
19179
+        if (!_isInVisual && _isOutVisual && !_isOutRtl) {
19180
+          // LLTR->VLTR, LRTL->VLTR
19181
+          _dir = _isInRtl ? DIR_RTL : DIR_LTR;
19182
+          text = _reorder(text, sourceToTargetMap, levels);
19183
+        } else if (_isInVisual && _isOutVisual && _isInRtl ^ _isOutRtl) {
19184
+          // VRTL->VLTR, VLTR->VRTL
19185
+          _dir = _isInRtl ? DIR_RTL : DIR_LTR;
19186
+          text = _invertString(text, sourceToTargetMap, levels);
19187
+        } else if (!_isInVisual && _isOutVisual && _isOutRtl) {
19188
+          // LLTR->VRTL, LRTL->VRTL
19189
+          _dir = _isInRtl ? DIR_RTL : DIR_LTR;
19190
+          text = _reorder(text, sourceToTargetMap, levels);
19191
+          text = _invertString(text, sourceToTargetMap);
19192
+        } else if (_isInVisual && !_isInRtl && !_isOutVisual && !_isOutRtl) {
19193
+          // VLTR->LLTR
19194
+          _dir = DIR_LTR;
19195
+          text = _reorder(text, sourceToTargetMap, levels);
19196
+        } else if (_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) {
19197
+          // VLTR->LRTL, VRTL->LLTR
19198
+          text = _invertString(text, sourceToTargetMap);
19199
+
19200
+          if (_isInRtl) {
19201
+            //LLTR -> VLTR
19202
+            _dir = DIR_LTR;
19203
+            text = _reorder(text, sourceToTargetMap, levels);
19204
+          } else {
19205
+            //LRTL -> VRTL
19206
+            _dir = DIR_RTL;
19207
+            text = _reorder(text, sourceToTargetMap, levels);
19208
+            text = _invertString(text, sourceToTargetMap);
19209
+          }
19210
+        } else if (_isInVisual && _isInRtl && !_isOutVisual && _isOutRtl) {
19211
+          //  VRTL->LRTL
19212
+          _dir = DIR_RTL;
19213
+          text = _reorder(text, sourceToTargetMap, levels);
19214
+          text = _invertString(text, sourceToTargetMap);
19215
+        } else if (!_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) {
19216
+          // LRTL->LLTR, LLTR->LRTL
19217
+          var isSymmetricSwappingOrig = _isSymmetricSwapping;
19218
+
19219
+          if (_isInRtl) {
19220
+            //LRTL->LLTR
19221
+            _dir = DIR_RTL;
19222
+            text = _reorder(text, sourceToTargetMap, levels);
19223
+            _dir = DIR_LTR;
19224
+            _isSymmetricSwapping = false;
19225
+            text = _reorder(text, sourceToTargetMap, levels);
19226
+            _isSymmetricSwapping = isSymmetricSwappingOrig;
19227
+          } else {
19228
+            //LLTR->LRTL
19229
+            _dir = DIR_LTR;
19230
+            text = _reorder(text, sourceToTargetMap, levels);
19231
+            text = _invertString(text, sourceToTargetMap);
19232
+            _dir = DIR_RTL;
19233
+            _isSymmetricSwapping = false;
19234
+            text = _reorder(text, sourceToTargetMap, levels);
19235
+            _isSymmetricSwapping = isSymmetricSwappingOrig;
19236
+            text = _invertString(text, sourceToTargetMap);
19237
+          }
19238
+        }
19239
+
19240
+        return text;
19241
+      };
19242
+      /**
19243
+      * @name setOptions( options )
19244
+      * @function 
19245
+      * Sets options for Bidi conversion
19246
+      * @param {Object}:
19247
+      * - isInputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode)
19248
+      * - isInputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong character of input string)
19249
+      * - isOutputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode)
19250
+      * - isOutputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong characterof input string)
19251
+      * - isSymmetricSwapping {boolean} (defaults to false): allowed values true(needs symmetric swapping), false (no need in symmetric swapping),
19252
+      */
19253
+
19254
+
19255
+      this.__bidiEngine__.setOptions = function (options) {
19256
+        if (options) {
19257
+          _isInVisual = options.isInputVisual;
19258
+          _isOutVisual = options.isOutputVisual;
19259
+          _isInRtl = options.isInputRtl;
19260
+          _isOutRtl = options.isOutputRtl;
19261
+          _isSymmetricSwapping = options.isSymmetricSwapping;
19262
+        }
19263
+      };
19264
+
19265
+      this.__bidiEngine__.setOptions(options);
19266
+
19267
+      return this.__bidiEngine__;
19268
+    };
19269
+
19270
+    var _bidiUnicodeTypes = bidiUnicodeTypes;
19271
+    var bidiEngine = new jsPDF.__bidiEngine__({
19272
+      isInputVisual: true
19273
+    });
19274
+
19275
+    var bidiEngineFunction = function bidiEngineFunction(args) {
19276
+      var text = args.text;
19277
+      var x = args.x;
19278
+      var y = args.y;
19279
+      var options = args.options || {};
19280
+      var mutex = args.mutex || {};
19281
+      var lang = options.lang;
19282
+      var tmpText = [];
19283
+
19284
+      if (Object.prototype.toString.call(text) === '[object Array]') {
19285
+        var i = 0;
19286
+        tmpText = [];
19287
+
19288
+        for (i = 0; i < text.length; i += 1) {
19289
+          if (Object.prototype.toString.call(text[i]) === '[object Array]') {
19290
+            tmpText.push([bidiEngine.doBidiReorder(text[i][0]), text[i][1], text[i][2]]);
19291
+          } else {
19292
+            tmpText.push([bidiEngine.doBidiReorder(text[i])]);
19293
+          }
19294
+        }
19295
+
19296
+        args.text = tmpText;
19297
+      } else {
19298
+        args.text = bidiEngine.doBidiReorder(text);
19299
+      }
19300
+    };
19301
+
19302
+    jsPDF.API.events.push(['postProcessText', bidiEngineFunction]);
19303
+  })(jsPDF);
19304
+
19305
+  /*
19306
+    Copyright (c) 2008, Adobe Systems Incorporated
19307
+    All rights reserved.
19308
+
19309
+    Redistribution and use in source and binary forms, with or without 
19310
+    modification, are permitted provided that the following conditions are
19311
+    met:
19312
+
19313
+    * Redistributions of source code must retain the above copyright notice, 
19314
+      this list of conditions and the following disclaimer.
19315
+    
19316
+    * Redistributions in binary form must reproduce the above copyright
19317
+      notice, this list of conditions and the following disclaimer in the 
19318
+      documentation and/or other materials provided with the distribution.
19319
+    
19320
+    * Neither the name of Adobe Systems Incorporated nor the names of its 
19321
+      contributors may be used to endorse or promote products derived from 
19322
+      this software without specific prior written permission.
19323
+
19324
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19325
+    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19326
+    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19327
+    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
19328
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19329
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19330
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
19331
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
19332
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19333
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19334
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19335
+  */
19336
+
19337
+  /*
19338
+  JPEG encoder ported to JavaScript and optimized by Andreas Ritter, www.bytestrom.eu, 11/2009
19339
+
19340
+  Basic GUI blocking jpeg encoder
19341
+  */
19342
+  function JPEGEncoder(quality) {
19343
+    var ffloor = Math.floor;
19344
+    var YTable = new Array(64);
19345
+    var UVTable = new Array(64);
19346
+    var fdtbl_Y = new Array(64);
19347
+    var fdtbl_UV = new Array(64);
19348
+    var YDC_HT;
19349
+    var UVDC_HT;
19350
+    var YAC_HT;
19351
+    var UVAC_HT;
19352
+    var bitcode = new Array(65535);
19353
+    var category = new Array(65535);
19354
+    var outputfDCTQuant = new Array(64);
19355
+    var DU = new Array(64);
19356
+    var byteout = [];
19357
+    var bytenew = 0;
19358
+    var bytepos = 7;
19359
+    var YDU = new Array(64);
19360
+    var UDU = new Array(64);
19361
+    var VDU = new Array(64);
19362
+    var clt = new Array(256);
19363
+    var RGB_YUV_TABLE = new Array(2048);
19364
+    var currentQuality;
19365
+    var ZigZag = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
19366
+    var std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
19367
+    var std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
19368
+    var std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d];
19369
+    var std_ac_luminance_values = [0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa];
19370
+    var std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
19371
+    var std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
19372
+    var std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77];
19373
+    var std_ac_chrominance_values = [0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa];
19374
+
19375
+    function initQuantTables(sf) {
19376
+      var YQT = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99];
19377
+
19378
+      for (var i = 0; i < 64; i++) {
19379
+        var t = ffloor((YQT[i] * sf + 50) / 100);
19380
+
19381
+        if (t < 1) {
19382
+          t = 1;
19383
+        } else if (t > 255) {
19384
+          t = 255;
19385
+        }
19386
+
19387
+        YTable[ZigZag[i]] = t;
19388
+      }
19389
+
19390
+      var UVQT = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99];
19391
+
19392
+      for (var j = 0; j < 64; j++) {
19393
+        var u = ffloor((UVQT[j] * sf + 50) / 100);
19394
+
19395
+        if (u < 1) {
19396
+          u = 1;
19397
+        } else if (u > 255) {
19398
+          u = 255;
19399
+        }
19400
+
19401
+        UVTable[ZigZag[j]] = u;
19402
+      }
19403
+
19404
+      var aasf = [1.0, 1.387039845, 1.306562965, 1.175875602, 1.0, 0.785694958, 0.541196100, 0.275899379];
19405
+      var k = 0;
19406
+
19407
+      for (var row = 0; row < 8; row++) {
19408
+        for (var col = 0; col < 8; col++) {
19409
+          fdtbl_Y[k] = 1.0 / (YTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0);
19410
+          fdtbl_UV[k] = 1.0 / (UVTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0);
19411
+          k++;
19412
+        }
19413
+      }
19414
+    }
19415
+
19416
+    function computeHuffmanTbl(nrcodes, std_table) {
19417
+      var codevalue = 0;
19418
+      var pos_in_table = 0;
19419
+      var HT = new Array();
19420
+
19421
+      for (var k = 1; k <= 16; k++) {
19422
+        for (var j = 1; j <= nrcodes[k]; j++) {
19423
+          HT[std_table[pos_in_table]] = [];
19424
+          HT[std_table[pos_in_table]][0] = codevalue;
19425
+          HT[std_table[pos_in_table]][1] = k;
19426
+          pos_in_table++;
19427
+          codevalue++;
19428
+        }
19429
+
19430
+        codevalue *= 2;
19431
+      }
19432
+
19433
+      return HT;
19434
+    }
19435
+
19436
+    function initHuffmanTbl() {
19437
+      YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values);
19438
+      UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values);
19439
+      YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values);
19440
+      UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values);
19441
+    }
19442
+
19443
+    function initCategoryNumber() {
19444
+      var nrlower = 1;
19445
+      var nrupper = 2;
19446
+
19447
+      for (var cat = 1; cat <= 15; cat++) {
19448
+        //Positive numbers
19449
+        for (var nr = nrlower; nr < nrupper; nr++) {
19450
+          category[32767 + nr] = cat;
19451
+          bitcode[32767 + nr] = [];
19452
+          bitcode[32767 + nr][1] = cat;
19453
+          bitcode[32767 + nr][0] = nr;
19454
+        } //Negative numbers
19455
+
19456
+
19457
+        for (var nrneg = -(nrupper - 1); nrneg <= -nrlower; nrneg++) {
19458
+          category[32767 + nrneg] = cat;
19459
+          bitcode[32767 + nrneg] = [];
19460
+          bitcode[32767 + nrneg][1] = cat;
19461
+          bitcode[32767 + nrneg][0] = nrupper - 1 + nrneg;
19462
+        }
19463
+
19464
+        nrlower <<= 1;
19465
+        nrupper <<= 1;
19466
+      }
19467
+    }
19468
+
19469
+    function initRGBYUVTable() {
19470
+      for (var i = 0; i < 256; i++) {
19471
+        RGB_YUV_TABLE[i] = 19595 * i;
19472
+        RGB_YUV_TABLE[i + 256 >> 0] = 38470 * i;
19473
+        RGB_YUV_TABLE[i + 512 >> 0] = 7471 * i + 0x8000;
19474
+        RGB_YUV_TABLE[i + 768 >> 0] = -11059 * i;
19475
+        RGB_YUV_TABLE[i + 1024 >> 0] = -21709 * i;
19476
+        RGB_YUV_TABLE[i + 1280 >> 0] = 32768 * i + 0x807FFF;
19477
+        RGB_YUV_TABLE[i + 1536 >> 0] = -27439 * i;
19478
+        RGB_YUV_TABLE[i + 1792 >> 0] = -5329 * i;
19479
+      }
19480
+    } // IO functions
19481
+
19482
+
19483
+    function writeBits(bs) {
19484
+      var value = bs[0];
19485
+      var posval = bs[1] - 1;
19486
+
19487
+      while (posval >= 0) {
19488
+        if (value & 1 << posval) {
19489
+          bytenew |= 1 << bytepos;
19490
+        }
19491
+
19492
+        posval--;
19493
+        bytepos--;
19494
+
19495
+        if (bytepos < 0) {
19496
+          if (bytenew == 0xFF) {
19497
+            writeByte(0xFF);
19498
+            writeByte(0);
19499
+          } else {
19500
+            writeByte(bytenew);
19501
+          }
19502
+
19503
+          bytepos = 7;
19504
+          bytenew = 0;
19505
+        }
19506
+      }
19507
+    }
19508
+
19509
+    function writeByte(value) {
19510
+      //byteout.push(clt[value]); // write char directly instead of converting later
19511
+      byteout.push(value);
19512
+    }
19513
+
19514
+    function writeWord(value) {
19515
+      writeByte(value >> 8 & 0xFF);
19516
+      writeByte(value & 0xFF);
19517
+    } // DCT & quantization core
19518
+
19519
+
19520
+    function fDCTQuant(data, fdtbl) {
19521
+      var d0, d1, d2, d3, d4, d5, d6, d7;
19522
+      /* Pass 1: process rows. */
19523
+
19524
+      var dataOff = 0;
19525
+      var i;
19526
+      var I8 = 8;
19527
+      var I64 = 64;
19528
+
19529
+      for (i = 0; i < I8; ++i) {
19530
+        d0 = data[dataOff];
19531
+        d1 = data[dataOff + 1];
19532
+        d2 = data[dataOff + 2];
19533
+        d3 = data[dataOff + 3];
19534
+        d4 = data[dataOff + 4];
19535
+        d5 = data[dataOff + 5];
19536
+        d6 = data[dataOff + 6];
19537
+        d7 = data[dataOff + 7];
19538
+        var tmp0 = d0 + d7;
19539
+        var tmp7 = d0 - d7;
19540
+        var tmp1 = d1 + d6;
19541
+        var tmp6 = d1 - d6;
19542
+        var tmp2 = d2 + d5;
19543
+        var tmp5 = d2 - d5;
19544
+        var tmp3 = d3 + d4;
19545
+        var tmp4 = d3 - d4;
19546
+        /* Even part */
19547
+
19548
+        var tmp10 = tmp0 + tmp3;
19549
+        /* phase 2 */
19550
+
19551
+        var tmp13 = tmp0 - tmp3;
19552
+        var tmp11 = tmp1 + tmp2;
19553
+        var tmp12 = tmp1 - tmp2;
19554
+        data[dataOff] = tmp10 + tmp11;
19555
+        /* phase 3 */
19556
+
19557
+        data[dataOff + 4] = tmp10 - tmp11;
19558
+        var z1 = (tmp12 + tmp13) * 0.707106781;
19559
+        /* c4 */
19560
+
19561
+        data[dataOff + 2] = tmp13 + z1;
19562
+        /* phase 5 */
19563
+
19564
+        data[dataOff + 6] = tmp13 - z1;
19565
+        /* Odd part */
19566
+
19567
+        tmp10 = tmp4 + tmp5;
19568
+        /* phase 2 */
19569
+
19570
+        tmp11 = tmp5 + tmp6;
19571
+        tmp12 = tmp6 + tmp7;
19572
+        /* The rotator is modified from fig 4-8 to avoid extra negations. */
19573
+
19574
+        var z5 = (tmp10 - tmp12) * 0.382683433;
19575
+        /* c6 */
19576
+
19577
+        var z2 = 0.541196100 * tmp10 + z5;
19578
+        /* c2-c6 */
19579
+
19580
+        var z4 = 1.306562965 * tmp12 + z5;
19581
+        /* c2+c6 */
19582
+
19583
+        var z3 = tmp11 * 0.707106781;
19584
+        /* c4 */
19585
+
19586
+        var z11 = tmp7 + z3;
19587
+        /* phase 5 */
19588
+
19589
+        var z13 = tmp7 - z3;
19590
+        data[dataOff + 5] = z13 + z2;
19591
+        /* phase 6 */
19592
+
19593
+        data[dataOff + 3] = z13 - z2;
19594
+        data[dataOff + 1] = z11 + z4;
19595
+        data[dataOff + 7] = z11 - z4;
19596
+        dataOff += 8;
19597
+        /* advance pointer to next row */
19598
+      }
19599
+      /* Pass 2: process columns. */
19600
+
19601
+
19602
+      dataOff = 0;
19603
+
19604
+      for (i = 0; i < I8; ++i) {
19605
+        d0 = data[dataOff];
19606
+        d1 = data[dataOff + 8];
19607
+        d2 = data[dataOff + 16];
19608
+        d3 = data[dataOff + 24];
19609
+        d4 = data[dataOff + 32];
19610
+        d5 = data[dataOff + 40];
19611
+        d6 = data[dataOff + 48];
19612
+        d7 = data[dataOff + 56];
19613
+        var tmp0p2 = d0 + d7;
19614
+        var tmp7p2 = d0 - d7;
19615
+        var tmp1p2 = d1 + d6;
19616
+        var tmp6p2 = d1 - d6;
19617
+        var tmp2p2 = d2 + d5;
19618
+        var tmp5p2 = d2 - d5;
19619
+        var tmp3p2 = d3 + d4;
19620
+        var tmp4p2 = d3 - d4;
19621
+        /* Even part */
19622
+
19623
+        var tmp10p2 = tmp0p2 + tmp3p2;
19624
+        /* phase 2 */
19625
+
19626
+        var tmp13p2 = tmp0p2 - tmp3p2;
19627
+        var tmp11p2 = tmp1p2 + tmp2p2;
19628
+        var tmp12p2 = tmp1p2 - tmp2p2;
19629
+        data[dataOff] = tmp10p2 + tmp11p2;
19630
+        /* phase 3 */
19631
+
19632
+        data[dataOff + 32] = tmp10p2 - tmp11p2;
19633
+        var z1p2 = (tmp12p2 + tmp13p2) * 0.707106781;
19634
+        /* c4 */
19635
+
19636
+        data[dataOff + 16] = tmp13p2 + z1p2;
19637
+        /* phase 5 */
19638
+
19639
+        data[dataOff + 48] = tmp13p2 - z1p2;
19640
+        /* Odd part */
19641
+
19642
+        tmp10p2 = tmp4p2 + tmp5p2;
19643
+        /* phase 2 */
19644
+
19645
+        tmp11p2 = tmp5p2 + tmp6p2;
19646
+        tmp12p2 = tmp6p2 + tmp7p2;
19647
+        /* The rotator is modified from fig 4-8 to avoid extra negations. */
19648
+
19649
+        var z5p2 = (tmp10p2 - tmp12p2) * 0.382683433;
19650
+        /* c6 */
19651
+
19652
+        var z2p2 = 0.541196100 * tmp10p2 + z5p2;
19653
+        /* c2-c6 */
19654
+
19655
+        var z4p2 = 1.306562965 * tmp12p2 + z5p2;
19656
+        /* c2+c6 */
19657
+
19658
+        var z3p2 = tmp11p2 * 0.707106781;
19659
+        /* c4 */
19660
+
19661
+        var z11p2 = tmp7p2 + z3p2;
19662
+        /* phase 5 */
19663
+
19664
+        var z13p2 = tmp7p2 - z3p2;
19665
+        data[dataOff + 40] = z13p2 + z2p2;
19666
+        /* phase 6 */
19667
+
19668
+        data[dataOff + 24] = z13p2 - z2p2;
19669
+        data[dataOff + 8] = z11p2 + z4p2;
19670
+        data[dataOff + 56] = z11p2 - z4p2;
19671
+        dataOff++;
19672
+        /* advance pointer to next column */
19673
+      } // Quantize/descale the coefficients
19674
+
19675
+
19676
+      var fDCTQuant;
19677
+
19678
+      for (i = 0; i < I64; ++i) {
19679
+        // Apply the quantization and scaling factor & Round to nearest integer
19680
+        fDCTQuant = data[i] * fdtbl[i];
19681
+        outputfDCTQuant[i] = fDCTQuant > 0.0 ? fDCTQuant + 0.5 | 0 : fDCTQuant - 0.5 | 0; //outputfDCTQuant[i] = fround(fDCTQuant);
19682
+      }
19683
+
19684
+      return outputfDCTQuant;
19685
+    }
19686
+
19687
+    function writeAPP0() {
19688
+      writeWord(0xFFE0); // marker
19689
+
19690
+      writeWord(16); // length
19691
+
19692
+      writeByte(0x4A); // J
19693
+
19694
+      writeByte(0x46); // F
19695
+
19696
+      writeByte(0x49); // I
19697
+
19698
+      writeByte(0x46); // F
19699
+
19700
+      writeByte(0); // = "JFIF",'\0'
19701
+
19702
+      writeByte(1); // versionhi
19703
+
19704
+      writeByte(1); // versionlo
19705
+
19706
+      writeByte(0); // xyunits
19707
+
19708
+      writeWord(1); // xdensity
19709
+
19710
+      writeWord(1); // ydensity
19711
+
19712
+      writeByte(0); // thumbnwidth
19713
+
19714
+      writeByte(0); // thumbnheight
19715
+    }
19716
+
19717
+    function writeSOF0(width, height) {
19718
+      writeWord(0xFFC0); // marker
19719
+
19720
+      writeWord(17); // length, truecolor YUV JPG
19721
+
19722
+      writeByte(8); // precision
19723
+
19724
+      writeWord(height);
19725
+      writeWord(width);
19726
+      writeByte(3); // nrofcomponents
19727
+
19728
+      writeByte(1); // IdY
19729
+
19730
+      writeByte(0x11); // HVY
19731
+
19732
+      writeByte(0); // QTY
19733
+
19734
+      writeByte(2); // IdU
19735
+
19736
+      writeByte(0x11); // HVU
19737
+
19738
+      writeByte(1); // QTU
19739
+
19740
+      writeByte(3); // IdV
19741
+
19742
+      writeByte(0x11); // HVV
19743
+
19744
+      writeByte(1); // QTV
19745
+    }
19746
+
19747
+    function writeDQT() {
19748
+      writeWord(0xFFDB); // marker
19749
+
19750
+      writeWord(132); // length
19751
+
19752
+      writeByte(0);
19753
+
19754
+      for (var i = 0; i < 64; i++) {
19755
+        writeByte(YTable[i]);
19756
+      }
19757
+
19758
+      writeByte(1);
19759
+
19760
+      for (var j = 0; j < 64; j++) {
19761
+        writeByte(UVTable[j]);
19762
+      }
19763
+    }
19764
+
19765
+    function writeDHT() {
19766
+      writeWord(0xFFC4); // marker
19767
+
19768
+      writeWord(0x01A2); // length
19769
+
19770
+      writeByte(0); // HTYDCinfo
19771
+
19772
+      for (var i = 0; i < 16; i++) {
19773
+        writeByte(std_dc_luminance_nrcodes[i + 1]);
19774
+      }
19775
+
19776
+      for (var j = 0; j <= 11; j++) {
19777
+        writeByte(std_dc_luminance_values[j]);
19778
+      }
19779
+
19780
+      writeByte(0x10); // HTYACinfo
19781
+
19782
+      for (var k = 0; k < 16; k++) {
19783
+        writeByte(std_ac_luminance_nrcodes[k + 1]);
19784
+      }
19785
+
19786
+      for (var l = 0; l <= 161; l++) {
19787
+        writeByte(std_ac_luminance_values[l]);
19788
+      }
19789
+
19790
+      writeByte(1); // HTUDCinfo
19791
+
19792
+      for (var m = 0; m < 16; m++) {
19793
+        writeByte(std_dc_chrominance_nrcodes[m + 1]);
19794
+      }
19795
+
19796
+      for (var n = 0; n <= 11; n++) {
19797
+        writeByte(std_dc_chrominance_values[n]);
19798
+      }
19799
+
19800
+      writeByte(0x11); // HTUACinfo
19801
+
19802
+      for (var o = 0; o < 16; o++) {
19803
+        writeByte(std_ac_chrominance_nrcodes[o + 1]);
19804
+      }
19805
+
19806
+      for (var p = 0; p <= 161; p++) {
19807
+        writeByte(std_ac_chrominance_values[p]);
19808
+      }
19809
+    }
19810
+
19811
+    function writeSOS() {
19812
+      writeWord(0xFFDA); // marker
19813
+
19814
+      writeWord(12); // length
19815
+
19816
+      writeByte(3); // nrofcomponents
19817
+
19818
+      writeByte(1); // IdY
19819
+
19820
+      writeByte(0); // HTY
19821
+
19822
+      writeByte(2); // IdU
19823
+
19824
+      writeByte(0x11); // HTU
19825
+
19826
+      writeByte(3); // IdV
19827
+
19828
+      writeByte(0x11); // HTV
19829
+
19830
+      writeByte(0); // Ss
19831
+
19832
+      writeByte(0x3f); // Se
19833
+
19834
+      writeByte(0); // Bf
19835
+    }
19836
+
19837
+    function processDU(CDU, fdtbl, DC, HTDC, HTAC) {
19838
+      var EOB = HTAC[0x00];
19839
+      var M16zeroes = HTAC[0xF0];
19840
+      var pos;
19841
+      var I16 = 16;
19842
+      var I63 = 63;
19843
+      var I64 = 64;
19844
+      var DU_DCT = fDCTQuant(CDU, fdtbl); //ZigZag reorder
19845
+
19846
+      for (var j = 0; j < I64; ++j) {
19847
+        DU[ZigZag[j]] = DU_DCT[j];
19848
+      }
19849
+
19850
+      var Diff = DU[0] - DC;
19851
+      DC = DU[0]; //Encode DC
19852
+
19853
+      if (Diff == 0) {
19854
+        writeBits(HTDC[0]); // Diff might be 0
19855
+      } else {
19856
+        pos = 32767 + Diff;
19857
+        writeBits(HTDC[category[pos]]);
19858
+        writeBits(bitcode[pos]);
19859
+      } //Encode ACs
19860
+
19861
+
19862
+      var end0pos = 63; // was const... which is crazy
19863
+
19864
+      for (; end0pos > 0 && DU[end0pos] == 0; end0pos--) {}
19865
+
19866
+      if (end0pos == 0) {
19867
+        writeBits(EOB);
19868
+        return DC;
19869
+      }
19870
+
19871
+      var i = 1;
19872
+      var lng;
19873
+
19874
+      while (i <= end0pos) {
19875
+        var startpos = i;
19876
+
19877
+        for (; DU[i] == 0 && i <= end0pos; ++i) {}
19878
+
19879
+        var nrzeroes = i - startpos;
19880
+
19881
+        if (nrzeroes >= I16) {
19882
+          lng = nrzeroes >> 4;
19883
+
19884
+          for (var nrmarker = 1; nrmarker <= lng; ++nrmarker) {
19885
+            writeBits(M16zeroes);
19886
+          }
19887
+
19888
+          nrzeroes = nrzeroes & 0xF;
19889
+        }
19890
+
19891
+        pos = 32767 + DU[i];
19892
+        writeBits(HTAC[(nrzeroes << 4) + category[pos]]);
19893
+        writeBits(bitcode[pos]);
19894
+        i++;
19895
+      }
19896
+
19897
+      if (end0pos != I63) {
19898
+        writeBits(EOB);
19899
+      }
19900
+
19901
+      return DC;
19902
+    }
19903
+
19904
+    function initCharLookupTable() {
19905
+      var sfcc = String.fromCharCode;
19906
+
19907
+      for (var i = 0; i < 256; i++) {
19908
+        ///// ACHTUNG // 255
19909
+        clt[i] = sfcc(i);
19910
+      }
19911
+    }
19912
+
19913
+    this.encode = function (image, quality) // image data object
19914
+    {
19915
+      var time_start = new Date().getTime();
19916
+      if (quality) setQuality(quality); // Initialize bit writer
19917
+
19918
+      byteout = new Array();
19919
+      bytenew = 0;
19920
+      bytepos = 7; // Add JPEG headers
19921
+
19922
+      writeWord(0xFFD8); // SOI
19923
+
19924
+      writeAPP0();
19925
+      writeDQT();
19926
+      writeSOF0(image.width, image.height);
19927
+      writeDHT();
19928
+      writeSOS(); // Encode 8x8 macroblocks
19929
+
19930
+      var DCY = 0;
19931
+      var DCU = 0;
19932
+      var DCV = 0;
19933
+      bytenew = 0;
19934
+      bytepos = 7;
19935
+      this.encode.displayName = "_encode_";
19936
+      var imageData = image.data;
19937
+      var width = image.width;
19938
+      var height = image.height;
19939
+      var quadWidth = width * 4;
19940
+      var x,
19941
+          y = 0;
19942
+      var r, g, b;
19943
+      var start, p, col, row, pos;
19944
+
19945
+      while (y < height) {
19946
+        x = 0;
19947
+
19948
+        while (x < quadWidth) {
19949
+          start = quadWidth * y + x;
19950
+          p = start;
19951
+          col = -1;
19952
+          row = 0;
19953
+
19954
+          for (pos = 0; pos < 64; pos++) {
19955
+            row = pos >> 3; // /8
19956
+
19957
+            col = (pos & 7) * 4; // %8
19958
+
19959
+            p = start + row * quadWidth + col;
19960
+
19961
+            if (y + row >= height) {
19962
+              // padding bottom
19963
+              p -= quadWidth * (y + 1 + row - height);
19964
+            }
19965
+
19966
+            if (x + col >= quadWidth) {
19967
+              // padding right	
19968
+              p -= x + col - quadWidth + 4;
19969
+            }
19970
+
19971
+            r = imageData[p++];
19972
+            g = imageData[p++];
19973
+            b = imageData[p++];
19974
+            /* // calculate YUV values dynamically
19975
+            YDU[pos]=((( 0.29900)*r+( 0.58700)*g+( 0.11400)*b))-128; //-0x80
19976
+            UDU[pos]=(((-0.16874)*r+(-0.33126)*g+( 0.50000)*b));
19977
+            VDU[pos]=((( 0.50000)*r+(-0.41869)*g+(-0.08131)*b));
19978
+            */
19979
+            // use lookup table (slightly faster)
19980
+
19981
+            YDU[pos] = (RGB_YUV_TABLE[r] + RGB_YUV_TABLE[g + 256 >> 0] + RGB_YUV_TABLE[b + 512 >> 0] >> 16) - 128;
19982
+            UDU[pos] = (RGB_YUV_TABLE[r + 768 >> 0] + RGB_YUV_TABLE[g + 1024 >> 0] + RGB_YUV_TABLE[b + 1280 >> 0] >> 16) - 128;
19983
+            VDU[pos] = (RGB_YUV_TABLE[r + 1280 >> 0] + RGB_YUV_TABLE[g + 1536 >> 0] + RGB_YUV_TABLE[b + 1792 >> 0] >> 16) - 128;
19984
+          }
19985
+
19986
+          DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);
19987
+          DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
19988
+          DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
19989
+          x += 32;
19990
+        }
19991
+
19992
+        y += 8;
19993
+      } ////////////////////////////////////////////////////////////////
19994
+      // Do the bit alignment of the EOI marker
19995
+
19996
+
19997
+      if (bytepos >= 0) {
19998
+        var fillbits = [];
19999
+        fillbits[1] = bytepos + 1;
20000
+        fillbits[0] = (1 << bytepos + 1) - 1;
20001
+        writeBits(fillbits);
20002
+      }
20003
+
20004
+      writeWord(0xFFD9); //EOI
20005
+
20006
+      return new Uint8Array(byteout);
20007
+    };
20008
+
20009
+    function setQuality(quality) {
20010
+      if (quality <= 0) {
20011
+        quality = 1;
20012
+      }
20013
+
20014
+      if (quality > 100) {
20015
+        quality = 100;
20016
+      }
20017
+
20018
+      if (currentQuality == quality) return; // don't recalc if unchanged
20019
+
20020
+      var sf = 0;
20021
+
20022
+      if (quality < 50) {
20023
+        sf = Math.floor(5000 / quality);
20024
+      } else {
20025
+        sf = Math.floor(200 - quality * 2);
20026
+      }
20027
+
20028
+      initQuantTables(sf);
20029
+      currentQuality = quality; //console.log('Quality set to: '+quality +'%');
20030
+    }
20031
+
20032
+    function init() {
20033
+      var time_start = new Date().getTime();
20034
+      if (!quality) quality = 50; // Create tables
20035
+
20036
+      initCharLookupTable();
20037
+      initHuffmanTbl();
20038
+      initCategoryNumber();
20039
+      initRGBYUVTable();
20040
+      setQuality(quality);
20041
+      var duration = new Date().getTime() - time_start; //console.log('Initialization '+ duration + 'ms');
20042
+    }
20043
+
20044
+    init();
20045
+  }
20046
+  /*rollup-keeper-start*/
20047
+
20048
+  window.tmp = JPEGEncoder;
20049
+  /*rollup-keeper-end*/
20050
+
20051
+  /**
20052
+   * @author shaozilee
20053
+   *
20054
+   * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp
20055
+   *
20056
+   */
20057
+  function BmpDecoder(buffer, is_with_alpha) {
20058
+    this.pos = 0;
20059
+    this.buffer = buffer;
20060
+    this.datav = new DataView(buffer.buffer);
20061
+    this.is_with_alpha = !!is_with_alpha;
20062
+    this.bottom_up = true;
20063
+    this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]);
20064
+    this.pos += 2;
20065
+    if (["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag) === -1) throw new Error("Invalid BMP File");
20066
+    this.parseHeader();
20067
+    this.parseBGR();
20068
+  }
20069
+
20070
+  BmpDecoder.prototype.parseHeader = function () {
20071
+    this.fileSize = this.datav.getUint32(this.pos, true);
20072
+    this.pos += 4;
20073
+    this.reserved = this.datav.getUint32(this.pos, true);
20074
+    this.pos += 4;
20075
+    this.offset = this.datav.getUint32(this.pos, true);
20076
+    this.pos += 4;
20077
+    this.headerSize = this.datav.getUint32(this.pos, true);
20078
+    this.pos += 4;
20079
+    this.width = this.datav.getUint32(this.pos, true);
20080
+    this.pos += 4;
20081
+    this.height = this.datav.getInt32(this.pos, true);
20082
+    this.pos += 4;
20083
+    this.planes = this.datav.getUint16(this.pos, true);
20084
+    this.pos += 2;
20085
+    this.bitPP = this.datav.getUint16(this.pos, true);
20086
+    this.pos += 2;
20087
+    this.compress = this.datav.getUint32(this.pos, true);
20088
+    this.pos += 4;
20089
+    this.rawSize = this.datav.getUint32(this.pos, true);
20090
+    this.pos += 4;
20091
+    this.hr = this.datav.getUint32(this.pos, true);
20092
+    this.pos += 4;
20093
+    this.vr = this.datav.getUint32(this.pos, true);
20094
+    this.pos += 4;
20095
+    this.colors = this.datav.getUint32(this.pos, true);
20096
+    this.pos += 4;
20097
+    this.importantColors = this.datav.getUint32(this.pos, true);
20098
+    this.pos += 4;
20099
+
20100
+    if (this.bitPP === 16 && this.is_with_alpha) {
20101
+      this.bitPP = 15;
20102
+    }
20103
+
20104
+    if (this.bitPP < 15) {
20105
+      var len = this.colors === 0 ? 1 << this.bitPP : this.colors;
20106
+      this.palette = new Array(len);
20107
+
20108
+      for (var i = 0; i < len; i++) {
20109
+        var blue = this.datav.getUint8(this.pos++, true);
20110
+        var green = this.datav.getUint8(this.pos++, true);
20111
+        var red = this.datav.getUint8(this.pos++, true);
20112
+        var quad = this.datav.getUint8(this.pos++, true);
20113
+        this.palette[i] = {
20114
+          red: red,
20115
+          green: green,
20116
+          blue: blue,
20117
+          quad: quad
20118
+        };
20119
+      }
20120
+    }
20121
+
20122
+    if (this.height < 0) {
20123
+      this.height *= -1;
20124
+      this.bottom_up = false;
20125
+    }
20126
+  };
20127
+
20128
+  BmpDecoder.prototype.parseBGR = function () {
20129
+    this.pos = this.offset;
20130
+
20131
+    try {
20132
+      var bitn = "bit" + this.bitPP;
20133
+      var len = this.width * this.height * 4;
20134
+      this.data = new Uint8Array(len);
20135
+      this[bitn]();
20136
+    } catch (e) {
20137
+      console.log("bit decode error:" + e);
20138
+    }
20139
+  };
20140
+
20141
+  BmpDecoder.prototype.bit1 = function () {
20142
+    var xlen = Math.ceil(this.width / 8);
20143
+    var mode = xlen % 4;
20144
+    var y = this.height >= 0 ? this.height - 1 : -this.height;
20145
+
20146
+    for (var y = this.height - 1; y >= 0; y--) {
20147
+      var line = this.bottom_up ? y : this.height - 1 - y;
20148
+
20149
+      for (var x = 0; x < xlen; x++) {
20150
+        var b = this.datav.getUint8(this.pos++, true);
20151
+        var location = line * this.width * 4 + x * 8 * 4;
20152
+
20153
+        for (var i = 0; i < 8; i++) {
20154
+          if (x * 8 + i < this.width) {
20155
+            var rgb = this.palette[b >> 7 - i & 0x1];
20156
+            this.data[location + i * 4] = rgb.blue;
20157
+            this.data[location + i * 4 + 1] = rgb.green;
20158
+            this.data[location + i * 4 + 2] = rgb.red;
20159
+            this.data[location + i * 4 + 3] = 0xFF;
20160
+          } else {
20161
+            break;
20162
+          }
20163
+        }
20164
+      }
20165
+
20166
+      if (mode != 0) {
20167
+        this.pos += 4 - mode;
20168
+      }
20169
+    }
20170
+  };
20171
+
20172
+  BmpDecoder.prototype.bit4 = function () {
20173
+    var xlen = Math.ceil(this.width / 2);
20174
+    var mode = xlen % 4;
20175
+
20176
+    for (var y = this.height - 1; y >= 0; y--) {
20177
+      var line = this.bottom_up ? y : this.height - 1 - y;
20178
+
20179
+      for (var x = 0; x < xlen; x++) {
20180
+        var b = this.datav.getUint8(this.pos++, true);
20181
+        var location = line * this.width * 4 + x * 2 * 4;
20182
+        var before = b >> 4;
20183
+        var after = b & 0x0F;
20184
+        var rgb = this.palette[before];
20185
+        this.data[location] = rgb.blue;
20186
+        this.data[location + 1] = rgb.green;
20187
+        this.data[location + 2] = rgb.red;
20188
+        this.data[location + 3] = 0xFF;
20189
+        if (x * 2 + 1 >= this.width) break;
20190
+        rgb = this.palette[after];
20191
+        this.data[location + 4] = rgb.blue;
20192
+        this.data[location + 4 + 1] = rgb.green;
20193
+        this.data[location + 4 + 2] = rgb.red;
20194
+        this.data[location + 4 + 3] = 0xFF;
20195
+      }
20196
+
20197
+      if (mode != 0) {
20198
+        this.pos += 4 - mode;
20199
+      }
20200
+    }
20201
+  };
20202
+
20203
+  BmpDecoder.prototype.bit8 = function () {
20204
+    var mode = this.width % 4;
20205
+
20206
+    for (var y = this.height - 1; y >= 0; y--) {
20207
+      var line = this.bottom_up ? y : this.height - 1 - y;
20208
+
20209
+      for (var x = 0; x < this.width; x++) {
20210
+        var b = this.datav.getUint8(this.pos++, true);
20211
+        var location = line * this.width * 4 + x * 4;
20212
+
20213
+        if (b < this.palette.length) {
20214
+          var rgb = this.palette[b];
20215
+          this.data[location] = rgb.red;
20216
+          this.data[location + 1] = rgb.green;
20217
+          this.data[location + 2] = rgb.blue;
20218
+          this.data[location + 3] = 0xFF;
20219
+        } else {
20220
+          this.data[location] = 0xFF;
20221
+          this.data[location + 1] = 0xFF;
20222
+          this.data[location + 2] = 0xFF;
20223
+          this.data[location + 3] = 0xFF;
20224
+        }
20225
+      }
20226
+
20227
+      if (mode != 0) {
20228
+        this.pos += 4 - mode;
20229
+      }
20230
+    }
20231
+  };
20232
+
20233
+  BmpDecoder.prototype.bit15 = function () {
20234
+    var dif_w = this.width % 3;
20235
+
20236
+    var _11111 = parseInt("11111", 2),
20237
+        _1_5 = _11111;
20238
+
20239
+    for (var y = this.height - 1; y >= 0; y--) {
20240
+      var line = this.bottom_up ? y : this.height - 1 - y;
20241
+
20242
+      for (var x = 0; x < this.width; x++) {
20243
+        var B = this.datav.getUint16(this.pos, true);
20244
+        this.pos += 2;
20245
+        var blue = (B & _1_5) / _1_5 * 255 | 0;
20246
+        var green = (B >> 5 & _1_5) / _1_5 * 255 | 0;
20247
+        var red = (B >> 10 & _1_5) / _1_5 * 255 | 0;
20248
+        var alpha = B >> 15 ? 0xFF : 0x00;
20249
+        var location = line * this.width * 4 + x * 4;
20250
+        this.data[location] = red;
20251
+        this.data[location + 1] = green;
20252
+        this.data[location + 2] = blue;
20253
+        this.data[location + 3] = alpha;
20254
+      } //skip extra bytes
20255
+
20256
+
20257
+      this.pos += dif_w;
20258
+    }
20259
+  };
20260
+
20261
+  BmpDecoder.prototype.bit16 = function () {
20262
+    var dif_w = this.width % 3;
20263
+
20264
+    var _11111 = parseInt("11111", 2),
20265
+        _1_5 = _11111;
20266
+
20267
+    var _111111 = parseInt("111111", 2),
20268
+        _1_6 = _111111;
20269
+
20270
+    for (var y = this.height - 1; y >= 0; y--) {
20271
+      var line = this.bottom_up ? y : this.height - 1 - y;
20272
+
20273
+      for (var x = 0; x < this.width; x++) {
20274
+        var B = this.datav.getUint16(this.pos, true);
20275
+        this.pos += 2;
20276
+        var alpha = 0xFF;
20277
+        var blue = (B & _1_5) / _1_5 * 255 | 0;
20278
+        var green = (B >> 5 & _1_6) / _1_6 * 255 | 0;
20279
+        var red = (B >> 11) / _1_5 * 255 | 0;
20280
+        var location = line * this.width * 4 + x * 4;
20281
+        this.data[location] = red;
20282
+        this.data[location + 1] = green;
20283
+        this.data[location + 2] = blue;
20284
+        this.data[location + 3] = alpha;
20285
+      } //skip extra bytes
20286
+
20287
+
20288
+      this.pos += dif_w;
20289
+    }
20290
+  };
20291
+
20292
+  BmpDecoder.prototype.bit24 = function () {
20293
+    //when height > 0
20294
+    for (var y = this.height - 1; y >= 0; y--) {
20295
+      var line = this.bottom_up ? y : this.height - 1 - y;
20296
+
20297
+      for (var x = 0; x < this.width; x++) {
20298
+        var blue = this.datav.getUint8(this.pos++, true);
20299
+        var green = this.datav.getUint8(this.pos++, true);
20300
+        var red = this.datav.getUint8(this.pos++, true);
20301
+        var location = line * this.width * 4 + x * 4;
20302
+        this.data[location] = red;
20303
+        this.data[location + 1] = green;
20304
+        this.data[location + 2] = blue;
20305
+        this.data[location + 3] = 0xFF;
20306
+      } //skip extra bytes
20307
+
20308
+
20309
+      this.pos += this.width % 4;
20310
+    }
20311
+  };
20312
+  /**
20313
+   * add 32bit decode func
20314
+   * @author soubok
20315
+   */
20316
+
20317
+
20318
+  BmpDecoder.prototype.bit32 = function () {
20319
+    //when height > 0
20320
+    for (var y = this.height - 1; y >= 0; y--) {
20321
+      var line = this.bottom_up ? y : this.height - 1 - y;
20322
+
20323
+      for (var x = 0; x < this.width; x++) {
20324
+        var blue = this.datav.getUint8(this.pos++, true);
20325
+        var green = this.datav.getUint8(this.pos++, true);
20326
+        var red = this.datav.getUint8(this.pos++, true);
20327
+        var alpha = this.datav.getUint8(this.pos++, true);
20328
+        var location = line * this.width * 4 + x * 4;
20329
+        this.data[location] = red;
20330
+        this.data[location + 1] = green;
20331
+        this.data[location + 2] = blue;
20332
+        this.data[location + 3] = alpha;
20333
+      } //skip extra bytes
20334
+      //this.pos += (this.width % 4);
20335
+
20336
+    }
20337
+  };
20338
+
20339
+  BmpDecoder.prototype.getData = function () {
20340
+    return this.data;
20341
+  };
20342
+  /*rollup-keeper-start*/
20343
+
20344
+
20345
+  window.tmp = BmpDecoder;
20346
+  /*rollup-keeper-end*/
20347
+
20348
+  /*
20349
+   Copyright (c) 2013 Gildas Lormeau. All rights reserved.
20350
+
20351
+   Redistribution and use in source and binary forms, with or without
20352
+   modification, are permitted provided that the following conditions are met:
20353
+
20354
+   1. Redistributions of source code must retain the above copyright notice,
20355
+   this list of conditions and the following disclaimer.
20356
+
20357
+   2. Redistributions in binary form must reproduce the above copyright 
20358
+   notice, this list of conditions and the following disclaimer in 
20359
+   the documentation and/or other materials provided with the distribution.
20360
+
20361
+   3. The names of the authors may not be used to endorse or promote products
20362
+   derived from this software without specific prior written permission.
20363
+
20364
+   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
20365
+   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20366
+   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20367
+   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
20368
+   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20369
+   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20370
+   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
20371
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20372
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20373
+   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20374
+   */
20375
+
20376
+  /*
20377
+   * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.
20378
+   * JZlib is based on zlib-1.1.3, so all credit should go authors
20379
+   * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
20380
+   * and contributors of zlib.
20381
+   */
20382
+  (function (global) {
20383
+
20384
+    var MAX_BITS = 15;
20385
+    var D_CODES = 30;
20386
+    var BL_CODES = 19;
20387
+    var LENGTH_CODES = 29;
20388
+    var LITERALS = 256;
20389
+    var L_CODES = LITERALS + 1 + LENGTH_CODES;
20390
+    var HEAP_SIZE = 2 * L_CODES + 1;
20391
+    var END_BLOCK = 256; // Bit length codes must not exceed MAX_BL_BITS bits
20392
+
20393
+    var MAX_BL_BITS = 7; // repeat previous bit length 3-6 times (2 bits of repeat count)
20394
+
20395
+    var REP_3_6 = 16; // repeat a zero length 3-10 times (3 bits of repeat count)
20396
+
20397
+    var REPZ_3_10 = 17; // repeat a zero length 11-138 times (7 bits of repeat count)
20398
+
20399
+    var REPZ_11_138 = 18; // The lengths of the bit length codes are sent in order of decreasing
20400
+    // probability, to avoid transmitting the lengths for unused bit
20401
+    // length codes.
20402
+
20403
+    var Buf_size = 8 * 2; // JZlib version : "1.0.2"
20404
+
20405
+    var Z_DEFAULT_COMPRESSION = -1; // compression strategy
20406
+
20407
+    var Z_FILTERED = 1;
20408
+    var Z_HUFFMAN_ONLY = 2;
20409
+    var Z_DEFAULT_STRATEGY = 0;
20410
+    var Z_NO_FLUSH = 0;
20411
+    var Z_PARTIAL_FLUSH = 1;
20412
+    var Z_FULL_FLUSH = 3;
20413
+    var Z_FINISH = 4;
20414
+    var Z_OK = 0;
20415
+    var Z_STREAM_END = 1;
20416
+    var Z_NEED_DICT = 2;
20417
+    var Z_STREAM_ERROR = -2;
20418
+    var Z_DATA_ERROR = -3;
20419
+    var Z_BUF_ERROR = -5; // Tree
20420
+    // see definition of array dist_code below
20421
+
20422
+    var _dist_code = [0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29];
20423
+
20424
+    function Tree() {
20425
+      var that = this; // dyn_tree; // the dynamic tree
20426
+      // max_code; // largest code with non zero frequency
20427
+      // stat_desc; // the corresponding static tree
20428
+      // Compute the optimal bit lengths for a tree and update the total bit
20429
+      // length
20430
+      // for the current block.
20431
+      // IN assertion: the fields freq and dad are set, heap[heap_max] and
20432
+      // above are the tree nodes sorted by increasing frequency.
20433
+      // OUT assertions: the field len is set to the optimal bit length, the
20434
+      // array bl_count contains the frequencies for each bit length.
20435
+      // The length opt_len is updated; static_len is also updated if stree is
20436
+      // not null.
20437
+
20438
+      function gen_bitlen(s) {
20439
+        var tree = that.dyn_tree;
20440
+        var stree = that.stat_desc.static_tree;
20441
+        var extra = that.stat_desc.extra_bits;
20442
+        var base = that.stat_desc.extra_base;
20443
+        var max_length = that.stat_desc.max_length;
20444
+        var h; // heap index
20445
+
20446
+        var n, m; // iterate over the tree elements
20447
+
20448
+        var bits; // bit length
20449
+
20450
+        var xbits; // extra bits
20451
+
20452
+        var f; // frequency
20453
+
20454
+        var overflow = 0; // number of elements with bit length too large
20455
+
20456
+        for (bits = 0; bits <= MAX_BITS; bits++) {
20457
+          s.bl_count[bits] = 0;
20458
+        } // In a first pass, compute the optimal bit lengths (which may
20459
+        // overflow in the case of the bit length tree).
20460
+
20461
+
20462
+        tree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap
20463
+
20464
+        for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
20465
+          n = s.heap[h];
20466
+          bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
20467
+
20468
+          if (bits > max_length) {
20469
+            bits = max_length;
20470
+            overflow++;
20471
+          }
20472
+
20473
+          tree[n * 2 + 1] = bits; // We overwrite tree[n*2+1] which is no longer needed
20474
+
20475
+          if (n > that.max_code) continue; // not a leaf node
20476
+
20477
+          s.bl_count[bits]++;
20478
+          xbits = 0;
20479
+          if (n >= base) xbits = extra[n - base];
20480
+          f = tree[n * 2];
20481
+          s.opt_len += f * (bits + xbits);
20482
+          if (stree) s.static_len += f * (stree[n * 2 + 1] + xbits);
20483
+        }
20484
+
20485
+        if (overflow === 0) return; // This happens for example on obj2 and pic of the Calgary corpus
20486
+        // Find the first bit length which could increase:
20487
+
20488
+        do {
20489
+          bits = max_length - 1;
20490
+
20491
+          while (s.bl_count[bits] === 0) {
20492
+            bits--;
20493
+          }
20494
+
20495
+          s.bl_count[bits]--; // move one leaf down the tree
20496
+
20497
+          s.bl_count[bits + 1] += 2; // move one overflow item as its brother
20498
+
20499
+          s.bl_count[max_length]--; // The brother of the overflow item also moves one step up,
20500
+          // but this does not affect bl_count[max_length]
20501
+
20502
+          overflow -= 2;
20503
+        } while (overflow > 0);
20504
+
20505
+        for (bits = max_length; bits !== 0; bits--) {
20506
+          n = s.bl_count[bits];
20507
+
20508
+          while (n !== 0) {
20509
+            m = s.heap[--h];
20510
+            if (m > that.max_code) continue;
20511
+
20512
+            if (tree[m * 2 + 1] != bits) {
20513
+              s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
20514
+              tree[m * 2 + 1] = bits;
20515
+            }
20516
+
20517
+            n--;
20518
+          }
20519
+        }
20520
+      } // Reverse the first len bits of a code, using straightforward code (a
20521
+      // faster
20522
+      // method would use a table)
20523
+      // IN assertion: 1 <= len <= 15
20524
+
20525
+
20526
+      function bi_reverse(code, // the value to invert
20527
+      len // its bit length
20528
+      ) {
20529
+        var res = 0;
20530
+
20531
+        do {
20532
+          res |= code & 1;
20533
+          code >>>= 1;
20534
+          res <<= 1;
20535
+        } while (--len > 0);
20536
+
20537
+        return res >>> 1;
20538
+      } // Generate the codes for a given tree and bit counts (which need not be
20539
+      // optimal).
20540
+      // IN assertion: the array bl_count contains the bit length statistics for
20541
+      // the given tree and the field len is set for all tree elements.
20542
+      // OUT assertion: the field code is set for all tree elements of non
20543
+      // zero code length.
20544
+
20545
+
20546
+      function gen_codes(tree, // the tree to decorate
20547
+      max_code, // largest code with non zero frequency
20548
+      bl_count // number of codes at each bit length
20549
+      ) {
20550
+        var next_code = []; // next code value for each
20551
+        // bit length
20552
+
20553
+        var code = 0; // running code value
20554
+
20555
+        var bits; // bit index
20556
+
20557
+        var n; // code index
20558
+
20559
+        var len; // The distribution counts are first used to generate the code values
20560
+        // without bit reversal.
20561
+
20562
+        for (bits = 1; bits <= MAX_BITS; bits++) {
20563
+          next_code[bits] = code = code + bl_count[bits - 1] << 1;
20564
+        } // Check that the bit counts in bl_count are consistent. The last code
20565
+        // must be all ones.
20566
+        // Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
20567
+        // "inconsistent bit counts");
20568
+        // Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
20569
+
20570
+
20571
+        for (n = 0; n <= max_code; n++) {
20572
+          len = tree[n * 2 + 1];
20573
+          if (len === 0) continue; // Now reverse the bits
20574
+
20575
+          tree[n * 2] = bi_reverse(next_code[len]++, len);
20576
+        }
20577
+      } // Construct one Huffman tree and assigns the code bit strings and lengths.
20578
+      // Update the total bit length for the current block.
20579
+      // IN assertion: the field freq is set for all tree elements.
20580
+      // OUT assertions: the fields len and code are set to the optimal bit length
20581
+      // and corresponding code. The length opt_len is updated; static_len is
20582
+      // also updated if stree is not null. The field max_code is set.
20583
+
20584
+
20585
+      that.build_tree = function (s) {
20586
+        var tree = that.dyn_tree;
20587
+        var stree = that.stat_desc.static_tree;
20588
+        var elems = that.stat_desc.elems;
20589
+        var n, m; // iterate over heap elements
20590
+
20591
+        var max_code = -1; // largest code with non zero frequency
20592
+
20593
+        var node; // new node being created
20594
+        // Construct the initial heap, with least frequent element in
20595
+        // heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
20596
+        // heap[0] is not used.
20597
+
20598
+        s.heap_len = 0;
20599
+        s.heap_max = HEAP_SIZE;
20600
+
20601
+        for (n = 0; n < elems; n++) {
20602
+          if (tree[n * 2] !== 0) {
20603
+            s.heap[++s.heap_len] = max_code = n;
20604
+            s.depth[n] = 0;
20605
+          } else {
20606
+            tree[n * 2 + 1] = 0;
20607
+          }
20608
+        } // The pkzip format requires that at least one distance code exists,
20609
+        // and that at least one bit should be sent even if there is only one
20610
+        // possible code. So to avoid special checks later on we force at least
20611
+        // two codes of non zero frequency.
20612
+
20613
+
20614
+        while (s.heap_len < 2) {
20615
+          node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
20616
+          tree[node * 2] = 1;
20617
+          s.depth[node] = 0;
20618
+          s.opt_len--;
20619
+          if (stree) s.static_len -= stree[node * 2 + 1]; // node is 0 or 1 so it does not have extra bits
20620
+        }
20621
+
20622
+        that.max_code = max_code; // The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
20623
+        // establish sub-heaps of increasing lengths:
20624
+
20625
+        for (n = Math.floor(s.heap_len / 2); n >= 1; n--) {
20626
+          s.pqdownheap(tree, n);
20627
+        } // Construct the Huffman tree by repeatedly combining the least two
20628
+        // frequent nodes.
20629
+
20630
+
20631
+        node = elems; // next internal node of the tree
20632
+
20633
+        do {
20634
+          // n = node of least frequency
20635
+          n = s.heap[1];
20636
+          s.heap[1] = s.heap[s.heap_len--];
20637
+          s.pqdownheap(tree, 1);
20638
+          m = s.heap[1]; // m = node of next least frequency
20639
+
20640
+          s.heap[--s.heap_max] = n; // keep the nodes sorted by frequency
20641
+
20642
+          s.heap[--s.heap_max] = m; // Create a new node father of n and m
20643
+
20644
+          tree[node * 2] = tree[n * 2] + tree[m * 2];
20645
+          s.depth[node] = Math.max(s.depth[n], s.depth[m]) + 1;
20646
+          tree[n * 2 + 1] = tree[m * 2 + 1] = node; // and insert the new node in the heap
20647
+
20648
+          s.heap[1] = node++;
20649
+          s.pqdownheap(tree, 1);
20650
+        } while (s.heap_len >= 2);
20651
+
20652
+        s.heap[--s.heap_max] = s.heap[1]; // At this point, the fields freq and dad are set. We can now
20653
+        // generate the bit lengths.
20654
+
20655
+        gen_bitlen(s); // The field len is now set, we can generate the bit codes
20656
+
20657
+        gen_codes(tree, that.max_code, s.bl_count);
20658
+      };
20659
+    }
20660
+
20661
+    Tree._length_code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28];
20662
+    Tree.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0];
20663
+    Tree.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576]; // Mapping from a distance to a distance code. dist is the distance - 1 and
20664
+    // must not have side effects. _dist_code[256] and _dist_code[257] are never
20665
+    // used.
20666
+
20667
+    Tree.d_code = function (dist) {
20668
+      return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
20669
+    }; // extra bits for each length code
20670
+
20671
+
20672
+    Tree.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]; // extra bits for each distance code
20673
+
20674
+    Tree.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]; // extra bits for each bit length code
20675
+
20676
+    Tree.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];
20677
+    Tree.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; // StaticTree
20678
+
20679
+    function StaticTree(static_tree, extra_bits, extra_base, elems, max_length) {
20680
+      var that = this;
20681
+      that.static_tree = static_tree;
20682
+      that.extra_bits = extra_bits;
20683
+      that.extra_base = extra_base;
20684
+      that.elems = elems;
20685
+      that.max_length = max_length;
20686
+    }
20687
+
20688
+    StaticTree.static_ltree = [12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8];
20689
+    StaticTree.static_dtree = [0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5];
20690
+    StaticTree.static_l_desc = new StaticTree(StaticTree.static_ltree, Tree.extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
20691
+    StaticTree.static_d_desc = new StaticTree(StaticTree.static_dtree, Tree.extra_dbits, 0, D_CODES, MAX_BITS);
20692
+    StaticTree.static_bl_desc = new StaticTree(null, Tree.extra_blbits, 0, BL_CODES, MAX_BL_BITS); // Deflate
20693
+
20694
+    var MAX_MEM_LEVEL = 9;
20695
+    var DEF_MEM_LEVEL = 8;
20696
+
20697
+    function Config(good_length, max_lazy, nice_length, max_chain, func) {
20698
+      var that = this;
20699
+      that.good_length = good_length;
20700
+      that.max_lazy = max_lazy;
20701
+      that.nice_length = nice_length;
20702
+      that.max_chain = max_chain;
20703
+      that.func = func;
20704
+    }
20705
+
20706
+    var STORED = 0;
20707
+    var FAST = 1;
20708
+    var SLOW = 2;
20709
+    var config_table = [new Config(0, 0, 0, 0, STORED), new Config(4, 4, 8, 4, FAST), new Config(4, 5, 16, 8, FAST), new Config(4, 6, 32, 32, FAST), new Config(4, 4, 16, 16, SLOW), new Config(8, 16, 32, 32, SLOW), new Config(8, 16, 128, 128, SLOW), new Config(8, 32, 128, 256, SLOW), new Config(32, 128, 258, 1024, SLOW), new Config(32, 258, 258, 4096, SLOW)];
20710
+    var z_errmsg = ["need dictionary", // Z_NEED_DICT
20711
+    // 2
20712
+    "stream end", // Z_STREAM_END 1
20713
+    "", // Z_OK 0
20714
+    "", // Z_ERRNO (-1)
20715
+    "stream error", // Z_STREAM_ERROR (-2)
20716
+    "data error", // Z_DATA_ERROR (-3)
20717
+    "", // Z_MEM_ERROR (-4)
20718
+    "buffer error", // Z_BUF_ERROR (-5)
20719
+    "", // Z_VERSION_ERROR (-6)
20720
+    ""]; // block not completed, need more input or more output
20721
+
20722
+    var NeedMore = 0; // block flush performed
20723
+
20724
+    var BlockDone = 1; // finish started, need only more output at next deflate
20725
+
20726
+    var FinishStarted = 2; // finish done, accept no more input or output
20727
+
20728
+    var FinishDone = 3; // preset dictionary flag in zlib header
20729
+
20730
+    var PRESET_DICT = 0x20;
20731
+    var INIT_STATE = 42;
20732
+    var BUSY_STATE = 113;
20733
+    var FINISH_STATE = 666; // The deflate compression method
20734
+
20735
+    var Z_DEFLATED = 8;
20736
+    var STORED_BLOCK = 0;
20737
+    var STATIC_TREES = 1;
20738
+    var DYN_TREES = 2;
20739
+    var MIN_MATCH = 3;
20740
+    var MAX_MATCH = 258;
20741
+    var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
20742
+
20743
+    function smaller(tree, n, m, depth) {
20744
+      var tn2 = tree[n * 2];
20745
+      var tm2 = tree[m * 2];
20746
+      return tn2 < tm2 || tn2 == tm2 && depth[n] <= depth[m];
20747
+    }
20748
+
20749
+    function Deflate() {
20750
+      var that = this;
20751
+      var strm; // pointer back to this zlib stream
20752
+
20753
+      var status; // as the name implies
20754
+      // pending_buf; // output still pending
20755
+
20756
+      var pending_buf_size; // size of pending_buf
20757
+
20758
+      var last_flush; // value of flush param for previous deflate call
20759
+
20760
+      var w_size; // LZ77 window size (32K by default)
20761
+
20762
+      var w_bits; // log2(w_size) (8..16)
20763
+
20764
+      var w_mask; // w_size - 1
20765
+
20766
+      var window; // Sliding window. Input bytes are read into the second half of the window,
20767
+      // and move to the first half later to keep a dictionary of at least wSize
20768
+      // bytes. With this organization, matches are limited to a distance of
20769
+      // wSize-MAX_MATCH bytes, but this ensures that IO is always
20770
+      // performed with a length multiple of the block size. Also, it limits
20771
+      // the window size to 64K, which is quite useful on MSDOS.
20772
+      // To do: use the user input buffer as sliding window.
20773
+
20774
+      var window_size; // Actual size of window: 2*wSize, except when the user input buffer
20775
+      // is directly used as sliding window.
20776
+
20777
+      var prev; // Link to older string with same hash index. To limit the size of this
20778
+      // array to 64K, this link is maintained only for the last 32K strings.
20779
+      // An index in this array is thus a window index modulo 32K.
20780
+
20781
+      var head; // Heads of the hash chains or NIL.
20782
+
20783
+      var ins_h; // hash index of string to be inserted
20784
+
20785
+      var hash_size; // number of elements in hash table
20786
+
20787
+      var hash_bits; // log2(hash_size)
20788
+
20789
+      var hash_mask; // hash_size-1
20790
+      // Number of bits by which ins_h must be shifted at each input
20791
+      // step. It must be such that after MIN_MATCH steps, the oldest
20792
+      // byte no longer takes part in the hash key, that is:
20793
+      // hash_shift * MIN_MATCH >= hash_bits
20794
+
20795
+      var hash_shift; // Window position at the beginning of the current output block. Gets
20796
+      // negative when the window is moved backwards.
20797
+
20798
+      var block_start;
20799
+      var match_length; // length of best match
20800
+
20801
+      var prev_match; // previous match
20802
+
20803
+      var match_available; // set if previous match exists
20804
+
20805
+      var strstart; // start of string to insert
20806
+
20807
+      var match_start; // start of matching string
20808
+
20809
+      var lookahead; // number of valid bytes ahead in window
20810
+      // Length of the best match at previous step. Matches not greater than this
20811
+      // are discarded. This is used in the lazy match evaluation.
20812
+
20813
+      var prev_length; // To speed up deflation, hash chains are never searched beyond this
20814
+      // length. A higher limit improves compression ratio but degrades the speed.
20815
+
20816
+      var max_chain_length; // Attempt to find a better match only when the current match is strictly
20817
+      // smaller than this value. This mechanism is used only for compression
20818
+      // levels >= 4.
20819
+
20820
+      var max_lazy_match; // Insert new strings in the hash table only if the match length is not
20821
+      // greater than this length. This saves time but degrades compression.
20822
+      // max_insert_length is used only for compression levels <= 3.
20823
+
20824
+      var level; // compression level (1..9)
20825
+
20826
+      var strategy; // favor or force Huffman coding
20827
+      // Use a faster search when the previous match is longer than this
20828
+
20829
+      var good_match; // Stop searching when current match exceeds this
20830
+
20831
+      var nice_match;
20832
+      var dyn_ltree; // literal and length tree
20833
+
20834
+      var dyn_dtree; // distance tree
20835
+
20836
+      var bl_tree; // Huffman tree for bit lengths
20837
+
20838
+      var l_desc = new Tree(); // desc for literal tree
20839
+
20840
+      var d_desc = new Tree(); // desc for distance tree
20841
+
20842
+      var bl_desc = new Tree(); // desc for bit length tree
20843
+      // that.heap_len; // number of elements in the heap
20844
+      // that.heap_max; // element of largest frequency
20845
+      // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
20846
+      // The same heap array is used to build all trees.
20847
+      // Depth of each subtree used as tie breaker for trees of equal frequency
20848
+
20849
+      that.depth = [];
20850
+      var l_buf; // index for literals or lengths */
20851
+      // Size of match buffer for literals/lengths. There are 4 reasons for
20852
+      // limiting lit_bufsize to 64K:
20853
+      // - frequencies can be kept in 16 bit counters
20854
+      // - if compression is not successful for the first block, all input
20855
+      // data is still in the window so we can still emit a stored block even
20856
+      // when input comes from standard input. (This can also be done for
20857
+      // all blocks if lit_bufsize is not greater than 32K.)
20858
+      // - if compression is not successful for a file smaller than 64K, we can
20859
+      // even emit a stored file instead of a stored block (saving 5 bytes).
20860
+      // This is applicable only for zip (not gzip or zlib).
20861
+      // - creating new Huffman trees less frequently may not provide fast
20862
+      // adaptation to changes in the input data statistics. (Take for
20863
+      // example a binary file with poorly compressible code followed by
20864
+      // a highly compressible string table.) Smaller buffer sizes give
20865
+      // fast adaptation but have of course the overhead of transmitting
20866
+      // trees more frequently.
20867
+      // - I can't count above 4
20868
+
20869
+      var lit_bufsize;
20870
+      var last_lit; // running index in l_buf
20871
+      // Buffer for distances. To simplify the code, d_buf and l_buf have
20872
+      // the same number of elements. To use different lengths, an extra flag
20873
+      // array would be necessary.
20874
+
20875
+      var d_buf; // index of pendig_buf
20876
+      // that.opt_len; // bit length of current block with optimal trees
20877
+      // that.static_len; // bit length of current block with static trees
20878
+
20879
+      var matches; // number of string matches in current block
20880
+
20881
+      var last_eob_len; // bit length of EOB code for last block
20882
+      // Output buffer. bits are inserted starting at the bottom (least
20883
+      // significant bits).
20884
+
20885
+      var bi_buf; // Number of valid bits in bi_buf. All bits above the last valid bit
20886
+      // are always zero.
20887
+
20888
+      var bi_valid; // number of codes at each bit length for an optimal tree
20889
+
20890
+      that.bl_count = []; // heap used to build the Huffman trees
20891
+
20892
+      that.heap = [];
20893
+      dyn_ltree = [];
20894
+      dyn_dtree = [];
20895
+      bl_tree = [];
20896
+
20897
+      function lm_init() {
20898
+        var i;
20899
+        window_size = 2 * w_size;
20900
+        head[hash_size - 1] = 0;
20901
+
20902
+        for (i = 0; i < hash_size - 1; i++) {
20903
+          head[i] = 0;
20904
+        } // Set the default configuration parameters:
20905
+
20906
+
20907
+        max_lazy_match = config_table[level].max_lazy;
20908
+        good_match = config_table[level].good_length;
20909
+        nice_match = config_table[level].nice_length;
20910
+        max_chain_length = config_table[level].max_chain;
20911
+        strstart = 0;
20912
+        block_start = 0;
20913
+        lookahead = 0;
20914
+        match_length = prev_length = MIN_MATCH - 1;
20915
+        match_available = 0;
20916
+        ins_h = 0;
20917
+      }
20918
+
20919
+      function init_block() {
20920
+        var i; // Initialize the trees.
20921
+
20922
+        for (i = 0; i < L_CODES; i++) {
20923
+          dyn_ltree[i * 2] = 0;
20924
+        }
20925
+
20926
+        for (i = 0; i < D_CODES; i++) {
20927
+          dyn_dtree[i * 2] = 0;
20928
+        }
20929
+
20930
+        for (i = 0; i < BL_CODES; i++) {
20931
+          bl_tree[i * 2] = 0;
20932
+        }
20933
+
20934
+        dyn_ltree[END_BLOCK * 2] = 1;
20935
+        that.opt_len = that.static_len = 0;
20936
+        last_lit = matches = 0;
20937
+      } // Initialize the tree data structures for a new zlib stream.
20938
+
20939
+
20940
+      function tr_init() {
20941
+        l_desc.dyn_tree = dyn_ltree;
20942
+        l_desc.stat_desc = StaticTree.static_l_desc;
20943
+        d_desc.dyn_tree = dyn_dtree;
20944
+        d_desc.stat_desc = StaticTree.static_d_desc;
20945
+        bl_desc.dyn_tree = bl_tree;
20946
+        bl_desc.stat_desc = StaticTree.static_bl_desc;
20947
+        bi_buf = 0;
20948
+        bi_valid = 0;
20949
+        last_eob_len = 8; // enough lookahead for inflate
20950
+        // Initialize the first block of the first file:
20951
+
20952
+        init_block();
20953
+      } // Restore the heap property by moving down the tree starting at node k,
20954
+      // exchanging a node with the smallest of its two sons if necessary,
20955
+      // stopping
20956
+      // when the heap property is re-established (each father smaller than its
20957
+      // two sons).
20958
+
20959
+
20960
+      that.pqdownheap = function (tree, // the tree to restore
20961
+      k // node to move down
20962
+      ) {
20963
+        var heap = that.heap;
20964
+        var v = heap[k];
20965
+        var j = k << 1; // left son of k
20966
+
20967
+        while (j <= that.heap_len) {
20968
+          // Set j to the smallest of the two sons:
20969
+          if (j < that.heap_len && smaller(tree, heap[j + 1], heap[j], that.depth)) {
20970
+            j++;
20971
+          } // Exit if v is smaller than both sons
20972
+
20973
+
20974
+          if (smaller(tree, v, heap[j], that.depth)) break; // Exchange v with the smallest son
20975
+
20976
+          heap[k] = heap[j];
20977
+          k = j; // And continue down the tree, setting j to the left son of k
20978
+
20979
+          j <<= 1;
20980
+        }
20981
+
20982
+        heap[k] = v;
20983
+      }; // Scan a literal or distance tree to determine the frequencies of the codes
20984
+      // in the bit length tree.
20985
+
20986
+
20987
+      function scan_tree(tree, // the tree to be scanned
20988
+      max_code // and its largest code of non zero frequency
20989
+      ) {
20990
+        var n; // iterates over all tree elements
20991
+
20992
+        var prevlen = -1; // last emitted length
20993
+
20994
+        var curlen; // length of current code
20995
+
20996
+        var nextlen = tree[0 * 2 + 1]; // length of next code
20997
+
20998
+        var count = 0; // repeat count of the current code
20999
+
21000
+        var max_count = 7; // max repeat count
21001
+
21002
+        var min_count = 4; // min repeat count
21003
+
21004
+        if (nextlen === 0) {
21005
+          max_count = 138;
21006
+          min_count = 3;
21007
+        }
21008
+
21009
+        tree[(max_code + 1) * 2 + 1] = 0xffff; // guard
21010
+
21011
+        for (n = 0; n <= max_code; n++) {
21012
+          curlen = nextlen;
21013
+          nextlen = tree[(n + 1) * 2 + 1];
21014
+
21015
+          if (++count < max_count && curlen == nextlen) {
21016
+            continue;
21017
+          } else if (count < min_count) {
21018
+            bl_tree[curlen * 2] += count;
21019
+          } else if (curlen !== 0) {
21020
+            if (curlen != prevlen) bl_tree[curlen * 2]++;
21021
+            bl_tree[REP_3_6 * 2]++;
21022
+          } else if (count <= 10) {
21023
+            bl_tree[REPZ_3_10 * 2]++;
21024
+          } else {
21025
+            bl_tree[REPZ_11_138 * 2]++;
21026
+          }
21027
+
21028
+          count = 0;
21029
+          prevlen = curlen;
21030
+
21031
+          if (nextlen === 0) {
21032
+            max_count = 138;
21033
+            min_count = 3;
21034
+          } else if (curlen == nextlen) {
21035
+            max_count = 6;
21036
+            min_count = 3;
21037
+          } else {
21038
+            max_count = 7;
21039
+            min_count = 4;
21040
+          }
21041
+        }
21042
+      } // Construct the Huffman tree for the bit lengths and return the index in
21043
+      // bl_order of the last bit length code to send.
21044
+
21045
+
21046
+      function build_bl_tree() {
21047
+        var max_blindex; // index of last bit length code of non zero freq
21048
+        // Determine the bit length frequencies for literal and distance trees
21049
+
21050
+        scan_tree(dyn_ltree, l_desc.max_code);
21051
+        scan_tree(dyn_dtree, d_desc.max_code); // Build the bit length tree:
21052
+
21053
+        bl_desc.build_tree(that); // opt_len now includes the length of the tree representations, except
21054
+        // the lengths of the bit lengths codes and the 5+5+4 bits for the
21055
+        // counts.
21056
+        // Determine the number of bit length codes to send. The pkzip format
21057
+        // requires that at least 4 bit length codes be sent. (appnote.txt says
21058
+        // 3 but the actual value used is 4.)
21059
+
21060
+        for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
21061
+          if (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0) break;
21062
+        } // Update opt_len to include the bit length tree and counts
21063
+
21064
+
21065
+        that.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
21066
+        return max_blindex;
21067
+      } // Output a byte on the stream.
21068
+      // IN assertion: there is enough room in pending_buf.
21069
+
21070
+
21071
+      function put_byte(p) {
21072
+        that.pending_buf[that.pending++] = p;
21073
+      }
21074
+
21075
+      function put_short(w) {
21076
+        put_byte(w & 0xff);
21077
+        put_byte(w >>> 8 & 0xff);
21078
+      }
21079
+
21080
+      function putShortMSB(b) {
21081
+        put_byte(b >> 8 & 0xff);
21082
+        put_byte(b & 0xff & 0xff);
21083
+      }
21084
+
21085
+      function send_bits(value, length) {
21086
+        var val,
21087
+            len = length;
21088
+
21089
+        if (bi_valid > Buf_size - len) {
21090
+          val = value; // bi_buf |= (val << bi_valid);
21091
+
21092
+          bi_buf |= val << bi_valid & 0xffff;
21093
+          put_short(bi_buf);
21094
+          bi_buf = val >>> Buf_size - bi_valid;
21095
+          bi_valid += len - Buf_size;
21096
+        } else {
21097
+          // bi_buf |= (value) << bi_valid;
21098
+          bi_buf |= value << bi_valid & 0xffff;
21099
+          bi_valid += len;
21100
+        }
21101
+      }
21102
+
21103
+      function send_code(c, tree) {
21104
+        var c2 = c * 2;
21105
+        send_bits(tree[c2] & 0xffff, tree[c2 + 1] & 0xffff);
21106
+      } // Send a literal or distance tree in compressed form, using the codes in
21107
+      // bl_tree.
21108
+
21109
+
21110
+      function send_tree(tree, // the tree to be sent
21111
+      max_code // and its largest code of non zero frequency
21112
+      ) {
21113
+        var n; // iterates over all tree elements
21114
+
21115
+        var prevlen = -1; // last emitted length
21116
+
21117
+        var curlen; // length of current code
21118
+
21119
+        var nextlen = tree[0 * 2 + 1]; // length of next code
21120
+
21121
+        var count = 0; // repeat count of the current code
21122
+
21123
+        var max_count = 7; // max repeat count
21124
+
21125
+        var min_count = 4; // min repeat count
21126
+
21127
+        if (nextlen === 0) {
21128
+          max_count = 138;
21129
+          min_count = 3;
21130
+        }
21131
+
21132
+        for (n = 0; n <= max_code; n++) {
21133
+          curlen = nextlen;
21134
+          nextlen = tree[(n + 1) * 2 + 1];
21135
+
21136
+          if (++count < max_count && curlen == nextlen) {
21137
+            continue;
21138
+          } else if (count < min_count) {
21139
+            do {
21140
+              send_code(curlen, bl_tree);
21141
+            } while (--count !== 0);
21142
+          } else if (curlen !== 0) {
21143
+            if (curlen != prevlen) {
21144
+              send_code(curlen, bl_tree);
21145
+              count--;
21146
+            }
21147
+
21148
+            send_code(REP_3_6, bl_tree);
21149
+            send_bits(count - 3, 2);
21150
+          } else if (count <= 10) {
21151
+            send_code(REPZ_3_10, bl_tree);
21152
+            send_bits(count - 3, 3);
21153
+          } else {
21154
+            send_code(REPZ_11_138, bl_tree);
21155
+            send_bits(count - 11, 7);
21156
+          }
21157
+
21158
+          count = 0;
21159
+          prevlen = curlen;
21160
+
21161
+          if (nextlen === 0) {
21162
+            max_count = 138;
21163
+            min_count = 3;
21164
+          } else if (curlen == nextlen) {
21165
+            max_count = 6;
21166
+            min_count = 3;
21167
+          } else {
21168
+            max_count = 7;
21169
+            min_count = 4;
21170
+          }
21171
+        }
21172
+      } // Send the header for a block using dynamic Huffman trees: the counts, the
21173
+      // lengths of the bit length codes, the literal tree and the distance tree.
21174
+      // IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
21175
+
21176
+
21177
+      function send_all_trees(lcodes, dcodes, blcodes) {
21178
+        var rank; // index in bl_order
21179
+
21180
+        send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt
21181
+
21182
+        send_bits(dcodes - 1, 5);
21183
+        send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt
21184
+
21185
+        for (rank = 0; rank < blcodes; rank++) {
21186
+          send_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3);
21187
+        }
21188
+
21189
+        send_tree(dyn_ltree, lcodes - 1); // literal tree
21190
+
21191
+        send_tree(dyn_dtree, dcodes - 1); // distance tree
21192
+      } // Flush the bit buffer, keeping at most 7 bits in it.
21193
+
21194
+
21195
+      function bi_flush() {
21196
+        if (bi_valid == 16) {
21197
+          put_short(bi_buf);
21198
+          bi_buf = 0;
21199
+          bi_valid = 0;
21200
+        } else if (bi_valid >= 8) {
21201
+          put_byte(bi_buf & 0xff);
21202
+          bi_buf >>>= 8;
21203
+          bi_valid -= 8;
21204
+        }
21205
+      } // Send one empty static block to give enough lookahead for inflate.
21206
+      // This takes 10 bits, of which 7 may remain in the bit buffer.
21207
+      // The current inflate code requires 9 bits of lookahead. If the
21208
+      // last two codes for the previous block (real code plus EOB) were coded
21209
+      // on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
21210
+      // the last real code. In this case we send two empty static blocks instead
21211
+      // of one. (There are no problems if the previous block is stored or fixed.)
21212
+      // To simplify the code, we assume the worst case of last real code encoded
21213
+      // on one bit only.
21214
+
21215
+
21216
+      function _tr_align() {
21217
+        send_bits(STATIC_TREES << 1, 3);
21218
+        send_code(END_BLOCK, StaticTree.static_ltree);
21219
+        bi_flush(); // Of the 10 bits for the empty block, we have already sent
21220
+        // (10 - bi_valid) bits. The lookahead for the last real code (before
21221
+        // the EOB of the previous block) was thus at least one plus the length
21222
+        // of the EOB plus what we have just sent of the empty static block.
21223
+
21224
+        if (1 + last_eob_len + 10 - bi_valid < 9) {
21225
+          send_bits(STATIC_TREES << 1, 3);
21226
+          send_code(END_BLOCK, StaticTree.static_ltree);
21227
+          bi_flush();
21228
+        }
21229
+
21230
+        last_eob_len = 7;
21231
+      } // Save the match info and tally the frequency counts. Return true if
21232
+      // the current block must be flushed.
21233
+
21234
+
21235
+      function _tr_tally(dist, // distance of matched string
21236
+      lc // match length-MIN_MATCH or unmatched char (if dist==0)
21237
+      ) {
21238
+        var out_length, in_length, dcode;
21239
+        that.pending_buf[d_buf + last_lit * 2] = dist >>> 8 & 0xff;
21240
+        that.pending_buf[d_buf + last_lit * 2 + 1] = dist & 0xff;
21241
+        that.pending_buf[l_buf + last_lit] = lc & 0xff;
21242
+        last_lit++;
21243
+
21244
+        if (dist === 0) {
21245
+          // lc is the unmatched char
21246
+          dyn_ltree[lc * 2]++;
21247
+        } else {
21248
+          matches++; // Here, lc is the match length - MIN_MATCH
21249
+
21250
+          dist--; // dist = match distance - 1
21251
+
21252
+          dyn_ltree[(Tree._length_code[lc] + LITERALS + 1) * 2]++;
21253
+          dyn_dtree[Tree.d_code(dist) * 2]++;
21254
+        }
21255
+
21256
+        if ((last_lit & 0x1fff) === 0 && level > 2) {
21257
+          // Compute an upper bound for the compressed length
21258
+          out_length = last_lit * 8;
21259
+          in_length = strstart - block_start;
21260
+
21261
+          for (dcode = 0; dcode < D_CODES; dcode++) {
21262
+            out_length += dyn_dtree[dcode * 2] * (5 + Tree.extra_dbits[dcode]);
21263
+          }
21264
+
21265
+          out_length >>>= 3;
21266
+          if (matches < Math.floor(last_lit / 2) && out_length < Math.floor(in_length / 2)) return true;
21267
+        }
21268
+
21269
+        return last_lit == lit_bufsize - 1; // We avoid equality with lit_bufsize because of wraparound at 64K
21270
+        // on 16 bit machines and because stored blocks are restricted to
21271
+        // 64K-1 bytes.
21272
+      } // Send the block data compressed using the given Huffman trees
21273
+
21274
+
21275
+      function compress_block(ltree, dtree) {
21276
+        var dist; // distance of matched string
21277
+
21278
+        var lc; // match length or unmatched char (if dist === 0)
21279
+
21280
+        var lx = 0; // running index in l_buf
21281
+
21282
+        var code; // the code to send
21283
+
21284
+        var extra; // number of extra bits to send
21285
+
21286
+        if (last_lit !== 0) {
21287
+          do {
21288
+            dist = that.pending_buf[d_buf + lx * 2] << 8 & 0xff00 | that.pending_buf[d_buf + lx * 2 + 1] & 0xff;
21289
+            lc = that.pending_buf[l_buf + lx] & 0xff;
21290
+            lx++;
21291
+
21292
+            if (dist === 0) {
21293
+              send_code(lc, ltree); // send a literal byte
21294
+            } else {
21295
+              // Here, lc is the match length - MIN_MATCH
21296
+              code = Tree._length_code[lc];
21297
+              send_code(code + LITERALS + 1, ltree); // send the length
21298
+              // code
21299
+
21300
+              extra = Tree.extra_lbits[code];
21301
+
21302
+              if (extra !== 0) {
21303
+                lc -= Tree.base_length[code];
21304
+                send_bits(lc, extra); // send the extra length bits
21305
+              }
21306
+
21307
+              dist--; // dist is now the match distance - 1
21308
+
21309
+              code = Tree.d_code(dist);
21310
+              send_code(code, dtree); // send the distance code
21311
+
21312
+              extra = Tree.extra_dbits[code];
21313
+
21314
+              if (extra !== 0) {
21315
+                dist -= Tree.base_dist[code];
21316
+                send_bits(dist, extra); // send the extra distance bits
21317
+              }
21318
+            } // literal or match pair ?
21319
+            // Check that the overlay between pending_buf and d_buf+l_buf is
21320
+            // ok:
21321
+
21322
+          } while (lx < last_lit);
21323
+        }
21324
+
21325
+        send_code(END_BLOCK, ltree);
21326
+        last_eob_len = ltree[END_BLOCK * 2 + 1];
21327
+      } // Flush the bit buffer and align the output on a byte boundary
21328
+
21329
+
21330
+      function bi_windup() {
21331
+        if (bi_valid > 8) {
21332
+          put_short(bi_buf);
21333
+        } else if (bi_valid > 0) {
21334
+          put_byte(bi_buf & 0xff);
21335
+        }
21336
+
21337
+        bi_buf = 0;
21338
+        bi_valid = 0;
21339
+      } // Copy a stored block, storing first the length and its
21340
+      // one's complement if requested.
21341
+
21342
+
21343
+      function copy_block(buf, // the input data
21344
+      len, // its length
21345
+      header // true if block header must be written
21346
+      ) {
21347
+        bi_windup(); // align on byte boundary
21348
+
21349
+        last_eob_len = 8; // enough lookahead for inflate
21350
+
21351
+        if (header) {
21352
+          put_short(len);
21353
+          put_short(~len);
21354
+        }
21355
+
21356
+        that.pending_buf.set(window.subarray(buf, buf + len), that.pending);
21357
+        that.pending += len;
21358
+      } // Send a stored block
21359
+
21360
+
21361
+      function _tr_stored_block(buf, // input block
21362
+      stored_len, // length of input block
21363
+      eof // true if this is the last block for a file
21364
+      ) {
21365
+        send_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type
21366
+
21367
+        copy_block(buf, stored_len, true); // with header
21368
+      } // Determine the best encoding for the current block: dynamic trees, static
21369
+      // trees or store, and output the encoded block to the zip file.
21370
+
21371
+
21372
+      function _tr_flush_block(buf, // input block, or NULL if too old
21373
+      stored_len, // length of input block
21374
+      eof // true if this is the last block for a file
21375
+      ) {
21376
+        var opt_lenb, static_lenb; // opt_len and static_len in bytes
21377
+
21378
+        var max_blindex = 0; // index of last bit length code of non zero freq
21379
+        // Build the Huffman trees unless a stored block is forced
21380
+
21381
+        if (level > 0) {
21382
+          // Construct the literal and distance trees
21383
+          l_desc.build_tree(that);
21384
+          d_desc.build_tree(that); // At this point, opt_len and static_len are the total bit lengths
21385
+          // of
21386
+          // the compressed block data, excluding the tree representations.
21387
+          // Build the bit length tree for the above two trees, and get the
21388
+          // index
21389
+          // in bl_order of the last bit length code to send.
21390
+
21391
+          max_blindex = build_bl_tree(); // Determine the best encoding. Compute first the block length in
21392
+          // bytes
21393
+
21394
+          opt_lenb = that.opt_len + 3 + 7 >>> 3;
21395
+          static_lenb = that.static_len + 3 + 7 >>> 3;
21396
+          if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
21397
+        } else {
21398
+          opt_lenb = static_lenb = stored_len + 5; // force a stored block
21399
+        }
21400
+
21401
+        if (stored_len + 4 <= opt_lenb && buf != -1) {
21402
+          // 4: two words for the lengths
21403
+          // The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
21404
+          // Otherwise we can't have processed more than WSIZE input bytes
21405
+          // since
21406
+          // the last block flush, because compression would have been
21407
+          // successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
21408
+          // transform a block into a stored block.
21409
+          _tr_stored_block(buf, stored_len, eof);
21410
+        } else if (static_lenb == opt_lenb) {
21411
+          send_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3);
21412
+          compress_block(StaticTree.static_ltree, StaticTree.static_dtree);
21413
+        } else {
21414
+          send_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3);
21415
+          send_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);
21416
+          compress_block(dyn_ltree, dyn_dtree);
21417
+        } // The above check is made mod 2^32, for files larger than 512 MB
21418
+        // and uLong implemented on 32 bits.
21419
+
21420
+
21421
+        init_block();
21422
+
21423
+        if (eof) {
21424
+          bi_windup();
21425
+        }
21426
+      }
21427
+
21428
+      function flush_block_only(eof) {
21429
+        _tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof);
21430
+
21431
+        block_start = strstart;
21432
+        strm.flush_pending();
21433
+      } // Fill the window when the lookahead becomes insufficient.
21434
+      // Updates strstart and lookahead.
21435
+      //
21436
+      // IN assertion: lookahead < MIN_LOOKAHEAD
21437
+      // OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
21438
+      // At least one byte has been read, or avail_in === 0; reads are
21439
+      // performed for at least two bytes (required for the zip translate_eol
21440
+      // option -- not supported here).
21441
+
21442
+
21443
+      function fill_window() {
21444
+        var n, m;
21445
+        var p;
21446
+        var more; // Amount of free space at the end of the window.
21447
+
21448
+        do {
21449
+          more = window_size - lookahead - strstart; // Deal with !@#$% 64K limit:
21450
+
21451
+          if (more === 0 && strstart === 0 && lookahead === 0) {
21452
+            more = w_size;
21453
+          } else if (more == -1) {
21454
+            // Very unlikely, but possible on 16 bit machine if strstart ==
21455
+            // 0
21456
+            // and lookahead == 1 (input done one byte at time)
21457
+            more--; // If the window is almost full and there is insufficient
21458
+            // lookahead,
21459
+            // move the upper half to the lower one to make room in the
21460
+            // upper half.
21461
+          } else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {
21462
+            window.set(window.subarray(w_size, w_size + w_size), 0);
21463
+            match_start -= w_size;
21464
+            strstart -= w_size; // we now have strstart >= MAX_DIST
21465
+
21466
+            block_start -= w_size; // Slide the hash table (could be avoided with 32 bit values
21467
+            // at the expense of memory usage). We slide even when level ==
21468
+            // 0
21469
+            // to keep the hash table consistent if we switch back to level
21470
+            // > 0
21471
+            // later. (Using level 0 permanently is not an optimal usage of
21472
+            // zlib, so we don't care about this pathological case.)
21473
+
21474
+            n = hash_size;
21475
+            p = n;
21476
+
21477
+            do {
21478
+              m = head[--p] & 0xffff;
21479
+              head[p] = m >= w_size ? m - w_size : 0;
21480
+            } while (--n !== 0);
21481
+
21482
+            n = w_size;
21483
+            p = n;
21484
+
21485
+            do {
21486
+              m = prev[--p] & 0xffff;
21487
+              prev[p] = m >= w_size ? m - w_size : 0; // If n is not on any hash chain, prev[n] is garbage but
21488
+              // its value will never be used.
21489
+            } while (--n !== 0);
21490
+
21491
+            more += w_size;
21492
+          }
21493
+
21494
+          if (strm.avail_in === 0) return; // If there was no sliding:
21495
+          // strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
21496
+          // more == window_size - lookahead - strstart
21497
+          // => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
21498
+          // => more >= window_size - 2*WSIZE + 2
21499
+          // In the BIG_MEM or MMAP case (not yet supported),
21500
+          // window_size == input_size + MIN_LOOKAHEAD &&
21501
+          // strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
21502
+          // Otherwise, window_size == 2*WSIZE so more >= 2.
21503
+          // If there was sliding, more >= WSIZE. So in all cases, more >= 2.
21504
+
21505
+          n = strm.read_buf(window, strstart + lookahead, more);
21506
+          lookahead += n; // Initialize the hash value now that we have some input:
21507
+
21508
+          if (lookahead >= MIN_MATCH) {
21509
+            ins_h = window[strstart] & 0xff;
21510
+            ins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask;
21511
+          } // If the whole input has less than MIN_MATCH bytes, ins_h is
21512
+          // garbage,
21513
+          // but this is not important since only literal bytes will be
21514
+          // emitted.
21515
+
21516
+        } while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);
21517
+      } // Copy without compression as much as possible from the input stream,
21518
+      // return
21519
+      // the current block state.
21520
+      // This function does not insert new strings in the dictionary since
21521
+      // uncompressible data is probably not useful. This function is used
21522
+      // only for the level=0 compression option.
21523
+      // NOTE: this function should be optimized to avoid extra copying from
21524
+      // window to pending_buf.
21525
+
21526
+
21527
+      function deflate_stored(flush) {
21528
+        // Stored blocks are limited to 0xffff bytes, pending_buf is limited
21529
+        // to pending_buf_size, and each stored block has a 5 byte header:
21530
+        var max_block_size = 0xffff;
21531
+        var max_start;
21532
+
21533
+        if (max_block_size > pending_buf_size - 5) {
21534
+          max_block_size = pending_buf_size - 5;
21535
+        } // Copy as much as possible from input to output:
21536
+
21537
+
21538
+        while (true) {
21539
+          // Fill the window as much as possible:
21540
+          if (lookahead <= 1) {
21541
+            fill_window();
21542
+            if (lookahead === 0 && flush == Z_NO_FLUSH) return NeedMore;
21543
+            if (lookahead === 0) break; // flush the current block
21544
+          }
21545
+
21546
+          strstart += lookahead;
21547
+          lookahead = 0; // Emit a stored block if pending_buf will be full:
21548
+
21549
+          max_start = block_start + max_block_size;
21550
+
21551
+          if (strstart === 0 || strstart >= max_start) {
21552
+            // strstart === 0 is possible when wraparound on 16-bit machine
21553
+            lookahead = strstart - max_start;
21554
+            strstart = max_start;
21555
+            flush_block_only(false);
21556
+            if (strm.avail_out === 0) return NeedMore;
21557
+          } // Flush if we may have to slide, otherwise block_start may become
21558
+          // negative and the data will be gone:
21559
+
21560
+
21561
+          if (strstart - block_start >= w_size - MIN_LOOKAHEAD) {
21562
+            flush_block_only(false);
21563
+            if (strm.avail_out === 0) return NeedMore;
21564
+          }
21565
+        }
21566
+
21567
+        flush_block_only(flush == Z_FINISH);
21568
+        if (strm.avail_out === 0) return flush == Z_FINISH ? FinishStarted : NeedMore;
21569
+        return flush == Z_FINISH ? FinishDone : BlockDone;
21570
+      }
21571
+
21572
+      function longest_match(cur_match) {
21573
+        var chain_length = max_chain_length; // max hash chain length
21574
+
21575
+        var scan = strstart; // current string
21576
+
21577
+        var match; // matched string
21578
+
21579
+        var len; // length of current match
21580
+
21581
+        var best_len = prev_length; // best match length so far
21582
+
21583
+        var limit = strstart > w_size - MIN_LOOKAHEAD ? strstart - (w_size - MIN_LOOKAHEAD) : 0;
21584
+        var _nice_match = nice_match; // Stop when cur_match becomes <= limit. To simplify the code,
21585
+        // we prevent matches with the string of window index 0.
21586
+
21587
+        var wmask = w_mask;
21588
+        var strend = strstart + MAX_MATCH;
21589
+        var scan_end1 = window[scan + best_len - 1];
21590
+        var scan_end = window[scan + best_len]; // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of
21591
+        // 16.
21592
+        // It is easy to get rid of this optimization if necessary.
21593
+        // Do not waste too much time if we already have a good match:
21594
+
21595
+        if (prev_length >= good_match) {
21596
+          chain_length >>= 2;
21597
+        } // Do not look for matches beyond the end of the input. This is
21598
+        // necessary
21599
+        // to make deflate deterministic.
21600
+
21601
+
21602
+        if (_nice_match > lookahead) _nice_match = lookahead;
21603
+
21604
+        do {
21605
+          match = cur_match; // Skip to next match if the match length cannot increase
21606
+          // or if the match length is less than 2:
21607
+
21608
+          if (window[match + best_len] != scan_end || window[match + best_len - 1] != scan_end1 || window[match] != window[scan] || window[++match] != window[scan + 1]) continue; // The check at best_len-1 can be removed because it will be made
21609
+          // again later. (This heuristic is not always a win.)
21610
+          // It is not necessary to compare scan[2] and match[2] since they
21611
+          // are always equal when the other bytes match, given that
21612
+          // the hash keys are equal and that HASH_BITS >= 8.
21613
+
21614
+          scan += 2;
21615
+          match++; // We check for insufficient lookahead only every 8th comparison;
21616
+          // the 256th check will be made at strstart+258.
21617
+
21618
+          do {} while (window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && scan < strend);
21619
+
21620
+          len = MAX_MATCH - (strend - scan);
21621
+          scan = strend - MAX_MATCH;
21622
+
21623
+          if (len > best_len) {
21624
+            match_start = cur_match;
21625
+            best_len = len;
21626
+            if (len >= _nice_match) break;
21627
+            scan_end1 = window[scan + best_len - 1];
21628
+            scan_end = window[scan + best_len];
21629
+          }
21630
+        } while ((cur_match = prev[cur_match & wmask] & 0xffff) > limit && --chain_length !== 0);
21631
+
21632
+        if (best_len <= lookahead) return best_len;
21633
+        return lookahead;
21634
+      } // Compress as much as possible from the input stream, return the current
21635
+      // block state.
21636
+      // This function does not perform lazy evaluation of matches and inserts
21637
+      // new strings in the dictionary only for unmatched strings or for short
21638
+      // matches. It is used only for the fast compression options.
21639
+
21640
+
21641
+      function deflate_fast(flush) {
21642
+        // short hash_head = 0; // head of the hash chain
21643
+        var hash_head = 0; // head of the hash chain
21644
+
21645
+        var bflush; // set if current block must be flushed
21646
+
21647
+        while (true) {
21648
+          // Make sure that we always have enough lookahead, except
21649
+          // at the end of the input file. We need MAX_MATCH bytes
21650
+          // for the next match, plus MIN_MATCH bytes to insert the
21651
+          // string following the next match.
21652
+          if (lookahead < MIN_LOOKAHEAD) {
21653
+            fill_window();
21654
+
21655
+            if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
21656
+              return NeedMore;
21657
+            }
21658
+
21659
+            if (lookahead === 0) break; // flush the current block
21660
+          } // Insert the string window[strstart .. strstart+2] in the
21661
+          // dictionary, and set hash_head to the head of the hash chain:
21662
+
21663
+
21664
+          if (lookahead >= MIN_MATCH) {
21665
+            ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];
21666
+
21667
+            hash_head = head[ins_h] & 0xffff;
21668
+            prev[strstart & w_mask] = head[ins_h];
21669
+            head[ins_h] = strstart;
21670
+          } // Find the longest match, discarding those <= prev_length.
21671
+          // At this point we have always match_length < MIN_MATCH
21672
+
21673
+
21674
+          if (hash_head !== 0 && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {
21675
+            // To simplify the code, we prevent matches with the string
21676
+            // of window index 0 (in particular we have to avoid a match
21677
+            // of the string with itself at the start of the input file).
21678
+            if (strategy != Z_HUFFMAN_ONLY) {
21679
+              match_length = longest_match(hash_head);
21680
+            } // longest_match() sets match_start
21681
+
21682
+          }
21683
+
21684
+          if (match_length >= MIN_MATCH) {
21685
+            // check_match(strstart, match_start, match_length);
21686
+            bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);
21687
+            lookahead -= match_length; // Insert new strings in the hash table only if the match length
21688
+            // is not too large. This saves time but degrades compression.
21689
+
21690
+            if (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {
21691
+              match_length--; // string at strstart already in hash table
21692
+
21693
+              do {
21694
+                strstart++;
21695
+                ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];
21696
+
21697
+                hash_head = head[ins_h] & 0xffff;
21698
+                prev[strstart & w_mask] = head[ins_h];
21699
+                head[ins_h] = strstart; // strstart never exceeds WSIZE-MAX_MATCH, so there are
21700
+                // always MIN_MATCH bytes ahead.
21701
+              } while (--match_length !== 0);
21702
+
21703
+              strstart++;
21704
+            } else {
21705
+              strstart += match_length;
21706
+              match_length = 0;
21707
+              ins_h = window[strstart] & 0xff;
21708
+              ins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask; // If lookahead < MIN_MATCH, ins_h is garbage, but it does
21709
+              // not
21710
+              // matter since it will be recomputed at next deflate call.
21711
+            }
21712
+          } else {
21713
+            // No match, output a literal byte
21714
+            bflush = _tr_tally(0, window[strstart] & 0xff);
21715
+            lookahead--;
21716
+            strstart++;
21717
+          }
21718
+
21719
+          if (bflush) {
21720
+            flush_block_only(false);
21721
+            if (strm.avail_out === 0) return NeedMore;
21722
+          }
21723
+        }
21724
+
21725
+        flush_block_only(flush == Z_FINISH);
21726
+
21727
+        if (strm.avail_out === 0) {
21728
+          if (flush == Z_FINISH) return FinishStarted;else return NeedMore;
21729
+        }
21730
+
21731
+        return flush == Z_FINISH ? FinishDone : BlockDone;
21732
+      } // Same as above, but achieves better compression. We use a lazy
21733
+      // evaluation for matches: a match is finally adopted only if there is
21734
+      // no better match at the next window position.
21735
+
21736
+
21737
+      function deflate_slow(flush) {
21738
+        // short hash_head = 0; // head of hash chain
21739
+        var hash_head = 0; // head of hash chain
21740
+
21741
+        var bflush; // set if current block must be flushed
21742
+
21743
+        var max_insert; // Process the input block.
21744
+
21745
+        while (true) {
21746
+          // Make sure that we always have enough lookahead, except
21747
+          // at the end of the input file. We need MAX_MATCH bytes
21748
+          // for the next match, plus MIN_MATCH bytes to insert the
21749
+          // string following the next match.
21750
+          if (lookahead < MIN_LOOKAHEAD) {
21751
+            fill_window();
21752
+
21753
+            if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
21754
+              return NeedMore;
21755
+            }
21756
+
21757
+            if (lookahead === 0) break; // flush the current block
21758
+          } // Insert the string window[strstart .. strstart+2] in the
21759
+          // dictionary, and set hash_head to the head of the hash chain:
21760
+
21761
+
21762
+          if (lookahead >= MIN_MATCH) {
21763
+            ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];
21764
+
21765
+            hash_head = head[ins_h] & 0xffff;
21766
+            prev[strstart & w_mask] = head[ins_h];
21767
+            head[ins_h] = strstart;
21768
+          } // Find the longest match, discarding those <= prev_length.
21769
+
21770
+
21771
+          prev_length = match_length;
21772
+          prev_match = match_start;
21773
+          match_length = MIN_MATCH - 1;
21774
+
21775
+          if (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {
21776
+            // To simplify the code, we prevent matches with the string
21777
+            // of window index 0 (in particular we have to avoid a match
21778
+            // of the string with itself at the start of the input file).
21779
+            if (strategy != Z_HUFFMAN_ONLY) {
21780
+              match_length = longest_match(hash_head);
21781
+            } // longest_match() sets match_start
21782
+
21783
+
21784
+            if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {
21785
+              // If prev_match is also MIN_MATCH, match_start is garbage
21786
+              // but we will ignore the current match anyway.
21787
+              match_length = MIN_MATCH - 1;
21788
+            }
21789
+          } // If there was a match at the previous step and the current
21790
+          // match is not better, output the previous match:
21791
+
21792
+
21793
+          if (prev_length >= MIN_MATCH && match_length <= prev_length) {
21794
+            max_insert = strstart + lookahead - MIN_MATCH; // Do not insert strings in hash table beyond this.
21795
+            // check_match(strstart-1, prev_match, prev_length);
21796
+
21797
+            bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); // Insert in hash table all strings up to the end of the match.
21798
+            // strstart-1 and strstart are already inserted. If there is not
21799
+            // enough lookahead, the last two strings are not inserted in
21800
+            // the hash table.
21801
+
21802
+            lookahead -= prev_length - 1;
21803
+            prev_length -= 2;
21804
+
21805
+            do {
21806
+              if (++strstart <= max_insert) {
21807
+                ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];
21808
+
21809
+                hash_head = head[ins_h] & 0xffff;
21810
+                prev[strstart & w_mask] = head[ins_h];
21811
+                head[ins_h] = strstart;
21812
+              }
21813
+            } while (--prev_length !== 0);
21814
+
21815
+            match_available = 0;
21816
+            match_length = MIN_MATCH - 1;
21817
+            strstart++;
21818
+
21819
+            if (bflush) {
21820
+              flush_block_only(false);
21821
+              if (strm.avail_out === 0) return NeedMore;
21822
+            }
21823
+          } else if (match_available !== 0) {
21824
+            // If there was no match at the previous position, output a
21825
+            // single literal. If there was a match but the current match
21826
+            // is longer, truncate the previous match to a single literal.
21827
+            bflush = _tr_tally(0, window[strstart - 1] & 0xff);
21828
+
21829
+            if (bflush) {
21830
+              flush_block_only(false);
21831
+            }
21832
+
21833
+            strstart++;
21834
+            lookahead--;
21835
+            if (strm.avail_out === 0) return NeedMore;
21836
+          } else {
21837
+            // There is no previous match to compare with, wait for
21838
+            // the next step to decide.
21839
+            match_available = 1;
21840
+            strstart++;
21841
+            lookahead--;
21842
+          }
21843
+        }
21844
+
21845
+        if (match_available !== 0) {
21846
+          bflush = _tr_tally(0, window[strstart - 1] & 0xff);
21847
+          match_available = 0;
21848
+        }
21849
+
21850
+        flush_block_only(flush == Z_FINISH);
21851
+
21852
+        if (strm.avail_out === 0) {
21853
+          if (flush == Z_FINISH) return FinishStarted;else return NeedMore;
21854
+        }
21855
+
21856
+        return flush == Z_FINISH ? FinishDone : BlockDone;
21857
+      }
21858
+
21859
+      function deflateReset(strm) {
21860
+        strm.total_in = strm.total_out = 0;
21861
+        strm.msg = null; //
21862
+
21863
+        that.pending = 0;
21864
+        that.pending_out = 0;
21865
+        status = BUSY_STATE;
21866
+        last_flush = Z_NO_FLUSH;
21867
+        tr_init();
21868
+        lm_init();
21869
+        return Z_OK;
21870
+      }
21871
+
21872
+      that.deflateInit = function (strm, _level, bits, _method, memLevel, _strategy) {
21873
+        if (!_method) _method = Z_DEFLATED;
21874
+        if (!memLevel) memLevel = DEF_MEM_LEVEL;
21875
+        if (!_strategy) _strategy = Z_DEFAULT_STRATEGY; // byte[] my_version=ZLIB_VERSION;
21876
+        //
21877
+        // if (!version || version[0] != my_version[0]
21878
+        // || stream_size != sizeof(z_stream)) {
21879
+        // return Z_VERSION_ERROR;
21880
+        // }
21881
+
21882
+        strm.msg = null;
21883
+        if (_level == Z_DEFAULT_COMPRESSION) _level = 6;
21884
+
21885
+        if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {
21886
+          return Z_STREAM_ERROR;
21887
+        }
21888
+
21889
+        strm.dstate = that;
21890
+        w_bits = bits;
21891
+        w_size = 1 << w_bits;
21892
+        w_mask = w_size - 1;
21893
+        hash_bits = memLevel + 7;
21894
+        hash_size = 1 << hash_bits;
21895
+        hash_mask = hash_size - 1;
21896
+        hash_shift = Math.floor((hash_bits + MIN_MATCH - 1) / MIN_MATCH);
21897
+        window = new Uint8Array(w_size * 2);
21898
+        prev = [];
21899
+        head = [];
21900
+        lit_bufsize = 1 << memLevel + 6; // 16K elements by default
21901
+        // We overlay pending_buf and d_buf+l_buf. This works since the average
21902
+        // output size for (length,distance) codes is <= 24 bits.
21903
+
21904
+        that.pending_buf = new Uint8Array(lit_bufsize * 4);
21905
+        pending_buf_size = lit_bufsize * 4;
21906
+        d_buf = Math.floor(lit_bufsize / 2);
21907
+        l_buf = (1 + 2) * lit_bufsize;
21908
+        level = _level;
21909
+        strategy = _strategy;
21910
+        return deflateReset(strm);
21911
+      };
21912
+
21913
+      that.deflateEnd = function () {
21914
+        if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) {
21915
+          return Z_STREAM_ERROR;
21916
+        } // Deallocate in reverse order of allocations:
21917
+
21918
+
21919
+        that.pending_buf = null;
21920
+        head = null;
21921
+        prev = null;
21922
+        window = null; // free
21923
+
21924
+        that.dstate = null;
21925
+        return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
21926
+      };
21927
+
21928
+      that.deflateParams = function (strm, _level, _strategy) {
21929
+        var err = Z_OK;
21930
+
21931
+        if (_level == Z_DEFAULT_COMPRESSION) {
21932
+          _level = 6;
21933
+        }
21934
+
21935
+        if (_level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {
21936
+          return Z_STREAM_ERROR;
21937
+        }
21938
+
21939
+        if (config_table[level].func != config_table[_level].func && strm.total_in !== 0) {
21940
+          // Flush the last buffer:
21941
+          err = strm.deflate(Z_PARTIAL_FLUSH);
21942
+        }
21943
+
21944
+        if (level != _level) {
21945
+          level = _level;
21946
+          max_lazy_match = config_table[level].max_lazy;
21947
+          good_match = config_table[level].good_length;
21948
+          nice_match = config_table[level].nice_length;
21949
+          max_chain_length = config_table[level].max_chain;
21950
+        }
21951
+
21952
+        strategy = _strategy;
21953
+        return err;
21954
+      };
21955
+
21956
+      that.deflateSetDictionary = function (strm, dictionary, dictLength) {
21957
+        var length = dictLength;
21958
+        var n,
21959
+            index = 0;
21960
+        if (!dictionary || status != INIT_STATE) return Z_STREAM_ERROR;
21961
+        if (length < MIN_MATCH) return Z_OK;
21962
+
21963
+        if (length > w_size - MIN_LOOKAHEAD) {
21964
+          length = w_size - MIN_LOOKAHEAD;
21965
+          index = dictLength - length; // use the tail of the dictionary
21966
+        }
21967
+
21968
+        window.set(dictionary.subarray(index, index + length), 0);
21969
+        strstart = length;
21970
+        block_start = length; // Insert all strings in the hash table (except for the last two bytes).
21971
+        // s->lookahead stays null, so s->ins_h will be recomputed at the next
21972
+        // call of fill_window.
21973
+
21974
+        ins_h = window[0] & 0xff;
21975
+        ins_h = (ins_h << hash_shift ^ window[1] & 0xff) & hash_mask;
21976
+
21977
+        for (n = 0; n <= length - MIN_MATCH; n++) {
21978
+          ins_h = (ins_h << hash_shift ^ window[n + (MIN_MATCH - 1)] & 0xff) & hash_mask;
21979
+          prev[n & w_mask] = head[ins_h];
21980
+          head[ins_h] = n;
21981
+        }
21982
+
21983
+        return Z_OK;
21984
+      };
21985
+
21986
+      that.deflate = function (_strm, flush) {
21987
+        var i, header, level_flags, old_flush, bstate;
21988
+
21989
+        if (flush > Z_FINISH || flush < 0) {
21990
+          return Z_STREAM_ERROR;
21991
+        }
21992
+
21993
+        if (!_strm.next_out || !_strm.next_in && _strm.avail_in !== 0 || status == FINISH_STATE && flush != Z_FINISH) {
21994
+          _strm.msg = z_errmsg[Z_NEED_DICT - Z_STREAM_ERROR];
21995
+          return Z_STREAM_ERROR;
21996
+        }
21997
+
21998
+        if (_strm.avail_out === 0) {
21999
+          _strm.msg = z_errmsg[Z_NEED_DICT - Z_BUF_ERROR];
22000
+          return Z_BUF_ERROR;
22001
+        }
22002
+
22003
+        strm = _strm; // just in case
22004
+
22005
+        old_flush = last_flush;
22006
+        last_flush = flush; // Write the zlib header
22007
+
22008
+        if (status == INIT_STATE) {
22009
+          header = Z_DEFLATED + (w_bits - 8 << 4) << 8;
22010
+          level_flags = (level - 1 & 0xff) >> 1;
22011
+          if (level_flags > 3) level_flags = 3;
22012
+          header |= level_flags << 6;
22013
+          if (strstart !== 0) header |= PRESET_DICT;
22014
+          header += 31 - header % 31;
22015
+          status = BUSY_STATE;
22016
+          putShortMSB(header);
22017
+        } // Flush as much pending output as possible
22018
+
22019
+
22020
+        if (that.pending !== 0) {
22021
+          strm.flush_pending();
22022
+
22023
+          if (strm.avail_out === 0) {
22024
+            // console.log(" avail_out==0");
22025
+            // Since avail_out is 0, deflate will be called again with
22026
+            // more output space, but possibly with both pending and
22027
+            // avail_in equal to zero. There won't be anything to do,
22028
+            // but this is not an error situation so make sure we
22029
+            // return OK instead of BUF_ERROR at next call of deflate:
22030
+            last_flush = -1;
22031
+            return Z_OK;
22032
+          } // Make sure there is something to do and avoid duplicate
22033
+          // consecutive
22034
+          // flushes. For repeated and useless calls with Z_FINISH, we keep
22035
+          // returning Z_STREAM_END instead of Z_BUFF_ERROR.
22036
+
22037
+        } else if (strm.avail_in === 0 && flush <= old_flush && flush != Z_FINISH) {
22038
+          strm.msg = z_errmsg[Z_NEED_DICT - Z_BUF_ERROR];
22039
+          return Z_BUF_ERROR;
22040
+        } // User must not provide more input after the first FINISH:
22041
+
22042
+
22043
+        if (status == FINISH_STATE && strm.avail_in !== 0) {
22044
+          _strm.msg = z_errmsg[Z_NEED_DICT - Z_BUF_ERROR];
22045
+          return Z_BUF_ERROR;
22046
+        } // Start a new block or continue the current one.
22047
+
22048
+
22049
+        if (strm.avail_in !== 0 || lookahead !== 0 || flush != Z_NO_FLUSH && status != FINISH_STATE) {
22050
+          bstate = -1;
22051
+
22052
+          switch (config_table[level].func) {
22053
+            case STORED:
22054
+              bstate = deflate_stored(flush);
22055
+              break;
22056
+
22057
+            case FAST:
22058
+              bstate = deflate_fast(flush);
22059
+              break;
22060
+
22061
+            case SLOW:
22062
+              bstate = deflate_slow(flush);
22063
+              break;
22064
+
22065
+            default:
22066
+          }
22067
+
22068
+          if (bstate == FinishStarted || bstate == FinishDone) {
22069
+            status = FINISH_STATE;
22070
+          }
22071
+
22072
+          if (bstate == NeedMore || bstate == FinishStarted) {
22073
+            if (strm.avail_out === 0) {
22074
+              last_flush = -1; // avoid BUF_ERROR next call, see above
22075
+            }
22076
+
22077
+            return Z_OK; // If flush != Z_NO_FLUSH && avail_out === 0, the next call
22078
+            // of deflate should use the same flush parameter to make sure
22079
+            // that the flush is complete. So we don't have to output an
22080
+            // empty block here, this will be done at next call. This also
22081
+            // ensures that for a very small output buffer, we emit at most
22082
+            // one empty block.
22083
+          }
22084
+
22085
+          if (bstate == BlockDone) {
22086
+            if (flush == Z_PARTIAL_FLUSH) {
22087
+              _tr_align();
22088
+            } else {
22089
+              // FULL_FLUSH or SYNC_FLUSH
22090
+              _tr_stored_block(0, 0, false); // For a full flush, this empty block will be recognized
22091
+              // as a special marker by inflate_sync().
22092
+
22093
+
22094
+              if (flush == Z_FULL_FLUSH) {
22095
+                // state.head[s.hash_size-1]=0;
22096
+                for (i = 0; i < hash_size
22097
+                /*-1*/
22098
+                ; i++) {
22099
+                  // forget history
22100
+                  head[i] = 0;
22101
+                }
22102
+              }
22103
+            }
22104
+
22105
+            strm.flush_pending();
22106
+
22107
+            if (strm.avail_out === 0) {
22108
+              last_flush = -1; // avoid BUF_ERROR at next call, see above
22109
+
22110
+              return Z_OK;
22111
+            }
22112
+          }
22113
+        }
22114
+
22115
+        if (flush != Z_FINISH) return Z_OK;
22116
+        return Z_STREAM_END;
22117
+      };
22118
+    } // ZStream
22119
+
22120
+
22121
+    function ZStream() {
22122
+      var that = this;
22123
+      that.next_in_index = 0;
22124
+      that.next_out_index = 0; // that.next_in; // next input byte
22125
+
22126
+      that.avail_in = 0; // number of bytes available at next_in
22127
+
22128
+      that.total_in = 0; // total nb of input bytes read so far
22129
+      // that.next_out; // next output byte should be put there
22130
+
22131
+      that.avail_out = 0; // remaining free space at next_out
22132
+
22133
+      that.total_out = 0; // total nb of bytes output so far
22134
+      // that.msg;
22135
+      // that.dstate;
22136
+    }
22137
+
22138
+    ZStream.prototype = {
22139
+      deflateInit: function deflateInit(level, bits) {
22140
+        var that = this;
22141
+        that.dstate = new Deflate();
22142
+        if (!bits) bits = MAX_BITS;
22143
+        return that.dstate.deflateInit(that, level, bits);
22144
+      },
22145
+      deflate: function deflate(flush) {
22146
+        var that = this;
22147
+
22148
+        if (!that.dstate) {
22149
+          return Z_STREAM_ERROR;
22150
+        }
22151
+
22152
+        return that.dstate.deflate(that, flush);
22153
+      },
22154
+      deflateEnd: function deflateEnd() {
22155
+        var that = this;
22156
+        if (!that.dstate) return Z_STREAM_ERROR;
22157
+        var ret = that.dstate.deflateEnd();
22158
+        that.dstate = null;
22159
+        return ret;
22160
+      },
22161
+      deflateParams: function deflateParams(level, strategy) {
22162
+        var that = this;
22163
+        if (!that.dstate) return Z_STREAM_ERROR;
22164
+        return that.dstate.deflateParams(that, level, strategy);
22165
+      },
22166
+      deflateSetDictionary: function deflateSetDictionary(dictionary, dictLength) {
22167
+        var that = this;
22168
+        if (!that.dstate) return Z_STREAM_ERROR;
22169
+        return that.dstate.deflateSetDictionary(that, dictionary, dictLength);
22170
+      },
22171
+      // Read a new buffer from the current input stream, update the
22172
+      // total number of bytes read. All deflate() input goes through
22173
+      // this function so some applications may wish to modify it to avoid
22174
+      // allocating a large strm->next_in buffer and copying from it.
22175
+      // (See also flush_pending()).
22176
+      read_buf: function read_buf(buf, start, size) {
22177
+        var that = this;
22178
+        var len = that.avail_in;
22179
+        if (len > size) len = size;
22180
+        if (len === 0) return 0;
22181
+        that.avail_in -= len;
22182
+        buf.set(that.next_in.subarray(that.next_in_index, that.next_in_index + len), start);
22183
+        that.next_in_index += len;
22184
+        that.total_in += len;
22185
+        return len;
22186
+      },
22187
+      // Flush as much pending output as possible. All deflate() output goes
22188
+      // through this function so some applications may wish to modify it
22189
+      // to avoid allocating a large strm->next_out buffer and copying into it.
22190
+      // (See also read_buf()).
22191
+      flush_pending: function flush_pending() {
22192
+        var that = this;
22193
+        var len = that.dstate.pending;
22194
+        if (len > that.avail_out) len = that.avail_out;
22195
+        if (len === 0) return; // if (that.dstate.pending_buf.length <= that.dstate.pending_out || that.next_out.length <= that.next_out_index
22196
+        // || that.dstate.pending_buf.length < (that.dstate.pending_out + len) || that.next_out.length < (that.next_out_index +
22197
+        // len)) {
22198
+        // console.log(that.dstate.pending_buf.length + ", " + that.dstate.pending_out + ", " + that.next_out.length + ", " +
22199
+        // that.next_out_index + ", " + len);
22200
+        // console.log("avail_out=" + that.avail_out);
22201
+        // }
22202
+
22203
+        that.next_out.set(that.dstate.pending_buf.subarray(that.dstate.pending_out, that.dstate.pending_out + len), that.next_out_index);
22204
+        that.next_out_index += len;
22205
+        that.dstate.pending_out += len;
22206
+        that.total_out += len;
22207
+        that.avail_out -= len;
22208
+        that.dstate.pending -= len;
22209
+
22210
+        if (that.dstate.pending === 0) {
22211
+          that.dstate.pending_out = 0;
22212
+        }
22213
+      }
22214
+    }; // Deflater
22215
+
22216
+    function Deflater(options) {
22217
+      var that = this;
22218
+      var z = new ZStream();
22219
+      var bufsize = 512;
22220
+      var flush = Z_NO_FLUSH;
22221
+      var buf = new Uint8Array(bufsize);
22222
+      var level = options ? options.level : Z_DEFAULT_COMPRESSION;
22223
+      if (typeof level == "undefined") level = Z_DEFAULT_COMPRESSION;
22224
+      z.deflateInit(level);
22225
+      z.next_out = buf;
22226
+
22227
+      that.append = function (data, onprogress) {
22228
+        var err,
22229
+            buffers = [],
22230
+            lastIndex = 0,
22231
+            bufferIndex = 0,
22232
+            bufferSize = 0,
22233
+            array;
22234
+        if (!data.length) return;
22235
+        z.next_in_index = 0;
22236
+        z.next_in = data;
22237
+        z.avail_in = data.length;
22238
+
22239
+        do {
22240
+          z.next_out_index = 0;
22241
+          z.avail_out = bufsize;
22242
+          err = z.deflate(flush);
22243
+          if (err != Z_OK) throw new Error("deflating: " + z.msg);
22244
+          if (z.next_out_index) if (z.next_out_index == bufsize) buffers.push(new Uint8Array(buf));else buffers.push(new Uint8Array(buf.subarray(0, z.next_out_index)));
22245
+          bufferSize += z.next_out_index;
22246
+
22247
+          if (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {
22248
+            onprogress(z.next_in_index);
22249
+            lastIndex = z.next_in_index;
22250
+          }
22251
+        } while (z.avail_in > 0 || z.avail_out === 0);
22252
+
22253
+        array = new Uint8Array(bufferSize);
22254
+        buffers.forEach(function (chunk) {
22255
+          array.set(chunk, bufferIndex);
22256
+          bufferIndex += chunk.length;
22257
+        });
22258
+        return array;
22259
+      };
22260
+
22261
+      that.flush = function () {
22262
+        var err,
22263
+            buffers = [],
22264
+            bufferIndex = 0,
22265
+            bufferSize = 0,
22266
+            array;
22267
+
22268
+        do {
22269
+          z.next_out_index = 0;
22270
+          z.avail_out = bufsize;
22271
+          err = z.deflate(Z_FINISH);
22272
+          if (err != Z_STREAM_END && err != Z_OK) throw new Error("deflating: " + z.msg);
22273
+          if (bufsize - z.avail_out > 0) buffers.push(new Uint8Array(buf.subarray(0, z.next_out_index)));
22274
+          bufferSize += z.next_out_index;
22275
+        } while (z.avail_in > 0 || z.avail_out === 0);
22276
+
22277
+        z.deflateEnd();
22278
+        array = new Uint8Array(bufferSize);
22279
+        buffers.forEach(function (chunk) {
22280
+          array.set(chunk, bufferIndex);
22281
+          bufferIndex += chunk.length;
22282
+        });
22283
+        return array;
22284
+      };
22285
+    } // 'zip' may not be defined in z-worker and some tests
22286
+
22287
+
22288
+    var env = global.zip || global;
22289
+    env.Deflater = env._jzlib_Deflater = Deflater;
22290
+  })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); // `self` is undefined in Firefox for Android content script context
22291
+  // while `this` is nsIContentFrameMessageManager
22292
+  // with an attribute `content` that corresponds to the window
22293
+
22294
+  /**
22295
+   * A class to parse color values
22296
+   * @author Stoyan Stefanov <sstoo@gmail.com>
22297
+   * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
22298
+   * @license Use it if you like it
22299
+   */
22300
+  (function (global) {
22301
+
22302
+    function RGBColor(color_string) {
22303
+      color_string = color_string || '';
22304
+      this.ok = false; // strip any leading #
22305
+
22306
+      if (color_string.charAt(0) == '#') {
22307
+        // remove # if any
22308
+        color_string = color_string.substr(1, 6);
22309
+      }
22310
+
22311
+      color_string = color_string.replace(/ /g, '');
22312
+      color_string = color_string.toLowerCase();
22313
+      var channels; // before getting into regexps, try simple matches
22314
+      // and overwrite the input
22315
+
22316
+      var simple_colors = {
22317
+        aliceblue: 'f0f8ff',
22318
+        antiquewhite: 'faebd7',
22319
+        aqua: '00ffff',
22320
+        aquamarine: '7fffd4',
22321
+        azure: 'f0ffff',
22322
+        beige: 'f5f5dc',
22323
+        bisque: 'ffe4c4',
22324
+        black: '000000',
22325
+        blanchedalmond: 'ffebcd',
22326
+        blue: '0000ff',
22327
+        blueviolet: '8a2be2',
22328
+        brown: 'a52a2a',
22329
+        burlywood: 'deb887',
22330
+        cadetblue: '5f9ea0',
22331
+        chartreuse: '7fff00',
22332
+        chocolate: 'd2691e',
22333
+        coral: 'ff7f50',
22334
+        cornflowerblue: '6495ed',
22335
+        cornsilk: 'fff8dc',
22336
+        crimson: 'dc143c',
22337
+        cyan: '00ffff',
22338
+        darkblue: '00008b',
22339
+        darkcyan: '008b8b',
22340
+        darkgoldenrod: 'b8860b',
22341
+        darkgray: 'a9a9a9',
22342
+        darkgreen: '006400',
22343
+        darkkhaki: 'bdb76b',
22344
+        darkmagenta: '8b008b',
22345
+        darkolivegreen: '556b2f',
22346
+        darkorange: 'ff8c00',
22347
+        darkorchid: '9932cc',
22348
+        darkred: '8b0000',
22349
+        darksalmon: 'e9967a',
22350
+        darkseagreen: '8fbc8f',
22351
+        darkslateblue: '483d8b',
22352
+        darkslategray: '2f4f4f',
22353
+        darkturquoise: '00ced1',
22354
+        darkviolet: '9400d3',
22355
+        deeppink: 'ff1493',
22356
+        deepskyblue: '00bfff',
22357
+        dimgray: '696969',
22358
+        dodgerblue: '1e90ff',
22359
+        feldspar: 'd19275',
22360
+        firebrick: 'b22222',
22361
+        floralwhite: 'fffaf0',
22362
+        forestgreen: '228b22',
22363
+        fuchsia: 'ff00ff',
22364
+        gainsboro: 'dcdcdc',
22365
+        ghostwhite: 'f8f8ff',
22366
+        gold: 'ffd700',
22367
+        goldenrod: 'daa520',
22368
+        gray: '808080',
22369
+        green: '008000',
22370
+        greenyellow: 'adff2f',
22371
+        honeydew: 'f0fff0',
22372
+        hotpink: 'ff69b4',
22373
+        indianred: 'cd5c5c',
22374
+        indigo: '4b0082',
22375
+        ivory: 'fffff0',
22376
+        khaki: 'f0e68c',
22377
+        lavender: 'e6e6fa',
22378
+        lavenderblush: 'fff0f5',
22379
+        lawngreen: '7cfc00',
22380
+        lemonchiffon: 'fffacd',
22381
+        lightblue: 'add8e6',
22382
+        lightcoral: 'f08080',
22383
+        lightcyan: 'e0ffff',
22384
+        lightgoldenrodyellow: 'fafad2',
22385
+        lightgrey: 'd3d3d3',
22386
+        lightgreen: '90ee90',
22387
+        lightpink: 'ffb6c1',
22388
+        lightsalmon: 'ffa07a',
22389
+        lightseagreen: '20b2aa',
22390
+        lightskyblue: '87cefa',
22391
+        lightslateblue: '8470ff',
22392
+        lightslategray: '778899',
22393
+        lightsteelblue: 'b0c4de',
22394
+        lightyellow: 'ffffe0',
22395
+        lime: '00ff00',
22396
+        limegreen: '32cd32',
22397
+        linen: 'faf0e6',
22398
+        magenta: 'ff00ff',
22399
+        maroon: '800000',
22400
+        mediumaquamarine: '66cdaa',
22401
+        mediumblue: '0000cd',
22402
+        mediumorchid: 'ba55d3',
22403
+        mediumpurple: '9370d8',
22404
+        mediumseagreen: '3cb371',
22405
+        mediumslateblue: '7b68ee',
22406
+        mediumspringgreen: '00fa9a',
22407
+        mediumturquoise: '48d1cc',
22408
+        mediumvioletred: 'c71585',
22409
+        midnightblue: '191970',
22410
+        mintcream: 'f5fffa',
22411
+        mistyrose: 'ffe4e1',
22412
+        moccasin: 'ffe4b5',
22413
+        navajowhite: 'ffdead',
22414
+        navy: '000080',
22415
+        oldlace: 'fdf5e6',
22416
+        olive: '808000',
22417
+        olivedrab: '6b8e23',
22418
+        orange: 'ffa500',
22419
+        orangered: 'ff4500',
22420
+        orchid: 'da70d6',
22421
+        palegoldenrod: 'eee8aa',
22422
+        palegreen: '98fb98',
22423
+        paleturquoise: 'afeeee',
22424
+        palevioletred: 'd87093',
22425
+        papayawhip: 'ffefd5',
22426
+        peachpuff: 'ffdab9',
22427
+        peru: 'cd853f',
22428
+        pink: 'ffc0cb',
22429
+        plum: 'dda0dd',
22430
+        powderblue: 'b0e0e6',
22431
+        purple: '800080',
22432
+        red: 'ff0000',
22433
+        rosybrown: 'bc8f8f',
22434
+        royalblue: '4169e1',
22435
+        saddlebrown: '8b4513',
22436
+        salmon: 'fa8072',
22437
+        sandybrown: 'f4a460',
22438
+        seagreen: '2e8b57',
22439
+        seashell: 'fff5ee',
22440
+        sienna: 'a0522d',
22441
+        silver: 'c0c0c0',
22442
+        skyblue: '87ceeb',
22443
+        slateblue: '6a5acd',
22444
+        slategray: '708090',
22445
+        snow: 'fffafa',
22446
+        springgreen: '00ff7f',
22447
+        steelblue: '4682b4',
22448
+        tan: 'd2b48c',
22449
+        teal: '008080',
22450
+        thistle: 'd8bfd8',
22451
+        tomato: 'ff6347',
22452
+        turquoise: '40e0d0',
22453
+        violet: 'ee82ee',
22454
+        violetred: 'd02090',
22455
+        wheat: 'f5deb3',
22456
+        white: 'ffffff',
22457
+        whitesmoke: 'f5f5f5',
22458
+        yellow: 'ffff00',
22459
+        yellowgreen: '9acd32'
22460
+      };
22461
+
22462
+      for (var key in simple_colors) {
22463
+        if (color_string == key) {
22464
+          color_string = simple_colors[key];
22465
+        }
22466
+      } // emd of simple type-in colors
22467
+      // array of color definition objects
22468
+
22469
+
22470
+      var color_defs = [{
22471
+        re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
22472
+        example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
22473
+        process: function process(bits) {
22474
+          return [parseInt(bits[1]), parseInt(bits[2]), parseInt(bits[3])];
22475
+        }
22476
+      }, {
22477
+        re: /^(\w{2})(\w{2})(\w{2})$/,
22478
+        example: ['#00ff00', '336699'],
22479
+        process: function process(bits) {
22480
+          return [parseInt(bits[1], 16), parseInt(bits[2], 16), parseInt(bits[3], 16)];
22481
+        }
22482
+      }, {
22483
+        re: /^(\w{1})(\w{1})(\w{1})$/,
22484
+        example: ['#fb0', 'f0f'],
22485
+        process: function process(bits) {
22486
+          return [parseInt(bits[1] + bits[1], 16), parseInt(bits[2] + bits[2], 16), parseInt(bits[3] + bits[3], 16)];
22487
+        }
22488
+      }]; // search through the definitions to find a match
22489
+
22490
+      for (var i = 0; i < color_defs.length; i++) {
22491
+        var re = color_defs[i].re;
22492
+        var processor = color_defs[i].process;
22493
+        var bits = re.exec(color_string);
22494
+
22495
+        if (bits) {
22496
+          channels = processor(bits);
22497
+          this.r = channels[0];
22498
+          this.g = channels[1];
22499
+          this.b = channels[2];
22500
+          this.ok = true;
22501
+        }
22502
+      } // validate/cleanup values
22503
+
22504
+
22505
+      this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;
22506
+      this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;
22507
+      this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b; // some getters
22508
+
22509
+      this.toRGB = function () {
22510
+        return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
22511
+      };
22512
+
22513
+      this.toHex = function () {
22514
+        var r = this.r.toString(16);
22515
+        var g = this.g.toString(16);
22516
+        var b = this.b.toString(16);
22517
+        if (r.length == 1) r = '0' + r;
22518
+        if (g.length == 1) g = '0' + g;
22519
+        if (b.length == 1) b = '0' + b;
22520
+        return '#' + r + g + b;
22521
+      };
22522
+    }
22523
+
22524
+    global.RGBColor = RGBColor;
22525
+  })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); // `self` is undefined in Firefox for Android content script context
22526
+  // while `this` is nsIContentFrameMessageManager
22527
+  // with an attribute `content` that corresponds to the window
22528
+
22529
+  /************************************************
22530
+   * Title : custom font                          *
22531
+   * Start Data : 2017. 01. 22.                   *
22532
+   * Comment : TEXT API                           *
22533
+   ************************************************/
22534
+
22535
+  /******************************
22536
+   * jsPDF extension API Design *
22537
+   * ****************************/
22538
+  (function (jsPDF) {
22539
+
22540
+    var PLUS = '+'.charCodeAt(0);
22541
+    var SLASH = '/'.charCodeAt(0);
22542
+    var NUMBER = '0'.charCodeAt(0);
22543
+    var LOWER = 'a'.charCodeAt(0);
22544
+    var UPPER = 'A'.charCodeAt(0);
22545
+    var PLUS_URL_SAFE = '-'.charCodeAt(0);
22546
+    var SLASH_URL_SAFE = '_'.charCodeAt(0);
22547
+    /*****************************************************************/
22548
+
22549
+    /* function : b64ToByteArray                                     */
22550
+
22551
+    /* comment : Base64 encoded TTF file contents (b64) are decoded  */
22552
+
22553
+    /*     by Byte array and stored.                                 */
22554
+
22555
+    /*****************************************************************/
22556
+
22557
+    var b64ToByteArray = function b64ToByteArray(b64) {
22558
+      var i, j, l, tmp, placeHolders, arr;
22559
+
22560
+      if (b64.length % 4 > 0) {
22561
+        throw new Error('Invalid string. Length must be a multiple of 4');
22562
+      } // the number of equal signs (place holders)
22563
+      // if there are two placeholders, than the two characters before it
22564
+      // represent one byte
22565
+      // if there is only one, then the three characters before it represent 2 bytes
22566
+      // this is just a cheap hack to not do indexOf twice
22567
+
22568
+
22569
+      var len = b64.length;
22570
+      placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0; // base64 is 4/3 + up to two characters of the original data
22571
+
22572
+      arr = new Uint8Array(b64.length * 3 / 4 - placeHolders); // if there are placeholders, only get up to the last complete 4 chars
22573
+
22574
+      l = placeHolders > 0 ? b64.length - 4 : b64.length;
22575
+      var L = 0;
22576
+
22577
+      function push(v) {
22578
+        arr[L++] = v;
22579
+      }
22580
+
22581
+      for (i = 0, j = 0; i < l; i += 4, j += 3) {
22582
+        tmp = decode(b64.charAt(i)) << 18 | decode(b64.charAt(i + 1)) << 12 | decode(b64.charAt(i + 2)) << 6 | decode(b64.charAt(i + 3));
22583
+        push((tmp & 0xFF0000) >> 16);
22584
+        push((tmp & 0xFF00) >> 8);
22585
+        push(tmp & 0xFF);
22586
+      }
22587
+
22588
+      if (placeHolders === 2) {
22589
+        tmp = decode(b64.charAt(i)) << 2 | decode(b64.charAt(i + 1)) >> 4;
22590
+        push(tmp & 0xFF);
22591
+      } else if (placeHolders === 1) {
22592
+        tmp = decode(b64.charAt(i)) << 10 | decode(b64.charAt(i + 1)) << 4 | decode(b64.charAt(i + 2)) >> 2;
22593
+        push(tmp >> 8 & 0xFF);
22594
+        push(tmp & 0xFF);
22595
+      }
22596
+
22597
+      return arr;
22598
+    };
22599
+    /***************************************************************/
22600
+
22601
+    /* function : decode                                           */
22602
+
22603
+    /* comment : Change the base64 encoded font's content to match */
22604
+
22605
+    /*   the base64 index value.                                   */
22606
+
22607
+    /***************************************************************/
22608
+
22609
+
22610
+    var decode = function decode(elt) {
22611
+      var code = elt.charCodeAt(0);
22612
+      if (code === PLUS || code === PLUS_URL_SAFE) return 62; // '+'
22613
+
22614
+      if (code === SLASH || code === SLASH_URL_SAFE) return 63; // '/'
22615
+
22616
+      if (code < NUMBER) return -1; //no match
22617
+
22618
+      if (code < NUMBER + 10) return code - NUMBER + 26 + 26;
22619
+      if (code < UPPER + 26) return code - UPPER;
22620
+      if (code < LOWER + 26) return code - LOWER + 26;
22621
+    };
22622
+
22623
+    jsPDF.API.TTFFont = function () {
22624
+      /************************************************************************/
22625
+
22626
+      /* function : open                                                       */
22627
+
22628
+      /* comment : Decode the encoded ttf content and create a TTFFont object. */
22629
+
22630
+      /************************************************************************/
22631
+      TTFFont.open = function (filename, name, vfs, encoding) {
22632
+        var contents;
22633
+
22634
+        if (typeof vfs !== "string") {
22635
+          throw new Error('Invalid argument supplied in TTFFont.open');
22636
+        }
22637
+
22638
+        contents = b64ToByteArray(vfs);
22639
+        return new TTFFont(contents, name, encoding);
22640
+      };
22641
+      /***************************************************************/
22642
+
22643
+      /* function : TTFFont gernerator                               */
22644
+
22645
+      /* comment : Decode TTF contents are parsed, Data,             */
22646
+
22647
+      /* Subset object is created, and registerTTF function is called.*/
22648
+
22649
+      /***************************************************************/
22650
+
22651
+
22652
+      function TTFFont(rawData, name, encoding) {
22653
+        var data;
22654
+
22655
+        this.rawData = rawData;
22656
+        data = this.contents = new Data(rawData);
22657
+        this.contents.pos = 4;
22658
+
22659
+        if (data.readString(4) === 'ttcf') {
22660
+          if (!name) {
22661
+            throw new Error("Must specify a font name for TTC files.");
22662
+          }
22663
+          throw new Error("Font " + name + " not found in TTC file.");
22664
+        } else {
22665
+          data.pos = 0;
22666
+          this.parse();
22667
+          this.subset = new Subset(this);
22668
+          this.registerTTF();
22669
+        }
22670
+      }
22671
+      /********************************************************/
22672
+
22673
+      /* function : parse                                     */
22674
+
22675
+      /* comment : TTF Parses the file contents by each table.*/
22676
+
22677
+      /********************************************************/
22678
+
22679
+
22680
+      TTFFont.prototype.parse = function () {
22681
+        this.directory = new Directory(this.contents);
22682
+        this.head = new HeadTable(this);
22683
+        this.name = new NameTable(this);
22684
+        this.cmap = new CmapTable(this);
22685
+        this.toUnicode = new Map();
22686
+        this.hhea = new HheaTable(this);
22687
+        this.maxp = new MaxpTable(this);
22688
+        this.hmtx = new HmtxTable(this);
22689
+        this.post = new PostTable(this);
22690
+        this.os2 = new OS2Table(this);
22691
+        this.loca = new LocaTable(this);
22692
+        this.glyf = new GlyfTable(this);
22693
+        this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender;
22694
+        this.decender = this.os2.exists && this.os2.decender || this.hhea.decender;
22695
+        this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap;
22696
+        return this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax];
22697
+      };
22698
+      /***************************************************************/
22699
+
22700
+      /* function : registerTTF                                      */
22701
+
22702
+      /* comment : Get the value to assign pdf font descriptors.     */
22703
+
22704
+      /***************************************************************/
22705
+
22706
+
22707
+      TTFFont.prototype.registerTTF = function () {
22708
+        var e, hi, low, raw, _ref;
22709
+
22710
+        this.scaleFactor = 1000.0 / this.head.unitsPerEm;
22711
+
22712
+        this.bbox = function () {
22713
+          var _i, _len, _ref, _results;
22714
+
22715
+          _ref = this.bbox;
22716
+          _results = [];
22717
+
22718
+          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
22719
+            e = _ref[_i];
22720
+
22721
+            _results.push(Math.round(e * this.scaleFactor));
22722
+          }
22723
+
22724
+          return _results;
22725
+        }.call(this);
22726
+
22727
+        this.stemV = 0;
22728
+
22729
+        if (this.post.exists) {
22730
+          raw = this.post.italic_angle;
22731
+          hi = raw >> 16;
22732
+          low = raw & 0xFF;
22733
+
22734
+          if (hi & 0x8000 !== 0) {
22735
+            hi = -((hi ^ 0xFFFF) + 1);
22736
+          }
22737
+
22738
+          this.italicAngle = +("" + hi + "." + low);
22739
+        } else {
22740
+          this.italicAngle = 0;
22741
+        }
22742
+
22743
+        this.ascender = Math.round(this.ascender * this.scaleFactor);
22744
+        this.decender = Math.round(this.decender * this.scaleFactor);
22745
+        this.lineGap = Math.round(this.lineGap * this.scaleFactor);
22746
+        this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender;
22747
+        this.xHeight = this.os2.exists && this.os2.xHeight || 0;
22748
+        this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8;
22749
+        this.isSerif = (_ref = this.familyClass) === 1 || _ref === 2 || _ref === 3 || _ref === 4 || _ref === 5 || _ref === 7;
22750
+        this.isScript = this.familyClass === 10;
22751
+        this.flags = 0;
22752
+
22753
+        if (this.post.isFixedPitch) {
22754
+          this.flags |= 1 << 0;
22755
+        }
22756
+
22757
+        if (this.isSerif) {
22758
+          this.flags |= 1 << 1;
22759
+        }
22760
+
22761
+        if (this.isScript) {
22762
+          this.flags |= 1 << 3;
22763
+        }
22764
+
22765
+        if (this.italicAngle !== 0) {
22766
+          this.flags |= 1 << 6;
22767
+        }
22768
+
22769
+        this.flags |= 1 << 5;
22770
+
22771
+        if (!this.cmap.unicode) {
22772
+          throw new Error('No unicode cmap for font');
22773
+        }
22774
+      };
22775
+
22776
+      TTFFont.prototype.characterToGlyph = function (character) {
22777
+        var _ref;
22778
+
22779
+        return ((_ref = this.cmap.unicode) != null ? _ref.codeMap[character] : void 0) || 0;
22780
+      };
22781
+
22782
+      TTFFont.prototype.widthOfGlyph = function (glyph) {
22783
+        var scale;
22784
+        scale = 1000.0 / this.head.unitsPerEm;
22785
+        return this.hmtx.forGlyph(glyph).advance * scale;
22786
+      };
22787
+
22788
+      TTFFont.prototype.widthOfString = function (string, size, charSpace) {
22789
+        var charCode, i, scale, width, _i, _ref, charSpace;
22790
+
22791
+        string = '' + string;
22792
+        width = 0;
22793
+
22794
+        for (i = _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
22795
+          charCode = string.charCodeAt(i);
22796
+          width += this.widthOfGlyph(this.characterToGlyph(charCode)) + charSpace * (1000 / size) || 0;
22797
+        }
22798
+
22799
+        scale = size / 1000;
22800
+        return width * scale;
22801
+      };
22802
+
22803
+      TTFFont.prototype.lineHeight = function (size, includeGap) {
22804
+        var gap;
22805
+
22806
+        if (includeGap == null) {
22807
+          includeGap = false;
22808
+        }
22809
+
22810
+        gap = includeGap ? this.lineGap : 0;
22811
+        return (this.ascender + gap - this.decender) / 1000 * size;
22812
+      };
22813
+
22814
+      return TTFFont;
22815
+    }();
22816
+    /************************************************************************************************/
22817
+
22818
+    /* function : Data                                                                              */
22819
+
22820
+    /* comment : The ttf data decoded and stored in an array is read and written to the Data object.*/
22821
+
22822
+    /************************************************************************************************/
22823
+
22824
+
22825
+    var Data = function () {
22826
+      function Data(data) {
22827
+        this.data = data != null ? data : [];
22828
+        this.pos = 0;
22829
+        this.length = this.data.length;
22830
+      }
22831
+
22832
+      Data.prototype.readByte = function () {
22833
+        return this.data[this.pos++];
22834
+      };
22835
+
22836
+      Data.prototype.writeByte = function (byte) {
22837
+        return this.data[this.pos++] = byte;
22838
+      };
22839
+
22840
+      Data.prototype.readUInt32 = function () {
22841
+        var b1, b2, b3, b4;
22842
+        b1 = this.readByte() * 0x1000000;
22843
+        b2 = this.readByte() << 16;
22844
+        b3 = this.readByte() << 8;
22845
+        b4 = this.readByte();
22846
+        return b1 + b2 + b3 + b4;
22847
+      };
22848
+
22849
+      Data.prototype.writeUInt32 = function (val) {
22850
+        this.writeByte(val >>> 24 & 0xff);
22851
+        this.writeByte(val >> 16 & 0xff);
22852
+        this.writeByte(val >> 8 & 0xff);
22853
+        return this.writeByte(val & 0xff);
22854
+      };
22855
+
22856
+      Data.prototype.readInt32 = function () {
22857
+        var int;
22858
+        int = this.readUInt32();
22859
+
22860
+        if (int >= 0x80000000) {
22861
+          return int - 0x100000000;
22862
+        } else {
22863
+          return int;
22864
+        }
22865
+      };
22866
+
22867
+      Data.prototype.writeInt32 = function (val) {
22868
+        if (val < 0) {
22869
+          val += 0x100000000;
22870
+        }
22871
+
22872
+        return this.writeUInt32(val);
22873
+      };
22874
+
22875
+      Data.prototype.readUInt16 = function () {
22876
+        var b1, b2;
22877
+        b1 = this.readByte() << 8;
22878
+        b2 = this.readByte();
22879
+        return b1 | b2;
22880
+      };
22881
+
22882
+      Data.prototype.writeUInt16 = function (val) {
22883
+        this.writeByte(val >> 8 & 0xff);
22884
+        return this.writeByte(val & 0xff);
22885
+      };
22886
+
22887
+      Data.prototype.readInt16 = function () {
22888
+        var int;
22889
+        int = this.readUInt16();
22890
+
22891
+        if (int >= 0x8000) {
22892
+          return int - 0x10000;
22893
+        } else {
22894
+          return int;
22895
+        }
22896
+      };
22897
+
22898
+      Data.prototype.writeInt16 = function (val) {
22899
+        if (val < 0) {
22900
+          val += 0x10000;
22901
+        }
22902
+
22903
+        return this.writeUInt16(val);
22904
+      };
22905
+
22906
+      Data.prototype.readString = function (length) {
22907
+        var i, ret, _i;
22908
+
22909
+        ret = [];
22910
+
22911
+        for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) {
22912
+          ret[i] = String.fromCharCode(this.readByte());
22913
+        }
22914
+
22915
+        return ret.join('');
22916
+      };
22917
+
22918
+      Data.prototype.writeString = function (val) {
22919
+        var i, _i, _ref, _results;
22920
+
22921
+        _results = [];
22922
+
22923
+        for (i = _i = 0, _ref = val.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
22924
+          _results.push(this.writeByte(val.charCodeAt(i)));
22925
+        }
22926
+
22927
+        return _results;
22928
+      };
22929
+      /*Data.prototype.stringAt = function (pos, length) {
22930
+          this.pos = pos;
22931
+          return this.readString(length);
22932
+      };*/
22933
+
22934
+
22935
+      Data.prototype.readShort = function () {
22936
+        return this.readInt16();
22937
+      };
22938
+
22939
+      Data.prototype.writeShort = function (val) {
22940
+        return this.writeInt16(val);
22941
+      };
22942
+
22943
+      Data.prototype.readLongLong = function () {
22944
+        var b1, b2, b3, b4, b5, b6, b7, b8;
22945
+        b1 = this.readByte();
22946
+        b2 = this.readByte();
22947
+        b3 = this.readByte();
22948
+        b4 = this.readByte();
22949
+        b5 = this.readByte();
22950
+        b6 = this.readByte();
22951
+        b7 = this.readByte();
22952
+        b8 = this.readByte();
22953
+
22954
+        if (b1 & 0x80) {
22955
+          return ((b1 ^ 0xff) * 0x100000000000000 + (b2 ^ 0xff) * 0x1000000000000 + (b3 ^ 0xff) * 0x10000000000 + (b4 ^ 0xff) * 0x100000000 + (b5 ^ 0xff) * 0x1000000 + (b6 ^ 0xff) * 0x10000 + (b7 ^ 0xff) * 0x100 + (b8 ^ 0xff) + 1) * -1;
22956
+        }
22957
+
22958
+        return b1 * 0x100000000000000 + b2 * 0x1000000000000 + b3 * 0x10000000000 + b4 * 0x100000000 + b5 * 0x1000000 + b6 * 0x10000 + b7 * 0x100 + b8;
22959
+      };
22960
+
22961
+      Data.prototype.writeLongLong = function (val) {
22962
+        var high, low;
22963
+        high = Math.floor(val / 0x100000000);
22964
+        low = val & 0xffffffff;
22965
+        this.writeByte(high >> 24 & 0xff);
22966
+        this.writeByte(high >> 16 & 0xff);
22967
+        this.writeByte(high >> 8 & 0xff);
22968
+        this.writeByte(high & 0xff);
22969
+        this.writeByte(low >> 24 & 0xff);
22970
+        this.writeByte(low >> 16 & 0xff);
22971
+        this.writeByte(low >> 8 & 0xff);
22972
+        return this.writeByte(low & 0xff);
22973
+      };
22974
+
22975
+      Data.prototype.readInt = function () {
22976
+        return this.readInt32();
22977
+      };
22978
+
22979
+      Data.prototype.writeInt = function (val) {
22980
+        return this.writeInt32(val);
22981
+      };
22982
+      /*Data.prototype.slice = function (start, end) {
22983
+          return this.data.slice(start, end);
22984
+      };*/
22985
+
22986
+
22987
+      Data.prototype.read = function (bytes) {
22988
+        var buf, i, _i;
22989
+
22990
+        buf = [];
22991
+
22992
+        for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) {
22993
+          buf.push(this.readByte());
22994
+        }
22995
+
22996
+        return buf;
22997
+      };
22998
+
22999
+      Data.prototype.write = function (bytes) {
23000
+        var byte, _i, _len, _results;
23001
+
23002
+        _results = [];
23003
+
23004
+        for (_i = 0, _len = bytes.length; _i < _len; _i++) {
23005
+          byte = bytes[_i];
23006
+
23007
+          _results.push(this.writeByte(byte));
23008
+        }
23009
+
23010
+        return _results;
23011
+      };
23012
+
23013
+      return Data;
23014
+    }();
23015
+
23016
+    var Directory = function () {
23017
+      var checksum;
23018
+      /*****************************************************************************************************/
23019
+
23020
+      /* function : Directory generator                                                                    */
23021
+
23022
+      /* comment : Initialize the offset, tag, length, and checksum for each table for the font to be used.*/
23023
+
23024
+      /*****************************************************************************************************/
23025
+
23026
+      function Directory(data) {
23027
+        var entry, i, _i, _ref;
23028
+
23029
+        this.scalarType = data.readInt();
23030
+        this.tableCount = data.readShort();
23031
+        this.searchRange = data.readShort();
23032
+        this.entrySelector = data.readShort();
23033
+        this.rangeShift = data.readShort();
23034
+        this.tables = {};
23035
+
23036
+        for (i = _i = 0, _ref = this.tableCount; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
23037
+          entry = {
23038
+            tag: data.readString(4),
23039
+            checksum: data.readInt(),
23040
+            offset: data.readInt(),
23041
+            length: data.readInt()
23042
+          };
23043
+          this.tables[entry.tag] = entry;
23044
+        }
23045
+      }
23046
+      /********************************************************************************************************/
23047
+
23048
+      /* function : encode                                                                                    */
23049
+
23050
+      /* comment : It encodes and stores the font table object and information used for the directory object. */
23051
+
23052
+      /********************************************************************************************************/
23053
+
23054
+
23055
+      Directory.prototype.encode = function (tables) {
23056
+        var adjustment, directory, directoryLength, entrySelector, headOffset, log2, offset, rangeShift, searchRange, sum, table, tableCount, tableData, tag;
23057
+        tableCount = Object.keys(tables).length;
23058
+        log2 = Math.log(2);
23059
+        searchRange = Math.floor(Math.log(tableCount) / log2) * 16;
23060
+        entrySelector = Math.floor(searchRange / log2);
23061
+        rangeShift = tableCount * 16 - searchRange;
23062
+        directory = new Data();
23063
+        directory.writeInt(this.scalarType);
23064
+        directory.writeShort(tableCount);
23065
+        directory.writeShort(searchRange);
23066
+        directory.writeShort(entrySelector);
23067
+        directory.writeShort(rangeShift);
23068
+        directoryLength = tableCount * 16;
23069
+        offset = directory.pos + directoryLength;
23070
+        headOffset = null;
23071
+        tableData = [];
23072
+
23073
+        for (tag in tables) {
23074
+          table = tables[tag];
23075
+          directory.writeString(tag);
23076
+          directory.writeInt(checksum(table));
23077
+          directory.writeInt(offset);
23078
+          directory.writeInt(table.length);
23079
+          tableData = tableData.concat(table);
23080
+
23081
+          if (tag === 'head') {
23082
+            headOffset = offset;
23083
+          }
23084
+
23085
+          offset += table.length;
23086
+
23087
+          while (offset % 4) {
23088
+            tableData.push(0);
23089
+            offset++;
23090
+          }
23091
+        }
23092
+
23093
+        directory.write(tableData);
23094
+        sum = checksum(directory.data);
23095
+        adjustment = 0xB1B0AFBA - sum;
23096
+        directory.pos = headOffset + 8;
23097
+        directory.writeUInt32(adjustment);
23098
+        return directory.data;
23099
+      };
23100
+      /***************************************************************/
23101
+
23102
+      /* function : checksum                                         */
23103
+
23104
+      /* comment : Duplicate the table for the tag.                  */
23105
+
23106
+      /***************************************************************/
23107
+
23108
+
23109
+      checksum = function checksum(data) {
23110
+        var i, sum, tmp, _i, _ref;
23111
+
23112
+        data = __slice.call(data);
23113
+
23114
+        while (data.length % 4) {
23115
+          data.push(0);
23116
+        }
23117
+
23118
+        tmp = new Data(data);
23119
+        sum = 0;
23120
+
23121
+        for (i = _i = 0, _ref = data.length; _i < _ref; i = _i += 4) {
23122
+          sum += tmp.readUInt32();
23123
+        }
23124
+
23125
+        return sum & 0xFFFFFFFF;
23126
+      };
23127
+
23128
+      return Directory;
23129
+    }();
23130
+
23131
+    var Table,
23132
+        __hasProp = {}.hasOwnProperty,
23133
+        __extends = function __extends(child, parent) {
23134
+      for (var key in parent) {
23135
+        if (__hasProp.call(parent, key)) child[key] = parent[key];
23136
+      }
23137
+
23138
+      function ctor() {
23139
+        this.constructor = child;
23140
+      }
23141
+
23142
+      ctor.prototype = parent.prototype;
23143
+      child.prototype = new ctor();
23144
+      child.__super__ = parent.prototype;
23145
+      return child;
23146
+    };
23147
+    /***************************************************************/
23148
+
23149
+    /* function : Table                                            */
23150
+
23151
+    /* comment : Save info for each table, and parse the table.    */
23152
+
23153
+    /***************************************************************/
23154
+
23155
+    Table = function () {
23156
+      function Table(file) {
23157
+        var info;
23158
+        this.file = file;
23159
+        info = this.file.directory.tables[this.tag];
23160
+        this.exists = !!info;
23161
+
23162
+        if (info) {
23163
+          this.offset = info.offset, this.length = info.length;
23164
+          this.parse(this.file.contents);
23165
+        }
23166
+      }
23167
+
23168
+      Table.prototype.parse = function () {};
23169
+
23170
+      Table.prototype.encode = function () {};
23171
+
23172
+      Table.prototype.raw = function () {
23173
+        if (!this.exists) {
23174
+          return null;
23175
+        }
23176
+
23177
+        this.file.contents.pos = this.offset;
23178
+        return this.file.contents.read(this.length);
23179
+      };
23180
+
23181
+      return Table;
23182
+    }();
23183
+
23184
+    var HeadTable = function (_super) {
23185
+      __extends(HeadTable, _super);
23186
+
23187
+      function HeadTable() {
23188
+        return HeadTable.__super__.constructor.apply(this, arguments);
23189
+      }
23190
+
23191
+      HeadTable.prototype.tag = 'head';
23192
+
23193
+      HeadTable.prototype.parse = function (data) {
23194
+        data.pos = this.offset;
23195
+        this.version = data.readInt();
23196
+        this.revision = data.readInt();
23197
+        this.checkSumAdjustment = data.readInt();
23198
+        this.magicNumber = data.readInt();
23199
+        this.flags = data.readShort();
23200
+        this.unitsPerEm = data.readShort();
23201
+        this.created = data.readLongLong();
23202
+        this.modified = data.readLongLong();
23203
+        this.xMin = data.readShort();
23204
+        this.yMin = data.readShort();
23205
+        this.xMax = data.readShort();
23206
+        this.yMax = data.readShort();
23207
+        this.macStyle = data.readShort();
23208
+        this.lowestRecPPEM = data.readShort();
23209
+        this.fontDirectionHint = data.readShort();
23210
+        this.indexToLocFormat = data.readShort();
23211
+        return this.glyphDataFormat = data.readShort();
23212
+      };
23213
+
23214
+      HeadTable.prototype.encode = function (indexToLocFormat) {
23215
+        var table;
23216
+        table = new Data();
23217
+        table.writeInt(this.version);
23218
+        table.writeInt(this.revision);
23219
+        table.writeInt(this.checkSumAdjustment);
23220
+        table.writeInt(this.magicNumber);
23221
+        table.writeShort(this.flags);
23222
+        table.writeShort(this.unitsPerEm);
23223
+        table.writeLongLong(this.created);
23224
+        table.writeLongLong(this.modified);
23225
+        table.writeShort(this.xMin);
23226
+        table.writeShort(this.yMin);
23227
+        table.writeShort(this.xMax);
23228
+        table.writeShort(this.yMax);
23229
+        table.writeShort(this.macStyle);
23230
+        table.writeShort(this.lowestRecPPEM);
23231
+        table.writeShort(this.fontDirectionHint);
23232
+        table.writeShort(indexToLocFormat);
23233
+        table.writeShort(this.glyphDataFormat);
23234
+        return table.data;
23235
+      };
23236
+
23237
+      return HeadTable;
23238
+    }(Table);
23239
+    /************************************************************************************/
23240
+
23241
+    /* function : CmapEntry                                                             */
23242
+
23243
+    /* comment : Cmap Initializes and encodes object information (required by pdf spec).*/
23244
+
23245
+    /************************************************************************************/
23246
+
23247
+
23248
+    var CmapEntry = function () {
23249
+      function CmapEntry(data, offset) {
23250
+        var code, count, endCode, glyphId, glyphIds, i, idDelta, idRangeOffset, index, saveOffset, segCount, segCountX2, start, startCode, tail, _i, _j, _k, _len;
23251
+
23252
+        this.platformID = data.readUInt16();
23253
+        this.encodingID = data.readShort();
23254
+        this.offset = offset + data.readInt();
23255
+        saveOffset = data.pos;
23256
+        data.pos = this.offset;
23257
+        this.format = data.readUInt16();
23258
+        this.length = data.readUInt16();
23259
+        this.language = data.readUInt16();
23260
+        this.isUnicode = this.platformID === 3 && this.encodingID === 1 && this.format === 4 || this.platformID === 0 && this.format === 4;
23261
+        this.codeMap = {};
23262
+
23263
+        switch (this.format) {
23264
+          case 0:
23265
+            for (i = _i = 0; _i < 256; i = ++_i) {
23266
+              this.codeMap[i] = data.readByte();
23267
+            }
23268
+
23269
+            break;
23270
+
23271
+          case 4:
23272
+            segCountX2 = data.readUInt16();
23273
+            segCount = segCountX2 / 2;
23274
+            data.pos += 6;
23275
+
23276
+            endCode = function () {
23277
+              var _j, _results;
23278
+
23279
+              _results = [];
23280
+
23281
+              for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) {
23282
+                _results.push(data.readUInt16());
23283
+              }
23284
+
23285
+              return _results;
23286
+            }();
23287
+
23288
+            data.pos += 2;
23289
+
23290
+            startCode = function () {
23291
+              var _j, _results;
23292
+
23293
+              _results = [];
23294
+
23295
+              for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) {
23296
+                _results.push(data.readUInt16());
23297
+              }
23298
+
23299
+              return _results;
23300
+            }();
23301
+
23302
+            idDelta = function () {
23303
+              var _j, _results;
23304
+
23305
+              _results = [];
23306
+
23307
+              for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) {
23308
+                _results.push(data.readUInt16());
23309
+              }
23310
+
23311
+              return _results;
23312
+            }();
23313
+
23314
+            idRangeOffset = function () {
23315
+              var _j, _results;
23316
+
23317
+              _results = [];
23318
+
23319
+              for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) {
23320
+                _results.push(data.readUInt16());
23321
+              }
23322
+
23323
+              return _results;
23324
+            }();
23325
+
23326
+            count = (this.length - data.pos + this.offset) / 2;
23327
+
23328
+            glyphIds = function () {
23329
+              var _j, _results;
23330
+
23331
+              _results = [];
23332
+
23333
+              for (i = _j = 0; 0 <= count ? _j < count : _j > count; i = 0 <= count ? ++_j : --_j) {
23334
+                _results.push(data.readUInt16());
23335
+              }
23336
+
23337
+              return _results;
23338
+            }();
23339
+
23340
+            for (i = _j = 0, _len = endCode.length; _j < _len; i = ++_j) {
23341
+              tail = endCode[i];
23342
+              start = startCode[i];
23343
+
23344
+              for (code = _k = start; start <= tail ? _k <= tail : _k >= tail; code = start <= tail ? ++_k : --_k) {
23345
+                if (idRangeOffset[i] === 0) {
23346
+                  glyphId = code + idDelta[i];
23347
+                } else {
23348
+                  index = idRangeOffset[i] / 2 + (code - start) - (segCount - i);
23349
+                  glyphId = glyphIds[index] || 0;
23350
+
23351
+                  if (glyphId !== 0) {
23352
+                    glyphId += idDelta[i];
23353
+                  }
23354
+                }
23355
+
23356
+                this.codeMap[code] = glyphId & 0xFFFF;
23357
+              }
23358
+            }
23359
+
23360
+        }
23361
+
23362
+        data.pos = saveOffset;
23363
+      }
23364
+
23365
+      CmapEntry.encode = function (charmap, encoding) {
23366
+        var charMap, code, codeMap, codes, delta, deltas, diff, endCode, endCodes, entrySelector, glyphIDs, i, id, indexes, last, map, nextID, offset, old, rangeOffsets, rangeShift, result, searchRange, segCount, segCountX2, startCode, startCodes, startGlyph, subtable, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _name, _o, _p, _q;
23367
+
23368
+        subtable = new Data();
23369
+        codes = Object.keys(charmap).sort(function (a, b) {
23370
+          return a - b;
23371
+        });
23372
+
23373
+        switch (encoding) {
23374
+          case 'macroman':
23375
+            id = 0;
23376
+
23377
+            indexes = function () {
23378
+              var _i, _results;
23379
+
23380
+              _results = [];
23381
+
23382
+              for (i = _i = 0; _i < 256; i = ++_i) {
23383
+                _results.push(0);
23384
+              }
23385
+
23386
+              return _results;
23387
+            }();
23388
+
23389
+            map = {
23390
+              0: 0
23391
+            };
23392
+            codeMap = {};
23393
+
23394
+            for (_i = 0, _len = codes.length; _i < _len; _i++) {
23395
+              code = codes[_i];
23396
+
23397
+              if (map[_name = charmap[code]] == null) {
23398
+                map[_name] = ++id;
23399
+              }
23400
+
23401
+              codeMap[code] = {
23402
+                old: charmap[code],
23403
+                "new": map[charmap[code]]
23404
+              };
23405
+              indexes[code] = map[charmap[code]];
23406
+            }
23407
+
23408
+            subtable.writeUInt16(1);
23409
+            subtable.writeUInt16(0);
23410
+            subtable.writeUInt32(12);
23411
+            subtable.writeUInt16(0);
23412
+            subtable.writeUInt16(262);
23413
+            subtable.writeUInt16(0);
23414
+            subtable.write(indexes);
23415
+            return result = {
23416
+              charMap: codeMap,
23417
+              subtable: subtable.data,
23418
+              maxGlyphID: id + 1
23419
+            };
23420
+
23421
+          case 'unicode':
23422
+            startCodes = [];
23423
+            endCodes = [];
23424
+            nextID = 0;
23425
+            map = {};
23426
+            charMap = {};
23427
+            last = diff = null;
23428
+
23429
+            for (_j = 0, _len1 = codes.length; _j < _len1; _j++) {
23430
+              code = codes[_j];
23431
+              old = charmap[code];
23432
+
23433
+              if (map[old] == null) {
23434
+                map[old] = ++nextID;
23435
+              }
23436
+
23437
+              charMap[code] = {
23438
+                old: old,
23439
+                "new": map[old]
23440
+              };
23441
+              delta = map[old] - code;
23442
+
23443
+              if (last == null || delta !== diff) {
23444
+                if (last) {
23445
+                  endCodes.push(last);
23446
+                }
23447
+
23448
+                startCodes.push(code);
23449
+                diff = delta;
23450
+              }
23451
+
23452
+              last = code;
23453
+            }
23454
+
23455
+            if (last) {
23456
+              endCodes.push(last);
23457
+            }
23458
+
23459
+            endCodes.push(0xFFFF);
23460
+            startCodes.push(0xFFFF);
23461
+            segCount = startCodes.length;
23462
+            segCountX2 = segCount * 2;
23463
+            searchRange = 2 * Math.pow(Math.log(segCount) / Math.LN2, 2);
23464
+            entrySelector = Math.log(searchRange / 2) / Math.LN2;
23465
+            rangeShift = 2 * segCount - searchRange;
23466
+            deltas = [];
23467
+            rangeOffsets = [];
23468
+            glyphIDs = [];
23469
+
23470
+            for (i = _k = 0, _len2 = startCodes.length; _k < _len2; i = ++_k) {
23471
+              startCode = startCodes[i];
23472
+              endCode = endCodes[i];
23473
+
23474
+              if (startCode === 0xFFFF) {
23475
+                deltas.push(0);
23476
+                rangeOffsets.push(0);
23477
+                break;
23478
+              }
23479
+
23480
+              startGlyph = charMap[startCode]["new"];
23481
+
23482
+              if (startCode - startGlyph >= 0x8000) {
23483
+                deltas.push(0);
23484
+                rangeOffsets.push(2 * (glyphIDs.length + segCount - i));
23485
+
23486
+                for (code = _l = startCode; startCode <= endCode ? _l <= endCode : _l >= endCode; code = startCode <= endCode ? ++_l : --_l) {
23487
+                  glyphIDs.push(charMap[code]["new"]);
23488
+                }
23489
+              } else {
23490
+                deltas.push(startGlyph - startCode);
23491
+                rangeOffsets.push(0);
23492
+              }
23493
+            }
23494
+
23495
+            subtable.writeUInt16(3);
23496
+            subtable.writeUInt16(1);
23497
+            subtable.writeUInt32(12);
23498
+            subtable.writeUInt16(4);
23499
+            subtable.writeUInt16(16 + segCount * 8 + glyphIDs.length * 2);
23500
+            subtable.writeUInt16(0);
23501
+            subtable.writeUInt16(segCountX2);
23502
+            subtable.writeUInt16(searchRange);
23503
+            subtable.writeUInt16(entrySelector);
23504
+            subtable.writeUInt16(rangeShift);
23505
+
23506
+            for (_m = 0, _len3 = endCodes.length; _m < _len3; _m++) {
23507
+              code = endCodes[_m];
23508
+              subtable.writeUInt16(code);
23509
+            }
23510
+
23511
+            subtable.writeUInt16(0);
23512
+
23513
+            for (_n = 0, _len4 = startCodes.length; _n < _len4; _n++) {
23514
+              code = startCodes[_n];
23515
+              subtable.writeUInt16(code);
23516
+            }
23517
+
23518
+            for (_o = 0, _len5 = deltas.length; _o < _len5; _o++) {
23519
+              delta = deltas[_o];
23520
+              subtable.writeUInt16(delta);
23521
+            }
23522
+
23523
+            for (_p = 0, _len6 = rangeOffsets.length; _p < _len6; _p++) {
23524
+              offset = rangeOffsets[_p];
23525
+              subtable.writeUInt16(offset);
23526
+            }
23527
+
23528
+            for (_q = 0, _len7 = glyphIDs.length; _q < _len7; _q++) {
23529
+              id = glyphIDs[_q];
23530
+              subtable.writeUInt16(id);
23531
+            }
23532
+
23533
+            return result = {
23534
+              charMap: charMap,
23535
+              subtable: subtable.data,
23536
+              maxGlyphID: nextID + 1
23537
+            };
23538
+        }
23539
+      };
23540
+
23541
+      return CmapEntry;
23542
+    }();
23543
+
23544
+    var CmapTable = function (_super) {
23545
+      __extends(CmapTable, _super);
23546
+
23547
+      function CmapTable() {
23548
+        return CmapTable.__super__.constructor.apply(this, arguments);
23549
+      }
23550
+
23551
+      CmapTable.prototype.tag = 'cmap';
23552
+
23553
+      CmapTable.prototype.parse = function (data) {
23554
+        var entry, i, tableCount, _i;
23555
+
23556
+        data.pos = this.offset;
23557
+        this.version = data.readUInt16();
23558
+        tableCount = data.readUInt16();
23559
+        this.tables = [];
23560
+        this.unicode = null;
23561
+
23562
+        for (i = _i = 0; 0 <= tableCount ? _i < tableCount : _i > tableCount; i = 0 <= tableCount ? ++_i : --_i) {
23563
+          entry = new CmapEntry(data, this.offset);
23564
+          this.tables.push(entry);
23565
+
23566
+          if (entry.isUnicode) {
23567
+            if (this.unicode == null) {
23568
+              this.unicode = entry;
23569
+            }
23570
+          }
23571
+        }
23572
+
23573
+        return true;
23574
+      };
23575
+      /*************************************************************************/
23576
+
23577
+      /* function : encode                                                     */
23578
+
23579
+      /* comment : Encode the cmap table corresponding to the input character. */
23580
+
23581
+      /*************************************************************************/
23582
+
23583
+
23584
+      CmapTable.encode = function (charmap, encoding) {
23585
+        var result, table;
23586
+
23587
+        if (encoding == null) {
23588
+          encoding = 'macroman';
23589
+        }
23590
+
23591
+        result = CmapEntry.encode(charmap, encoding);
23592
+        table = new Data();
23593
+        table.writeUInt16(0);
23594
+        table.writeUInt16(1);
23595
+        result.table = table.data.concat(result.subtable);
23596
+        return result;
23597
+      };
23598
+
23599
+      return CmapTable;
23600
+    }(Table);
23601
+
23602
+    var HheaTable = function (_super) {
23603
+      __extends(HheaTable, _super);
23604
+
23605
+      function HheaTable() {
23606
+        return HheaTable.__super__.constructor.apply(this, arguments);
23607
+      }
23608
+
23609
+      HheaTable.prototype.tag = 'hhea';
23610
+
23611
+      HheaTable.prototype.parse = function (data) {
23612
+        data.pos = this.offset;
23613
+        this.version = data.readInt();
23614
+        this.ascender = data.readShort();
23615
+        this.decender = data.readShort();
23616
+        this.lineGap = data.readShort();
23617
+        this.advanceWidthMax = data.readShort();
23618
+        this.minLeftSideBearing = data.readShort();
23619
+        this.minRightSideBearing = data.readShort();
23620
+        this.xMaxExtent = data.readShort();
23621
+        this.caretSlopeRise = data.readShort();
23622
+        this.caretSlopeRun = data.readShort();
23623
+        this.caretOffset = data.readShort();
23624
+        data.pos += 4 * 2;
23625
+        this.metricDataFormat = data.readShort();
23626
+        return this.numberOfMetrics = data.readUInt16();
23627
+      };
23628
+      /*HheaTable.prototype.encode = function (ids) {
23629
+          var i, table, _i, _ref;
23630
+          table = new Data;
23631
+          table.writeInt(this.version);
23632
+          table.writeShort(this.ascender);
23633
+          table.writeShort(this.decender);
23634
+          table.writeShort(this.lineGap);
23635
+          table.writeShort(this.advanceWidthMax);
23636
+          table.writeShort(this.minLeftSideBearing);
23637
+          table.writeShort(this.minRightSideBearing);
23638
+          table.writeShort(this.xMaxExtent);
23639
+          table.writeShort(this.caretSlopeRise);
23640
+          table.writeShort(this.caretSlopeRun);
23641
+          table.writeShort(this.caretOffset);
23642
+          for (i = _i = 0, _ref = 4 * 2; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
23643
+              table.writeByte(0);
23644
+          }
23645
+          table.writeShort(this.metricDataFormat);
23646
+          table.writeUInt16(ids.length);
23647
+          return table.data;
23648
+      };*/
23649
+
23650
+
23651
+      return HheaTable;
23652
+    }(Table);
23653
+
23654
+    var OS2Table = function (_super) {
23655
+      __extends(OS2Table, _super);
23656
+
23657
+      function OS2Table() {
23658
+        return OS2Table.__super__.constructor.apply(this, arguments);
23659
+      }
23660
+
23661
+      OS2Table.prototype.tag = 'OS/2';
23662
+
23663
+      OS2Table.prototype.parse = function (data) {
23664
+        var i;
23665
+        data.pos = this.offset;
23666
+        this.version = data.readUInt16();
23667
+        this.averageCharWidth = data.readShort();
23668
+        this.weightClass = data.readUInt16();
23669
+        this.widthClass = data.readUInt16();
23670
+        this.type = data.readShort();
23671
+        this.ySubscriptXSize = data.readShort();
23672
+        this.ySubscriptYSize = data.readShort();
23673
+        this.ySubscriptXOffset = data.readShort();
23674
+        this.ySubscriptYOffset = data.readShort();
23675
+        this.ySuperscriptXSize = data.readShort();
23676
+        this.ySuperscriptYSize = data.readShort();
23677
+        this.ySuperscriptXOffset = data.readShort();
23678
+        this.ySuperscriptYOffset = data.readShort();
23679
+        this.yStrikeoutSize = data.readShort();
23680
+        this.yStrikeoutPosition = data.readShort();
23681
+        this.familyClass = data.readShort();
23682
+
23683
+        this.panose = function () {
23684
+          var _i, _results;
23685
+
23686
+          _results = [];
23687
+
23688
+          for (i = _i = 0; _i < 10; i = ++_i) {
23689
+            _results.push(data.readByte());
23690
+          }
23691
+
23692
+          return _results;
23693
+        }();
23694
+
23695
+        this.charRange = function () {
23696
+          var _i, _results;
23697
+
23698
+          _results = [];
23699
+
23700
+          for (i = _i = 0; _i < 4; i = ++_i) {
23701
+            _results.push(data.readInt());
23702
+          }
23703
+
23704
+          return _results;
23705
+        }();
23706
+
23707
+        this.vendorID = data.readString(4);
23708
+        this.selection = data.readShort();
23709
+        this.firstCharIndex = data.readShort();
23710
+        this.lastCharIndex = data.readShort();
23711
+
23712
+        if (this.version > 0) {
23713
+          this.ascent = data.readShort();
23714
+          this.descent = data.readShort();
23715
+          this.lineGap = data.readShort();
23716
+          this.winAscent = data.readShort();
23717
+          this.winDescent = data.readShort();
23718
+
23719
+          this.codePageRange = function () {
23720
+            var _i, _results;
23721
+
23722
+            _results = [];
23723
+
23724
+            for (i = _i = 0; _i < 2; i = ++_i) {
23725
+              _results.push(data.readInt());
23726
+            }
23727
+
23728
+            return _results;
23729
+          }();
23730
+
23731
+          if (this.version > 1) {
23732
+            this.xHeight = data.readShort();
23733
+            this.capHeight = data.readShort();
23734
+            this.defaultChar = data.readShort();
23735
+            this.breakChar = data.readShort();
23736
+            return this.maxContext = data.readShort();
23737
+          }
23738
+        }
23739
+      };
23740
+      /*OS2Table.prototype.encode = function () {
23741
+          return this.raw();
23742
+      };*/
23743
+
23744
+
23745
+      return OS2Table;
23746
+    }(Table);
23747
+
23748
+    var PostTable = function (_super) {
23749
+
23750
+      __extends(PostTable, _super);
23751
+
23752
+      function PostTable() {
23753
+        return PostTable.__super__.constructor.apply(this, arguments);
23754
+      }
23755
+
23756
+      PostTable.prototype.tag = 'post';
23757
+
23758
+      PostTable.prototype.parse = function (data) {
23759
+        var i, length, numberOfGlyphs, _i, _results;
23760
+
23761
+        data.pos = this.offset;
23762
+        this.format = data.readInt();
23763
+        this.italicAngle = data.readInt();
23764
+        this.underlinePosition = data.readShort();
23765
+        this.underlineThickness = data.readShort();
23766
+        this.isFixedPitch = data.readInt();
23767
+        this.minMemType42 = data.readInt();
23768
+        this.maxMemType42 = data.readInt();
23769
+        this.minMemType1 = data.readInt();
23770
+        this.maxMemType1 = data.readInt();
23771
+
23772
+        switch (this.format) {
23773
+          case 0x00010000:
23774
+            break;
23775
+
23776
+          case 0x00020000:
23777
+            numberOfGlyphs = data.readUInt16();
23778
+            this.glyphNameIndex = [];
23779
+
23780
+            for (i = _i = 0; 0 <= numberOfGlyphs ? _i < numberOfGlyphs : _i > numberOfGlyphs; i = 0 <= numberOfGlyphs ? ++_i : --_i) {
23781
+              this.glyphNameIndex.push(data.readUInt16());
23782
+            }
23783
+
23784
+            this.names = [];
23785
+            _results = [];
23786
+
23787
+            while (data.pos < this.offset + this.length) {
23788
+              length = data.readByte();
23789
+
23790
+              _results.push(this.names.push(data.readString(length)));
23791
+            }
23792
+
23793
+            return _results;
23794
+            break;
23795
+
23796
+          case 0x00025000:
23797
+            numberOfGlyphs = data.readUInt16();
23798
+            return this.offsets = data.read(numberOfGlyphs);
23799
+
23800
+          case 0x00030000:
23801
+            break;
23802
+
23803
+          case 0x00040000:
23804
+            return this.map = function () {
23805
+              var _j, _ref, _results1;
23806
+
23807
+              _results1 = [];
23808
+
23809
+              for (i = _j = 0, _ref = this.file.maxp.numGlyphs; 0 <= _ref ? _j < _ref : _j > _ref; i = 0 <= _ref ? ++_j : --_j) {
23810
+                _results1.push(data.readUInt32());
23811
+              }
23812
+
23813
+              return _results1;
23814
+            }.call(this);
23815
+        }
23816
+      };
23817
+      return PostTable;
23818
+    }(Table);
23819
+    /*********************************************************************************************************/
23820
+
23821
+    /* function : NameEntry                                                                                  */
23822
+
23823
+    /* comment : Store copyright information, platformID, encodingID, and languageID in the NameEntry object.*/
23824
+
23825
+    /*********************************************************************************************************/
23826
+
23827
+
23828
+    var NameEntry = function () {
23829
+      function NameEntry(raw, entry) {
23830
+        this.raw = raw;
23831
+        this.length = raw.length;
23832
+        this.platformID = entry.platformID;
23833
+        this.encodingID = entry.encodingID;
23834
+        this.languageID = entry.languageID;
23835
+      }
23836
+
23837
+      return NameEntry;
23838
+    }();
23839
+
23840
+    var NameTable = function (_super) {
23841
+
23842
+      __extends(NameTable, _super);
23843
+
23844
+      function NameTable() {
23845
+        return NameTable.__super__.constructor.apply(this, arguments);
23846
+      }
23847
+
23848
+      NameTable.prototype.tag = 'name';
23849
+
23850
+      NameTable.prototype.parse = function (data) {
23851
+        var count, entries, entry, format, i, name, stringOffset, strings, text, _i, _j, _len, _name;
23852
+
23853
+        data.pos = this.offset;
23854
+        format = data.readShort();
23855
+        count = data.readShort();
23856
+        stringOffset = data.readShort();
23857
+        entries = [];
23858
+
23859
+        for (i = _i = 0; 0 <= count ? _i < count : _i > count; i = 0 <= count ? ++_i : --_i) {
23860
+          entries.push({
23861
+            platformID: data.readShort(),
23862
+            encodingID: data.readShort(),
23863
+            languageID: data.readShort(),
23864
+            nameID: data.readShort(),
23865
+            length: data.readShort(),
23866
+            offset: this.offset + stringOffset + data.readShort()
23867
+          });
23868
+        }
23869
+
23870
+        strings = {};
23871
+
23872
+        for (i = _j = 0, _len = entries.length; _j < _len; i = ++_j) {
23873
+          entry = entries[i];
23874
+          data.pos = entry.offset;
23875
+          text = data.readString(entry.length);
23876
+          name = new NameEntry(text, entry);
23877
+
23878
+          if (strings[_name = entry.nameID] == null) {
23879
+            strings[_name] = [];
23880
+          }
23881
+
23882
+          strings[entry.nameID].push(name);
23883
+        }
23884
+
23885
+        this.strings = strings;
23886
+        this.copyright = strings[0];
23887
+        this.fontFamily = strings[1];
23888
+        this.fontSubfamily = strings[2];
23889
+        this.uniqueSubfamily = strings[3];
23890
+        this.fontName = strings[4];
23891
+        this.version = strings[5];
23892
+
23893
+        try {
23894
+          this.postscriptName = strings[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
23895
+        } catch (e) {
23896
+          this.postscriptName = strings[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
23897
+        }
23898
+
23899
+        this.trademark = strings[7];
23900
+        this.manufacturer = strings[8];
23901
+        this.designer = strings[9];
23902
+        this.description = strings[10];
23903
+        this.vendorUrl = strings[11];
23904
+        this.designerUrl = strings[12];
23905
+        this.license = strings[13];
23906
+        this.licenseUrl = strings[14];
23907
+        this.preferredFamily = strings[15];
23908
+        this.preferredSubfamily = strings[17];
23909
+        this.compatibleFull = strings[18];
23910
+        return this.sampleText = strings[19];
23911
+      };
23912
+      /*NameTable.prototype.encode = function () {
23913
+          var id, list, nameID, nameTable, postscriptName, strCount, strTable, string, strings, table, val, _i, _len, _ref;
23914
+          strings = {};
23915
+          _ref = this.strings;
23916
+          for (id in _ref) {
23917
+              val = _ref[id];
23918
+              strings[id] = val;
23919
+          }
23920
+          postscriptName = new NameEntry("" + subsetTag + "+" + this.postscriptName, {
23921
+              platformID: 1
23922
+              , encodingID: 0
23923
+              , languageID: 0
23924
+          });
23925
+          strings[6] = [postscriptName];
23926
+          subsetTag = successorOf(subsetTag);
23927
+          strCount = 0;
23928
+          for (id in strings) {
23929
+              list = strings[id];
23930
+              if (list != null) {
23931
+                  strCount += list.length;
23932
+              }
23933
+          }
23934
+          table = new Data;
23935
+          strTable = new Data;
23936
+          table.writeShort(0);
23937
+          table.writeShort(strCount);
23938
+          table.writeShort(6 + 12 * strCount);
23939
+          for (nameID in strings) {
23940
+              list = strings[nameID];
23941
+              if (list != null) {
23942
+                  for (_i = 0, _len = list.length; _i < _len; _i++) {
23943
+                      string = list[_i];
23944
+                      table.writeShort(string.platformID);
23945
+                      table.writeShort(string.encodingID);
23946
+                      table.writeShort(string.languageID);
23947
+                      table.writeShort(nameID);
23948
+                      table.writeShort(string.length);
23949
+                      table.writeShort(strTable.pos);
23950
+                      strTable.writeString(string.raw);
23951
+                  }
23952
+              }
23953
+          }
23954
+          return nameTable = {
23955
+              postscriptName: postscriptName.raw
23956
+              , table: table.data.concat(strTable.data)
23957
+          };
23958
+      };*/
23959
+
23960
+      return NameTable;
23961
+    }(Table);
23962
+
23963
+    var MaxpTable = function (_super) {
23964
+      __extends(MaxpTable, _super);
23965
+
23966
+      function MaxpTable() {
23967
+        return MaxpTable.__super__.constructor.apply(this, arguments);
23968
+      }
23969
+
23970
+      MaxpTable.prototype.tag = 'maxp';
23971
+
23972
+      MaxpTable.prototype.parse = function (data) {
23973
+        data.pos = this.offset;
23974
+        this.version = data.readInt();
23975
+        this.numGlyphs = data.readUInt16();
23976
+        this.maxPoints = data.readUInt16();
23977
+        this.maxContours = data.readUInt16();
23978
+        this.maxCompositePoints = data.readUInt16();
23979
+        this.maxComponentContours = data.readUInt16();
23980
+        this.maxZones = data.readUInt16();
23981
+        this.maxTwilightPoints = data.readUInt16();
23982
+        this.maxStorage = data.readUInt16();
23983
+        this.maxFunctionDefs = data.readUInt16();
23984
+        this.maxInstructionDefs = data.readUInt16();
23985
+        this.maxStackElements = data.readUInt16();
23986
+        this.maxSizeOfInstructions = data.readUInt16();
23987
+        this.maxComponentElements = data.readUInt16();
23988
+        return this.maxComponentDepth = data.readUInt16();
23989
+      };
23990
+      /*MaxpTable.prototype.encode = function (ids) {
23991
+          var table;
23992
+          table = new Data;
23993
+          table.writeInt(this.version);
23994
+          table.writeUInt16(ids.length);
23995
+          table.writeUInt16(this.maxPoints);
23996
+          table.writeUInt16(this.maxContours);
23997
+          table.writeUInt16(this.maxCompositePoints);
23998
+          table.writeUInt16(this.maxComponentContours);
23999
+          table.writeUInt16(this.maxZones);
24000
+          table.writeUInt16(this.maxTwilightPoints);
24001
+          table.writeUInt16(this.maxStorage);
24002
+          table.writeUInt16(this.maxFunctionDefs);
24003
+          table.writeUInt16(this.maxInstructionDefs);
24004
+          table.writeUInt16(this.maxStackElements);
24005
+          table.writeUInt16(this.maxSizeOfInstructions);
24006
+          table.writeUInt16(this.maxComponentElements);
24007
+          table.writeUInt16(this.maxComponentDepth);
24008
+          return table.data;
24009
+      };*/
24010
+
24011
+
24012
+      return MaxpTable;
24013
+    }(Table);
24014
+
24015
+    var HmtxTable = function (_super) {
24016
+      __extends(HmtxTable, _super);
24017
+
24018
+      function HmtxTable() {
24019
+        return HmtxTable.__super__.constructor.apply(this, arguments);
24020
+      }
24021
+
24022
+      HmtxTable.prototype.tag = 'hmtx';
24023
+
24024
+      HmtxTable.prototype.parse = function (data) {
24025
+        var i, last, lsbCount, m, _i, _j, _ref, _results;
24026
+
24027
+        data.pos = this.offset;
24028
+        this.metrics = [];
24029
+
24030
+        for (i = _i = 0, _ref = this.file.hhea.numberOfMetrics; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
24031
+          this.metrics.push({
24032
+            advance: data.readUInt16(),
24033
+            lsb: data.readInt16()
24034
+          });
24035
+        }
24036
+
24037
+        lsbCount = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics;
24038
+
24039
+        this.leftSideBearings = function () {
24040
+          var _j, _results;
24041
+
24042
+          _results = [];
24043
+
24044
+          for (i = _j = 0; 0 <= lsbCount ? _j < lsbCount : _j > lsbCount; i = 0 <= lsbCount ? ++_j : --_j) {
24045
+            _results.push(data.readInt16());
24046
+          }
24047
+
24048
+          return _results;
24049
+        }();
24050
+
24051
+        this.widths = function () {
24052
+          var _j, _len, _ref1, _results;
24053
+
24054
+          _ref1 = this.metrics;
24055
+          _results = [];
24056
+
24057
+          for (_j = 0, _len = _ref1.length; _j < _len; _j++) {
24058
+            m = _ref1[_j];
24059
+
24060
+            _results.push(m.advance);
24061
+          }
24062
+
24063
+          return _results;
24064
+        }.call(this);
24065
+
24066
+        last = this.widths[this.widths.length - 1];
24067
+        _results = [];
24068
+
24069
+        for (i = _j = 0; 0 <= lsbCount ? _j < lsbCount : _j > lsbCount; i = 0 <= lsbCount ? ++_j : --_j) {
24070
+          _results.push(this.widths.push(last));
24071
+        }
24072
+
24073
+        return _results;
24074
+      };
24075
+      /***************************************************************/
24076
+
24077
+      /* function : forGlyph                                         */
24078
+
24079
+      /* comment : Returns the advance width and lsb for this glyph. */
24080
+
24081
+      /***************************************************************/
24082
+
24083
+
24084
+      HmtxTable.prototype.forGlyph = function (id) {
24085
+        var metrics;
24086
+
24087
+        if (id in this.metrics) {
24088
+          return this.metrics[id];
24089
+        }
24090
+
24091
+        return metrics = {
24092
+          advance: this.metrics[this.metrics.length - 1].advance,
24093
+          lsb: this.leftSideBearings[id - this.metrics.length]
24094
+        };
24095
+      };
24096
+      /*HmtxTable.prototype.encode = function (mapping) {
24097
+          var id, metric, table, _i, _len;
24098
+          table = new Data;
24099
+          for (_i = 0, _len = mapping.length; _i < _len; _i++) {
24100
+              id = mapping[_i];
24101
+              metric = this.forGlyph(id);
24102
+              table.writeUInt16(metric.advance);
24103
+              table.writeUInt16(metric.lsb);
24104
+          }
24105
+          return table.data;
24106
+      };*/
24107
+
24108
+
24109
+      return HmtxTable;
24110
+    }(Table);
24111
+
24112
+    var __slice = [].slice;
24113
+
24114
+    var GlyfTable = function (_super) {
24115
+      __extends(GlyfTable, _super);
24116
+
24117
+      function GlyfTable() {
24118
+        return GlyfTable.__super__.constructor.apply(this, arguments);
24119
+      }
24120
+
24121
+      GlyfTable.prototype.tag = 'glyf';
24122
+
24123
+      GlyfTable.prototype.parse = function (data) {
24124
+        return this.cache = {};
24125
+      };
24126
+
24127
+      GlyfTable.prototype.glyphFor = function (id) {
24128
+        id = id;
24129
+        var data, index, length, loca, numberOfContours, raw, xMax, xMin, yMax, yMin;
24130
+
24131
+        if (id in this.cache) {
24132
+          return this.cache[id];
24133
+        }
24134
+
24135
+        loca = this.file.loca;
24136
+        data = this.file.contents;
24137
+        index = loca.indexOf(id);
24138
+        length = loca.lengthOf(id);
24139
+
24140
+        if (length === 0) {
24141
+          return this.cache[id] = null;
24142
+        }
24143
+
24144
+        data.pos = this.offset + index;
24145
+        raw = new Data(data.read(length));
24146
+        numberOfContours = raw.readShort();
24147
+        xMin = raw.readShort();
24148
+        yMin = raw.readShort();
24149
+        xMax = raw.readShort();
24150
+        yMax = raw.readShort();
24151
+
24152
+        if (numberOfContours === -1) {
24153
+          this.cache[id] = new CompoundGlyph(raw, xMin, yMin, xMax, yMax);
24154
+        } else {
24155
+          this.cache[id] = new SimpleGlyph(raw, numberOfContours, xMin, yMin, xMax, yMax);
24156
+        }
24157
+
24158
+        return this.cache[id];
24159
+      };
24160
+
24161
+      GlyfTable.prototype.encode = function (glyphs, mapping, old2new) {
24162
+        var glyph, id, offsets, table, _i, _len;
24163
+
24164
+        table = [];
24165
+        offsets = [];
24166
+
24167
+        for (_i = 0, _len = mapping.length; _i < _len; _i++) {
24168
+          id = mapping[_i];
24169
+          glyph = glyphs[id];
24170
+          offsets.push(table.length);
24171
+
24172
+          if (glyph) {
24173
+            table = table.concat(glyph.encode(old2new));
24174
+          }
24175
+        }
24176
+
24177
+        offsets.push(table.length);
24178
+        return {
24179
+          table: table,
24180
+          offsets: offsets
24181
+        };
24182
+      };
24183
+
24184
+      return GlyfTable;
24185
+    }(Table);
24186
+
24187
+    var SimpleGlyph = function () {
24188
+      /**************************************************************************/
24189
+
24190
+      /* function : SimpleGlyph                                                 */
24191
+
24192
+      /* comment : Stores raw, xMin, yMin, xMax, and yMax values for this glyph.*/
24193
+
24194
+      /**************************************************************************/
24195
+      function SimpleGlyph(raw, numberOfContours, xMin, yMin, xMax, yMax) {
24196
+        this.raw = raw;
24197
+        this.numberOfContours = numberOfContours;
24198
+        this.xMin = xMin;
24199
+        this.yMin = yMin;
24200
+        this.xMax = xMax;
24201
+        this.yMax = yMax;
24202
+        this.compound = false;
24203
+      }
24204
+
24205
+      SimpleGlyph.prototype.encode = function () {
24206
+        return this.raw.data;
24207
+      };
24208
+
24209
+      return SimpleGlyph;
24210
+    }();
24211
+
24212
+    var CompoundGlyph = function () {
24213
+      var ARG_1_AND_2_ARE_WORDS, MORE_COMPONENTS, WE_HAVE_AN_X_AND_Y_SCALE, WE_HAVE_A_SCALE, WE_HAVE_A_TWO_BY_TWO;
24214
+      ARG_1_AND_2_ARE_WORDS = 0x0001;
24215
+      WE_HAVE_A_SCALE = 0x0008;
24216
+      MORE_COMPONENTS = 0x0020;
24217
+      WE_HAVE_AN_X_AND_Y_SCALE = 0x0040;
24218
+      WE_HAVE_A_TWO_BY_TWO = 0x0080;
24219
+      /********************************************************************************************************************/
24220
+
24221
+      /* function : CompoundGlypg generator                                                                               */
24222
+
24223
+      /* comment : It stores raw, xMin, yMin, xMax, yMax, glyph id, and glyph offset for the corresponding compound glyph.*/
24224
+
24225
+      /********************************************************************************************************************/
24226
+
24227
+      function CompoundGlyph(raw, xMin, yMin, xMax, yMax) {
24228
+        var data, flags;
24229
+        this.raw = raw;
24230
+        this.xMin = xMin;
24231
+        this.yMin = yMin;
24232
+        this.xMax = xMax;
24233
+        this.yMax = yMax;
24234
+        this.compound = true;
24235
+        this.glyphIDs = [];
24236
+        this.glyphOffsets = [];
24237
+        data = this.raw;
24238
+
24239
+        while (true) {
24240
+          flags = data.readShort();
24241
+          this.glyphOffsets.push(data.pos);
24242
+          this.glyphIDs.push(data.readShort());
24243
+
24244
+          if (!(flags & MORE_COMPONENTS)) {
24245
+            break;
24246
+          }
24247
+
24248
+          if (flags & ARG_1_AND_2_ARE_WORDS) {
24249
+            data.pos += 4;
24250
+          } else {
24251
+            data.pos += 2;
24252
+          }
24253
+
24254
+          if (flags & WE_HAVE_A_TWO_BY_TWO) {
24255
+            data.pos += 8;
24256
+          } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
24257
+            data.pos += 4;
24258
+          } else if (flags & WE_HAVE_A_SCALE) {
24259
+            data.pos += 2;
24260
+          }
24261
+        }
24262
+      }
24263
+      /****************************************************************************************************************/
24264
+
24265
+      /* function : CompoundGlypg encode                                                                              */
24266
+
24267
+      /* comment : After creating a table for the characters you typed, you call directory.encode to encode the table.*/
24268
+
24269
+      /****************************************************************************************************************/
24270
+
24271
+
24272
+      CompoundGlyph.prototype.encode = function (mapping) {
24273
+        var i, id, result, _i, _len, _ref;
24274
+
24275
+        result = new Data(__slice.call(this.raw.data));
24276
+        _ref = this.glyphIDs;
24277
+
24278
+        for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
24279
+          id = _ref[i];
24280
+          result.pos = this.glyphOffsets[i];
24281
+        }
24282
+
24283
+        return result.data;
24284
+      };
24285
+
24286
+      return CompoundGlyph;
24287
+    }();
24288
+
24289
+    var LocaTable = function (_super) {
24290
+      __extends(LocaTable, _super);
24291
+
24292
+      function LocaTable() {
24293
+        return LocaTable.__super__.constructor.apply(this, arguments);
24294
+      }
24295
+
24296
+      LocaTable.prototype.tag = 'loca';
24297
+
24298
+      LocaTable.prototype.parse = function (data) {
24299
+        var format, i;
24300
+        data.pos = this.offset;
24301
+        format = this.file.head.indexToLocFormat;
24302
+
24303
+        if (format === 0) {
24304
+          return this.offsets = function () {
24305
+            var _i, _ref, _results;
24306
+
24307
+            _results = [];
24308
+
24309
+            for (i = _i = 0, _ref = this.length; _i < _ref; i = _i += 2) {
24310
+              _results.push(data.readUInt16() * 2);
24311
+            }
24312
+
24313
+            return _results;
24314
+          }.call(this);
24315
+        } else {
24316
+          return this.offsets = function () {
24317
+            var _i, _ref, _results;
24318
+
24319
+            _results = [];
24320
+
24321
+            for (i = _i = 0, _ref = this.length; _i < _ref; i = _i += 4) {
24322
+              _results.push(data.readUInt32());
24323
+            }
24324
+
24325
+            return _results;
24326
+          }.call(this);
24327
+        }
24328
+      };
24329
+
24330
+      LocaTable.prototype.indexOf = function (id) {
24331
+        return this.offsets[id];
24332
+      };
24333
+
24334
+      LocaTable.prototype.lengthOf = function (id) {
24335
+        return this.offsets[id + 1] - this.offsets[id];
24336
+      };
24337
+
24338
+      LocaTable.prototype.encode = function (offsets, activeGlyphs) {
24339
+        var LocaTable = new Uint32Array(this.offsets.length);
24340
+        var glyfPtr = 0;
24341
+        var listGlyf = 0;
24342
+
24343
+        for (var k = 0; k < LocaTable.length; ++k) {
24344
+          LocaTable[k] = glyfPtr;
24345
+
24346
+          if (listGlyf < activeGlyphs.length && activeGlyphs[listGlyf] == k) {
24347
+            ++listGlyf;
24348
+            LocaTable[k] = glyfPtr;
24349
+            var start = this.offsets[k];
24350
+            var len = this.offsets[k + 1] - start;
24351
+
24352
+            if (len > 0) {
24353
+              glyfPtr += len;
24354
+            }
24355
+          }
24356
+        }
24357
+
24358
+        var newLocaTable = new Array(LocaTable.length * 4);
24359
+
24360
+        for (var j = 0; j < LocaTable.length; ++j) {
24361
+          newLocaTable[4 * j + 3] = LocaTable[j] & 0x000000ff;
24362
+          newLocaTable[4 * j + 2] = (LocaTable[j] & 0x0000ff00) >> 8;
24363
+          newLocaTable[4 * j + 1] = (LocaTable[j] & 0x00ff0000) >> 16;
24364
+          newLocaTable[4 * j] = (LocaTable[j] & 0xff000000) >> 24;
24365
+        }
24366
+
24367
+        return newLocaTable;
24368
+      };
24369
+
24370
+      return LocaTable;
24371
+    }(Table);
24372
+    /************************************************************************************/
24373
+
24374
+    /* function : invert                                                                */
24375
+
24376
+    /* comment : Change the object's (key: value) to create an object with (value: key).*/
24377
+
24378
+    /************************************************************************************/
24379
+
24380
+
24381
+    var invert = function invert(object) {
24382
+      var key, ret, val;
24383
+      ret = {};
24384
+
24385
+      for (key in object) {
24386
+        val = object[key];
24387
+        ret[val] = key;
24388
+      }
24389
+
24390
+      return ret;
24391
+    };
24392
+    /*var successorOf = function (input) {
24393
+        var added, alphabet, carry, i, index, isUpperCase, last, length, next, result;
24394
+        alphabet = 'abcdefghijklmnopqrstuvwxyz';
24395
+        length = alphabet.length;
24396
+        result = input;
24397
+        i = input.length;
24398
+        while (i >= 0) {
24399
+            last = input.charAt(--i);
24400
+            if (isNaN(last)) {
24401
+                index = alphabet.indexOf(last.toLowerCase());
24402
+                if (index === -1) {
24403
+                    next = last;
24404
+                    carry = true;
24405
+                }
24406
+                else {
24407
+                    next = alphabet.charAt((index + 1) % length);
24408
+                    isUpperCase = last === last.toUpperCase();
24409
+                    if (isUpperCase) {
24410
+                        next = next.toUpperCase();
24411
+                    }
24412
+                    carry = index + 1 >= length;
24413
+                    if (carry && i === 0) {
24414
+                        added = isUpperCase ? 'A' : 'a';
24415
+                        result = added + next + result.slice(1);
24416
+                        break;
24417
+                    }
24418
+                }
24419
+            }
24420
+            else {
24421
+                next = +last + 1;
24422
+                carry = next > 9;
24423
+                if (carry) {
24424
+                    next = 0;
24425
+                }
24426
+                if (carry && i === 0) {
24427
+                    result = '1' + next + result.slice(1);
24428
+                    break;
24429
+                }
24430
+            }
24431
+            result = result.slice(0, i) + next + result.slice(i + 1);
24432
+            if (!carry) {
24433
+                break;
24434
+            }
24435
+        }
24436
+        return result;
24437
+    };*/
24438
+
24439
+
24440
+    var Subset = function () {
24441
+      function Subset(font) {
24442
+        this.font = font;
24443
+        this.subset = {};
24444
+        this.unicodes = {};
24445
+        this.next = 33;
24446
+      }
24447
+      /*Subset.prototype.use = function (character) {
24448
+          var i, _i, _ref;
24449
+          if (typeof character === 'string') {
24450
+              for (i = _i = 0, _ref = character.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
24451
+                  this.use(character.charCodeAt(i));
24452
+              }
24453
+              return;
24454
+          }
24455
+          if (!this.unicodes[character]) {
24456
+              this.subset[this.next] = character;
24457
+              return this.unicodes[character] = this.next++;
24458
+          }
24459
+      };*/
24460
+
24461
+      /*Subset.prototype.encodeText = function (text) {
24462
+          var char, i, string, _i, _ref;
24463
+          string = '';
24464
+          for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
24465
+              char = this.unicodes[text.charCodeAt(i)];
24466
+              string += String.fromCharCode(char);
24467
+          }
24468
+          return string;
24469
+      };*/
24470
+
24471
+      /***************************************************************/
24472
+
24473
+      /* function : generateCmap                                     */
24474
+
24475
+      /* comment : Returns the unicode cmap for this font.         */
24476
+
24477
+      /***************************************************************/
24478
+
24479
+
24480
+      Subset.prototype.generateCmap = function () {
24481
+        var mapping, roman, unicode, unicodeCmap, _ref;
24482
+
24483
+        unicodeCmap = this.font.cmap.tables[0].codeMap;
24484
+        mapping = {};
24485
+        _ref = this.subset;
24486
+
24487
+        for (roman in _ref) {
24488
+          unicode = _ref[roman];
24489
+          mapping[roman] = unicodeCmap[unicode];
24490
+        }
24491
+
24492
+        return mapping;
24493
+      };
24494
+      /*Subset.prototype.glyphIDs = function () {
24495
+          var ret, roman, unicode, unicodeCmap, val, _ref;
24496
+          unicodeCmap = this.font.cmap.tables[0].codeMap;
24497
+          ret = [0];
24498
+          _ref = this.subset;
24499
+          for (roman in _ref) {
24500
+              unicode = _ref[roman];
24501
+              val = unicodeCmap[unicode];
24502
+              if ((val != null) && __indexOf.call(ret, val) < 0) {
24503
+                  ret.push(val);
24504
+              }
24505
+          }
24506
+          return ret.sort();
24507
+      };*/
24508
+
24509
+      /******************************************************************/
24510
+
24511
+      /* function : glyphsFor                                           */
24512
+
24513
+      /* comment : Returns simple glyph objects for the input character.*/
24514
+
24515
+      /******************************************************************/
24516
+
24517
+
24518
+      Subset.prototype.glyphsFor = function (glyphIDs) {
24519
+        var additionalIDs, glyph, glyphs, id, _i, _len, _ref;
24520
+
24521
+        glyphs = {};
24522
+
24523
+        for (_i = 0, _len = glyphIDs.length; _i < _len; _i++) {
24524
+          id = glyphIDs[_i];
24525
+          glyphs[id] = this.font.glyf.glyphFor(id);
24526
+        }
24527
+
24528
+        additionalIDs = [];
24529
+
24530
+        for (id in glyphs) {
24531
+          glyph = glyphs[id];
24532
+
24533
+          if (glyph != null ? glyph.compound : void 0) {
24534
+            additionalIDs.push.apply(additionalIDs, glyph.glyphIDs);
24535
+          }
24536
+        }
24537
+
24538
+        if (additionalIDs.length > 0) {
24539
+          _ref = this.glyphsFor(additionalIDs);
24540
+
24541
+          for (id in _ref) {
24542
+            glyph = _ref[id];
24543
+            glyphs[id] = glyph;
24544
+          }
24545
+        }
24546
+
24547
+        return glyphs;
24548
+      };
24549
+      /***************************************************************/
24550
+
24551
+      /* function : encode                                           */
24552
+
24553
+      /* comment : Encode various tables for the characters you use. */
24554
+
24555
+      /***************************************************************/
24556
+
24557
+
24558
+      Subset.prototype.encode = function (glyID, indexToLocFormat) {
24559
+        var cmap, code, glyf, glyphs, id, ids, loca, new2old, newIDs, nextGlyphID, old2new, oldID, oldIDs, tables, _ref;
24560
+
24561
+        cmap = CmapTable.encode(this.generateCmap(), 'unicode');
24562
+        glyphs = this.glyphsFor(glyID);
24563
+        old2new = {
24564
+          0: 0
24565
+        };
24566
+        _ref = cmap.charMap;
24567
+
24568
+        for (code in _ref) {
24569
+          ids = _ref[code];
24570
+          old2new[ids.old] = ids["new"];
24571
+        }
24572
+
24573
+        nextGlyphID = cmap.maxGlyphID;
24574
+
24575
+        for (oldID in glyphs) {
24576
+          if (!(oldID in old2new)) {
24577
+            old2new[oldID] = nextGlyphID++;
24578
+          }
24579
+        }
24580
+
24581
+        new2old = invert(old2new);
24582
+        newIDs = Object.keys(new2old).sort(function (a, b) {
24583
+          return a - b;
24584
+        });
24585
+
24586
+        oldIDs = function () {
24587
+          var _i, _len, _results;
24588
+
24589
+          _results = [];
24590
+
24591
+          for (_i = 0, _len = newIDs.length; _i < _len; _i++) {
24592
+            id = newIDs[_i];
24593
+
24594
+            _results.push(new2old[id]);
24595
+          }
24596
+
24597
+          return _results;
24598
+        }();
24599
+
24600
+        glyf = this.font.glyf.encode(glyphs, oldIDs, old2new);
24601
+        loca = this.font.loca.encode(glyf.offsets, oldIDs);
24602
+        tables = {
24603
+          cmap: this.font.cmap.raw(),
24604
+          glyf: glyf.table,
24605
+          loca: loca,
24606
+          hmtx: this.font.hmtx.raw(),
24607
+          hhea: this.font.hhea.raw(),
24608
+          maxp: this.font.maxp.raw(),
24609
+          post: this.font.post.raw(),
24610
+          name: this.font.name.raw(),
24611
+          head: this.font.head.encode(indexToLocFormat)
24612
+        };
24613
+
24614
+        if (this.font.os2.exists) {
24615
+          tables['OS/2'] = this.font.os2.raw();
24616
+        }
24617
+
24618
+        return this.font.directory.encode(tables);
24619
+      };
24620
+
24621
+      return Subset;
24622
+    }();
24623
+
24624
+    jsPDF.API.PDFObject = function () {
24625
+      var pad;
24626
+
24627
+      function PDFObject() {}
24628
+
24629
+      pad = function pad(str, length) {
24630
+        return (Array(length + 1).join('0') + str).slice(-length);
24631
+      };
24632
+      /*****************************************************************************/
24633
+
24634
+      /* function : convert                                                        */
24635
+
24636
+      /* comment :Converts pdf tag's / FontBBox and array values in / W to strings */
24637
+
24638
+      /*****************************************************************************/
24639
+
24640
+
24641
+      PDFObject.convert = function (object) {
24642
+        var e, items, key, out, val;
24643
+
24644
+        if (Array.isArray(object)) {
24645
+          items = function () {
24646
+            var _i, _len, _results;
24647
+
24648
+            _results = [];
24649
+
24650
+            for (_i = 0, _len = object.length; _i < _len; _i++) {
24651
+              e = object[_i];
24652
+
24653
+              _results.push(PDFObject.convert(e));
24654
+            }
24655
+
24656
+            return _results;
24657
+          }().join(' ');
24658
+
24659
+          return '[' + items + ']';
24660
+        } else if (typeof object === 'string') {
24661
+          return '/' + object;
24662
+        } else if (object != null ? object.isString : void 0) {
24663
+          return '(' + object + ')';
24664
+        } else if (object instanceof Date) {
24665
+          return '(D:' + pad(object.getUTCFullYear(), 4) + pad(object.getUTCMonth(), 2) + pad(object.getUTCDate(), 2) + pad(object.getUTCHours(), 2) + pad(object.getUTCMinutes(), 2) + pad(object.getUTCSeconds(), 2) + 'Z)';
24666
+        } else if ({}.toString.call(object) === '[object Object]') {
24667
+          out = ['<<'];
24668
+
24669
+          for (key in object) {
24670
+            val = object[key];
24671
+            out.push('/' + key + ' ' + PDFObject.convert(val));
24672
+          }
24673
+
24674
+          out.push('>>');
24675
+          return out.join('\n');
24676
+        } else {
24677
+          return '' + object;
24678
+        }
24679
+      };
24680
+
24681
+      return PDFObject;
24682
+    }();
24683
+  })(jsPDF);
24684
+
24685
+  // Generated by CoffeeScript 1.4.0
24686
+
24687
+  /*
24688
+  # PNG.js
24689
+  # Copyright (c) 2011 Devon Govett
24690
+  # MIT LICENSE
24691
+  # 
24692
+  # 
24693
+  */
24694
+  (function (global) {
24695
+    var PNG;
24696
+
24697
+    PNG = function () {
24698
+      var APNG_BLEND_OP_SOURCE, APNG_DISPOSE_OP_BACKGROUND, APNG_DISPOSE_OP_PREVIOUS, makeImage, scratchCanvas, scratchCtx;
24699
+
24700
+      PNG.load = function (url, canvas, callback) {
24701
+        var xhr;
24702
+
24703
+        if (typeof canvas === 'function') {
24704
+          callback = canvas;
24705
+        }
24706
+
24707
+        xhr = new XMLHttpRequest();
24708
+        xhr.open("GET", url, true);
24709
+        xhr.responseType = "arraybuffer";
24710
+
24711
+        xhr.onload = function () {
24712
+          var data, png;
24713
+          data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer);
24714
+          png = new PNG(data);
24715
+
24716
+          if (typeof (canvas != null ? canvas.getContext : void 0) === 'function') {
24717
+            png.render(canvas);
24718
+          }
24719
+
24720
+          return typeof callback === "function" ? callback(png) : void 0;
24721
+        };
24722
+
24723
+        return xhr.send(null);
24724
+      };
24725
+      APNG_DISPOSE_OP_BACKGROUND = 1;
24726
+      APNG_DISPOSE_OP_PREVIOUS = 2;
24727
+      APNG_BLEND_OP_SOURCE = 0;
24728
+
24729
+      function PNG(data) {
24730
+        var chunkSize, colors, palLen, delayDen, delayNum, frame, i, index, key, section, palShort, text, _i, _j, _ref;
24731
+
24732
+        this.data = data;
24733
+        this.pos = 8;
24734
+        this.palette = [];
24735
+        this.imgData = [];
24736
+        this.transparency = {};
24737
+        this.animation = null;
24738
+        this.text = {};
24739
+        frame = null;
24740
+
24741
+        while (true) {
24742
+          chunkSize = this.readUInt32();
24743
+
24744
+          section = function () {
24745
+            var _i, _results;
24746
+
24747
+            _results = [];
24748
+
24749
+            for (i = _i = 0; _i < 4; i = ++_i) {
24750
+              _results.push(String.fromCharCode(this.data[this.pos++]));
24751
+            }
24752
+
24753
+            return _results;
24754
+          }.call(this).join('');
24755
+
24756
+          switch (section) {
24757
+            case 'IHDR':
24758
+              this.width = this.readUInt32();
24759
+              this.height = this.readUInt32();
24760
+              this.bits = this.data[this.pos++];
24761
+              this.colorType = this.data[this.pos++];
24762
+              this.compressionMethod = this.data[this.pos++];
24763
+              this.filterMethod = this.data[this.pos++];
24764
+              this.interlaceMethod = this.data[this.pos++];
24765
+              break;
24766
+
24767
+            case 'acTL':
24768
+              this.animation = {
24769
+                numFrames: this.readUInt32(),
24770
+                numPlays: this.readUInt32() || Infinity,
24771
+                frames: []
24772
+              };
24773
+              break;
24774
+
24775
+            case 'PLTE':
24776
+              this.palette = this.read(chunkSize);
24777
+              break;
24778
+
24779
+            case 'fcTL':
24780
+              if (frame) {
24781
+                this.animation.frames.push(frame);
24782
+              }
24783
+
24784
+              this.pos += 4;
24785
+              frame = {
24786
+                width: this.readUInt32(),
24787
+                height: this.readUInt32(),
24788
+                xOffset: this.readUInt32(),
24789
+                yOffset: this.readUInt32()
24790
+              };
24791
+              delayNum = this.readUInt16();
24792
+              delayDen = this.readUInt16() || 100;
24793
+              frame.delay = 1000 * delayNum / delayDen;
24794
+              frame.disposeOp = this.data[this.pos++];
24795
+              frame.blendOp = this.data[this.pos++];
24796
+              frame.data = [];
24797
+              break;
24798
+
24799
+            case 'IDAT':
24800
+            case 'fdAT':
24801
+              if (section === 'fdAT') {
24802
+                this.pos += 4;
24803
+                chunkSize -= 4;
24804
+              }
24805
+
24806
+              data = (frame != null ? frame.data : void 0) || this.imgData;
24807
+
24808
+              for (i = _i = 0; 0 <= chunkSize ? _i < chunkSize : _i > chunkSize; i = 0 <= chunkSize ? ++_i : --_i) {
24809
+                data.push(this.data[this.pos++]);
24810
+              }
24811
+
24812
+              break;
24813
+
24814
+            case 'tRNS':
24815
+              this.transparency = {};
24816
+
24817
+              switch (this.colorType) {
24818
+                case 3:
24819
+                  palLen = this.palette.length / 3;
24820
+                  this.transparency.indexed = this.read(chunkSize);
24821
+                  if (this.transparency.indexed.length > palLen) throw new Error('More transparent colors than palette size');
24822
+                  /*
24823
+                   * According to the PNG spec trns should be increased to the same size as palette if shorter
24824
+                   */
24825
+                  //palShort = 255 - this.transparency.indexed.length;
24826
+
24827
+                  palShort = palLen - this.transparency.indexed.length;
24828
+
24829
+                  if (palShort > 0) {
24830
+                    for (i = _j = 0; 0 <= palShort ? _j < palShort : _j > palShort; i = 0 <= palShort ? ++_j : --_j) {
24831
+                      this.transparency.indexed.push(255);
24832
+                    }
24833
+                  }
24834
+
24835
+                  break;
24836
+
24837
+                case 0:
24838
+                  this.transparency.grayscale = this.read(chunkSize)[0];
24839
+                  break;
24840
+
24841
+                case 2:
24842
+                  this.transparency.rgb = this.read(chunkSize);
24843
+              }
24844
+
24845
+              break;
24846
+
24847
+            case 'tEXt':
24848
+              text = this.read(chunkSize);
24849
+              index = text.indexOf(0);
24850
+              key = String.fromCharCode.apply(String, text.slice(0, index));
24851
+              this.text[key] = String.fromCharCode.apply(String, text.slice(index + 1));
24852
+              break;
24853
+
24854
+            case 'IEND':
24855
+              if (frame) {
24856
+                this.animation.frames.push(frame);
24857
+              }
24858
+
24859
+              this.colors = function () {
24860
+                switch (this.colorType) {
24861
+                  case 0:
24862
+                  case 3:
24863
+                  case 4:
24864
+                    return 1;
24865
+
24866
+                  case 2:
24867
+                  case 6:
24868
+                    return 3;
24869
+                }
24870
+              }.call(this);
24871
+
24872
+              this.hasAlphaChannel = (_ref = this.colorType) === 4 || _ref === 6;
24873
+              colors = this.colors + (this.hasAlphaChannel ? 1 : 0);
24874
+              this.pixelBitlength = this.bits * colors;
24875
+
24876
+              this.colorSpace = function () {
24877
+                switch (this.colors) {
24878
+                  case 1:
24879
+                    return 'DeviceGray';
24880
+
24881
+                  case 3:
24882
+                    return 'DeviceRGB';
24883
+                }
24884
+              }.call(this);
24885
+
24886
+              this.imgData = new Uint8Array(this.imgData);
24887
+              return;
24888
+
24889
+            default:
24890
+              this.pos += chunkSize;
24891
+          }
24892
+
24893
+          this.pos += 4;
24894
+
24895
+          if (this.pos > this.data.length) {
24896
+            throw new Error("Incomplete or corrupt PNG file");
24897
+          }
24898
+        }
24899
+
24900
+        return;
24901
+      }
24902
+
24903
+      PNG.prototype.read = function (bytes) {
24904
+        var i, _i, _results;
24905
+
24906
+        _results = [];
24907
+
24908
+        for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) {
24909
+          _results.push(this.data[this.pos++]);
24910
+        }
24911
+
24912
+        return _results;
24913
+      };
24914
+
24915
+      PNG.prototype.readUInt32 = function () {
24916
+        var b1, b2, b3, b4;
24917
+        b1 = this.data[this.pos++] << 24;
24918
+        b2 = this.data[this.pos++] << 16;
24919
+        b3 = this.data[this.pos++] << 8;
24920
+        b4 = this.data[this.pos++];
24921
+        return b1 | b2 | b3 | b4;
24922
+      };
24923
+
24924
+      PNG.prototype.readUInt16 = function () {
24925
+        var b1, b2;
24926
+        b1 = this.data[this.pos++] << 8;
24927
+        b2 = this.data[this.pos++];
24928
+        return b1 | b2;
24929
+      };
24930
+
24931
+      PNG.prototype.decodePixels = function (data) {
24932
+        var pixelBytes = this.pixelBitlength / 8;
24933
+        var fullPixels = new Uint8Array(this.width * this.height * pixelBytes);
24934
+        var pos = 0;
24935
+
24936
+        var _this = this;
24937
+
24938
+        if (data == null) {
24939
+          data = this.imgData;
24940
+        }
24941
+
24942
+        if (data.length === 0) {
24943
+          return new Uint8Array(0);
24944
+        }
24945
+
24946
+        data = new FlateStream(data);
24947
+        data = data.getBytes();
24948
+
24949
+        function pass(x0, y0, dx, dy) {
24950
+          var abyte, c, col, i, left, length, p, pa, paeth, pb, pc, pixels, row, scanlineLength, upper, upperLeft, _i, _j, _k, _l, _m;
24951
+
24952
+          var w = Math.ceil((_this.width - x0) / dx),
24953
+              h = Math.ceil((_this.height - y0) / dy);
24954
+          var isFull = _this.width == w && _this.height == h;
24955
+          scanlineLength = pixelBytes * w;
24956
+          pixels = isFull ? fullPixels : new Uint8Array(scanlineLength * h);
24957
+          length = data.length;
24958
+          row = 0;
24959
+          c = 0;
24960
+
24961
+          while (row < h && pos < length) {
24962
+            switch (data[pos++]) {
24963
+              case 0:
24964
+                for (i = _i = 0; _i < scanlineLength; i = _i += 1) {
24965
+                  pixels[c++] = data[pos++];
24966
+                }
24967
+
24968
+                break;
24969
+
24970
+              case 1:
24971
+                for (i = _j = 0; _j < scanlineLength; i = _j += 1) {
24972
+                  abyte = data[pos++];
24973
+                  left = i < pixelBytes ? 0 : pixels[c - pixelBytes];
24974
+                  pixels[c++] = (abyte + left) % 256;
24975
+                }
24976
+
24977
+                break;
24978
+
24979
+              case 2:
24980
+                for (i = _k = 0; _k < scanlineLength; i = _k += 1) {
24981
+                  abyte = data[pos++];
24982
+                  col = (i - i % pixelBytes) / pixelBytes;
24983
+                  upper = row && pixels[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes];
24984
+                  pixels[c++] = (upper + abyte) % 256;
24985
+                }
24986
+
24987
+                break;
24988
+
24989
+              case 3:
24990
+                for (i = _l = 0; _l < scanlineLength; i = _l += 1) {
24991
+                  abyte = data[pos++];
24992
+                  col = (i - i % pixelBytes) / pixelBytes;
24993
+                  left = i < pixelBytes ? 0 : pixels[c - pixelBytes];
24994
+                  upper = row && pixels[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes];
24995
+                  pixels[c++] = (abyte + Math.floor((left + upper) / 2)) % 256;
24996
+                }
24997
+
24998
+                break;
24999
+
25000
+              case 4:
25001
+                for (i = _m = 0; _m < scanlineLength; i = _m += 1) {
25002
+                  abyte = data[pos++];
25003
+                  col = (i - i % pixelBytes) / pixelBytes;
25004
+                  left = i < pixelBytes ? 0 : pixels[c - pixelBytes];
25005
+
25006
+                  if (row === 0) {
25007
+                    upper = upperLeft = 0;
25008
+                  } else {
25009
+                    upper = pixels[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes];
25010
+                    upperLeft = col && pixels[(row - 1) * scanlineLength + (col - 1) * pixelBytes + i % pixelBytes];
25011
+                  }
25012
+
25013
+                  p = left + upper - upperLeft;
25014
+                  pa = Math.abs(p - left);
25015
+                  pb = Math.abs(p - upper);
25016
+                  pc = Math.abs(p - upperLeft);
25017
+
25018
+                  if (pa <= pb && pa <= pc) {
25019
+                    paeth = left;
25020
+                  } else if (pb <= pc) {
25021
+                    paeth = upper;
25022
+                  } else {
25023
+                    paeth = upperLeft;
25024
+                  }
25025
+
25026
+                  pixels[c++] = (abyte + paeth) % 256;
25027
+                }
25028
+
25029
+                break;
25030
+
25031
+              default:
25032
+                throw new Error("Invalid filter algorithm: " + data[pos - 1]);
25033
+            }
25034
+
25035
+            if (!isFull) {
25036
+              var fullPos = ((y0 + row * dy) * _this.width + x0) * pixelBytes;
25037
+              var partPos = row * scanlineLength;
25038
+
25039
+              for (i = 0; i < w; i += 1) {
25040
+                for (var j = 0; j < pixelBytes; j += 1) {
25041
+                  fullPixels[fullPos++] = pixels[partPos++];
25042
+                }
25043
+
25044
+                fullPos += (dx - 1) * pixelBytes;
25045
+              }
25046
+            }
25047
+
25048
+            row++;
25049
+          }
25050
+        }
25051
+
25052
+        if (_this.interlaceMethod == 1) {
25053
+          /*
25054
+            1 6 4 6 2 6 4 6
25055
+            7 7 7 7 7 7 7 7
25056
+            5 6 5 6 5 6 5 6
25057
+            7 7 7 7 7 7 7 7
25058
+            3 6 4 6 3 6 4 6
25059
+            7 7 7 7 7 7 7 7
25060
+            5 6 5 6 5 6 5 6
25061
+            7 7 7 7 7 7 7 7
25062
+          */
25063
+          pass(0, 0, 8, 8); // 1
25064
+
25065
+          /* NOTE these seem to follow the pattern:
25066
+           * pass(x, 0, 2*x, 2*x);
25067
+           * pass(0, x,   x, 2*x);
25068
+           * with x being 4, 2, 1.
25069
+           */
25070
+
25071
+          pass(4, 0, 8, 8); // 2
25072
+
25073
+          pass(0, 4, 4, 8); // 3
25074
+
25075
+          pass(2, 0, 4, 4); // 4
25076
+
25077
+          pass(0, 2, 2, 4); // 5
25078
+
25079
+          pass(1, 0, 2, 2); // 6
25080
+
25081
+          pass(0, 1, 1, 2); // 7
25082
+        } else {
25083
+          pass(0, 0, 1, 1);
25084
+        }
25085
+
25086
+        return fullPixels;
25087
+      };
25088
+
25089
+      PNG.prototype.decodePalette = function () {
25090
+        var c, i, length, palette, pos, ret, transparency, _i, _ref, _ref1;
25091
+
25092
+        palette = this.palette;
25093
+        transparency = this.transparency.indexed || [];
25094
+        ret = new Uint8Array((transparency.length || 0) + palette.length);
25095
+        pos = 0;
25096
+        length = palette.length;
25097
+        c = 0;
25098
+
25099
+        for (i = _i = 0, _ref = palette.length; _i < _ref; i = _i += 3) {
25100
+          ret[pos++] = palette[i];
25101
+          ret[pos++] = palette[i + 1];
25102
+          ret[pos++] = palette[i + 2];
25103
+          ret[pos++] = (_ref1 = transparency[c++]) != null ? _ref1 : 255;
25104
+        }
25105
+
25106
+        return ret;
25107
+      };
25108
+
25109
+      PNG.prototype.copyToImageData = function (imageData, pixels) {
25110
+        var alpha, colors, data, i, input, j, k, length, palette, v, _ref;
25111
+
25112
+        colors = this.colors;
25113
+        palette = null;
25114
+        alpha = this.hasAlphaChannel;
25115
+
25116
+        if (this.palette.length) {
25117
+          palette = (_ref = this._decodedPalette) != null ? _ref : this._decodedPalette = this.decodePalette();
25118
+          colors = 4;
25119
+          alpha = true;
25120
+        }
25121
+
25122
+        data = imageData.data || imageData;
25123
+        length = data.length;
25124
+        input = palette || pixels;
25125
+        i = j = 0;
25126
+
25127
+        if (colors === 1) {
25128
+          while (i < length) {
25129
+            k = palette ? pixels[i / 4] * 4 : j;
25130
+            v = input[k++];
25131
+            data[i++] = v;
25132
+            data[i++] = v;
25133
+            data[i++] = v;
25134
+            data[i++] = alpha ? input[k++] : 255;
25135
+            j = k;
25136
+          }
25137
+        } else {
25138
+          while (i < length) {
25139
+            k = palette ? pixels[i / 4] * 4 : j;
25140
+            data[i++] = input[k++];
25141
+            data[i++] = input[k++];
25142
+            data[i++] = input[k++];
25143
+            data[i++] = alpha ? input[k++] : 255;
25144
+            j = k;
25145
+          }
25146
+        }
25147
+      };
25148
+
25149
+      PNG.prototype.decode = function () {
25150
+        var ret;
25151
+        ret = new Uint8Array(this.width * this.height * 4);
25152
+        this.copyToImageData(ret, this.decodePixels());
25153
+        return ret;
25154
+      };
25155
+
25156
+      try {
25157
+        scratchCanvas = global.document.createElement('canvas');
25158
+        scratchCtx = scratchCanvas.getContext('2d');
25159
+      } catch (e) {
25160
+        return -1;
25161
+      }
25162
+
25163
+      makeImage = function makeImage(imageData) {
25164
+        var img;
25165
+        scratchCtx.width = imageData.width;
25166
+        scratchCtx.height = imageData.height;
25167
+        scratchCtx.clearRect(0, 0, imageData.width, imageData.height);
25168
+        scratchCtx.putImageData(imageData, 0, 0);
25169
+        img = new Image();
25170
+        img.src = scratchCanvas.toDataURL();
25171
+        return img;
25172
+      };
25173
+
25174
+      PNG.prototype.decodeFrames = function (ctx) {
25175
+        var frame, i, imageData, pixels, _i, _len, _ref, _results;
25176
+
25177
+        if (!this.animation) {
25178
+          return;
25179
+        }
25180
+
25181
+        _ref = this.animation.frames;
25182
+        _results = [];
25183
+
25184
+        for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
25185
+          frame = _ref[i];
25186
+          imageData = ctx.createImageData(frame.width, frame.height);
25187
+          pixels = this.decodePixels(new Uint8Array(frame.data));
25188
+          this.copyToImageData(imageData, pixels);
25189
+          frame.imageData = imageData;
25190
+
25191
+          _results.push(frame.image = makeImage(imageData));
25192
+        }
25193
+
25194
+        return _results;
25195
+      };
25196
+
25197
+      PNG.prototype.renderFrame = function (ctx, number) {
25198
+        var frame, frames, prev;
25199
+        frames = this.animation.frames;
25200
+        frame = frames[number];
25201
+        prev = frames[number - 1];
25202
+
25203
+        if (number === 0) {
25204
+          ctx.clearRect(0, 0, this.width, this.height);
25205
+        }
25206
+
25207
+        if ((prev != null ? prev.disposeOp : void 0) === APNG_DISPOSE_OP_BACKGROUND) {
25208
+          ctx.clearRect(prev.xOffset, prev.yOffset, prev.width, prev.height);
25209
+        } else if ((prev != null ? prev.disposeOp : void 0) === APNG_DISPOSE_OP_PREVIOUS) {
25210
+          ctx.putImageData(prev.imageData, prev.xOffset, prev.yOffset);
25211
+        }
25212
+
25213
+        if (frame.blendOp === APNG_BLEND_OP_SOURCE) {
25214
+          ctx.clearRect(frame.xOffset, frame.yOffset, frame.width, frame.height);
25215
+        }
25216
+
25217
+        return ctx.drawImage(frame.image, frame.xOffset, frame.yOffset);
25218
+      };
25219
+
25220
+      PNG.prototype.animate = function (ctx) {
25221
+        var _doFrame,
25222
+            frameNumber,
25223
+            frames,
25224
+            numFrames,
25225
+            numPlays,
25226
+            _ref,
25227
+            _this = this;
25228
+
25229
+        frameNumber = 0;
25230
+        _ref = this.animation, numFrames = _ref.numFrames, frames = _ref.frames, numPlays = _ref.numPlays;
25231
+        return (_doFrame = function doFrame() {
25232
+          var f, frame;
25233
+          f = frameNumber++ % numFrames;
25234
+          frame = frames[f];
25235
+
25236
+          _this.renderFrame(ctx, f);
25237
+
25238
+          if (numFrames > 1 && frameNumber / numFrames < numPlays) {
25239
+            return _this.animation._timeout = setTimeout(_doFrame, frame.delay);
25240
+          }
25241
+        })();
25242
+      };
25243
+
25244
+      PNG.prototype.stopAnimation = function () {
25245
+        var _ref;
25246
+
25247
+        return clearTimeout((_ref = this.animation) != null ? _ref._timeout : void 0);
25248
+      };
25249
+
25250
+      PNG.prototype.render = function (canvas) {
25251
+        var ctx, data;
25252
+
25253
+        if (canvas._png) {
25254
+          canvas._png.stopAnimation();
25255
+        }
25256
+
25257
+        canvas._png = this;
25258
+        canvas.width = this.width;
25259
+        canvas.height = this.height;
25260
+        ctx = canvas.getContext("2d");
25261
+
25262
+        if (this.animation) {
25263
+          this.decodeFrames(ctx);
25264
+          return this.animate(ctx);
25265
+        } else {
25266
+          data = ctx.createImageData(this.width, this.height);
25267
+          this.copyToImageData(data, this.decodePixels());
25268
+          return ctx.putImageData(data, 0, 0);
25269
+        }
25270
+      };
25271
+
25272
+      return PNG;
25273
+    }();
25274
+
25275
+    global.PNG = PNG;
25276
+  })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); // `self` is undefined in Firefox for Android content script context
25277
+  // while `this` is nsIContentFrameMessageManager
25278
+  // with an attribute `content` that corresponds to the window
25279
+
25280
+  /*
25281
+   * Extracted from pdf.js
25282
+   * https://github.com/andreasgal/pdf.js
25283
+   *
25284
+   * Copyright (c) 2011 Mozilla Foundation
25285
+   *
25286
+   * Contributors: Andreas Gal <gal@mozilla.com>
25287
+   *               Chris G Jones <cjones@mozilla.com>
25288
+   *               Shaon Barman <shaon.barman@gmail.com>
25289
+   *               Vivien Nicolas <21@vingtetun.org>
25290
+   *               Justin D'Arcangelo <justindarc@gmail.com>
25291
+   *               Yury Delendik
25292
+   *
25293
+   * 
25294
+   */
25295
+  var DecodeStream = function () {
25296
+    function constructor() {
25297
+      this.pos = 0;
25298
+      this.bufferLength = 0;
25299
+      this.eof = false;
25300
+      this.buffer = null;
25301
+    }
25302
+
25303
+    constructor.prototype = {
25304
+      ensureBuffer: function decodestream_ensureBuffer(requested) {
25305
+        var buffer = this.buffer;
25306
+        var current = buffer ? buffer.byteLength : 0;
25307
+        if (requested < current) return buffer;
25308
+        var size = 512;
25309
+
25310
+        while (size < requested) {
25311
+          size <<= 1;
25312
+        }
25313
+
25314
+        var buffer2 = new Uint8Array(size);
25315
+
25316
+        for (var i = 0; i < current; ++i) {
25317
+          buffer2[i] = buffer[i];
25318
+        }
25319
+
25320
+        return this.buffer = buffer2;
25321
+      },
25322
+      getByte: function decodestream_getByte() {
25323
+        var pos = this.pos;
25324
+
25325
+        while (this.bufferLength <= pos) {
25326
+          if (this.eof) return null;
25327
+          this.readBlock();
25328
+        }
25329
+
25330
+        return this.buffer[this.pos++];
25331
+      },
25332
+      getBytes: function decodestream_getBytes(length) {
25333
+        var pos = this.pos;
25334
+
25335
+        if (length) {
25336
+          this.ensureBuffer(pos + length);
25337
+          var end = pos + length;
25338
+
25339
+          while (!this.eof && this.bufferLength < end) {
25340
+            this.readBlock();
25341
+          }
25342
+
25343
+          var bufEnd = this.bufferLength;
25344
+          if (end > bufEnd) end = bufEnd;
25345
+        } else {
25346
+          while (!this.eof) {
25347
+            this.readBlock();
25348
+          }
25349
+
25350
+          var end = this.bufferLength;
25351
+        }
25352
+
25353
+        this.pos = end;
25354
+        return this.buffer.subarray(pos, end);
25355
+      },
25356
+      lookChar: function decodestream_lookChar() {
25357
+        var pos = this.pos;
25358
+
25359
+        while (this.bufferLength <= pos) {
25360
+          if (this.eof) return null;
25361
+          this.readBlock();
25362
+        }
25363
+
25364
+        return String.fromCharCode(this.buffer[this.pos]);
25365
+      },
25366
+      getChar: function decodestream_getChar() {
25367
+        var pos = this.pos;
25368
+
25369
+        while (this.bufferLength <= pos) {
25370
+          if (this.eof) return null;
25371
+          this.readBlock();
25372
+        }
25373
+
25374
+        return String.fromCharCode(this.buffer[this.pos++]);
25375
+      },
25376
+      makeSubStream: function decodestream_makeSubstream(start, length, dict) {
25377
+        var end = start + length;
25378
+
25379
+        while (this.bufferLength <= end && !this.eof) {
25380
+          this.readBlock();
25381
+        }
25382
+
25383
+        return new Stream(this.buffer, start, length, dict);
25384
+      },
25385
+      skip: function decodestream_skip(n) {
25386
+        if (!n) n = 1;
25387
+        this.pos += n;
25388
+      },
25389
+      reset: function decodestream_reset() {
25390
+        this.pos = 0;
25391
+      }
25392
+    };
25393
+    return constructor;
25394
+  }();
25395
+
25396
+  var FlateStream = function () {
25397
+    if (typeof Uint32Array === 'undefined') {
25398
+      return undefined;
25399
+    }
25400
+
25401
+    var codeLenCodeMap = new Uint32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
25402
+    var lengthDecode = new Uint32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]);
25403
+    var distDecode = new Uint32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]);
25404
+    var fixedLitCodeTab = [new Uint32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9];
25405
+    var fixedDistCodeTab = [new Uint32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5];
25406
+
25407
+    function error(e) {
25408
+      throw new Error(e);
25409
+    }
25410
+
25411
+    function constructor(bytes) {
25412
+      //var bytes = stream.getBytes();
25413
+      var bytesPos = 0;
25414
+      var cmf = bytes[bytesPos++];
25415
+      var flg = bytes[bytesPos++];
25416
+      if (cmf == -1 || flg == -1) error('Invalid header in flate stream');
25417
+      if ((cmf & 0x0f) != 0x08) error('Unknown compression method in flate stream');
25418
+      if (((cmf << 8) + flg) % 31 != 0) error('Bad FCHECK in flate stream');
25419
+      if (flg & 0x20) error('FDICT bit set in flate stream');
25420
+      this.bytes = bytes;
25421
+      this.bytesPos = bytesPos;
25422
+      this.codeSize = 0;
25423
+      this.codeBuf = 0;
25424
+      DecodeStream.call(this);
25425
+    }
25426
+
25427
+    constructor.prototype = Object.create(DecodeStream.prototype);
25428
+
25429
+    constructor.prototype.getBits = function (bits) {
25430
+      var codeSize = this.codeSize;
25431
+      var codeBuf = this.codeBuf;
25432
+      var bytes = this.bytes;
25433
+      var bytesPos = this.bytesPos;
25434
+      var b;
25435
+
25436
+      while (codeSize < bits) {
25437
+        if (typeof (b = bytes[bytesPos++]) == 'undefined') error('Bad encoding in flate stream');
25438
+        codeBuf |= b << codeSize;
25439
+        codeSize += 8;
25440
+      }
25441
+
25442
+      b = codeBuf & (1 << bits) - 1;
25443
+      this.codeBuf = codeBuf >> bits;
25444
+      this.codeSize = codeSize -= bits;
25445
+      this.bytesPos = bytesPos;
25446
+      return b;
25447
+    };
25448
+
25449
+    constructor.prototype.getCode = function (table) {
25450
+      var codes = table[0];
25451
+      var maxLen = table[1];
25452
+      var codeSize = this.codeSize;
25453
+      var codeBuf = this.codeBuf;
25454
+      var bytes = this.bytes;
25455
+      var bytesPos = this.bytesPos;
25456
+
25457
+      while (codeSize < maxLen) {
25458
+        var b;
25459
+        if (typeof (b = bytes[bytesPos++]) == 'undefined') error('Bad encoding in flate stream');
25460
+        codeBuf |= b << codeSize;
25461
+        codeSize += 8;
25462
+      }
25463
+
25464
+      var code = codes[codeBuf & (1 << maxLen) - 1];
25465
+      var codeLen = code >> 16;
25466
+      var codeVal = code & 0xffff;
25467
+      if (codeSize == 0 || codeSize < codeLen || codeLen == 0) error('Bad encoding in flate stream');
25468
+      this.codeBuf = codeBuf >> codeLen;
25469
+      this.codeSize = codeSize - codeLen;
25470
+      this.bytesPos = bytesPos;
25471
+      return codeVal;
25472
+    };
25473
+
25474
+    constructor.prototype.generateHuffmanTable = function (lengths) {
25475
+      var n = lengths.length; // find max code length
25476
+
25477
+      var maxLen = 0;
25478
+
25479
+      for (var i = 0; i < n; ++i) {
25480
+        if (lengths[i] > maxLen) maxLen = lengths[i];
25481
+      } // build the table
25482
+
25483
+
25484
+      var size = 1 << maxLen;
25485
+      var codes = new Uint32Array(size);
25486
+
25487
+      for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {
25488
+        for (var val = 0; val < n; ++val) {
25489
+          if (lengths[val] == len) {
25490
+            // bit-reverse the code
25491
+            var code2 = 0;
25492
+            var t = code;
25493
+
25494
+            for (var i = 0; i < len; ++i) {
25495
+              code2 = code2 << 1 | t & 1;
25496
+              t >>= 1;
25497
+            } // fill the table entries
25498
+
25499
+
25500
+            for (var i = code2; i < size; i += skip) {
25501
+              codes[i] = len << 16 | val;
25502
+            }
25503
+
25504
+            ++code;
25505
+          }
25506
+        }
25507
+      }
25508
+
25509
+      return [codes, maxLen];
25510
+    };
25511
+
25512
+    constructor.prototype.readBlock = function () {
25513
+      function repeat(stream, array, len, offset, what) {
25514
+        var repeat = stream.getBits(len) + offset;
25515
+
25516
+        while (repeat-- > 0) {
25517
+          array[i++] = what;
25518
+        }
25519
+      } // read block header
25520
+
25521
+
25522
+      var hdr = this.getBits(3);
25523
+      if (hdr & 1) this.eof = true;
25524
+      hdr >>= 1;
25525
+
25526
+      if (hdr == 0) {
25527
+        // uncompressed block
25528
+        var bytes = this.bytes;
25529
+        var bytesPos = this.bytesPos;
25530
+        var b;
25531
+        if (typeof (b = bytes[bytesPos++]) == 'undefined') error('Bad block header in flate stream');
25532
+        var blockLen = b;
25533
+        if (typeof (b = bytes[bytesPos++]) == 'undefined') error('Bad block header in flate stream');
25534
+        blockLen |= b << 8;
25535
+        if (typeof (b = bytes[bytesPos++]) == 'undefined') error('Bad block header in flate stream');
25536
+        var check = b;
25537
+        if (typeof (b = bytes[bytesPos++]) == 'undefined') error('Bad block header in flate stream');
25538
+        check |= b << 8;
25539
+        if (check != (~blockLen & 0xffff)) error('Bad uncompressed block length in flate stream');
25540
+        this.codeBuf = 0;
25541
+        this.codeSize = 0;
25542
+        var bufferLength = this.bufferLength;
25543
+        var buffer = this.ensureBuffer(bufferLength + blockLen);
25544
+        var end = bufferLength + blockLen;
25545
+        this.bufferLength = end;
25546
+
25547
+        for (var n = bufferLength; n < end; ++n) {
25548
+          if (typeof (b = bytes[bytesPos++]) == 'undefined') {
25549
+            this.eof = true;
25550
+            break;
25551
+          }
25552
+
25553
+          buffer[n] = b;
25554
+        }
25555
+
25556
+        this.bytesPos = bytesPos;
25557
+        return;
25558
+      }
25559
+
25560
+      var litCodeTable;
25561
+      var distCodeTable;
25562
+
25563
+      if (hdr == 1) {
25564
+        // compressed block, fixed codes
25565
+        litCodeTable = fixedLitCodeTab;
25566
+        distCodeTable = fixedDistCodeTab;
25567
+      } else if (hdr == 2) {
25568
+        // compressed block, dynamic codes
25569
+        var numLitCodes = this.getBits(5) + 257;
25570
+        var numDistCodes = this.getBits(5) + 1;
25571
+        var numCodeLenCodes = this.getBits(4) + 4; // build the code lengths code table
25572
+
25573
+        var codeLenCodeLengths = Array(codeLenCodeMap.length);
25574
+        var i = 0;
25575
+
25576
+        while (i < numCodeLenCodes) {
25577
+          codeLenCodeLengths[codeLenCodeMap[i++]] = this.getBits(3);
25578
+        }
25579
+
25580
+        var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); // build the literal and distance code tables
25581
+
25582
+        var len = 0;
25583
+        var i = 0;
25584
+        var codes = numLitCodes + numDistCodes;
25585
+        var codeLengths = new Array(codes);
25586
+
25587
+        while (i < codes) {
25588
+          var code = this.getCode(codeLenCodeTab);
25589
+
25590
+          if (code == 16) {
25591
+            repeat(this, codeLengths, 2, 3, len);
25592
+          } else if (code == 17) {
25593
+            repeat(this, codeLengths, 3, 3, len = 0);
25594
+          } else if (code == 18) {
25595
+            repeat(this, codeLengths, 7, 11, len = 0);
25596
+          } else {
25597
+            codeLengths[i++] = len = code;
25598
+          }
25599
+        }
25600
+
25601
+        litCodeTable = this.generateHuffmanTable(codeLengths.slice(0, numLitCodes));
25602
+        distCodeTable = this.generateHuffmanTable(codeLengths.slice(numLitCodes, codes));
25603
+      } else {
25604
+        error('Unknown block type in flate stream');
25605
+      }
25606
+
25607
+      var buffer = this.buffer;
25608
+      var limit = buffer ? buffer.length : 0;
25609
+      var pos = this.bufferLength;
25610
+
25611
+      while (true) {
25612
+        var code1 = this.getCode(litCodeTable);
25613
+
25614
+        if (code1 < 256) {
25615
+          if (pos + 1 >= limit) {
25616
+            buffer = this.ensureBuffer(pos + 1);
25617
+            limit = buffer.length;
25618
+          }
25619
+
25620
+          buffer[pos++] = code1;
25621
+          continue;
25622
+        }
25623
+
25624
+        if (code1 == 256) {
25625
+          this.bufferLength = pos;
25626
+          return;
25627
+        }
25628
+
25629
+        code1 -= 257;
25630
+        code1 = lengthDecode[code1];
25631
+        var code2 = code1 >> 16;
25632
+        if (code2 > 0) code2 = this.getBits(code2);
25633
+        var len = (code1 & 0xffff) + code2;
25634
+        code1 = this.getCode(distCodeTable);
25635
+        code1 = distDecode[code1];
25636
+        code2 = code1 >> 16;
25637
+        if (code2 > 0) code2 = this.getBits(code2);
25638
+        var dist = (code1 & 0xffff) + code2;
25639
+
25640
+        if (pos + len >= limit) {
25641
+          buffer = this.ensureBuffer(pos + len);
25642
+          limit = buffer.length;
25643
+        }
25644
+
25645
+        for (var k = 0; k < len; ++k, ++pos) {
25646
+          buffer[pos] = buffer[pos - dist];
25647
+        }
25648
+      }
25649
+    };
25650
+
25651
+    return constructor;
25652
+  }();
25653
+  /*rollup-keeper-start*/
25654
+
25655
+
25656
+  window.tmp = FlateStream;
25657
+  /*rollup-keeper-end*/
25658
+
25659
+}));
25660
+
25661
+try {
25662
+module.exports = jsPDF;
25663
+}
25664
+catch (e) {}
+286
js/jspdf.min.js
... ...
@@ -0,0 +1,286 @@
1
+!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";
2
+/** @license
3
+   * jsPDF - PDF Document creation from JavaScript
4
+   * Version 1.5.3 Built on 2018-12-27T14:11:42.696Z
5
+   *                      CommitID d93d28db14
6
+   *
7
+   * Copyright (c) 2010-2016 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
8
+   *               2010 Aaron Spike, https://github.com/acspike
9
+   *               2012 Willow Systems Corporation, willow-systems.com
10
+   *               2012 Pablo Hess, https://github.com/pablohess
11
+   *               2012 Florian Jenett, https://github.com/fjenett
12
+   *               2013 Warren Weckesser, https://github.com/warrenweckesser
13
+   *               2013 Youssef Beddad, https://github.com/lifof
14
+   *               2013 Lee Driscoll, https://github.com/lsdriscoll
15
+   *               2013 Stefan Slonevskiy, https://github.com/stefslon
16
+   *               2013 Jeremy Morel, https://github.com/jmorel
17
+   *               2013 Christoph Hartmann, https://github.com/chris-rock
18
+   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
19
+   *               2014 James Makes, https://github.com/dollaruw
20
+   *               2014 Diego Casorran, https://github.com/diegocr
21
+   *               2014 Steven Spungin, https://github.com/Flamenco
22
+   *               2014 Kenneth Glassey, https://github.com/Gavvers
23
+   *
24
+   * Licensed under the MIT License
25
+   *
26
+   * Contributor(s):
27
+   *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
28
+   *    kim3er, mfo, alnorth, Flamenco
29
+   */function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==se(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i)}var s,l,h,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,l="",h=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,h[s++]=c.charAt(e)+c.charAt(n)+c.charAt(r)+c.charAt(i),a<t.length;);l=h.join("");var u=t.length%3;return(u?l.slice(0,u-3):l)+"===".slice(u||3)}),void 0===t.atob&&(t.atob=function(t){var e,n,r,i,o,a,s=0,l=0,h=[];if(!t)return t;for(t+="";e=(a=c.indexOf(t.charAt(s++))<<18|c.indexOf(t.charAt(s++))<<12|(i=c.indexOf(t.charAt(s++)))<<6|(o=c.indexOf(t.charAt(s++))))>>16&255,n=a>>8&255,r=255&a,h[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s<t.length;);return h.join("")}),Array.prototype.map||(Array.prototype.map=function(t){if(null==this||"function"!=typeof t)throw new TypeError;for(var e=Object(this),n=e.length>>>0,r=new Array(n),i=1<arguments.length?arguments[1]:void 0,o=0;o<n;o++)o in e&&(r[o]=t.call(i,e[o],o,e));return r}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(null==this||"function"!=typeof t)throw new TypeError;for(var n=Object(this),r=n.length>>>0,i=0;i<r;i++)i in n&&t.call(e,n[i],i,n)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=e[i];if(t.call(r,o,i,e))return o;i++}},configurable:!0,writable:!0}),Object.keys||(Object.keys=(s=Object.prototype.hasOwnProperty,l=!{toString:null}.propertyIsEnumerable("toString"),u=(h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(t){if("object"!==se(t)&&("function"!=typeof t||null===t))throw new TypeError;var e,n,r=[];for(e in t)s.call(t,e)&&r.push(e);if(l)for(n=0;n<u;n++)s.call(t,h[n])&&r.push(h[n]);return r})),"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var n=arguments[e];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}),String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")}),Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());var t,e,n,_,l,F,P,p,d,k,a,o,s,h,u,c,r,i,f,g,m,y,v,w,b,x,I,C,B,N,L,A,S,j,E,M,O,q,T,R,D,U,z,H,W,V,G,Y,J,X,K,Z,Q,$,tt,et,nt,rt,it,ot,at,st,lt=function(ie){function oe(o){if("object"!==se(o))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var a={};this.subscribe=function(t,e,n){if(n=n||!1,"string"!=typeof t||"function"!=typeof e||"boolean"!=typeof n)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");a.hasOwnProperty(t)||(a[t]={});var r=Math.random().toString(35);return a[t][r]=[e,!!n],r},this.unsubscribe=function(t){for(var e in a)if(a[e][t])return delete a[e][t],0===Object.keys(a[e]).length&&delete a[e],!0;return!1},this.publish=function(t){if(a.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1),n=[];for(var r in a[t]){var i=a[t][r];try{i[0].apply(o,e)}catch(t){ie.console&&console.error("jsPDF PubSub Error",t.message,t)}i[1]&&n.push(r)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return a}}function ae(t,e,i,n){var r={},o=[],a=1;"object"===se(t)&&(t=(r=t).orientation,e=r.unit||e,i=r.format||i,n=r.compress||r.compressPdf||n,o=r.filters||(!0===n?["FlateEncode"]:o),a="number"==typeof r.userUnit?Math.abs(r.userUnit):1),e=e||"mm",t=(""+(t||"P")).toLowerCase();var s=r.putOnlyUsedFonts||!0,K={},l={internal:{},__private__:{}};l.__private__.PubSub=oe;var h="1.3",u=l.__private__.getPdfVersion=function(){return h},c=(l.__private__.setPdfVersion=function(t){h=t},{a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]}),f=(l.__private__.getPageFormats=function(){return c},l.__private__.getPageFormat=function(t){return c[t]});"string"==typeof i&&(i=f(i)),i=i||f("a4");var p,Z=l.f2=l.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},Q=l.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return t.toFixed(3)},d="00000000000000000000000000000000",g=l.__private__.getFileId=function(){return d},m=l.__private__.setFileId=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d=t};l.setFileId=function(t){return m(t),this},l.getFileId=function(){return g()};var y=l.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=e<0?"+":"-",r=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),o=[n,P(r),"'",P(i),"'"].join("");return["D:",t.getFullYear(),P(t.getMonth()+1),P(t.getDate()),P(t.getHours()),P(t.getMinutes()),P(t.getSeconds()),o].join("")},v=l.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),a=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10),parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,a,0)},w=l.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),"object"===se(t)&&"[object Date]"===Object.prototype.toString.call(t))e=y(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return p=e},b=l.__private__.getCreationDate=function(t){var e=p;return"jsDate"===t&&(e=v(p)),e};l.setCreationDate=function(t){return w(t),this},l.getCreationDate=function(t){return b(t)};var x,N,L,A,S,$,_,F,P=l.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},k=!1,I=[],C=[],B=0,tt=(l.__private__.setCustomOutputDestination=function(t){N=t},l.__private__.resetCustomOutputDestination=function(t){N=void 0},l.__private__.out=function(t){var e;return t="string"==typeof t?t:t.toString(),(e=void 0===N?k?I[x]:C:N).push(t),k||(B+=t.length+1),e}),j=l.__private__.write=function(t){return tt(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},E=l.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},M=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]],et=(l.__private__.getStandardFonts=function(t){return M},r.fontSize||16),O=(l.__private__.setFontSize=l.setFontSize=function(t){return et=t,this},l.__private__.getFontSize=l.getFontSize=function(){return et}),nt=r.R2L||!1,q=(l.__private__.setR2L=l.setR2L=function(t){return nt=t,this},l.__private__.getR2L=l.getR2L=function(t){return nt},l.__private__.setZoomMode=function(t){var e=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^\d*\.?\d*\%$/.test(t))L=t;else if(isNaN(t)){if(-1===e.indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');L=t}else L=parseInt(t,10)}),T=(l.__private__.getZoomMode=function(){return L},l.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');A=t}),R=(l.__private__.getPageMode=function(){return A},l.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');S=t}),D=(l.__private__.getLayoutMode=function(){return S},l.__private__.setDisplayMode=l.setDisplayMode=function(t,e,n){return q(t),R(e),T(n),this},{title:"",subject:"",author:"",keywords:"",creator:""}),U=(l.__private__.getDocumentProperty=function(t){if(-1===Object.keys(D).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return D[t]},l.__private__.getDocumentProperties=function(t){return D},l.__private__.setDocumentProperties=l.setProperties=l.setDocumentProperties=function(t){for(var e in D)D.hasOwnProperty(e)&&t[e]&&(D[e]=t[e]);return this},l.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(D).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return D[t]=e},0),z=[],rt={},H={},W=0,V=[],G=[],it=new oe(l),Y=r.hotfixes||[],J=l.__private__.newObject=function(){var t=X();return ot(t,!0),t},X=l.__private__.newObjectDeferred=function(){return z[++U]=function(){return B},U},ot=function(t,e){return e="boolean"==typeof e&&e,z[t]=B,e&&tt(t+" 0 obj"),t},at=l.__private__.newAdditionalObject=function(){var t={objId:X(),content:""};return G.push(t),t},st=X(),lt=X(),ht=l.__private__.decodeColorString=function(t){var e=t.split(" ");if(2===e.length&&("g"===e[1]||"G"===e[1])){var n=parseFloat(e[0]);e=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return r},ut=l.__private__.encodeColorString=function(t){var e;"string"==typeof t&&(t={ch1:t});var n=t.ch1,r=t.ch2,i=t.ch3,o=t.ch4,a=(t.precision,"draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof n&&"#"!==n.charAt(0)){var s=new RGBColor(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var l=parseInt(n.substr(1),16);n=l>>16&255,r=l>>8&255,i=255&l}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=Z(n/255)+" "+a[0];break;case 3:default:e=Q(n/255)+" "+a[0]}else if(void 0===o||"object"===se(o)){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.000","1.000","1.000",a[1]].join(" ");if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),a[1]].join(" ");break;default:case 3:e=[Q(n/255),Q(r/255),Q(i/255),a[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),Z(o/255),a[2]].join(" ");break;case 3:default:e=[Q(n/255),Q(r/255),Q(i/255),Q(o/255),a[2]].join(" ")}return e},ct=l.__private__.getFilters=function(){return o},ft=l.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||ct(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,o=e.length,a={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],l=(a=void 0!==ae.API.processDataByFilters?ae.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());0!==a.data.length&&(s.push({key:"Length",value:a.data.length}),!0===i&&s.push({key:"Length1",value:o})),0!=l.length&&(l.split("/").length-1==1?s.push({key:"Filter",value:l}):s.push({key:"Filter",value:"["+l+"]"})),tt("<<");for(var h=0;h<s.length;h++)tt("/"+s[h].key+" "+s[h].value);tt(">>"),0!==a.data.length&&(tt("stream"),tt(a.data),tt("endstream"))},pt=l.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ot(r,!0);V[x].mediaBox.topRightX,V[x].mediaBox.bottomLeftX,V[x].mediaBox.topRightY,V[x].mediaBox.bottomLeftY;tt("<</Type /Page"),tt("/Parent "+t.rootDictionaryObjId+" 0 R"),tt("/Resources "+t.resourceDictionaryObjId+" 0 R"),tt("/MediaBox ["+parseFloat(Z(t.mediaBox.bottomLeftX))+" "+parseFloat(Z(t.mediaBox.bottomLeftY))+" "+Z(t.mediaBox.topRightX)+" "+Z(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&tt("/CropBox ["+Z(t.cropBox.bottomLeftX)+" "+Z(t.cropBox.bottomLeftY)+" "+Z(t.cropBox.topRightX)+" "+Z(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&tt("/BleedBox ["+Z(t.bleedBox.bottomLeftX)+" "+Z(t.bleedBox.bottomLeftY)+" "+Z(t.bleedBox.topRightX)+" "+Z(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&tt("/TrimBox ["+Z(t.trimBox.bottomLeftX)+" "+Z(t.trimBox.bottomLeftY)+" "+Z(t.trimBox.topRightX)+" "+Z(t.trimBox.topRightY)+"]"),null!==t.artBox&&tt("/ArtBox ["+Z(t.artBox.bottomLeftX)+" "+Z(t.artBox.bottomLeftY)+" "+Z(t.artBox.topRightX)+" "+Z(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&tt("/UserUnit "+t.userUnit),it.publish("putPage",{objId:r,pageContext:V[e],pageNumber:e,page:n}),tt("/Contents "+i+" 0 R"),tt(">>"),tt("endobj");var o=n.join("\n");return ot(i,!0),ft({data:o,filters:ct()}),tt("endobj"),r},dt=l.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=W;t++)V[t].objId=X(),V[t].contentsObjId=X();for(t=1;t<=W;t++)n.push(pt({number:t,data:I[t],objId:V[t].objId,contentsObjId:V[t].contentsObjId,mediaBox:V[t].mediaBox,cropBox:V[t].cropBox,bleedBox:V[t].bleedBox,trimBox:V[t].trimBox,artBox:V[t].artBox,userUnit:V[t].userUnit,rootDictionaryObjId:st,resourceDictionaryObjId:lt}));ot(st,!0),tt("<</Type /Pages");var r="/Kids [";for(e=0;e<W;e++)r+=n[e]+" 0 R ";tt(r+"]"),tt("/Count "+W),tt(">>"),tt("endobj"),it.publish("postPutPages")},gt=function(){!function(){for(var t in rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&(e=rt[t],it.publish("putFont",{font:e,out:tt,newObject:J,putStream:ft}),!0!==e.isAlreadyPutted&&(e.objectNumber=J(),tt("<<"),tt("/Type /Font"),tt("/BaseFont /"+e.postScriptName),tt("/Subtype /Type1"),"string"==typeof e.encoding&&tt("/Encoding /"+e.encoding),tt("/FirstChar 32"),tt("/LastChar 255"),tt(">>"),tt("endobj")));var e}(),it.publish("putResources"),ot(lt,!0),tt("<<"),function(){for(var t in tt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),tt("/Font <<"),rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&tt("/"+t+" "+rt[t].objectNumber+" 0 R");tt(">>"),tt("/XObject <<"),it.publish("putXobjectDict"),tt(">>")}(),tt(">>"),tt("endobj"),it.publish("postPutResources")},mt=function(t,e,n){H.hasOwnProperty(e)||(H[e]={}),H[e][n]=t},yt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(rt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return it.publish("addFont",{font:a,instance:this}),void 0!==o&&(rt[o]=a,mt(o,e,n)),o},vt=l.__private__.pdfEscape=l.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,l,h,u;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&rt[$].metadata&&rt[$].metadata[i]&&rt[$].metadata[i].encoding&&(o=rt[$].metadata[i].encoding,!a&&rt[$].encoding&&(a=rt[$].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(l=!1,s=[],n=0,r=t.length;n<r;n++)(h=a[t.charCodeAt(n)])?s.push(String.fromCharCode(h)):s.push(t[n]),s[n].charCodeAt(0)>>8&&(l=!0);t=s.join("")}for(n=t.length;void 0===l&&0!==n;)t.charCodeAt(n-1)>>8&&(l=!0),n--;if(!l)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((u=(h=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(u),s.push(h-(u<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=l.__private__.beginPage=function(t,e){var n,r="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(n=f(t.toLowerCase()))&&(t=n[0],e=n[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=i[0],e=i[1]),r){switch(r.substr(0,1)){case"l":t<e&&(r="s");break;case"p":e<t&&(r="s")}"s"===r&&(n=t,t=e,e=n)}(14400<t||14400<e)&&(console.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),t=Math.min(14400,t),e=Math.min(14400,e)),i=[t,e],k=!0,I[++W]=[],V[W]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t),topRightY:Number(e)}},xt(W)},bt=function(){wt.apply(this,arguments),Dt(Rt),tt(Jt),0!==te&&tt(te+" J"),0!==ne&&tt(ne+" j"),it.publish("addPage",{pageNumber:W})},xt=function(t){0<t&&t<=W&&(x=t)},Nt=l.__private__.getNumberOfPages=l.getNumberOfPages=function(){return I.length-1},Lt=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:rt[$].fontName,e=void 0!==e?e:rt[$].fontStyle,r=t.toLowerCase(),void 0!==H[r]&&void 0!==H[r][e]?i=H[r][e]:void 0!==H[t]&&void 0!==H[t][e]?i=H[t][e]:!1===n.disableWarning&&console.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=H.times[e])&&(i=H.times.normal),i},At=l.__private__.putInfo=function(){for(var t in J(),tt("<<"),tt("/Producer (jsPDF "+ae.version+")"),D)D.hasOwnProperty(t)&&D[t]&&tt("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+vt(D[t])+")");tt("/CreationDate ("+p+")"),tt(">>"),tt("endobj")},St=l.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||st;switch(J(),tt("<<"),tt("/Type /Catalog"),tt("/Pages "+e+" 0 R"),L||(L="fullwidth"),L){case"fullwidth":tt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":tt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":tt("/OpenAction [3 0 R /Fit]");break;case"original":tt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+L;"%"===n.substr(n.length-1)&&(L=parseInt(L)/100),"number"==typeof L&&tt("/OpenAction [3 0 R /XYZ null null "+Z(L)+"]")}switch(S||(S="continuous"),S){case"continuous":tt("/PageLayout /OneColumn");break;case"single":tt("/PageLayout /SinglePage");break;case"two":case"twoleft":tt("/PageLayout /TwoColumnLeft");break;case"tworight":tt("/PageLayout /TwoColumnRight")}A&&tt("/PageMode /"+A),it.publish("putCatalog"),tt(">>"),tt("endobj")},_t=l.__private__.putTrailer=function(){tt("trailer"),tt("<<"),tt("/Size "+(U+1)),tt("/Root "+U+" 0 R"),tt("/Info "+(U-1)+" 0 R"),tt("/ID [ <"+d+"> <"+d+"> ]"),tt(">>")},Ft=l.__private__.putHeader=function(){tt("%PDF-"+h),tt("%ºß¬à")},Pt=l.__private__.putXRef=function(){var t=1,e="0000000000";for(tt("xref"),tt("0 "+(U+1)),tt("0000000000 65535 f "),t=1;t<=U;t++){"function"==typeof z[t]?tt((e+z[t]()).slice(-10)+" 00000 n "):void 0!==z[t]?tt((e+z[t]).slice(-10)+" 00000 n "):tt("0000000000 00000 n ")}},kt=l.__private__.buildDocument=function(){k=!1,B=U=0,C=[],z=[],G=[],st=X(),lt=X(),it.publish("buildDocument"),Ft(),dt(),function(){it.publish("putAdditionalObjects");for(var t=0;t<G.length;t++){var e=G[t];ot(e.objId,!0),tt(e.content),tt("endobj")}it.publish("postPutAdditionalObjects")}(),gt(),At(),St();var t=B;return Pt(),_t(),tt("startxref"),tt(""+t),tt("%%EOF"),k=!0,C.join("\n")},It=l.__private__.getBlob=function(t){return new Blob([E(t)],{type:"application/pdf"})},Ct=l.output=l.__private__.output=((F=function(t,e){e=e||{};var n=kt();switch("string"==typeof e?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return n;case"save":l.save(e.filename);break;case"arraybuffer":return E(n);case"blob":return It(n);case"bloburi":case"bloburl":if(void 0!==ie.URL&&"function"==typeof ie.URL.createObjectURL)return ie.URL&&ie.URL.createObjectURL(It(n))||void 0;console.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":return"data:application/pdf;filename="+e.filename+";base64,"+btoa(n);case"dataurlnewwindow":var r='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring")+'"></iframe></body></html>',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1<Y.indexOf(t)};switch(e){case"pt":_=1;break;case"mm":_=72/25.4;break;case"cm":_=72/2.54;break;case"in":_=72;break;case"px":_=1==Bt("px_scaling")?.75:96/72;break;case"pc":case"em":_=12;break;case"ex":_=6;break;default:throw new Error("Invalid unit: "+e)}w(),m();var jt=l.__private__.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:V[t].objId,pageNumber:t,pageContext:V[t]}},Et=l.__private__.getPageInfoByObjId=function(t){for(var e in V)if(V[e].objId===t)break;if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");return jt(e)},Mt=l.__private__.getCurrentPageInfo=function(){return{objId:V[x].objId,pageNumber:x,pageContext:V[x]}};l.addPage=function(){return bt.apply(this,arguments),this},l.setPage=function(){return xt.apply(this,arguments),this},l.insertPage=function(t){return this.addPage(),this.movePage(x,t),this},l.movePage=function(t,e){if(e<t){for(var n=I[t],r=V[t],i=t;e<i;i--)I[i]=I[i-1],V[i]=V[i-1];I[e]=n,V[e]=r,this.setPage(e)}else if(t<e){for(n=I[t],r=V[t],i=t;i<e;i++)I[i]=I[i+1],V[i]=V[i+1];I[e]=n,V[e]=r,this.setPage(e)}return this},l.deletePage=function(){return function(t){0<t&&t<=W&&(I.splice(t,1),--W<x&&(x=W),this.setPage(x))}.apply(this,arguments),this};l.__private__.text=l.text=function(t,e,n,i){var r;"number"!=typeof t||"number"!=typeof e||"string"!=typeof n&&!Array.isArray(n)||(r=n,n=e,e=t,t=r);var o=arguments[3],a=arguments[4],s=arguments[5];if("object"===se(o)&&null!==o||("string"==typeof a&&(s=a,a=null),"string"==typeof o&&(s=o,o=null),"number"==typeof o&&(a=o,o=null),i={flags:o,angle:a,align:s}),(o=o||{}).noBOM=o.noBOM||!0,o.autoencode=o.autoencode||!0,isNaN(e)||isNaN(n)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return c;var l,h="",u="number"==typeof i.lineHeightFactor?i.lineHeightFactor:Tt,c=i.scope||this;function f(t){for(var e,n=t.concat(),r=[],i=n.length;i--;)"string"==typeof(e=n.shift())?r.push(e):Array.isArray(t)&&1===e.length?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function p(t,e){var n;if("string"==typeof t)n=e(t)[0];else if(Array.isArray(t)){for(var r,i,o=t.concat(),a=[],s=o.length;s--;)"string"==typeof(r=o.shift())?a.push(e(r)[0]):Array.isArray(r)&&"string"===r[0]&&(i=e(r[0],r[1],r[2]),a.push([i[0],i[1],i[2]]));n=a}return n}var d=!1,g=!0;if("string"==typeof t)d=!0;else if(Array.isArray(t)){for(var m,y=t.concat(),v=[],w=y.length;w--;)("string"!=typeof(m=y.shift())||Array.isArray(m)&&"string"!=typeof m[0])&&(g=!1);d=g}if(!1===d)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');var b=rt[$].encoding;"WinAnsiEncoding"!==b&&"StandardEncoding"!==b||(t=p(t,function(t,e,n){return[(r=t,r=r.split("\t").join(Array(i.TabLen||9).join(" ")),vt(r,o)),e,n];var r})),"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var x=et/c.internal.scaleFactor,N=x*(Tt-1);switch(i.baseline){case"bottom":n-=N;break;case"top":n+=x-N;break;case"hanging":n+=x-2*N;break;case"middle":n+=x/2-N}0<(O=i.maxWidth||0)&&("string"==typeof t?t=c.splitTextToSize(t,O):"[object Array]"===Object.prototype.toString.call(t)&&(t=c.splitTextToSize(t.join(" "),O)));var L={text:t,x:e,y:n,options:i,mutex:{pdfEscape:vt,activeFontKey:$,fonts:rt,activeFontSize:et}};it.publish("preProcessText",L),t=L.text;a=(i=L.options).angle;var A=c.internal.scaleFactor,S=[];if(a){a*=Math.PI/180;var _=Math.cos(a),F=Math.sin(a);S=[Z(_),Z(F),Z(-1*F),Z(_)]}void 0!==(M=i.charSpace)&&(h+=Q(M*A)+" Tc\n");i.lang;var P=-1,k=void 0!==i.renderingMode?i.renderingMode:i.stroke,I=c.internal.getCurrentPageInfo().pageContext;switch(k){case 0:case!1:case"fill":P=0;break;case 1:case!0:case"stroke":P=1;break;case 2:case"fillThenStroke":P=2;break;case 3:case"invisible":P=3;break;case 4:case"fillAndAddForClipping":P=4;break;case 5:case"strokeAndAddPathForClipping":P=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":P=6;break;case 7:case"addToPathForClipping":P=7}var C=void 0!==I.usedRenderingMode?I.usedRenderingMode:-1;-1!==P?h+=P+" Tr\n":-1!==C&&(h+="0 Tr\n"),-1!==P&&(I.usedRenderingMode=P);s=i.align||"left";var B=et*u,j=c.internal.pageSize.getWidth(),E=(A=c.internal.scaleFactor,rt[$]),M=i.charSpace||Qt,O=i.maxWidth||0,q=(o={},[]);if("[object Array]"===Object.prototype.toString.call(t)){var T,R;v=f(t);"left"!==s&&(R=v.map(function(t){return c.getStringUnitWidth(t,{font:E,charSpace:M,fontSize:et})*et/A}));var D,U=Math.max.apply(Math,R),z=0;if("right"===s){e-=R[0],t=[];var H=0;for(w=v.length;H<w;H++)U-R[H],T=0===H?(D=Wt(e),Vt(n)):(D=(z-R[H])*A,-B),t.push([v[H],D,T]),z=R[H]}else if("center"===s){e-=R[0]/2,t=[];for(H=0,w=v.length;H<w;H++)(U-R[H])/2,T=0===H?(D=Wt(e),Vt(n)):(D=(z-R[H])/2*A,-B),t.push([v[H],D,T]),z=R[H]}else if("left"===s){t=[];for(H=0,w=v.length;H<w;H++)T=0===H?Vt(n):-B,D=0===H?Wt(e):0,t.push(v[H])}else{if("justify"!==s)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[];for(O=0!==O?O:j,H=0,w=v.length;H<w;H++)T=0===H?Vt(n):-B,D=0===H?Wt(e):0,H<w-1&&q.push(((O-R[H])/(v[H].split(" ").length-1)*A).toFixed(2)),t.push([v[H],D,T])}}!0===("boolean"==typeof i.R2L?i.R2L:nt)&&(t=p(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]}));L={text:t,x:e,y:n,options:i,mutex:{pdfEscape:vt,activeFontKey:$,fonts:rt,activeFontSize:et}};it.publish("postProcessText",L),t=L.text,l=L.mutex.isHex;v=f(t);t=[];var W,V,G,Y=0,J=(w=v.length,"");for(H=0;H<w;H++)J="",Array.isArray(v[H])?(W=parseFloat(v[H][1]),V=parseFloat(v[H][2]),G=(l?"<":"(")+v[H][0]+(l?">":")"),Y=1):(W=Wt(e),V=Vt(n),G=(l?"<":"(")+v[H]+(l?">":")")),void 0!==q&&void 0!==q[H]&&(J=q[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*u).toFixed(2)+" TL\n"+Kt+"\n";return X+=h,X+=t,tt(X+="ET"),K[$]=!0,c},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log("clip_fixed is deprecated"),l.clip(t)};var Ot=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=l.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,h,u,c,f,p,d,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Ot(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),a=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l<h;l++)2===(u=t[l]).length?(g=u[0]*a+g,m=u[1]*s+m,tt(Q(Wt(g))+" "+Q(Vt(m))+" l")):(c=u[0]*a+g,f=u[1]*s+m,p=u[2]*a+g,d=u[3]*s+m,g=u[4]*a+g,m=u[5]*s+m,tt(Q(Wt(c))+" "+Q(Vt(f))+" "+Q(Wt(p))+" "+Q(Vt(d))+" "+Q(Wt(g))+" "+Q(Vt(m))+" c"));return o&&tt(" h"),null!==i&&tt(qt(i)),this},l.__private__.rect=l.rect=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ot(i))throw new Error("Invalid arguments passed to jsPDF.rect");return tt([Z(Wt(t)),Z(Vt(e)),Z(n*_),Z(-r*_),"re"].join(" ")),null!==i&&tt(qt(i)),this},l.__private__.triangle=l.triangle=function(t,e,n,r,i,o,a){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!Ot(a))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],a,!0),this},l.__private__.roundedRect=l.roundedRect=function(t,e,n,r,i,o,a){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!Ot(a))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var s=4/3*(Math.SQRT2-1);return this.lines([[n-2*i,0],[i*s,0,i,o-o*s,i,o],[0,r-2*o],[0,o*s,-i*s,o,-i,o],[2*i-n,0],[-i*s,0,-i,-o*s,-i,-o],[0,2*o-r],[0,-o*s,i*s,-o,i,-o]],t+i,e,[1,1],a),this},l.__private__.ellipse=l.ellipse=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ot(i))throw new Error("Invalid arguments passed to jsPDF.ellipse");var o=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return tt([Z(Wt(t+n)),Z(Vt(e)),"m",Z(Wt(t+n)),Z(Vt(e-a)),Z(Wt(t+o)),Z(Vt(e-r)),Z(Wt(t)),Z(Vt(e-r)),"c"].join(" ")),tt([Z(Wt(t-o)),Z(Vt(e-r)),Z(Wt(t-n)),Z(Vt(e-a)),Z(Wt(t-n)),Z(Vt(e)),"c"].join(" ")),tt([Z(Wt(t-n)),Z(Vt(e+a)),Z(Wt(t-o)),Z(Vt(e+r)),Z(Wt(t)),Z(Vt(e+r)),"c"].join(" ")),tt([Z(Wt(t+o)),Z(Vt(e+r)),Z(Wt(t+n)),Z(Vt(e+a)),Z(Wt(t+n)),Z(Vt(e)),"c"].join(" ")),null!==i&&tt(qt(i)),this},l.__private__.circle=l.circle=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||!Ot(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,e,n,n,r)};l.setFont=function(t,e){return $=Lt(t,e,{disableWarning:!1}),this},l.setFontStyle=l.setFontType=function(t){return $=Lt(void 0,t),this};l.__private__.getFontList=l.getFontList=function(){var t,e,n,r={};for(t in H)if(H.hasOwnProperty(t))for(e in r[t]=n=[],H[t])H[t].hasOwnProperty(e)&&n.push(e);return r};l.addFont=function(t,e,n,r){yt.call(this,t,e,n,r=r||"Identity-H")};var Tt,Rt=r.lineWidth||.200025,Dt=l.__private__.setLineWidth=l.setLineWidth=function(t){return tt((t*_).toFixed(2)+" w"),this},Ut=(l.__private__.setLineDash=ae.API.setLineDash=function(t,e){if(t=t||[],e=e||0,isNaN(e)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map(function(t){return(t*_).toFixed(3)}).join(" "),e=parseFloat((e*_).toFixed(3)),tt("["+t+"] "+e+" d"),this},l.__private__.getLineHeight=l.getLineHeight=function(){return et*Tt}),zt=(Ut=l.__private__.getLineHeight=l.getLineHeight=function(){return et*Tt},l.__private__.setLineHeightFactor=l.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(Tt=t),this}),Ht=l.__private__.getLineHeightFactor=l.getLineHeightFactor=function(){return Tt};zt(r.lineHeight);var Wt=l.__private__.getHorizontalCoordinate=function(t){return t*_},Vt=l.__private__.getVerticalCoordinate=function(t){return V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY-t*_},Gt=l.__private__.getHorizontalCoordinateString=function(t){return Z(t*_)},Yt=l.__private__.getVerticalCoordinateString=function(t){return Z(V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY-t*_)},Jt=r.strokeColor||"0 G",Xt=(l.__private__.getStrokeColor=l.getDrawColor=function(){return ht(Jt)},l.__private__.setStrokeColor=l.setDrawColor=function(t,e,n,r){return Jt=ut({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2}),tt(Jt),this},r.fillColor||"0 g"),Kt=(l.__private__.getFillColor=l.getFillColor=function(){return ht(Xt)},l.__private__.setFillColor=l.setFillColor=function(t,e,n,r){return Xt=ut({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2}),tt(Xt),this},r.textColor||"0 g"),Zt=l.__private__.getTextColor=l.getTextColor=function(){return ht(Kt)},Qt=(l.__private__.setTextColor=l.setTextColor=function(t,e,n,r){return Kt=ut({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this},r.charSpace||0),$t=l.__private__.getCharSpace=l.getCharSpace=function(){return Qt},te=(l.__private__.setCharSpace=l.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Qt=t,this},0);l.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2};l.__private__.setLineCap=l.setLineCap=function(t){var e=l.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return tt((te=e)+" J"),this};var ee,ne=0;l.__private__.setLineJoin=l.setLineJoin=function(t){var e=l.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return tt((ne=e)+" j"),this},l.__private__.setMiterLimit=l.setMiterLimit=function(t){if(t=t||0,isNaN(t))throw new Error("Invalid argument passed to jsPDF.setMiterLimit");return ee=parseFloat(Z(t*_)),tt(ee+" M"),this};for(var re in l.save=function(r,t){if(r=r||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1!==t.returnPromise)return new Promise(function(t,e){try{var n=le(It(kt()),r);"function"==typeof le.unload&&ie.setTimeout&&setTimeout(le.unload,911),t(n)}catch(t){e(t.message)}});le(It(kt()),r),"function"==typeof le.unload&&ie.setTimeout&&setTimeout(le.unload,911)},ae.API)ae.API.hasOwnProperty(re)&&("events"===re&&ae.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(it,ae.API.events):l[re]=ae.API[re]);return l.internal={pdfEscape:vt,getStyle:qt,getFont:function(){return rt[Lt.apply(l,arguments)]},getFontSize:O,getCharSpace:$t,getTextColor:Zt,getLineHeight:Ut,getLineHeightFactor:Ht,write:j,getHorizontalCoordinate:Wt,getVerticalCoordinate:Vt,getCoordinateString:Gt,getVerticalCoordinateString:Yt,collections:{},newObject:J,newAdditionalObject:at,newObjectDeferred:X,newObjectDeferredBegin:ot,getFilters:ct,putStream:ft,events:it,scaleFactor:_,pageSize:{getWidth:function(){return(V[x].mediaBox.topRightX-V[x].mediaBox.bottomLeftX)/_},setWidth:function(t){V[x].mediaBox.topRightX=t*_+V[x].mediaBox.bottomLeftX},getHeight:function(){return(V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY)/_},setHeight:function(t){V[x].mediaBox.topRightY=t*_+V[x].mediaBox.bottomLeftY}},output:Ct,getNumberOfPages:Nt,pages:I,out:tt,f2:Z,f3:Q,getPageInfo:jt,getPageInfoByObjId:Et,getCurrentPageInfo:Mt,getPDFVersion:u,hasHotfix:Bt},Object.defineProperty(l.internal.pageSize,"width",{get:function(){return(V[x].mediaBox.topRightX-V[x].mediaBox.bottomLeftX)/_},set:function(t){V[x].mediaBox.topRightX=t*_+V[x].mediaBox.bottomLeftX},enumerable:!0,configurable:!0}),Object.defineProperty(l.internal.pageSize,"height",{get:function(){return(V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY)/_},set:function(t){V[x].mediaBox.topRightY=t*_+V[x].mediaBox.bottomLeftY},enumerable:!0,configurable:!0}),function(t){for(var e=0,n=M.length;e<n;e++){var r=yt(t[e][0],t[e][1],t[e][2],M[e][3],!0);K[r]=!0;var i=t[e][0].split("-");mt(r,i[0],i[1]||"")}it.publish("addFonts",{fonts:rt,dictionary:H})}(M),$="F1",bt(i,t),it.publish("initialized"),l}return ae.API={events:[]},ae.version="1.5.3","function"==typeof define&&define.amd?define("jsPDF",function(){return ae}):"undefined"!=typeof module&&module.exports?(module.exports=ae,module.exports.jsPDF=ae):ie.jsPDF=ae,ae}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());
30
+/**
31
+   * @license
32
+   * Copyright (c) 2016 Alexander Weidt,
33
+   * https://github.com/BiggA94
34
+   * 
35
+   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
36
+   */
37
+(function(t,e){var A,n=1,S=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},y=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},_=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},s=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(5)};t.__acroform__={};var r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},v=function(t){return t*n},w=function(t){return t/n},l=function(t){var e=new j,n=Y.internal.getHeight(t)||0,r=Y.internal.getWidth(t)||0;return e.BBox=[0,0,Number(_(r)),Number(_(n))],e},i=t.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<<e},o=t.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&=~(1<<e)},a=t.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<e)?0:1},b=t.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return a(t,e-1)},x=t.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return i(t,e-1)},N=t.__acroform__.clearBitForPdf=function(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return o(t,e-1)},c=t.__acroform__.calculateCoordinates=function(t){var e=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,r=t[0],i=t[1],o=t[2],a=t[3],s={};return s.lowerLeft_X=e(r)||0,s.lowerLeft_Y=n(i+a)||0,s.upperRight_X=e(r+o)||0,s.upperRight_Y=n(i)||0,[Number(_(s.lowerLeft_X)),Number(_(s.lowerLeft_Y)),Number(_(s.upperRight_X)),Number(_(s.upperRight_Y))]},f=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=h(t,n),i=A.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(A.__private__.encodeColorString(t.color)),e.push("/"+i+" "+_(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var o=new l(t);return o.stream=e.join("\n"),o}},h=function(i,t){var e=i.maxFontSize||12,n=(i.fontName,{text:"",fontSize:""}),o=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" "),r=(A.__private__.encodeColorString(i.color),e),a=Y.internal.getHeight(i)||0;a=a<0?-a:a;var s=Y.internal.getWidth(i)||0;s=s<0?-s:s;var l=function(t,e,n){if(t+1<o.length){var r=e+" "+o[t+1];return F(r,i,n).width<=s-4}return!1};r++;t:for(;;){t="";var h=F("3",i,--r).height,u=i.multiline?a-r:(a-h)/2,c=-2,f=u+=2,p=0,d=0,g=0;if(r<=0){t="(...) Tj\n",t+="% Width of Text: "+F(t,i,r=12).width+", FieldWidth:"+s+"\n";break}g=F(o[0]+" ",i,r).width;var m="",y=0;for(var v in o)if(o.hasOwnProperty(v)){m=" "==(m+=o[v]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var w=parseInt(v);g=F(m+" ",i,r).width;var b=l(w,m,r),x=v>=o.length-1;if(b&&!x){m+=" ";continue}if(b||x){if(x)d=w;else if(i.multiline&&a<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(h+2)*(y+2)+2)continue t;d=w}for(var N="",L=p;L<=d;L++)N+=o[L]+" ";switch(N=" "==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case"right":c=s-g-2;break;case"center":c=(s-g)/2;break;case"left":default:c=2}t+=_(c)+" "+_(f)+" Td\n",t+="("+S(N)+") Tj\n",t+=-_(c)+" 0 Td\n",f=-(r+2),g=0,p=d+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},u={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=c.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===se(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:"AP",value:"<</N "+a+">>"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s="";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var h=r.appearanceStreamContent[l];if(s+="/"+l+" ",s+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var u;if(h.hasOwnProperty(n))"function"==typeof(u=h[n])&&(u=u.call(this,r)),s+="/"+n+" "+u+" ",0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u)}else"function"==typeof(u=h)&&(u=u.call(this,r)),s+="/"+n+" "+u,0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u);s+=">>"}i.push({key:"AP",value:"<<\n"+s+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===se(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,M.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(u)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n<t.length;n++)switch(0!==n&&(e+=" "),se(t[n])){case"boolean":case"number":case"object":e+=t[n].toString();break;case"string":"/"!==t[n].substr(0,1)?e+="("+S(t[n].toString())+")":e+=t[n].toString()}return e+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")};var C=function(t){return(t=t||"").toString(),t="("+S(t)+")"},B=function(){var e;Object.defineProperty(this,"objId",{configurable:!0,get:function(){if(e||(e=A.internal.newObjectDeferred()),!e)throw new Error("AcroFormPDFObject: Couldn't create Object ID");return e},set:function(t){e=t}})};B.prototype.toString=function(){return this.objId+" 0 R"},B.prototype.putStream=function(){var t=this.getKeyValueListForStream();A.internal.putStream({data:this.stream,additionalKeyValues:t}),A.internal.out("endobj")},B.prototype.getKeyValueListForStream=function(){return function(t){var e=[],n=Object.getOwnPropertyNames(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n)if(!1===Object.getOwnPropertyDescriptor(t,n[r]).configurable){var i=n[r],o=t[i];o&&(Array.isArray(o)?e.push({key:i,value:I(o)}):o instanceof B?e.push({key:i,value:o.objId+" 0 R"}):"function"!=typeof o&&e.push({key:i,value:o}))}return e}(this)};var j=function(){B.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writeable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writeable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writeable:!0});var e,n=[];Object.defineProperty(this,"BBox",{configurable:!1,writeable:!0,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writeable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};r(j,B);var E=function(){B.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0<t.length?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e)return"("+e+")"},set:function(t){e=t}})};r(E,B);var M=function t(){B.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');e=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(e,3))},set:function(t){!0===Boolean(t)?this.F=x(e,3):this.F=N(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');n=t}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(t){r=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:w(r[0])},set:function(t){r[0]=v(t)}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:w(r[1])},set:function(t){r[1]=v(t)}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:w(r[2])},set:function(t){r[2]=v(t)}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:w(r[3])},set:function(t){r[3]=v(t)}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var o=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!o||o.length<1){if(this instanceof H)return;o="FieldObject"+t.FieldNum++}return"("+S(o)+")"},set:function(t){o=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return o},set:function(t){o=t}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(t){a=t}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(t){s=t}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return w(l)},set:function(t){l=v(t)}});var h=50;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return w(h)},set:function(t){h=v(t)}});var u="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return u},set:function(t){u=t}});var c="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!c||this instanceof H||this instanceof V))return C(c)},set:function(t){t=t.toString(),c=t}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof D==!1?C(f):f},set:function(t){t=t.toString(),f=this instanceof D==!1?"("===t.substr(0,1)?y(t.substr(1,t.length-2)):y(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof D==!0?y(f.substr(1,f.length-1)):f},set:function(t){t=t.toString(),f=this instanceof D==!0?"/"+t:t}});var p=null;Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof D==!1?C(p):p},set:function(t){t=t.toString(),p=this instanceof D==!1?"("===t.substr(0,1)?y(t.substr(1,t.length-2)):y(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof D==!0?y(p.substr(1,p.length-1)):p},set:function(t){t=t.toString(),p=this instanceof D==!0?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var d,g=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,writeable:!0,get:function(){return g},set:function(t){t=Boolean(t),g=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writeable:!0,get:function(){if(d)return d},set:function(t){d=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,1):this.Ff=N(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,2):this.Ff=N(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,3):this.Ff=N(this.Ff,3)}});var m=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==m)return m},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');m=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t="left";switch(m){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:m=2;break;case"center":case 1:m=1;break;case"left":case 0:default:m=0}}})};r(M,B);var O=function(){M.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var r=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return I(r)},set:function(t){var e,n;n=[],"string"==typeof(e=t)&&(n=function(t,e,n){n||(n=1);for(var r,i=[];r=e.exec(t);)i.push(r[n]);return i}(e,/\((.*?)\)/g)),r=n}}),this.getOptions=function(){return r},this.setOptions=function(t){r=t,this.sort&&r.sort()},this.addOption=function(t){t=(t=t||"").toString(),r.push(t),this.sort&&r.sort()},this.removeOption=function(t,e){for(e=e||!1,t=(t=t||"").toString();-1!==r.indexOf(t)&&(r.splice(r.indexOf(t),1),!1!==e););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,18):this.Ff=N(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=x(this.Ff,19):this.Ff=N(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=x(this.Ff,20),r.sort()):this.Ff=N(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,22):this.Ff=N(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,27):this.Ff=N(this.Ff,27)}}),this.hasAppearanceStream=!1};r(O,M);var q=function(){O.call(this),this.fontName="helvetica",this.combo=!1};r(q,O);var T=function(){q.call(this),this.combo=!0};r(T,q);var R=function(){T.call(this),this.edit=!0};r(R,T);var D=function(){M.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,15):this.Ff=N(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,16):this.Ff=N(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,17):this.Ff=N(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){if(0!==Object.keys(n).length){var t,e=[];for(t in e.push("<<"),n)e.push("/"+t+" ("+n[t]+")");return e.push(">>"),e.join("\n")}},set:function(t){"object"===se(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(D,M);var U=function(){D.call(this),this.pushButton=!0};r(U,D);var z=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(z,D);var H=function(){var e,n;M.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===se(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,M),z.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},z.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){M.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,M);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=h(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(a)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(a-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof M))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof O==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=O,e.ListBox=q,e.ComboBox=T,e.EditBox=R,e.Button=D,e.PushButton=U,e.RadioButton=z,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=O,t.AcroFormListBox=q,t.AcroFormComboBox=T,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=U,t.AcroFormRadioButton=z,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:O,ListBox:q,ComboBox:T,EditBox:R,Button:D,PushButton:U,RadioButton:z,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=lt).API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global),
38
+/** @license
39
+   * jsPDF addImage plugin
40
+   * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
41
+   *               2013 Chris Dowling, https://github.com/gingerchris
42
+   *               2013 Trinh Ho, https://github.com/ineedfat
43
+   *               2013 Edwin Alejandro Perez, https://github.com/eaparango
44
+   *               2013 Norah Smith, https://github.com/burnburnrocket
45
+   *               2014 Diego Casorran, https://github.com/diegocr
46
+   *               2014 James Robb, https://github.com/jamesbrobb
47
+   *
48
+   * 
49
+   */
50
+function(x){var N="addImage_",l={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=x.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in x.isArrayBufferView(t)&&(t=x.arrayBufferToBinaryString(t)),l)for(i=l[a],n=0;n<i.length;n+=1){for(o=!0,r=0;r<i[n].length;r+=1)if(void 0!==i[n][r]&&i[n][r]!==t.charCodeAt(r)){o=!1;break}if(!0===o){s=a;break}}return"UNKNOWN"===s&&"UNKNOWN"!==e&&(console.warn('FileType of Image not recognized. Processing image as "'+e+'".'),s=e),s},n=function t(e){for(var n=this.internal.newObject(),r=this.internal.write,i=this.internal.putStream,o=(0,this.internal.getFilters)();-1!==o.indexOf("FlateEncode");)o.splice(o.indexOf("FlateEncode"),1);e.n=n;var a=[];if(a.push({key:"Type",value:"/XObject"}),a.push({key:"Subtype",value:"/Image"}),a.push({key:"Width",value:e.w}),a.push({key:"Height",value:e.h}),e.cs===this.color_spaces.INDEXED?a.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(e.pal.length/3-1)+" "+("smask"in e?n+2:n+1)+" 0 R]"}):(a.push({key:"ColorSpace",value:"/"+e.cs}),e.cs===this.color_spaces.DEVICE_CMYK&&a.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),a.push({key:"BitsPerComponent",value:e.bpc}),"dp"in e&&a.push({key:"DecodeParms",value:"<<"+e.dp+">>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",l=0,h=e.trns.length;l<h;l++)s+=e.trns[l]+" "+e.trns[l]+" ";a.push({key:"Mask",value:"["+s+"]"})}"smask"in e&&a.push({key:"SMask",value:n+1+" 0 R"});var u=void 0!==e.f?["/"+e.f]:void 0;if(i({data:e.data,additionalKeyValues:a,alreadyAppliedFilters:u}),r("endobj"),"smask"in e){var c="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,f={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:c,data:e.smask};"f"in e&&(f.f=e.f),t.call(this,f)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),i({data:this.arrayBufferToBinaryString(new Uint8Array(e.pal))}),r("endobj"))},L=function(){var t=this.internal.collections[N+"images"];for(var e in t)n.call(this,t[e])},A=function(){var t,e=this.internal.collections[N+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R")},S=function(t){return"function"==typeof x["process"+t.toUpperCase()]},_=function(t){return"object"===se(t)&&1===t.nodeType},F=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return unescape(n);var r=x.loadFile(n);if(void 0!==r)return btoa(r)}if("CANVAS"===t.nodeName){var i=t;return t.toDataURL("image/jpeg",1)}(i=document.createElement("canvas")).width=t.clientWidth||t.width,i.height=t.clientHeight||t.height;var o=i.getContext("2d");if(!o)throw"addImage requires canvas to be supported by browser.";return o.drawImage(t,0,0,i.width,i.height),i.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},P=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};x.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},x.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},x.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},x.sHashCode=function(t){var e,n=0;if(0===(t=t||"").length)return n;for(e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return n},x.isString=function(t){return"string"==typeof t},x.validateStringAsBase64=function(t){(t=t||"").toString().trim();var e=!0;return 0===t.length&&(e=!1),t.length%4!=0&&(e=!1),!1===/^[A-Za-z0-9+\/]+$/.test(t.substr(0,t.length-2))&&(e=!1),!1===/^[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==$/.test(t.substr(-2))&&(e=!1),e},x.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));\S*;*base64,(.+)$/g.exec(t)},x.extractImageFromDataUrl=function(t){var e=(t=t||"").split("base64,"),n=null;if(2===e.length){var r=/^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(e[0]);Array.isArray(r)&&(n={mimeType:r[1],charset:r[2],data:e[1]})}return n},x.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},x.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer},x.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))},x.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n},x.arrayBufferToBinaryString=function(t){if("function"==typeof atob)return atob(this.arrayBufferToBase64(t))},x.arrayBufferToBase64=function(t){for(var e,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(t),o=i.byteLength,a=o%3,s=o-a,l=0;l<s;l+=3)n+=r[(16515072&(e=i[l]<<16|i[l+1]<<8|i[l+2]))>>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,h,u,c,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),l&&(p.dp=l),h&&(p.trns=h),u&&(p.pal=u),c&&(p.smask=c),f&&(p.p=f),p},x.addImage=function(t,e,n,r,i,o,a,s,l){var h="";if("string"!=typeof e){var u=o;o=i,i=r,r=n,n=e,e=u}if("object"===se(t)&&!_(t)&&"imageData"in t){var c=t;t=c.imageData,e=c.format||e||"UNKNOWN",n=c.x||n||0,r=c.y||r||0,i=c.w||i,o=c.h||o,a=c.alias||a,s=c.compression||s,l=c.rotation||c.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf("FlateEncode")&&(s="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[N+"images"];return t||(this.internal.collections[N+"images"]=t={},this.internal.events.subscribe("putResources",L),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a="string"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),p=P(a,b)))){if(this.isString(t)&&(""!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=x.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&"string"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),d)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var c=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(c),p(f),p(-1*f),p(c),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,h(t),u(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([h(n),"0","0",h(r),"0","0","cm"].join(" "))):this.internal.write([h(n),"0","0",h(r),h(t),u(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,p,p.i,b,l),this},x.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var u=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if("JPEG"!==h(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r<i;){if(r+=n,255!==t.charCodeAt(r))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(r+1)||193===t.charCodeAt(r+1)||194===t.charCodeAt(r+1)||195===t.charCodeAt(r+1)||196===t.charCodeAt(r+1)||197===t.charCodeAt(r+1)||198===t.charCodeAt(r+1)||199===t.charCodeAt(r+1))return e=256*t.charCodeAt(r+5)+t.charCodeAt(r+6),[256*t.charCodeAt(r+7)+t.charCodeAt(r+8),e,t.charCodeAt(r+9)];r+=2,n=256*t.charCodeAt(r)+t.charCodeAt(r+1)}}(t)),this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)&&(a=function(t){if(65496!=(t[0]<<8|t[1]))throw new Error("Supplied data is not a JPEG");for(var e,n=t.length,r=(t[4]<<8)+t[5],i=4;i<n;){if(r=((e=u(t,i+=r))[2]<<8)+e[3],(192===e[1]||194===e[1])&&255===e[0]&&7<r)return{width:((e=u(t,i+5))[2]<<8)+e[3],height:(e[0]<<8)+e[1],numcomponents:e[4]};i+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")}(t),t=i||this.arrayBufferToBinaryString(t)),void 0===o)switch(a.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;default:case 3:o=this.color_spaces.DEVICE_RGB}return this.createImageInfo(t,a.width,a.height,o,8,s,e,n)},x.processJPG=function(){return this.processJPEG.apply(this,arguments)},x.getImageProperties=function(t){var e,n,r="";if(_(t)&&(t=F(t)),this.isString(t)&&(""!==(r=this.convertStringToImageData(t))?t=r:void 0!==(r=x.loadFile(t))&&(t=r)),n=this.getImageFileTypeByImageData(t),!S(n))throw new Error("addImage does not support files of type '"+n+"', please ensure that a plugin for '"+n+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(t=this.binaryStringToUint8Array(t))),!(e=this["process"+n.toUpperCase()](t)))throw new Error("An unknown error occurred whilst processing the image");return{fileType:n,width:e.w,height:e.h,colorSpace:e.cs,compressionMode:e.f,bitsPerComponent:e.bpc}}}(lt.API),
51
+/**
52
+   * @license
53
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
54
+   *
55
+   * Licensed under the MIT License.
56
+   * http://opensource.org/licenses/mit-license
57
+   */
58
+t=lt.API,lt.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(t){for(var e=this.internal.getPageInfoByObjId(t.objId),n=t.pageContext.annotations,r=function(t){if(void 0!==t&&""!=t)return!0},i=!1,o=0;o<n.length&&!i;o++)switch((l=n[o]).type){case"link":if(r(l.options.url)||r(l.options.pageNumber)){i=!0;break}case"reference":case"text":case"freetext":i=!0}if(0!=i){this.internal.write("/Annots ["),this.internal.pageSize.height;var a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString;for(o=0;o<n.length;o++){var l;switch((l=n[o]).type){case"reference":this.internal.write(" "+l.object.objId+" 0 R ");break;case"text":var h=this.internal.newAdditionalObject(),u=this.internal.newAdditionalObject(),c=l.title||"Note";m="<</Type /Annot /Subtype /Text "+(p="/Rect ["+a(l.bounds.x)+" "+s(l.bounds.y+l.bounds.h)+" "+a(l.bounds.x+l.bounds.w)+" "+s(l.bounds.y)+"] ")+"/Contents ("+l.contents+")",m+=" /Popup "+u.objId+" 0 R",m+=" /P "+e.objId+" 0 R",m+=" /T ("+c+") >>",h.content=m;var f=h.objId+" 0 R";m="<</Type /Annot /Subtype /Popup "+(p="/Rect ["+a(l.bounds.x+30)+" "+s(l.bounds.y+l.bounds.h)+" "+a(l.bounds.x+l.bounds.w+30)+" "+s(l.bounds.y)+"] ")+" /Parent "+f,l.open&&(m+=" /Open true"),m+=" >>",u.content=m,this.internal.write(h.objId,"0 R",u.objId,"0 R");break;case"freetext":var p="/Rect ["+a(l.bounds.x)+" "+s(l.bounds.y)+" "+a(l.bounds.x+l.bounds.w)+" "+s(l.bounds.y+l.bounds.h)+"] ",d=l.color||"#000000";m="<</Type /Annot /Subtype /FreeText "+p+"/Contents ("+l.contents+")",m+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+d+")",m+=" /Border [0 0 0]",m+=" >>",this.internal.write(m);break;case"link":if(l.options.name){var g=this.annotations._nameMap[l.options.name];l.options.pageNumber=g.page,l.options.top=g.y}else l.options.top||(l.options.top=0);p="/Rect ["+a(l.x)+" "+s(l.y)+" "+a(l.x+l.w)+" "+s(l.y+l.h)+"] ";var m="";if(l.options.url)m="<</Type /Annot /Subtype /Link "+p+"/Border [0 0 0] /A <</S /URI /URI ("+l.options.url+") >>";else if(l.options.pageNumber)switch(m="<</Type /Annot /Subtype /Link "+p+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(l.options.pageNumber).objId+" 0 R",l.options.magFactor=l.options.magFactor||"XYZ",l.options.magFactor){case"Fit":m+=" /Fit]";break;case"FitH":m+=" /FitH "+l.options.top+"]";break;case"FitV":l.options.left=l.options.left||0,m+=" /FitV "+l.options.left+"]";break;case"XYZ":default:var y=s(l.options.top);l.options.left=l.options.left||0,void 0===l.options.zoom&&(l.options.zoom=0),m+=" /XYZ "+l.options.left+" "+y+" "+l.options.zoom+"]"}""!=m&&(m+=" >>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},
59
+/**
60
+   * @license
61
+   * Copyright (c) 2017 Aras Abbasi 
62
+   *
63
+   * Licensed under the MIT License.
64
+   * http://opensource.org/licenses/mit-license
65
+   */
66
+function(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},u=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return u(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return u(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return u(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return u(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return u(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return u(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),c=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i="",o=0;for(e=0;e<t.length;e+=1)void 0!==n[t.charCodeAt(e)]?(o++,"number"==typeof(n=n[t.charCodeAt(e)])&&(r=-1!==(r=f(t.charAt(e),t.charAt(e-o),t.charAt(e+1)))?r:0,i+=String.fromCharCode(n),n=a,o=0),e===t.length-1&&(n=a,i+=t.charAt(e-(o-1)),e-=o-1,o=0)):(n=a,i+=t.charAt(e-o),e-=o,o=0);return i},f=(t.__arabicParser__.isArabicDiacritic=function(t){return void 0!==t&&void 0!==e[t.charCodeAt(0)]},t.__arabicParser__.getCorrectForm=function(t,e,n){return u(t)?!1===r(t)?-1:!s(t)||!u(e)&&!u(n)||!u(n)&&i(e)||i(t)&&!u(e)||i(t)&&o(e)||i(t)&&i(e)?0:l(t)&&u(e)&&!i(e)&&u(n)&&s(n)?3:i(t)||!u(n)?1:2:-1}),p=t.__arabicParser__.processArabic=t.processArabic=function(t){var e=0,n=0,r=0,i="",o="",a="",s=(t=t||"").split("\\s+"),l=[];for(e=0;e<s.length;e+=1){for(l.push(""),n=0;n<s[e].length;n+=1)i=s[e][n],o=s[e][n-1],a=s[e][n+1],u(i)?(r=f(i,o,a),l[e]+=-1!==r?String.fromCharCode(h[i.charCodeAt(0)][r]):i):l[e]+=i;l[e]=c(l[e])}return l.join(" ")};t.events.push(["preProcessText",function(t){var e=t.text,n=(t.x,t.y,t.options||{}),r=(t.mutex,n.lang,[]);if("[object Array]"===Object.prototype.toString.call(e)){var i=0;for(r=[],i=0;i<e.length;i+=1)"[object Array]"===Object.prototype.toString.call(e[i])?r.push([p(e[i][0]),e[i][1],e[i][2]]):r.push([p(e[i])]);t.text=r}else t.text=p(e)}])}(lt.API),lt.API.autoPrint=function(t){var e;switch((t=t||{}).variant=t.variant||"non-conform",t.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this},
67
+/**
68
+   * @license
69
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
70
+   *
71
+   * Licensed under the MIT License.
72
+   * http://opensource.org/licenses/mit-license
73
+   */
74
+e=lt.API,(n=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},n.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new n,this.canvas.pdf=this}]),
75
+/** 
76
+   * @license
77
+   * ====================================================================
78
+   * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
79
+   *               2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
80
+   *               2013 Lee Driscoll, https://github.com/lsdriscoll
81
+   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
82
+   *               2014 James Hall, james@parall.ax
83
+   *               2014 Diego Casorran, https://github.com/diegocr
84
+   *
85
+   * 
86
+   * ====================================================================
87
+   */
88
+_=lt.API,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,p=function(t,e,n,r,i){F={x:t,y:e,w:n,h:r,ln:i}},d=function(){return F},k={left:0,top:0,bottom:0},_.setHeaderFunction=function(t){l=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s<t.length;s++)i<(a=this.getStringUnitWidth(t[s])*n)&&(i=a);0!==i&&(o=t.length)}return{w:i/=r,h:Math.max((o*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/r,0)}},_.cellAddPage=function(){var t=this.margins||k;this.addPage(),p(t.left,t.top,void 0,void 0),P+=1},_.cellInitialize=function(){F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1},_.cell=function(t,e,n,r,i,o,a){var s=d(),l=!1;if(void 0!==s.ln)if(s.ln===o)t=s.x+s.w,e=s.y;else{var h=this.margins||k;s.y+s.h+r+13>=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var u=0;u<i.length;u++){var c=i[u],f=this.getStringUnitWidth(c)*this.internal.getFontSize()/this.internal.scaleFactor;this.text(c,t+n-f-3,e+this.internal.getLineHeight()*(u+1))}}else this.text(i,t+3,e+this.internal.getLineHeight());return p(t,e,n,r,o),this},_.arrayMax=function(t,e){var n,r,i,o=t[0];for(n=0,r=t.length;n<r;n+=1)i=t[n],e?-1===e(o,i)&&(o=i):o<i&&(o=i);return o},_.table=function(t,e,n,r,i){if(!n)throw"No data for PDF table";var o,a,s,l,h,u,c,f,p,d,g=[],m=[],y={},v={},w=[],b=[],x=!1,N=!0,L=12,A=k;if(A.width=this.internal.pageSize.getWidth(),i&&(!0===i.autoSize&&(x=!0),!1===i.printHeaders&&(N=!1),i.fontSize&&(L=i.fontSize),i.css&&void 0!==i.css["font-size"]&&(L=16*i.css["font-size"]),i.margins&&(A=i.margins)),this.lnMod=0,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,this.printHeaders=N,this.margins=A,this.setFontSize(L),this.table_font_size=L,null==r)g=Object.keys(n[0]);else if(r[0]&&"string"!=typeof r[0])for(a=0,s=r.length;a<s;a+=1)o=r[a],g.push(o.name),m.push(o.prompt),v[o.name]=o.width*(19.049976/25.4);else g=r;if(x)for(d=function(t){return t[o]},a=0,s=g.length;a<s;a+=1){for(y[o=g[a]]=n.map(d),w.push(this.getTextDimensions(m[a]||o,{scaleFactor:1}).w),c=0,l=(u=y[o]).length;c<l;c+=1)h=u[c],w.push(this.getTextDimensions(h,{scaleFactor:1}).w);v[o]=_.arrayMax(w),w=[]}if(N){var S=this.calculateLineHeight(g,v,m.length?m:g);for(a=0,s=g.length;a<s;a+=1)o=g[a],b.push([t,e,v[o],S,String(m.length?m[a]:o)]);this.setTableHeaderRow(b),this.printHeaderRow(1,!1)}for(a=0,s=n.length;a<s;a+=1)for(f=n[a],S=this.calculateLineHeight(g,v,f),c=0,p=g.length;c<p;c+=1)o=g[c],this.cell(t,e,v[o],S,f[o],a+2,o.align);return this.lastCellPos=F,this.table_x=t,this.table_y=e,this},_.calculateLineHeight=function(t,e,n){for(var r,i=0,o=0;o<t.length;o++){n[r=t[o]]=this.splitTextToSize(String(n[r]),e[r]-3);var a=this.internal.getLineHeight()*n[r].length+3;i<a&&(i=a)}return i},_.setTableHeaderRow=function(t){this.tableHeaderRow=t},_.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,i,o;if(this.printingHeaderRow=!0,void 0!==l){var a=l(this,P);p(a[0],a[1],a[2],a[3],-1)}this.setFontStyle("bold");var s=[];for(i=0,o=this.tableHeaderRow.length;i<o;i+=1)this.setFillColor(200,200,200),n=this.tableHeaderRow[i],e&&(this.margins.top=13,n[1]=this.margins&&this.margins.top||0,s.push(n)),r=[].concat(n),this.cell.apply(this,r.concat(t));0<s.length&&this.setTableHeaderRow(s),this.setFontStyle("normal"),this.printingHeaderRow=!1},
89
+/**
90
+   * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
91
+   *
92
+   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
93
+   */
94
+function(t,e){var l,i,o,h,u,c=function(t){return t=t||{},this.isStrokeTransparent=t.isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new M,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new j,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new j,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new n(this),l=this.internal.f2,this.internal.f3,i=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,h=this.internal.getHorizontalCoordinate,u=this.internal.getVerticalCoordinate}]);var n=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}}),Object.defineProperty(this,"pdf",{get:function(){return t}});var e=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return e},set:function(t){e=Boolean(t)}});var n=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return n},set:function(t){n=Boolean(t)}});var r=0;Object.defineProperty(this,"posX",{get:function(){return r},set:function(t){isNaN(t)||(r=t)}});var i=0;Object.defineProperty(this,"posY",{get:function(){return i},set:function(t){isNaN(t)||(i=t)}});var o=!1;Object.defineProperty(this,"autoPaging",{get:function(){return o},set:function(t){o=Boolean(t)}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(t){a=t}});var s=[];Object.defineProperty(this,"pageBreaks",{get:function(){return s},set:function(t){s=t}});var l=new c;Object.defineProperty(this,"ctx",{get:function(){return l},set:function(t){t instanceof c&&(l=t)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(t){l.path=t}});var h=[];Object.defineProperty(this,"ctxStack",{get:function(){return h},set:function(t){h=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var e;e=f(t),this.ctx.fillStyle=e.style,this.ctx.isFillTransparent=0===e.a,this.ctx.fillOpacity=e.a,this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}),this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var e=f(t);this.ctx.strokeStyle=e.style,this.ctx.isStrokeTransparent=0===e.a,this.ctx.strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(t){var e;if(this.ctx.font=t,null!==(e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t))){var n=e[1],r=(e[2],e[3]),i=e[4],o=e[5],a=e[6];i="px"===o?Math.floor(parseFloat(i)):"em"===o?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)),this.pdf.setFontSize(i);var s="";("bold"===r||700<=parseInt(r,10)||"bold"===n)&&(s="bold"),"italic"===n&&(s+="italic"),0===s.length&&(s="normal");for(var l="",h=a.toLowerCase().replace(/"|'/g,"").split(/\s*,\s*/),u={arial:"Helvetica",verdana:"Helvetica",helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",courier:"Courier",times:"Times",cursive:"Times",fantasy:"Times",serif:"Times"},c=0;c<h.length;c++){if(void 0!==this.pdf.internal.getFont(h[c],s,{noFallback:!0,disableWarning:!0})){l=h[c];break}if("bolditalic"===s&&void 0!==this.pdf.internal.getFont(h[c],"bold",{noFallback:!0,disableWarning:!0}))l=h[c],s="bold";else if(void 0!==this.pdf.internal.getFont(h[c],"normal",{noFallback:!0,disableWarning:!0})){l=h[c],s="normal";break}}if(""===l)for(c=0;c<h.length;c++)if(u[h[c]]){l=u[h[c]];break}l=""===l?"Times":l,this.pdf.setFont(l,s)}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=Boolean(t)}})};n.prototype.fill=function(){r.call(this,"fill",!1)},n.prototype.stroke=function(){r.call(this,"stroke",!1)},n.prototype.beginPath=function(){this.path=[{type:"begin"}]},n.prototype.moveTo=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new j(t,e));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new j(t,e)},n.prototype.closePath=function(){var t=new j(0,0),e=0;for(e=this.path.length-1;-1!==e;e--)if("begin"===this.path[e].type&&"object"===se(this.path[e+1])&&"number"==typeof this.path[e+1].x){t=new j(this.path[e+1].x,this.path[e+1].y),this.path.push({type:"lt",x:t.x,y:t.y});break}"object"===se(this.path[e+2])&&"number"==typeof this.path[e+2].x&&this.path.push(JSON.parse(JSON.stringify(this.path[e+2]))),this.path.push({type:"close"}),this.ctx.lastPoint=new j(t.x,t.y)},n.prototype.lineTo=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new j(t,e));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new j(n.x,n.y)},n.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),r.call(this,null,!0)},n.prototype.quadraticCurveTo=function(t,e,n,r){if(isNaN(n)||isNaN(r)||isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var i=this.ctx.transform.applyToPoint(new j(n,r)),o=this.ctx.transform.applyToPoint(new j(t,e));this.path.push({type:"qct",x1:o.x,y1:o.y,x:i.x,y:i.y}),this.ctx.lastPoint=new j(i.x,i.y)},n.prototype.bezierCurveTo=function(t,e,n,r,i,o){if(isNaN(i)||isNaN(o)||isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new j(i,o)),s=this.ctx.transform.applyToPoint(new j(t,e)),l=this.ctx.transform.applyToPoint(new j(n,r));this.path.push({type:"bct",x1:s.x,y1:s.y,x2:l.x,y2:l.y,x:a.x,y:a.y}),this.ctx.lastPoint=new j(a.x,a.y)},n.prototype.arc=function(t,e,n,r,i,o){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i))throw console.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(o=Boolean(o),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new j(t,e));t=a.x,e=a.y;var s=this.ctx.transform.applyToPoint(new j(0,n)),l=this.ctx.transform.applyToPoint(new j(0,0));n=Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))}Math.abs(i-r)>=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!N.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(e),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},n.prototype.restore=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(e),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin)},n.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var f=function(t){var e,n,r,i;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t))i=r=n=e=0;else{var o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t);if(null!==o)e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=1;else if(null!==(o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/.exec(t)))e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=parseFloat(o[4]);else{if(i=1,"string"==typeof t&&"#"!==t.charAt(0)){var a=new RGBColor(t);t=a.ok?a.toHex():"#000000"}4===t.length?(e=t.substring(1,2),e+=e,n=t.substring(2,3),n+=n,r=t.substring(3,4),r+=r):(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16)}}return{r:e,g:n,b:r,a:i,style:t}},N=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},L=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};n.prototype.fillText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw console.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!N.call(this)){n=a.call(this,n);var i=B(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;s.call(this,{text:t,x:e,y:n,scale:o,angle:i,align:this.textAlign,maxWidth:r})}},n.prototype.strokeText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw console.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!L.call(this)){r=isNaN(r)?void 0:r,n=a.call(this,n);var i=B(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;s.call(this,{text:t,x:e,y:n,scale:o,renderingMode:"stroke",angle:i,align:this.textAlign,maxWidth:r})}},n.prototype.measureText=function(t){if("string"!=typeof t)throw console.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var e=this.pdf,n=this.pdf.internal.scaleFactor,r=e.internal.getFontSize(),i=e.getStringUnitWidth(t)*r/e.internal.scaleFactor;return new function(t){var e=(t=t||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return e}}),this}({width:i*=Math.round(96*n/72*1e4)/1e4})},n.prototype.scale=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new M(t,0,0,e,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},n.prototype.rotate=function(t){if(isNaN(t))throw console.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var e=new M(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(e)},n.prototype.translate=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new M(1,0,0,1,t,e);this.ctx.transform=this.ctx.transform.multiply(n)},n.prototype.transform=function(t,e,n,r,i,o){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o))throw console.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var a=new M(t,e,n,r,i,o);this.ctx.transform=this.ctx.transform.multiply(a)},n.prototype.setTransform=function(t,e,n,r,i,o){t=isNaN(t)?1:t,e=isNaN(e)?0:e,n=isNaN(n)?0:n,r=isNaN(r)?1:r,i=isNaN(i)?0:i,o=isNaN(o)?0:o,this.ctx.transform=new M(t,e,n,r,i,o)},n.prototype.drawImage=function(t,e,n,r,i,o,a,s,l){var h=this.pdf.getImageProperties(t),u=1,c=1,f=1,p=1;void 0!==r&&void 0!==s&&(f=s/r,p=l/i,u=h.width/r*s/r,c=h.height/i*l/i),void 0===o&&(o=e,a=n,n=e=0),void 0!==r&&void 0===s&&(s=r,l=i),void 0===r&&void 0===s&&(s=h.width,l=h.height);var d=this.ctx.transform.decompose(),g=B(d.rotate.shx);d.scale.sx,d.scale.sy;for(var m,y=new M,v=((y=(y=(y=y.multiply(d.translate)).multiply(d.skew)).multiply(d.scale)).applyToPoint(new j(s,l)),y.applyToRectangle(new E(o-e*f,a-n*p,r*u,i*c))),w=F.call(this,v),b=[],x=0;x<w.length;x+=1)-1===b.indexOf(w[x])&&b.push(w[x]);if(b.sort(),this.autoPaging)for(var N=b[0],L=b[b.length-1],A=N;A<L+1;A++){if(this.pdf.setPage(A),0!==this.ctx.clip_path.length){var S=this.path;m=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=P(m,this.posX,-1*this.pdf.internal.pageSize.height*(A-1)+this.posY),k.call(this,"fill",!0),this.path=S}var _=JSON.parse(JSON.stringify(v));_=P([_],this.posX,-1*this.pdf.internal.pageSize.height*(A-1)+this.posY)[0],this.pdf.addImage(t,"jpg",_.x,_.y,_.w,_.h,null,null,g)}else this.pdf.addImage(t,"jpg",v.x,v.y,v.w,v.h,null,null,g)};var F=function(t,e,n){var r=[];switch(e=e||this.pdf.internal.pageSize.width,n=n||this.pdf.internal.pageSize.height,t.type){default:case"mt":case"lt":r.push(Math.floor((t.y+this.posY)/n)+1);break;case"arc":r.push(Math.floor((t.y+this.posY-t.radius)/n)+1),r.push(Math.floor((t.y+this.posY+t.radius)/n)+1);break;case"qct":var i=w(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);r.push(Math.floor(i.y/n)+1),r.push(Math.floor((i.y+i.h)/n)+1);break;case"bct":var o=b(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);r.push(Math.floor(o.y/n)+1),r.push(Math.floor((o.y+o.h)/n)+1);break;case"rect":r.push(Math.floor((t.y+this.posY)/n)+1),r.push(Math.floor((t.y+t.h+this.posY)/n)+1)}for(var a=0;a<r.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<r[a];)v.call(this);return r},v=function(){var t=this.fillStyle,e=this.strokeStyle,n=this.font,r=this.lineCap,i=this.lineWidth,o=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=e,this.font=n,this.lineCap=r,this.lineWidth=i,this.lineJoin=o},P=function(t,e,n){for(var r=0;r<t.length;r++)switch(t[r].type){case"bct":t[r].x2+=e,t[r].y2+=n;case"qct":t[r].x1+=e,t[r].y1+=n;case"mt":case"lt":case"arc":default:t[r].x+=e,t[r].y+=n}return t},r=function(t,e){for(var n,r,i=this.fillStyle,o=this.strokeStyle,a=(this.font,this.lineCap),s=this.lineWidth,l=this.lineJoin,h=JSON.parse(JSON.stringify(this.path)),u=JSON.parse(JSON.stringify(this.path)),c=[],f=0;f<u.length;f++)if(void 0!==u[f].x)for(var p=F.call(this,u[f]),d=0;d<p.length;d+=1)-1===c.indexOf(p[d])&&c.push(p[d]);for(f=0;f<c.length;f++)for(;this.pdf.internal.getNumberOfPages()<c[f];)v.call(this);if(c.sort(),this.autoPaging){var g=c[0],m=c[c.length-1];for(f=g;f<m+1;f++){if(this.pdf.setPage(f),this.fillStyle=i,this.strokeStyle=o,this.lineCap=a,this.lineWidth=s,this.lineJoin=l,0!==this.ctx.clip_path.length){var y=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=P(n,this.posX,-1*this.pdf.internal.pageSize.height*(f-1)+this.posY),k.call(this,t,!0),this.path=y}r=JSON.parse(JSON.stringify(h)),this.path=P(r,this.posX,-1*this.pdf.internal.pageSize.height*(f-1)+this.posY),!1!==e&&0!==f||k.call(this,t,e)}}else k.call(this,t,e);this.path=h},k=function(t,e){if(("stroke"!==t||e||!L.call(this))&&("stroke"===t||e||!N.call(this))){var n=[];this.ctx.globalAlpha;this.ctx.fillOpacity<1&&this.ctx.fillOpacity;for(var r,i=this.path,o=0;o<i.length;o++){var a=i[o];switch(a.type){case"begin":n.push({begin:!0});break;case"close":n.push({close:!0});break;case"mt":n.push({start:a,deltas:[],abs:[]});break;case"lt":var s=n.length;if(!isNaN(i[o-1].x)){var l=[a.x-i[o-1].x,a.y-i[o-1].y];if(0<s)for(;0<=s;s--)if(!0!==n[s-1].close&&!0!==n[s-1].begin){n[s-1].deltas.push(l),n[s-1].abs.push(a);break}}break;case"bct":l=[a.x1-i[o-1].x,a.y1-i[o-1].y,a.x2-i[o-1].x,a.y2-i[o-1].y,a.x-i[o-1].x,a.y-i[o-1].y];n[n.length-1].deltas.push(l);break;case"qct":var h=i[o-1].x+2/3*(a.x1-i[o-1].x),u=i[o-1].y+2/3*(a.y1-i[o-1].y),c=a.x+2/3*(a.x1-a.x),f=a.y+2/3*(a.y1-a.y),p=a.x,d=a.y;l=[h-i[o-1].x,u-i[o-1].y,c-i[o-1].x,f-i[o-1].y,p-i[o-1].x,d-i[o-1].y];n[n.length-1].deltas.push(l);break;case"arc":n.push({deltas:[],abs:[],arc:!0}),Array.isArray(n[n.length-1].abs)&&n[n.length-1].abs.push(a)}}r=e?null:"stroke"===t?"stroke":"fill";for(o=0;o<n.length;o++){if(n[o].arc)for(var g=n[o].abs,m=0;m<g.length;m++){var y=g[m];if(void 0!==y.startAngle){var v=B(y.startAngle),w=B(y.endAngle),b=y.x,x=y.y;A.call(this,b,x,y.radius,v,w,y.counterclockwise,r,e)}else I.call(this,y.x,y.y)}if(!n[o].arc&&!0!==n[o].close&&!0!==n[o].begin){b=n[o].start.x,x=n[o].start.y;C.call(this,n[o].deltas,b,x,null,null)}}r&&S.call(this,r),e&&_.call(this)}},a=function(t){var e=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=e*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+e-n;case"hanging":return t+e-2*n;case"middle":return t+e/2-n;case"ideographic":return t;case"alphabetic":default:return t}};n.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,e){this.colorStops.push([t,e])},t.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},t.isCanvasGradient=!0,t},n.prototype.createPattern=function(){return this.createLinearGradient()},n.prototype.createRadialGradient=function(){return this.createLinearGradient()};var A=function(t,e,n,r,i,o,a,s){this.pdf.internal.scaleFactor;for(var l=y(r),h=y(i),u=g.call(this,n,l,h,o),c=0;c<u.length;c++){var f=u[c];0===c&&p.call(this,f.x1+t,f.y1+e),d.call(this,t,e,f.x2,f.y2,f.x3,f.y3,f.x4,f.y4)}s?_.call(this):S.call(this,a)},S=function(t){switch(t){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},_=function(){this.pdf.clip()},p=function(t,e){this.pdf.internal.out(i(t)+" "+o(e)+" m")},s=function(t){var e;switch(t.align){case"right":case"end":e="right";break;case"center":e="center";break;case"left":case"start":default:e="left"}var n=this.ctx.transform.applyToPoint(new j(t.x,t.y)),r=this.ctx.transform.decompose(),i=new M;i=(i=(i=i.multiply(r.translate)).multiply(r.skew)).multiply(r.scale);for(var o,a=this.pdf.getTextDimensions(t.text),s=this.ctx.transform.applyToRectangle(new E(t.x,t.y,a.w,a.h)),l=i.applyToRectangle(new E(t.x,t.y-a.h,a.w,a.h)),h=F.call(this,l),u=[],c=0;c<h.length;c+=1)-1===u.indexOf(h[c])&&u.push(h[c]);if(u.sort(),!0===this.autoPaging)for(var f=u[0],p=u[u.length-1],d=f;d<p+1;d++){if(this.pdf.setPage(d),0!==this.ctx.clip_path.length){var g=this.path;o=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=P(o,this.posX,-1*this.pdf.internal.pageSize.height*(d-1)+this.posY),k.call(this,"fill",!0),this.path=g}var m=JSON.parse(JSON.stringify(s));if(m=P([m],this.posX,-1*this.pdf.internal.pageSize.height*(d-1)+this.posY)[0],.01<=t.scale){var y=this.pdf.internal.getFontSize();this.pdf.setFontSize(y*t.scale)}this.pdf.text(t.text,m.x,m.y,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),.01<=t.scale&&this.pdf.setFontSize(y)}else{if(.01<=t.scale){y=this.pdf.internal.getFontSize();this.pdf.setFontSize(y*t.scale)}this.pdf.text(t.text,n.x+this.posX,n.y+this.posY,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),.01<=t.scale&&this.pdf.setFontSize(y)}},I=function(t,e,n,r){n=n||0,r=r||0,this.pdf.internal.out(i(t+n)+" "+o(e+r)+" l")},C=function(t,e,n){return this.pdf.lines(t,e,n,null,null)},d=function(t,e,n,r,i,o,a,s){this.pdf.internal.out([l(h(n+t)),l(u(r+e)),l(h(i+t)),l(u(o+e)),l(h(a+t)),l(u(s+e)),"c"].join(" "))},g=function(t,e,n,r){var i=2*Math.PI,o=e;(o<i||i<o)&&(o%=i);var a=n;(a<i||i<a)&&(a%=i);for(var s=[],l=Math.PI/2,h=r?-1:1,u=e,c=Math.min(i,Math.abs(a-o));1e-5<c;){var f=u+h*Math.min(c,l);s.push(m.call(this,t,u,f)),c-=Math.abs(f-u),u=f}return s},m=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),a=i,s=-o,l=a*a+s*s,h=l+a*i+s*o,u=4/3*(Math.sqrt(2*l*h)-h)/(a*o-s*i),c=a-u*s,f=s+u*a,p=c,d=-f,g=r+e,m=Math.cos(g),y=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:c*m-f*y,y2:c*y+f*m,x3:p*m-d*y,y3:p*y+d*m,x4:t*Math.cos(n),y4:t*Math.sin(n)}},B=function(t){return 180*t/Math.PI},y=function(t){return t*Math.PI/180},w=function(t,e,n,r,i,o){var a=t+.5*(n-t),s=e+.5*(r-e),l=i+.5*(n-i),h=o+.5*(r-o),u=Math.min(t,i,a,l),c=Math.max(t,i,a,l),f=Math.min(e,o,s,h),p=Math.max(e,o,s,h);return new E(u,f,c-u,p-f)},b=function(t,e,n,r,i,o,a,s){for(var l,h,u,c,f,p,d,g,m,y,v,w,b,x=n-t,N=r-e,L=i-n,A=o-r,S=a-i,_=s-o,F=0;F<41;F++)g=(p=(h=t+(l=F/40)*x)+l*((c=n+l*L)-h))+l*(c+l*(i+l*S-c)-p),m=(d=(u=e+l*N)+l*((f=r+l*A)-u))+l*(f+l*(o+l*_-f)-d),b=0==F?(w=y=g,v=m):(y=Math.min(y,g),v=Math.min(v,m),w=Math.max(w,g),Math.max(b,m));return new E(Math.round(y),Math.round(v),Math.round(w-y),Math.round(b-v))},j=function(t,e){var n=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var r=e||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var i="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return i},set:function(t){i=t.toString()}}),this},E=function(t,e,n,r){j.call(this,t,e),this.type="rect";var i=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var o=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return o},set:function(t){isNaN(t)||(o=parseFloat(t))}}),this},M=function(t,e,n,r,i,o){var a=[];return Object.defineProperty(this,"sx",{get:function(){return a[0]},set:function(t){a[0]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"shy",{get:function(){return a[1]},set:function(t){a[1]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"shx",{get:function(){return a[2]},set:function(t){a[2]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"sy",{get:function(){return a[3]},set:function(t){a[3]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"tx",{get:function(){return a[4]},set:function(t){a[4]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"ty",{get:function(){return a[5]},set:function(t){a[5]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(this,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(this,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(this,"isIdentity",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),this.sx=isNaN(t)?1:t,this.shy=isNaN(e)?0:e,this.shx=isNaN(n)?0:n,this.sy=isNaN(r)?1:r,this.tx=isNaN(i)?0:i,this.ty=isNaN(o)?0:o,this};M.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,r=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,o=t.tx*this.sx+t.ty*this.shx+this.tx,a=t.tx*this.shy+t.ty*this.sy+this.ty;return new M(e,n,r,i,o,a)},M.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty,a=Math.sqrt(t*t+e*e),s=(t/=a)*n+(e/=a)*r;n-=t*s,r-=e*s;var l=Math.sqrt(n*n+r*r);return s/=l,t*(r/=l)<e*(n/=l)&&(t=-t,e=-e,s=-s,a=-a),{scale:new M(a,0,0,l,0,0),translate:new M(1,0,0,1,i,o),rotate:new M(t,e,-e,t,0,0),skew:new M(1,0,s,1,0,0)}},M.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,n=t.x*this.shy+t.y*this.sy+this.ty;return new j(e,n)},M.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),n=this.applyToPoint(new j(t.x+t.w,t.y+t.h));return new E(e.x,e.y,n.x-e.x,n.y-e.y)},M.prototype.clone=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty;return new M(t,e,n,r,i,o)}}(lt.API,"undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()),
95
+/**
96
+   * jsPDF filters PlugIn
97
+   * Copyright (c) 2014 Aras Abbasi 
98
+   *
99
+   * Licensed under the MIT License.
100
+   * http://opensource.org/licenses/mit-license
101
+   */
102
+a=lt.API,o=function(t){var r,e,n,i,o,a,s,l,h,u;for(/[^\x00-\xFF]/.test(t),e=[],n=0,i=(t+=r="\0\0\0\0".slice(t.length%4||4)).length;n<i;n+=4)0!==(o=(t.charCodeAt(n)<<24)+(t.charCodeAt(n+1)<<16)+(t.charCodeAt(n+2)<<8)+t.charCodeAt(n+3))?(a=(o=((o=((o=((o=(o-(u=o%85))/85)-(h=o%85))/85)-(l=o%85))/85)-(s=o%85))/85)%85,e.push(a+33,s+33,l+33,h+33,u+33)):e.push(122);return function(t,e){for(var n=r.length;0<n;n--)t.pop()}(e),String.fromCharCode.apply(String,e)+"~>"},s=function(t){var r,e,n,i,o,a=String,s="length",l="charCodeAt",h="slice",u="replace";for(t[h](-2),t=t[h](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[h](t[s]%5||5))[s];i<o;i+=5)e=52200625*(t[l](i)-33)+614125*(t[l](i+1)-33)+7225*(t[l](i+2)-33)+85*(t[l](i+3)-33)+(t[l](i+4)-33),n.push(255&e>>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0<n;n--)t.pop()}(n),a.fromCharCode.apply(a,n)},h=function(t){for(var e="",n=0;n<t.length;n+=1)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e+=">"},u=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r<t.length;r+=2)n+=String.fromCharCode("0x"+(t[r]+t[r+1]));return n},c=function(t,e){e=Object.assign({predictor:1,colors:1,bitsPerComponent:8,columns:1},e);for(var n,r,i=[],o=t.length;o--;)i[o]=t.charCodeAt(o);return n=a.adler32cs.from(t),(r=new Deflater(6)).append(new Uint8Array(i)),t=r.flush(),(i=new Uint8Array(t.length+6)).set(new Uint8Array([120,156])),i.set(t,2),i.set(new Uint8Array([255&n,n>>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n<e.length;n+=1)switch(e[n]){case"ASCII85Decode":case"/ASCII85Decode":r=s(r),i.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":r=o(r),i.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":r=u(r),i.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":r=h(r),i.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":r=c(r),i.push("/FlateDecode");break;default:throw'The filter: "'+e[n]+'" is not implemented'}return{data:r,reverseChain:i.reverse().join(" ")}},(
103
+/**
104
+   * jsPDF fileloading PlugIn
105
+   * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
106
+   *
107
+   * Licensed under the MIT License.
108
+   * http://opensource.org/licenses/mit-license
109
+   */
110
+r=lt.API).loadFile=function(t,e,n){var r;e=e||!0,n=n||function(){};try{r=function(t,e,n){var r=new XMLHttpRequest,i=[],o=0,a=function(t){var e=t.length,n=String.fromCharCode;for(o=0;o<e;o+=1)i.push(n(255&t.charCodeAt(o)));return i.join("")};if(r.open("GET",t,!e),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===e&&(r.onload=function(){return a(this.responseText)}),r.send(null),200===r.status)return e?a(r.responseText):void 0;console.warn('Unable to load file "'+t+'"')}(t,e)}catch(t){r=void 0}return r},r.loadImageFile=r.loadFile,
111
+/**
112
+   * Copyright (c) 2018 Erik Koopmans
113
+   * Released under the MIT License.
114
+   *
115
+   * Licensed under the MIT License.
116
+   * http://opensource.org/licenses/mit-license
117
+   */
118
+i=lt.API,f="undefined"!=typeof window&&window||"undefined"!=typeof global&&global,g=function(t){var e=se(t);return"undefined"===e?"undefined":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===e?"object":"unknown"},m=function(t,e){var n=document.createElement(t);if(e.className&&(n.className=e.className),e.innerHTML){n.innerHTML=e.innerHTML;for(var r=n.getElementsByTagName("script"),i=r.length;0<i--;null)r[i].parentNode.removeChild(r[i])}for(var o in e.style)n.style[o]=e.style[o];return n},(((y=function t(e){var n=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),n);return r=(r=r.setProgress(1,t,1,[t])).set(e)}).prototype=Object.create(Promise.prototype)).constructor=y).convert=function(t,e){return t.__proto__=e||y.prototype,t},y.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{}}},y.prototype.from=function(t,e){return this.then(function(){switch(e=e||function(t){switch(g(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.set({src:m("div",{innerHTML:t})});case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}})},y.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},y.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var t={position:"relative",display:"inline-block",width:Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:"white"},e=function t(e,n){for(var r=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(t(i,n));return 1===e.nodeType&&("CANVAS"===e.nodeName?(r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0)):"TEXTAREA"!==e.nodeName&&"SELECT"!==e.nodeName||(r.value=e.value),r.addEventListener("load",function(){r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft},!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===e.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=m("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=m("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(e),this.prop.container.firstChild.appendChild(m("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},y.prototype.toCanvas=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(function(){var t=Object.assign({},this.opt.html2canvas);if(delete t.onrendered,this.isHtml2CanvasLoaded())return html2canvas(this.prop.container,t)}).then(function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},y.prototype.toContext2d=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(function(){var t=this.opt.jsPDF,e=Object.assign({async:!0,allowTaint:!0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete e.onrendered,t.context2d.autoPaging=!0,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,e.windowHeight=e.windowHeight||0,e.windowHeight=0==e.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):e.windowHeight,this.isHtml2CanvasLoaded())return html2canvas(this.prop.container,e)}).then(function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},y.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var t=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=t})},y.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},y.prototype.output=function(t,e,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(t,e):this.outputPdf(t,e)},y.prototype.outputPdf=function(t,e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(t,e)})},y.prototype.outputImg=function(t,e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(t){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+t+'" is not supported.'}})},y.prototype.isHtml2CanvasLoaded=function(){var t=void 0!==f.html2canvas;return t||console.error("html2canvas not loaded."),t},y.prototype.save=function(t){if(this.isHtml2CanvasLoaded())return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},y.prototype.doCallback=function(t){if(this.isHtml2CanvasLoaded())return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},y.prototype.set=function(e){if("object"!==g(e))return this;var t=Object.keys(e||{}).map(function(t){if(t in y.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}},this);return this.then(function(){return this.thenList(t)})},y.prototype.get=function(e,n){return this.then(function(){var t=e in y.template.prop?this.prop[e]:this.opt[e];return n?n(t):t})},y.prototype.setMargin=function(t){return this.then(function(){switch(g(t)){case"number":t=[t,t,t,t];case"array":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=t}).then(this.setPageSize)},y.prototype.setPageSize=function(t){function e(t,e){return Math.floor(t*e/72*96)}return this.then(function(){(t=t||lt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:e(t.inner.width,t.k),height:e(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t})},y.prototype.setProgress=function(t,e,n,r){return null!=t&&(this.progress.val=t),null!=e&&(this.progress.state=e),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},y.prototype.updateProgress=function(t,e,n,r){return this.setProgress(t?this.progress.val+t:null,e||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},y.prototype.then=function(t,e){var n=this;return this.thenCore(t,e,function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,function(t){return n.updateProgress(null,e),t}).then(e,t).then(function(t){return n.updateProgress(1),t})})},y.prototype.thenCore=function(t,e,n){n=n||Promise.prototype.then;var r=this;t&&(t=t.bind(r)),e&&(e=e.bind(r));var i=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:y.convert(Object.assign({},r),Promise.prototype),o=n.call(i,t,e);return y.convert(o,r.__proto__)},y.prototype.thenExternal=function(t,e){return Promise.prototype.then.call(this,t,e)},y.prototype.thenList=function(t){var e=this;return t.forEach(function(t){e=e.thenCore(t)}),e},y.prototype.catch=function(t){t&&(t=t.bind(this));var e=Promise.prototype.catch.call(this,t);return y.convert(e,this)},y.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},y.prototype.error=function(t){return this.then(function(){throw new Error(t)})},y.prototype.using=y.prototype.set,y.prototype.saveAs=y.prototype.save,y.prototype.export=y.prototype.output,y.prototype.run=y.prototype.then,lt.getPageSize=function(t,e,n){if("object"===se(t)){var r=t;t=r.orientation,e=r.unit||e,n=r.format||n}e=e||"mm",n=n||"a4",t=(""+(t||"P")).toLowerCase();var i=(""+n).toLowerCase(),o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(e){case"pt":var a=1;break;case"mm":a=72/25.4;break;case"cm":a=72/2.54;break;case"in":a=72;break;case"px":a=.75;break;case"pc":case"em":a=12;break;case"ex":a=6;break;default:throw"Invalid unit: "+e}if(o.hasOwnProperty(i))var s=o[i][1]/a,l=o[i][0]/a;else try{s=n[1],l=n[0]}catch(t){throw new Error("Invalid format: "+n)}if("p"===t||"portrait"===t){if(t="p",s<l){var h=l;l=s,s=h}}else{if("l"!==t&&"landscape"!==t)throw"Invalid orientation: "+t;t="l",l<s&&(h=l,l=s,s=h)}return{width:l,height:s,unit:e,k:a}},i.html=function(t,e){(e=e||{}).callback=e.callback||function(){},e.html2canvas=e.html2canvas||{},e.html2canvas.canvas=e.html2canvas.canvas||this.canvas,e.jsPDF=e.jsPDF||this,e.jsPDF;var n=new y(e);return e.worker?n:n.from(t).doCallback()},lt.API.addJS=function(t){return b=t,this.internal.events.subscribe("postPutResources",function(t){v=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(v+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),w=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+b+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==v&&void 0!==w&&this.internal.out("/Names <</JavaScript "+v+" 0 R>>")}),this},(
119
+/**
120
+   * @license
121
+   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
122
+   *
123
+   * Licensed under the MIT License.
124
+   * http://opensource.org/licenses/mit-license
125
+   */
126
+x=lt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0<this.outline.root.children.length)for(var n=t.outline.render().split(/\r\n/),r=0;r<n.length;r++){var i=n[r],o=e.exec(i);if(null!=o){var a=o[1];t.internal.newObjectDeferredBegin(a,!1)}t.internal.write(i)}if(this.outline.createNamedDestinations){var s=this.internal.pages.length,l=[];for(r=0;r<s;r++){var h=t.internal.newObject();l.push(h);var u=t.internal.getPageInfo(r+1);t.internal.write("<< /D["+u.objId+" 0 R /XYZ null null null]>> endobj")}var c=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r<l.length;r++)t.internal.write("(page_"+(r+1)+")"+l[r]+" 0 R");t.internal.write(" ] >>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+c+" 0 R"),t.internal.write(">>","endobj")}}]),x.events.push(["putCatalog",function(){0<this.outline.root.children.length&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+namesOid+" 0 R"))}]),x.events.push(["initialized",function(){var a=this;a.outline={createNamedDestinations:!1,root:{children:[]}},a.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root),t.children.push(r),r},a.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=a,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},a.outline.genIds_r=function(t){t.id=a.internal.newObjectDeferred();for(var e=0;e<t.children.length;e++)this.genIds_r(t.children[e])},a.outline.renderRoot=function(t){this.objStart(t),this.line("/Type /Outlines"),0<t.children.length&&(this.line("/First "+this.makeRef(t.children[0])),this.line("/Last "+this.makeRef(t.children[t.children.length-1]))),this.line("/Count "+this.count_r({count:0},t)),this.objEnd()},a.outline.renderItems=function(t){this.ctx.pdf.internal.getCoordinateString;for(var e=this.ctx.pdf.internal.getVerticalCoordinateString,n=0;n<t.children.length;n++){var r=t.children[n];this.objStart(r),this.line("/Title "+this.makeString(r.title)),this.line("/Parent "+this.makeRef(t)),0<n&&this.line("/Prev "+this.makeRef(t.children[n-1])),n<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[n+1])),0<r.children.length&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1])));var i=this.count=this.count_r({count:0},r);if(0<i&&this.line("/Count "+i),r.options&&r.options.pageNumber){var o=a.internal.getPageInfo(r.options.pageNumber);this.line("/Dest ["+o.objId+" 0 R /XYZ 0 "+e(0)+" 0]")}this.objEnd()}for(n=0;n<t.children.length;n++)r=t.children[n],this.renderItems(r)},a.outline.line=function(t){this.ctx.val+=t+"\r\n"},a.outline.makeRef=function(t){return t.id+" 0 R"},a.outline.makeString=function(t){return"("+a.internal.pdfEscape(t)+")"},a.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n"},a.outline.objEnd=function(t){this.ctx.val+=">> \r\nendobj\r\n"},a.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++,this.count_r(t,e.children[n]);return t.count}}]),
127
+/**
128
+   * @license
129
+   * 
130
+   * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
131
+   *
132
+   * 
133
+   * ====================================================================
134
+   */
135
+I=lt.API,C=function(){var t="function"==typeof Deflater;if(!t)throw new Error("requires deflate.js for compression");return t},B=function(t,e,n,r){var i=5,o=E;switch(r){case I.image_compression.FAST:i=3,o=j;break;case I.image_compression.MEDIUM:i=6,o=M;break;case I.image_compression.SLOW:i=9,o=O}t=A(t,e,n,o);var a=new Uint8Array(N(i)),s=L(t),l=new Deflater(i),h=l.append(t),u=l.flush(),c=a.length+h.length+u.length,f=new Uint8Array(c+4);return f.set(a),f.set(h,a.length),f.set(u,a.length+h.length),f[c++]=s>>>24&255,f[c++]=s>>>16&255,f[c++]=s>>>8&255,f[c++]=255&s,I.arrayBufferToBinaryString(f)},N=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},L=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0<o;){for(o-=n=e<o?e:o;i+=r+=t[a++],--n;);r%=65521,i%=65521}return(i<<16|r)>>>0},A=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),h=T(),u=0;u<s;u++){if(a=u*e,i=t.subarray(a,a+e),r)l.set(r(i,n,o),a+u);else{for(var c=0,f=h.length,p=[];c<f;c++)p[c]=h[c](i,n,o);var d=R(p.concat());l.set(p[d],a+u)}o=i}return l},S=function(t,e,n){var r=Array.apply([],t);return r.unshift(0),r},j=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=1;o<a;o++)r=t[o-e]||0,i[o+1]=t[o]-r+256&255;return i},E=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=2;o<a;o++)r=n&&n[o]||0,i[o+1]=t[o]-r+256&255;return i},M=function(t,e,n){var r,i,o=[],a=0,s=t.length;for(o[0]=3;a<s;a++)r=t[a-e]||0,i=n&&n[a]||0,o[a+1]=t[a]+256-(r+i>>>1)&255;return o},O=function(t,e,n){var r,i,o,a,s=[],l=0,h=t.length;for(s[0]=4;l<h;l++)r=t[l-e]||0,i=n&&n[l]||0,o=n&&n[l-e]||0,a=q(r,i,o),s[l+1]=t[l]-a+256&255;return s},q=function(t,e,n){var r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),a=Math.abs(r-n);return i<=o&&i<=a?t:o<=a?e:n},T=function(){return[S,j,E,M,O]},R=function(t){for(var e,n,r,i=0,o=t.length;i<o;)((e=D(t[i].slice(1)))<n||!n)&&(n=e,r=i),i++;return r},D=function(t){for(var e=0,n=t.length,r=0;e<n;)r+=Math.abs(t[e++]);return r},I.processPNG=function(t,e,n,r,i){var o,a,s,l,h,u,c=this.color_spaces.DEVICE_RGB,f=this.decode.FLATE_DECODE,p=8;if(this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)){if("function"!=typeof PNG||"function"!=typeof kt)throw new Error("PNG support requires png.js and zlib.js");if(t=(o=new PNG(t)).imgData,p=o.bits,c=o.colorSpace,l=o.colors,-1!==[4,6].indexOf(o.colorType)){if(8===o.bits)for(var d,g=(_=32==o.pixelBitlength?new Uint32Array(o.decodePixels().buffer):16==o.pixelBitlength?new Uint16Array(o.decodePixels().buffer):new Uint8Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*o.colors),y=new Uint8Array(g),v=o.pixelBitlength-o.bits,w=0,b=0;w<g;w++){for(x=_[w],d=0;d<v;)m[b++]=x>>>d&255,d+=o.bits;y[w]=x>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1<o.colors,L=b=w=0;w<g;)x=_[w++],m[b++]=x>>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;p=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),u=B(y,o.width,1,r)):(t=m,u=y,f=null)}if(3===o.colorType&&(c=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;w<g;++w)S+=A[w];if((S/=255)==g-1&&-1!==A.indexOf(0))s=[A.indexOf(0)];else if(S!==g){var _=o.decodePixels();for(y=new Uint8Array(_.length),w=0,g=_.length;w<g;w++)y[w]=A[_[w]];u=B(y,o.width,1)}}var F=function(t){var e;switch(t){case I.image_compression.FAST:e=11;break;case I.image_compression.MEDIUM:e=13;break;case I.image_compression.SLOW:e=14;break;default:e=12}return e}(r);return a=f===this.decode.FLATE_DECODE?"/Predictor "+F+" /Colors "+l+" /BitsPerComponent "+p+" /Columns "+o.width:"/Colors "+l+" /BitsPerComponent "+p+" /Columns "+o.width,(this.isArrayBuffer(t)||this.isArrayBufferView(t))&&(t=this.arrayBufferToBinaryString(t)),(u&&this.isArrayBuffer(u)||this.isArrayBufferView(u))&&(u=this.arrayBufferToBinaryString(u)),this.createImageInfo(t,o.width,o.height,c,p,f,e,n,a,s,h,u,F)}throw new Error("Unsupported PNG image data, try using JPEG instead.")},(
136
+/**
137
+   * @license
138
+   * Copyright (c) 2017 Aras Abbasi 
139
+   *
140
+   * Licensed under the MIT License.
141
+   * http://opensource.org/licenses/mit-license
142
+   */
143
+U=lt.API).processGIF89A=function(t,e,n,r,i){var o=new At(t),a=o.width,s=o.height,l=[];o.decodeAndBlitFrameRGBA(0,l);var h={data:l,width:a,height:s},u=new _t(100).encode(h,100);return U.processJPEG.call(this,u,e,n,r)},U.processGIF87A=U.processGIF89A,(
144
+/**
145
+   * Copyright (c) 2018 Aras Abbasi 
146
+   *
147
+   * Licensed under the MIT License.
148
+   * http://opensource.org/licenses/mit-license
149
+   */
150
+z=lt.API).processBMP=function(t,e,n,r,i){var o=new Ft(t,!1),a=o.width,s=o.height,l={data:o.getData(),width:a,height:s},h=new _t(100).encode(l,100);return z.processJPEG.call(this,h,e,n,r)},lt.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"FYRO Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]&&(this.internal.languageSettings.languageCode=t,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},
151
+/** @license
152
+   * MIT license.
153
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
154
+   *               2014 Diego Casorran, https://github.com/diegocr
155
+   *
156
+   * 
157
+   * ====================================================================
158
+   */
159
+H=lt.API,W=H.getCharWidthsArray=function(t,e){var n,r,i,o=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),s=e.charSpace||this.internal.getCharSpace(),l=e.widths?e.widths:o.metadata.Unicode.widths,h=l.fof?l.fof:1,u=e.kerning?e.kerning:o.metadata.Unicode.kerning,c=u.fof?u.fof:1,f=0,p=l[0]||h,d=[];for(n=0,r=t.length;n<r;n++)i=t.charCodeAt(n),"function"==typeof o.metadata.widthOfString?d.push((o.metadata.widthOfGlyph(o.metadata.characterToGlyph(i))+s*(1e3/a)||0)/1e3):d.push((l[i]||p)/h+(u[i]&&u[i][f]||0)/c),f=i;return d},V=H.getArraySum=function(t){for(var e=t.length,n=0;e;)n+=t[--e];return n},G=H.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:V(W.apply(this,arguments))},Y=function(t,e,n,r){for(var i=[],o=0,a=t.length,s=0;o!==a&&s+e[o]<n;)s+=e[o],o++;i.push(t.slice(0,o));var l=o;for(s=0;o!==a;)s+e[o]>r&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},J=function(t,e,n){n||(n={});var r,i,o,a,s,l,h=[],u=[h],c=n.textIndent||0,f=0,p=0,d=t.split(" "),g=W.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(l).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,l=G.apply(this,[m,n])}for(o=0,a=d.length;o<a;o++){var v=0;if(r=d[o],l&&"\n"==r[0]&&(r=r.substr(1),v=1),i=W.apply(this,[r,n]),e<c+f+(p=V(i))||v){if(e<p){for(s=Y.apply(this,[r,i,e-(c+f),e]),h.push(s.shift()),h=[s.pop()];s.length;)u.push([s.shift()]);p=V(i.slice(r.length-(h[0]?h[0].length:0)))}else h=[r];u.push(h),c=p+l,f=g}else h.push(r),c+=f+p,f=g}if(l)var w=function(t,e){return(e?m:"")+t.join(" ")};else w=function(t){return t.join(" ")};return u.map(w)},H.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),o=function(t){var e={0:1},n={};if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var r=this.internal.getFont(t.fontName,t.fontStyle),i="Unicode";return r.metadata[i]?{widths:r.metadata[i].widths||e,kerning:r.metadata[i].kerning||n}:{font:r.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(t)?t:t.split(/\r?\n/);var a=1*this.internal.scaleFactor*e/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=n.lineIndent;var s,l,h=[];for(s=0,l=r.length;s<l;s++)h=h.concat(J.apply(this,[r[s],a,o]));return h},
160
+/** @license
161
+   jsPDF standard_fonts_metrics plugin
162
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
163
+   * MIT license.
164
+   * 
165
+   * ====================================================================
166
+   */
167
+X=lt.API,Z={codePages:["WinAnsiEncoding"],WinAnsiEncoding:(K=function(t){for(var e="klmnopqrstuvwxyz",n={},r=0;r<e.length;r++)n[e[r]]="0123456789abcdef"[r];var i,o,a,s,l,h={},u=1,c=h,f=[],p="",d="",g=t.length-1;for(r=1;r!=g;)l=t[r],r+=1,"'"==l?o=o?(s=o.join(""),i):[]:o?o.push(l):"{"==l?(f.push([c,s]),c={},s=i):"}"==l?((a=f.pop())[0][a[1]]=c,s=i,c=a[0]):"-"==l?u=-1:s===i?n.hasOwnProperty(l)?(p+=n[l],s=parseInt(p,16)*u,u=1,p=""):p+=l:n.hasOwnProperty(l)?(d+=n[l],c[s]=parseInt(d,16)*u,u=1,s=i,d=""):d+=l;return h})("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},Q={Unicode:{Courier:Z,"Courier-Bold":Z,"Courier-BoldOblique":Z,"Courier-Oblique":Z,Helvetica:Z,"Helvetica-Bold":Z,"Helvetica-BoldOblique":Z,"Helvetica-Oblique":Z,"Times-Roman":Z,"Times-Bold":Z,"Times-BoldItalic":Z,"Times-Italic":Z}},$={Unicode:{"Courier-Oblique":K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":K("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":K("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":K("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:K("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:K("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":K("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:K("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":K("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":K("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":K("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}},X.events.push(["addFont",function(t){var e,n,r,i=t.font,o="Unicode";(e=$[o][i.postScriptName])&&((n=i.metadata[o]?i.metadata[o]:i.metadata[o]={}).widths=e.widths,n.kerning=e.kerning),(r=Q[o][i.postScriptName])&&((n=i.metadata[o]?i.metadata[o]:i.metadata[o]={}).encoding=r).codePages&&r.codePages.length&&(i.encoding=r.codePages[0])}]),
168
+/**
169
+   * @license
170
+   * Licensed under the MIT License.
171
+   * http://opensource.org/licenses/mit-license
172
+   */
173
+tt=lt,"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||"undefined"!=typeof window&&window||Function("return this")(),tt.API.events.push(["addFont",function(t){var e=t.font,n=t.instance;if(void 0!==n&&n.existsFileInVFS(e.postScriptName)){var r=n.getFileFromVFS(e.postScriptName);if("string"!=typeof r)throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+e.postScriptName+"').");e.metadata=tt.API.TTFFont.open(e.postScriptName,e.fontName,r,e.encoding),e.metadata.Unicode=e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},e.metadata.glyIdsUsed=[0]}else if(!1===e.isStandardFont)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+e.postScriptName+"').")}]),(
174
+/** @license
175
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
176
+   * 
177
+   * 
178
+   * ====================================================================
179
+   */
180
+et=lt.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function o(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,o=t.length;i<o;)"c"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2]),parseFloat(t[i+3]),parseFloat(t[i+4]),parseFloat(t[i+5]),parseFloat(t[i+6])]),i+=7):"l"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2])]),i+=3):i+=1;return[e,n,r]}var a,s,l,h,u,c,f,p,d=(h=document,p=h.createElement("iframe"),u=".jsPDF_sillysvg_iframe {display:none;position:absolute;}",(f=(c=h).createElement("style")).type="text/css",f.styleSheet?f.styleSheet.cssText=u:f.appendChild(c.createTextNode(u)),c.getElementsByTagName("head")[0].appendChild(f),p.name="childframe",p.setAttribute("width",0),p.setAttribute("height",0),p.setAttribute("frameborder","0"),p.setAttribute("scrolling","no"),p.setAttribute("seamless","seamless"),p.setAttribute("class","jsPDF_sillysvg_iframe"),h.body.appendChild(p),p),g=(a=t,(l=((s=d).contentWindow||s.contentDocument).document).write(a),l.close(),l.getElementsByTagName("svg")[0]),m=[1,1],y=parseFloat(g.getAttribute("width")),v=parseFloat(g.getAttribute("height"));y&&v&&(r&&i?m=[r/y,i/v]:r?m=[r/y,r/y]:i&&(m=[i/v,i/v]));var w,b,x,N,L=g.childNodes;for(w=0,b=L.length;w<b;w++)(x=L[w]).tagName&&"PATH"===x.tagName.toUpperCase()&&((N=o(x.getAttribute("d").split(" ")))[0]=N[0]*m[0]+e,N[1]=N[1]*m[1]+n,this.lines.call(this,N[2],N[0],N[1],m));return this},et.addSVG=et.addSvg,et.addSvgAsImage=function(t,e,n,r,i,o,a,s){if(isNaN(e)||isNaN(n))throw console.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var h=l.getContext("2d");return h.fillStyle="#fff",h.fillRect(0,0,l.width,l.height),canvg(l,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0}),this.addImage(l.toDataURL("image/jpeg",1),e,n,r,i,a,s),this},lt.API.putTotalPages=function(t){var e,n=0;n=parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},lt.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),s=[],l=0,h=0,u=0,c=!0;function f(t,e){var n,r=!1;for(n=0;n<t.length;n+=1)t[n]===e&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===t||!0===e){var p=a.length;for(u=0;u<p;u+=1)n[a[u]].value=n[a[u]].defaultValue,n[a[u]].explicitSet=!1}if("object"===se(t))for(r in t)if(i=t[r],f(a,r)&&void 0!==i){if("boolean"===n[r].type&&"boolean"==typeof i)n[r].value=i;else if("name"===n[r].type&&f(n[r].valueSet,i))n[r].value=i;else if("integer"===n[r].type&&Number.isInteger(i))n[r].value=i;else if("array"===n[r].type){for(l=0;l<i.length;l+=1)if(c=!0,1===i[l].length&&"number"==typeof i[l][0])s.push(String(i[l]-1));else if(1<i[l].length){for(h=0;h<i[l].length;h+=1)"number"!=typeof i[l][h]&&(c=!1);!0===c&&s.push([i[l][0]-1,i[l][1]-1].join(" "))}n[r].value="["+s.join(" ")+"]"}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
181
+/** ==================================================================== 
182
+   * jsPDF XMP metadata plugin
183
+   * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
184
+   * 
185
+   * 
186
+   * ====================================================================
187
+   */
188
+nt=lt.API,ot=it=rt="",nt.addMetadata=function(t,e){return it=e||"http://jspdf.default.namespaceuri/",rt=t,this.internal.events.subscribe("postPutResources",function(){if(rt){var t='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+it+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(rt)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),o=unescape(encodeURIComponent("</x:xmpmeta>")),a=n.length+r.length+i.length+e.length+o.length;ot=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ot=""}),this.internal.events.subscribe("putCatalog",function(){ot&&this.internal.write("/Metadata "+ot+" 0 R")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<s;++a){if(n=e.metadata.characterToGlyph(t.charCodeAt(a)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(a),-1==r.indexOf(n)&&(r.push(n),r.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(i[4-n.length],n)}return o.join("")},p=function(t){var e,n,r,i,o,a,s;for(o="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n  /Registry (Adobe)\n  /Ordering (UCS)\n  /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],a=0,s=(n=Object.keys(t).sort(function(t,e){return t-e})).length;a<s;a++)e=n[a],100<=r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),i=("0000"+t[e].toString(16)).slice(-4),e=("0000"+(+e).toString(16)).slice(-4),r.push("<"+e+"><"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a="",s=0;s<o.length;s++)a+=String.fromCharCode(o[s]);var l=n();r({data:a,addLength1:!0}),e("endobj");var h=n();r({data:p(t.metadata.toUnicode),addLength1:!0}),e("endobj");var u=n();e("<<"),e("/Type /FontDescriptor"),e("/FontName /"+t.fontName),e("/FontFile2 "+l+" 0 R"),e("/FontBBox "+f.API.PDFObject.convert(t.metadata.bbox)),e("/Flags "+t.metadata.flags),e("/StemV "+t.metadata.stemV),e("/ItalicAngle "+t.metadata.italicAngle),e("/Ascent "+t.metadata.ascender),e("/Descent "+t.metadata.decender),e("/CapHeight "+t.metadata.capHeight),e(">>"),e("endobj");var c=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+u+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+h+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+c+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",a=0;a<i.length;a++)o+=String.fromCharCode(i[a]);var s=n();r({data:o,addLength1:!0}),e("endobj");var l=n();r({data:p(t.metadata.toUnicode),addLength1:!0}),e("endobj");var h=n();for(e("<<"),e("/Descent "+t.metadata.decender),e("/CapHeight "+t.metadata.capHeight),e("/StemV "+t.metadata.stemV),e("/Type /FontDescriptor"),e("/FontFile2 "+s+" 0 R"),e("/Flags 96"),e("/FontBBox "+f.API.PDFObject.convert(t.metadata.bbox)),e("/FontName /"+t.fontName),e("/ItalicAngle "+t.metadata.italicAngle),e("/Ascent "+t.metadata.ascender),e(">>"),e("endobj"),t.objectNumber=n(),a=0;a<t.metadata.hmtx.widths.length;a++)t.metadata.hmtx.widths[a]=parseInt(t.metadata.hmtx.widths[a]*(1e3/t.metadata.head.unitsPerEm));e("<</Subtype/TrueType/Type/Font/ToUnicode "+l+" 0 R/BaseFont/"+t.fontName+"/FontDescriptor "+h+" 0 R/Encoding/"+t.encoding+" /FirstChar 29 /LastChar 255 /Widths "+f.API.PDFObject.convert(t.metadata.hmtx.widths)+">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,h=s.activeFontKey,u=s.fonts,c=(s.activeFontSize,""),f=0,p="",d=u[n=h].encoding;if("Identity-H"!==u[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(p=r,n=h,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;f<p.length;f+=1)u[n].metadata.hasOwnProperty("cmap")&&(e=u[n].metadata.cmap.unicode.codeMap[p[f].charCodeAt(0)]),e?c+=p[f]:p[f].charCodeAt(0)<256&&u[n].metadata.hasOwnProperty("Unicode")?c+=p[f]:c+="";var g="";return parseInt(n.slice(1))<14||"WinAnsiEncoding"===d?g=function(t){for(var e="",n=0;n<t.length;n++)e+=""+t.charCodeAt(n).toString(16);return e}(l(c,n)):"Identity-H"===d&&(g=m(c,u[n])),s.isHex=!0,{text:g,x:i,y:o,options:a,mutex:s}};e.events.push(["postProcessText",function(t){var e=t.text||"",n=t.x,r=t.y,i=t.options,o=t.mutex,a=(i.lang,[]),s={text:e,x:n,y:r,options:i,mutex:o};if("[object Array]"===Object.prototype.toString.call(e)){var l=0;for(l=0;l<e.length;l+=1)"[object Array]"===Object.prototype.toString.call(e[l])&&3===e[l].length?a.push([h(Object.assign({},s,{text:e[l][0]})).text,e[l][1],e[l][2]]):a.push(h(Object.assign({},s,{text:e[l]})).text);t.text=a}else t.text=h(Object.assign({},s,{text:e})).text}])}(lt,"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||"undefined"!=typeof window&&window||Function("return this")()),at=lt.API,st=function(t){return void 0!==t&&(void 0===t.vFS&&(t.vFS={}),!0)},at.existsFileInVFS=function(t){return!!st(this.internal)&&void 0!==this.internal.vFS[t]},at.addFileToVFS=function(t,e){return st(this.internal),this.internal.vFS[t]=e,this},at.getFileFromVFS=function(t){return st(this.internal),void 0!==this.internal.vFS[t]?this.internal.vFS[t]:null},lt.API.addHTML=function(t,d,g,s,m){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof d&&(s=d,m=g),"function"==typeof s&&(m=s,s=null),"function"!=typeof m&&(m=function(){});var e=this.internal,y=e.scaleFactor,v=e.pageSize.getWidth(),w=e.pageSize.getHeight();if((s=s||{}).onrendered=function(l){d=parseInt(d)||0,g=parseInt(g)||0;var t=s.dim||{},h=Object.assign({top:0,right:0,bottom:0,left:0,useFor:"content"},s.margin),e=t.h||Math.min(w,l.height/y),u=t.w||Math.min(v,l.width/y)-d,c=s.format||"JPEG",f=s.imageCompression||"SLOW";if(l.height>w-h.top-h.bottom&&s.pagesplit){var p=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i,o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||"#ffffff",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?h.top:g,i.left=0!==n?h.left:d,o=(v-h.left-h.right)*y<l.width,"content"===h.useFor?0===n?(t=Math.min((v-h.left)*y,l.width),e=Math.min((w-h.top)*y,l.height-n)):(t=Math.min(v*y,l.width),e=Math.min(w*y,l.height-n),i.top=0):(t=Math.min((v-h.left-h.right)*y,l.width),e=Math.min((w-h.bottom-h.top)*y,l.height-n)),o)for(;;){"content"===h.useFor&&(0===r?t=Math.min((v-h.left)*y,l.width):(t=Math.min(v*y,l.width-r),i.left=0));var s=[a=p(l,r,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f];if(this.addImage.apply(this,s),(r+=t)>=l.width)break;this.addPage()}else s=[a=p(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(u,n,null,s)}.bind(this);if("CANVAS"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL("image/png"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,d,g,u,e,c,i,f];this.addImage.apply(this,o),m(u,e,i,o)}}.bind(this),"undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"==typeof rasterizeHTML)return null;var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})},
189
+/**
190
+   * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
191
+   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
192
+   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
193
+   *               2014 Diego Casorran, https://github.com/diegocr
194
+   *               2014 Daniel Husar, https://github.com/danielhusar
195
+   *               2014 Wolfgang Gassler, https://github.com/woolfg
196
+   *               2014 Steven Spungin, https://github.com/flamenco
197
+   *
198
+   * @license
199
+   * 
200
+   * ====================================================================
201
+   */
202
+function(t){var P,k,i,a,s,l,h,u,I,w,f,c,p,n,C,B,d,g,m,j;P=function(){return function(t){return e.prototype=t,new e};function e(){}}(),w=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},c=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},p=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1<t.indexOf("pt")&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),void 0,16,(e=n[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])?n[t]=e/16:(e=parseFloat(t))?n[t]=e/16:(e=t.match(/([\d\.]+)(px)/),Array.isArray(e)&&3===e.length?n[t]=parseFloat(e[1])/16:n[t]=1)},I=function(t){var e,n,r,i,o;return o=t,i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(o,null):o.currentStyle?o.currentStyle:o.style,n=void 0,(e={})["font-family"]=c((r=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),i[t]})("font-family"))||"times",e["font-style"]=a[r("font-style")]||"normal",e["text-align"]=s[r("text-align")]||"left","bold"===(n=l[r("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=p(r("font-size"))||1,e["line-height"]=p(r("line-height"))||1,e.display="inline"===r("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&p(r("margin-top"))||0,e["margin-bottom"]=n&&p(r("margin-bottom"))||0,e["padding-top"]=n&&p(r("padding-top"))||0,e["padding-bottom"]=n&&p(r("padding-bottom"))||0,e["margin-left"]=n&&p(r("margin-left"))||0,e["margin-right"]=n&&p(r("margin-right"))||0,e["padding-left"]=n&&p(r("padding-left"))||0,e["padding-right"]=n&&p(r("padding-right"))||0,e["page-break-before"]=r("page-break-before")||"auto",e.float=h[r("cssFloat")]||"none",e.clear=u[r("clear")]||"none",e.color=r("color"),e},C=function(t,e,n){var r,i,o,a,s;if(o=!1,a=i=void 0,r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;if(r=n[t.nodeName],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;for(s="string"==typeof t.className?t.className.split(" "):[],i=0;i<s.length;i++)if(r=n["."+s[i]],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;return o},j=function(t,e){var n,r,i,o,a,s,l,h,u;for(n=[],r=[],i=0,u=t.rows[0].cells.length,l=t.clientWidth;i<u;)h=t.rows[0].cells[i],r[i]={name:h.textContent.toLowerCase().replace(/\s+/g,""),prompt:h.textContent.replace(/\r?\n/g,""),width:h.clientWidth/l*e.pdf.internal.pageSize.getWidth()},i++;for(i=1;i<t.rows.length;){for(s=t.rows[i],a={},o=0;o<s.cells.length;)a[r[o].name]=s.cells[o].textContent.replace(/\r?\n/g,""),o++;n.push(a),i++}return{rows:n,headers:r}};var E={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},M=1;k=function(t,i,e){var n,r,o,a,s,l,h,u;for(r=t.childNodes,n=void 0,(s="block"===(o=I(t)).display)&&(i.setBlockBoundary(),i.setBlockStyle(o)),a=0,l=r.length;a<l;){if("object"===se(n=r[a])){if(i.executeWatchFunctions(n),1===n.nodeType&&"HEADER"===n.nodeName){var c=n,f=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=f,k(c,i,e),i.pdf.margins_doc.top=i.y+10,i.y+=10},!1)}if(8===n.nodeType&&"#comment"===n.nodeName)~n.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==n.nodeType||E[n.nodeName])if(3===n.nodeType){var p=n.nodeValue;if(n.nodeValue&&"LI"===n.parentNode.nodeName)if("OL"===n.parentNode.parentNode.nodeName)p=M+++". "+p;else{var d=o["font-size"],g=(3-.75*d)*i.pdf.internal.scaleFactor,m=.75*d*i.pdf.internal.scaleFactor,y=1.74*d/i.pdf.internal.scaleFactor;u=function(t,e){this.pdf.circle(t+g,e+m,y,"FD")}}16&n.ownerDocument.body.compareDocumentPosition(n)&&i.addText(p,o)}else"string"==typeof n&&i.addText(n,o);else{var v;if("IMG"===n.nodeName){var w=n.getAttribute("src");v=B[i.pdf.sHashCode(w)||w]}if(v){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+n.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=I(n),x=i.x,N=12/i.pdf.internal.scaleFactor,L=(b["margin-left"]+b["padding-left"])*N,A=(b["margin-right"]+b["padding-right"])*N,S=(b["margin-top"]+b["padding-top"])*N,_=(b["margin-bottom"]+b["padding-bottom"])*N;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-A:x+=L,i.pdf.addImage(v,x,i.y+S,n.width,n.height),v=void 0,"right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!E[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===b.float?-n.width-L-A:0,i.y+n.height+S+_,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===I(n).clear&&(i.y=t,!0)}.bind(this,i.y+n.height,i.pdf.internal.getNumberOfPages())),i.settings.width-=n.width+L+A,"left"===b.float&&(i.x+=n.width+L+A)):i.y+=n.height+S+_}else if("TABLE"===n.nodeName)h=j(n,i),i.y+=10,i.pdf.table(i.x,i.y,h.rows,h.headers,{autoSize:!1,printHeaders:e.printHeaders,margins:i.pdf.margins_doc,css:I(n)}),i.y=i.pdf.lastCellPos.y+i.pdf.lastCellPos.h+20;else if("OL"===n.nodeName||"UL"===n.nodeName)M=1,C(n,i,e)||k(n,i,e),i.y+=10;else if("LI"===n.nodeName){var F=i.x;i.x+=20/i.pdf.internal.scaleFactor,i.y+=3,C(n,i,e)||k(n,i,e),i.x=F}else"BR"===n.nodeName?(i.y+=o["font-size"]*i.pdf.internal.scaleFactor,i.addText("\u2028",P(o))):C(n,i,e)||k(n,i,e)}}a++}if(e.outY=i.y,s)return i.setBlockBoundary(u)},B={},d=function(t,o,e,n){var a,r=t.getElementsByTagName("img"),i=r.length,s=0;function l(){o.pdf.internal.events.publish("imagesLoaded"),n(a)}function h(e,n,r){if(e){var i=new Image;a=++s,i.crossOrigin="",i.onerror=i.onload=function(){if(i.complete&&(0===i.src.indexOf("data:image/")&&(i.width=n||i.width||0,i.height=r||i.height||0),i.width+i.height)){var t=o.pdf.sHashCode(e)||e;B[t]=B[t]||i}--s||l()},i.src=e}}for(;i--;)h(r[i].getAttribute("src"),r[i].width,r[i].height);return s||l()},g=function(t,o,a){var s=t.getElementsByTagName("footer");if(0<s.length){s=s[0];var e=o.pdf.internal.write,n=o.y;o.pdf.internal.write=function(){},k(s,o,a);var l=Math.ceil(o.y-n)+5;o.y=n,o.pdf.internal.write=e,o.pdf.margins_doc.bottom+=l;for(var r=function(t){var e=void 0!==t?t.pageNumber:1,n=o.y;o.y=o.pdf.internal.pageSize.getHeight()-o.pdf.margins_doc.bottom,o.pdf.margins_doc.bottom-=l;for(var r=s.getElementsByTagName("span"),i=0;i<r.length;++i)-1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")&&(r[i].innerHTML=e),-1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&(r[i].innerHTML="###jsPDFVarTotalPages###");k(s,o,a),o.pdf.margins_doc.bottom+=l,o.y=n},i=s.getElementsByTagName("span"),h=0;h<i.length;++h)-1<(" "+i[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&o.pdf.internal.events.subscribe("htmlRenderingFinished",o.pdf.putTotalPages.bind(o.pdf,"###jsPDFVarTotalPages###"),!0);o.pdf.internal.events.subscribe("addPage",r,!1),r(),E.FOOTER=1}},m=function(t,e,n,r,i,o){if(!e)return!1;var a,s,l,h;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(a=e.replace(/<\/?script[^>]*?>/gi,""),h="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",l.innerHTML='<iframe style="height:1px;width:1px" name="'+h+'" />',document.body.appendChild(l),(s=window.frames[h]).document.open(),s.document.writeln(a),s.document.close(),e=s.document.body);var u,c=new f(t,n,r,i);return d.call(this,e,c,i.elementHandlers,function(t){g(e,c,i.elementHandlers),k(e,c,i.elementHandlers),c.pdf.internal.events.publish("htmlRenderingFinished"),u=c.dispose(),"function"==typeof o?o(u):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),u||{x:c.x,y:c.y}},(f=function(t,e,n,r){return this.pdf=t,this.x=e,this.y=n,this.settings=r,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},f.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},f.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(0<this.watchFunctions.length){for(var r=0;r<this.watchFunctions.length;++r)!0===this.watchFunctions[r](t)?e=!0:n.push(this.watchFunctions[r]);this.watchFunctions=n}return e},f.prototype.splitFragmentsIntoLines=function(t,e){var n,r,i,o,a,s,l,h,u,c,f,p,d,g;for(12,c=this.pdf.internal.scaleFactor,o={},s=l=h=g=a=i=u=r=void 0,p=[f=[]],n=0,d=this.settings.width;t.length;)if(a=t.shift(),g=e.shift(),a)if((i=o[(r=g["font-family"])+(u=g["font-style"])])||(i=this.pdf.internal.getFont(r,u).metadata.Unicode,o[r+u]=i),h={widths:i.widths,kerning:i.kerning,fontSize:12*g["font-size"],textIndent:n},l=this.pdf.getStringUnitWidth(a,h)*h.fontSize/c,"\u2028"==a)f=[],p.push(f);else if(d<n+l){for(s=this.pdf.splitTextToSize(a,d,h),f.push([s.shift(),g]);s.length;)f=[[s.shift(),g]],p.push(f);n=this.pdf.getStringUnitWidth(f[0][0],h)*h.fontSize/c}else f.push([a,g]),n+=l;if(void 0!==g["text-align"]&&("center"===g["text-align"]||"right"===g["text-align"]||"justify"===g["text-align"]))for(var m=0;m<p.length;++m){var y=this.pdf.getStringUnitWidth(p[m][0][0],h)*h.fontSize/c;0<m&&(p[m][0][1]=P(p[m][0][1]));var v=d-y;if("right"===g["text-align"])p[m][0][1]["margin-left"]=v;else if("center"===g["text-align"])p[m][0][1]["margin-left"]=v/2;else if("justify"===g["text-align"]){var w=p[m][0][0].split(" ").length-1;p[m][0][1]["word-spacing"]=v/w,m===p.length-1&&(p[m][0][1]["word-spacing"]=0)}}return p},f.prototype.RenderTextFragment=function(t,e){var n,r;r=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()&&(this.pdf.internal.write("ET","Q"),this.pdf.addPage(),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),r=Math.max(r,e["line-height"],e["font-size"]),this.pdf.internal.write(0,(-12*r).toFixed(2),"Td")),n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var i=this.getPdfColor(e.color);i!==this.lastTextColor&&(this.pdf.internal.write(i),this.lastTextColor=i),void 0!==e["word-spacing"]&&0<e["word-spacing"]&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw"),this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(t)+") Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},f.prototype.getPdfColor=function(t){var e,n,r,i=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=i)e=parseInt(i[1]),n=parseInt(i[2]),r=parseInt(i[3]);else{if("string"==typeof t&&"#"!=t.charAt(0)){var o=new RGBColor(t);t=o.ok?o.toHex():"#000000"}e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),r=t.substring(5,7),r=parseInt(r,16)}if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var a=parseInt(e.substr(1),16);e=a>>16&255,n=a>>8&255,r=255&a}var s=this.f3;return 0===e&&0===n&&0===r||void 0===n?s(e/255)+" g":[s(e/255),s(n/255),s(r/255),"rg"].join(" ")},f.prototype.f3=function(t){return t.toFixed(3)},f.prototype.renderParagraph=function(t){var e,n,r,i,o,a,s,l,h,u,c,f,p;if(r=w(this.paragraph.text),f=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle||{},this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},r.join("").trim()){s=this.splitFragmentsIntoLines(r,f),l=a=void 0,n=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,c=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n,u=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,c=((e["margin-top"]||0)+(e["padding-top"]||0))*n),h=this.pdf.internal.write,o=i=void 0,this.y+=c,h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var d=0;s.length;){for(i=l=0,o=(a=s.shift()).length;i!==o;)a[i][0].trim()&&(l=Math.max(l,a[i][1]["line-height"],a[i][1]["font-size"]),p=7*a[i][1]["font-size"]),i++;var g=0,m=0;for(void 0!==a[0][1]["margin-left"]&&0<a[0][1]["margin-left"]&&(g=(m=this.pdf.internal.getCoordinateString(a[0][1]["margin-left"]))-d,d=m),h(g+Math.max(e["margin-left"]||0,0)*n,(-12*l).toFixed(2),"Td"),i=0,o=a.length;i!==o;)a[i][0]&&this.RenderTextFragment(a[i][0],a[i][1]),i++;if(this.y+=l*n,this.executeWatchFunctions(a[0][1])&&0<s.length){var y=[],v=[];s.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(y.push(t[e][0]+" "),v.push(t[e][1])),++e}),s=this.splitFragmentsIntoLines(w(y),v),h("ET","Q"),h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-p/2),h("ET","Q"),this.y+=u}},f.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},f.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},f.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},l={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},a={normal:"normal",italic:"italic",oblique:"italic"},s={left:"left",right:"right",center:"center",justify:"justify"},h={none:"none",right:"right",left:"left"},u={none:"none",both:"both"},n={normal:1},t.fromHTML=function(t,e,n,r,i,o){return this.margins_doc=o||{top:0,bottom:0},r||(r={}),r.elementHandlers||(r.elementHandlers={}),m(this,t,isNaN(e)?4:e,isNaN(n)?4:n,r,i)}}(lt.API),lt.API,("undefined"!=typeof window&&window||"undefined"!=typeof global&&global).html2pdf=function(t,a,e){var n=a.canvas;if(n){var r,i;if((n.pdf=a).annotations={_nameMap:[],createAnnotation:function(t,e){var n,r=a.context2d._wrapX(e.left),i=a.context2d._wrapY(e.top),o=(a.context2d._page(e.top),t.indexOf("#"));n=0<=o?{name:t.substring(o+1)}:{url:t},a.link(r,i,e.right-e.left,e.bottom-e.top,n)},setName:function(t,e){var n=a.context2d._wrapX(e.left),r=a.context2d._wrapY(e.top),i=a.context2d._page(e.top);this._nameMap[t]={page:i,x:n,y:r}}},n.annotations=a.annotations,a.context2d._pageBreakAt=function(t){this.pageBreaks.push(t)},a.context2d._gotoPage=function(t){for(;a.internal.getNumberOfPages()<t;)a.addPage();a.setPage(t)},"string"==typeof t){t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");var o,s,l=document.createElement("iframe");document.body.appendChild(l),null!=(o=l.contentDocument)&&null!=o||(o=l.contentWindow.document),o.open(),o.write(t),o.close(),r=o.body,s=o.body||{},t=o.documentElement||{},i=Math.max(s.scrollHeight,s.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}else s=(r=t).body||{},i=Math.max(s.scrollHeight,s.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight);var h={async:!0,allowTaint:!0,backgroundColor:"#ffffff",canvas:n,imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1,windowHeight:i=a.internal.pageSize.getHeight(),scrollY:i};a.context2d.pageWrapYEnabled=!0,a.context2d.pageWrapY=a.internal.pageSize.getHeight(),html2canvas(r,h).then(function(t){e&&(l&&l.parentElement.removeChild(l),e(a))})}else alert("jsPDF canvas plugin not installed")},window.tmp=html2pdf,function(f){var r=f.BlobBuilder||f.WebKitBlobBuilder||f.MSBlobBuilder||f.MozBlobBuilder;f.URL=f.URL||f.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var n=f.Blob,p=URL.createObjectURL,d=URL.revokeObjectURL,o=f.Symbol&&f.Symbol.toStringTag,t=!1,e=!1,g=!!f.ArrayBuffer,i=r&&r.prototype.append&&r.prototype.getBlob;try{t=2===new Blob(["ä"]).size,e=2===new Blob([new Uint8Array([1,2])]).size}catch(t){}function a(t){return t.map(function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=n.buffer}return e}return t})}function s(t,e){e=e||{};var n=new r;return a(t).forEach(function(t){n.append(t)}),e.type?n.getBlob(e.type):n.getBlob()}function l(t,e){return new n(a(t),e||{})}if(f.Blob&&(s.prototype=Blob.prototype,l.prototype=Blob.prototype),o)try{File.prototype[o]="File",Blob.prototype[o]="Blob",FileReader.prototype[o]="FileReader"}catch(t){}function h(){var t=!!f.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,e=f.XMLHttpRequest&&f.XMLHttpRequest.prototype.send;t&&e&&(XMLHttpRequest.prototype.send=function(t){t instanceof Blob&&this.setRequestHeader("Content-Type",t.type),e.call(this,t)});try{new File([],"")}catch(t){try{var n=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();f.File=n}catch(t){n=function(t,e,n){var r=new Blob(t,n),i=n&&void 0!==n.lastModified?new Date(n.lastModified):new Date;return r.name=e,r.lastModifiedDate=i,r.lastModified=+i,r.toString=function(){return"[object File]"},o&&(r[o]="File"),r};f.File=n}}}t?(h(),f.Blob=e?f.Blob:l):i?(h(),f.Blob=s):function(){function a(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e.push(r):r<2048?e.push(192|r>>6,128|63&r):r<55296||57344<=r?e.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&t.charCodeAt(n)),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return e}function e(t){var e,n,r,i,o,a;for(e="",r=t.length,n=0;n<r;)switch((i=t[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=String.fromCharCode(i);break;case 12:case 13:o=t[n++],e+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[n++],a=t[n++],e+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&a)<<0)}return e}function s(t){for(var e=new Array(t.byteLength),n=new Uint8Array(t),r=e.length;r--;)e[r]=n[r];return e}function n(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=0;r<t.length;r+=3){var i=t[r],o=r+1<t.length,a=o?t[r+1]:0,s=r+2<t.length,l=s?t[r+2]:0,h=i>>2,u=(3&i)<<4|a>>4,c=(15&a)<<2|l>>6,f=63&l;s||(f=64,o||(c=64)),n.push(e[h],e[u],e[c],e[f])}return n.join("")}var t=Object.create||function(t){function e(){}return e.prototype=t,new e};if(g)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&-1<r.indexOf(Object.prototype.toString.call(t))};function h(t,e){for(var n=0,r=(t=t||[]).length;n<r;n++){var i=t[n];i instanceof h?t[n]=i._buffer:"string"==typeof i?t[n]=a(i):g&&(ArrayBuffer.prototype.isPrototypeOf(i)||l(i))?t[n]=s(i):g&&(o=i)&&DataView.prototype.isPrototypeOf(o)?t[n]=s(i.buffer):t[n]=a(String(i))}var o;this._buffer=[].concat.apply([],t),this.size=this._buffer.length,this.type=e&&e.type||""}function i(t,e,n){var r=h.call(this,t,n=n||{})||this;return r.name=e,r.lastModifiedDate=n.lastModified?new Date(n.lastModified):new Date,r.lastModified=+r.lastModifiedDate,r}if(h.prototype.slice=function(t,e,n){return new h([this._buffer.slice(t||0,e||this._buffer.length)],{type:n})},h.prototype.toString=function(){return"[object Blob]"},(i.prototype=t(h.prototype)).constructor=i,Object.setPrototypeOf)Object.setPrototypeOf(i,h);else try{i.__proto__=h}catch(t){}function o(){if(!(this instanceof o))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var n=document.createDocumentFragment();this.addEventListener=n.addEventListener,this.dispatchEvent=function(t){var e=this["on"+t.type];"function"==typeof e&&e(t),n.dispatchEvent(t)},this.removeEventListener=n.removeEventListener}function u(t,e,n){if(!(e instanceof h))throw new TypeError("Failed to execute '"+n+"' on 'FileReader': parameter 1 is not of type 'Blob'.");t.result="",setTimeout(function(){this.readyState=o.LOADING,t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend"))})}i.prototype.toString=function(){return"[object File]"},o.EMPTY=0,o.LOADING=1,o.DONE=2,o.prototype.error=null,o.prototype.onabort=null,o.prototype.onerror=null,o.prototype.onload=null,o.prototype.onloadend=null,o.prototype.onloadstart=null,o.prototype.onprogress=null,o.prototype.readAsDataURL=function(t){u(this,t,"readAsDataURL"),this.result="data:"+t.type+";base64,"+n(t._buffer)},o.prototype.readAsText=function(t){u(this,t,"readAsText"),this.result=e(t._buffer)},o.prototype.readAsArrayBuffer=function(t){u(this,t,"readAsText"),this.result=t._buffer.slice()},o.prototype.abort=function(){},URL.createObjectURL=function(t){return t instanceof h?"data:"+t.type+";base64,"+n(t._buffer):p.call(URL,t)},URL.revokeObjectURL=function(t){d&&d.call(URL,t)};var c=f.XMLHttpRequest&&f.XMLHttpRequest.prototype.send;c&&(XMLHttpRequest.prototype.send=function(t){t instanceof h?(this.setRequestHeader("Content-Type",t.type),c.call(this,e(t._buffer))):c.call(this,t)}),f.FileReader=o,f.File=i,f.Blob=h}()}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());var ht,ut,ct,ft,pt,dt,gt,mt,yt,vt,wt,bt,xt,Nt,Lt,le=le||function(s){if(!(void 0===s||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=s.document,l=function(){return s.URL||s.webkitURL||s},h=t.createElementNS("http://www.w3.org/1999/xhtml","a"),u="download"in h,c=/constructor/i.test(s.HTMLElement)||s.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),p=s.setImmediate||s.setTimeout,d=function(t){p(function(){throw t},0)},g=function(t){setTimeout(function(){"string"==typeof t?l().revokeObjectURL(t):t.remove()},4e4)},m=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},r=function(t,n,e){e||(t=m(t));var r,i=this,o="application/octet-stream"===t.type,a=function(){!function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(t){d(t)}}}(i,"writestart progress write writeend".split(" "))};if(i.readyState=i.INIT,u)return r=l().createObjectURL(t),void p(function(){var t,e;h.href=r,h.download=n,t=h,e=new MouseEvent("click"),t.dispatchEvent(e),a(),g(r),i.readyState=i.DONE},0);!function(){if((f||o&&c)&&s.FileReader){var e=new FileReader;return e.onloadend=function(){var t=f?e.result:e.result.replace(/^data:[^;]*;/,"data:attachment/file;");s.open(t,"_blank")||(s.location.href=t),t=void 0,i.readyState=i.DONE,a()},e.readAsDataURL(t),i.readyState=i.INIT}r||(r=l().createObjectURL(t)),o?s.location.href=r:s.open(r,"_blank")||(s.location.href=r);i.readyState=i.DONE,a(),g(r)}()},e=r.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download",n||(t=m(t)),navigator.msSaveOrOpenBlob(t,e)}:(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,function(t,e,n){return new r(t,e||t.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0);function At(x){var t=0;if(71!==x[t++]||73!==x[t++]||70!==x[t++]||56!==x[t++]||56!=(x[t++]+1&253)||97!==x[t++])throw"Invalid GIF 87a/89a header.";var N=x[t++]|x[t++]<<8,e=x[t++]|x[t++]<<8,n=x[t++],r=n>>7,i=1<<(7&n)+1;x[t++];x[t++];var o=null;r&&(o=t,t+=3*i);var a=!0,s=[],l=0,h=null,u=0,c=null;for(this.width=N,this.height=e;a&&t<x.length;)switch(x[t++]){case 33:switch(x[t++]){case 255:if(11!==x[t]||78==x[t+1]&&69==x[t+2]&&84==x[t+3]&&83==x[t+4]&&67==x[t+5]&&65==x[t+6]&&80==x[t+7]&&69==x[t+8]&&50==x[t+9]&&46==x[t+10]&&48==x[t+11]&&3==x[t+12]&&1==x[t+13]&&0==x[t+16])t+=14,c=x[t++]|x[t++]<<8,t++;else for(t+=12;;){if(0===(A=x[t++]))break;t+=A}break;case 249:if(4!==x[t++]||0!==x[t+4])throw"Invalid graphics extension block.";var f=x[t++];l=x[t++]|x[t++]<<8,h=x[t++],0==(1&f)&&(h=null),u=f>>2&7,t++;break;case 254:for(;;){if(0===(A=x[t++]))break;t+=A}break;default:throw"Unknown graphic control label: 0x"+x[t-1].toString(16)}break;case 44:var p=x[t++]|x[t++]<<8,d=x[t++]|x[t++]<<8,g=x[t++]|x[t++]<<8,m=x[t++]|x[t++]<<8,y=x[t++],v=y>>6&1,w=o,b=!1;if(y>>7){b=!0;w=t,t+=3*(1<<(7&y)+1)}var L=t;for(t++;;){var A;if(0===(A=x[t++]))break;t+=A}s.push({x:p,y:d,width:g,height:m,has_local_palette:b,palette_offset:w,data_offset:L,data_length:t-L,transparent_index:h,interlaced:!!v,delay:l,disposal:u});break;case 59:a=!1;break;default:throw"Unknown gif block: 0x"+x[t-1].toString(16)}this.numFrames=function(){return s.length},this.loopCount=function(){return c},this.frameInfo=function(t){if(t<0||t>=s.length)throw"Frame index out of range.";return s[t]},this.decodeAndBlitFrameBGRA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);St(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,l=N-s,h=s,u=4*(n.y*N+n.x),c=4*((n.y+n.height)*N+n.x),f=u,p=4*l;!0===n.interlaced&&(p+=4*(s+l)*7);for(var d=8,g=0,m=i.length;g<m;++g){var y=i[g];if(0===h&&(h=s,c<=(f+=p)&&(p=l+4*(s+l)*(d-1),f=u+(s+l)*(d<<1),d>>=1)),y===a)f+=4;else{var v=x[o+3*y],w=x[o+3*y+1],b=x[o+3*y+2];e[f++]=b,e[f++]=w,e[f++]=v,e[f++]=255}--h}},this.decodeAndBlitFrameRGBA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);St(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,l=N-s,h=s,u=4*(n.y*N+n.x),c=4*((n.y+n.height)*N+n.x),f=u,p=4*l;!0===n.interlaced&&(p+=4*(s+l)*7);for(var d=8,g=0,m=i.length;g<m;++g){var y=i[g];if(0===h&&(h=s,c<=(f+=p)&&(p=l+4*(s+l)*(d-1),f=u+(s+l)*(d<<1),d>>=1)),y===a)f+=4;else{var v=x[o+3*y],w=x[o+3*y+1],b=x[o+3*y+2];e[f++]=v,e[f++]=w,e[f++]=b,e[f++]=255}--h}}}function St(t,e,n,r){for(var i=t[e++],o=1<<i,a=o+1,s=a+1,l=i+1,h=(1<<l)-1,u=0,c=0,f=0,p=t[e++],d=new Int32Array(4096),g=null;;){for(;u<16&&0!==p;)c|=t[e++]<<u,u+=8,1===p?p=t[e++]:--p;if(u<l)break;var m=c&h;if(c>>=l,u-=l,m!==o){if(m===a)break;for(var y=m<s?m:g,v=0,w=y;o<w;)w=d[w]>>8,++v;var b=w;if(r<f+v+(y!==m?1:0))return void console.log("Warning, gif stream longer than expected.");n[f++]=b;var x=f+=v;for(y!==m&&(n[f++]=b),w=y;v--;)w=d[w],n[--x]=255&w,w>>=8;null!==g&&s<4096&&(d[s++]=g<<8|b,h+1<=s&&l<12&&(++l,h=h<<1|1)),g=m}else s=a+1,h=(1<<(l=i+1))-1,g=null}return f!==r&&console.log("Warning, gif stream shorter than expected."),n}try{exports.GifWriter=function(y,t,e,n){var v=0,r=void 0===(n=void 0===n?{}:n).loop?null:n.loop,w=void 0===n.palette?null:n.palette;if(t<=0||e<=0||65535<t||65535<e)throw"Width/Height invalid.";function b(t){var e=t.length;if(e<2||256<e||e&e-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return e}y[v++]=71,y[v++]=73,y[v++]=70,y[v++]=56,y[v++]=57,y[v++]=97;var i=0,o=0;if(null!==w){for(var a=b(w);a>>=1;)++i;if(a=1<<i,--i,void 0!==n.background){if(a<=(o=n.background))throw"Background index out of range.";if(0===o)throw"Background index explicitly passed as 0."}}if(y[v++]=255&t,y[v++]=t>>8&255,y[v++]=255&e,y[v++]=e>>8&255,y[v++]=(null!==w?128:0)|i,y[v++]=o,y[v++]=0,null!==w)for(var s=0,l=w.length;s<l;++s){var h=w[s];y[v++]=h>>16&255,y[v++]=h>>8&255,y[v++]=255&h}if(null!==r){if(r<0||65535<r)throw"Loop count invalid.";y[v++]=33,y[v++]=255,y[v++]=11,y[v++]=78,y[v++]=69,y[v++]=84,y[v++]=83,y[v++]=67,y[v++]=65,y[v++]=80,y[v++]=69,y[v++]=50,y[v++]=46,y[v++]=48,y[v++]=3,y[v++]=1,y[v++]=255&r,y[v++]=r>>8&255,y[v++]=0}var x=!1;this.addFrame=function(t,e,n,r,i,o){if(!0===x&&(--v,x=!1),o=void 0===o?{}:o,t<0||e<0||65535<t||65535<e)throw"x/y invalid.";if(n<=0||r<=0||65535<n||65535<r)throw"Width/Height invalid.";if(i.length<n*r)throw"Not enough pixels for the frame size.";var a=!0,s=o.palette;if(null==s&&(a=!1,s=w),null==s)throw"Must supply either a local or global palette.";for(var l=b(s),h=0;l>>=1;)++h;l=1<<h;var u=void 0===o.delay?0:o.delay,c=void 0===o.disposal?0:o.disposal;if(c<0||3<c)throw"Disposal out of range.";var f=!1,p=0;if(void 0!==o.transparent&&null!==o.transparent&&(f=!0,(p=o.transparent)<0||l<=p))throw"Transparent color index.";if((0!==c||f||0!==u)&&(y[v++]=33,y[v++]=249,y[v++]=4,y[v++]=c<<2|(!0===f?1:0),y[v++]=255&u,y[v++]=u>>8&255,y[v++]=p,y[v++]=0),y[v++]=44,y[v++]=255&t,y[v++]=t>>8&255,y[v++]=255&e,y[v++]=e>>8&255,y[v++]=255&n,y[v++]=n>>8&255,y[v++]=255&r,y[v++]=r>>8&255,y[v++]=!0===a?128|h-1:0,!0===a)for(var d=0,g=s.length;d<g;++d){var m=s[d];y[v++]=m>>16&255,y[v++]=m>>8&255,y[v++]=255&m}v=function(e,n,t,r){e[n++]=t;var i=n++,o=1<<t,a=o-1,s=o+1,l=s+1,h=t+1,u=0,c=0;function f(t){for(;t<=u;)e[n++]=255&c,c>>=8,u-=8,n===i+256&&(e[i]=255,i=n++)}function p(t){c|=t<<u,u+=h,f(8)}var d=r[0]&a,g={};p(o);for(var m=1,y=r.length;m<y;++m){var v=r[m]&a,w=d<<8|v,b=g[w];if(void 0===b){for(c|=d<<u,u+=h;8<=u;)e[n++]=255&c,c>>=8,u-=8,n===i+256&&(e[i]=255,i=n++);4096===l?(p(o),l=s+1,h=t+1,g={}):(1<<h<=l&&++h,g[w]=l++),d=v}else d=b}return p(d),p(s),f(1),i+1===n?e[i]=0:(e[i]=n-i-1,e[n++]=0),n}(y,v,h<2?2:h,i)},this.end=function(){return!1===x&&(y[v++]=59,x=!0),v}},exports.GifReader=At}catch(t){}
203
+/*
204
+    Copyright (c) 2008, Adobe Systems Incorporated
205
+    All rights reserved.
206
+
207
+    Redistribution and use in source and binary forms, with or without 
208
+    modification, are permitted provided that the following conditions are
209
+    met:
210
+
211
+    * Redistributions of source code must retain the above copyright notice, 
212
+      this list of conditions and the following disclaimer.
213
+    
214
+    * Redistributions in binary form must reproduce the above copyright
215
+      notice, this list of conditions and the following disclaimer in the 
216
+      documentation and/or other materials provided with the distribution.
217
+    
218
+    * Neither the name of Adobe Systems Incorporated nor the names of its 
219
+      contributors may be used to endorse or promote products derived from 
220
+      this software without specific prior written permission.
221
+
222
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
223
+    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
224
+    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
225
+    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
226
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
227
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
228
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
229
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
230
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
231
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
232
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
233
+  */
234
+function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName="_encode_";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}function Ft(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}window.tmp=At,lt.API.adler32cs=(dt="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array,gt=null,mt=function(){if(!dt)return function(){return!1};try{var t={};"function"==typeof t.Buffer&&(gt=t.Buffer)}catch(t){}return function(t){return t instanceof ArrayBuffer||null!==gt&&t instanceof gt}}(),yt=null!==gt?function(t){return new gt(t,"utf8").toString("binary")}:function(t){return unescape(encodeURIComponent(t))},vt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+(255&e.charCodeAt(i)))%65521,r=(r+n)%65521;return(r<<16|n)>>>0},wt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+e[i])%65521,r=(r+n)%65521;return(r<<16|n)>>>0},xt=(bt={}).Adler32=(((pt=(ft=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0}).prototype={}).constructor=ft).from=((ht=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=vt(1,t.toString())}).prototype=pt,ht),ft.fromUtf8=((ut=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var e=yt(t.toString());this.checksum=vt(1,e)}).prototype=pt,ut),dt&&(ft.fromBuffer=((ct=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(!mt(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=wt(1,e)}).prototype=pt,ct)),pt.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=vt(this.checksum,t)},pt.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=yt(t.toString());return this.checksum=vt(this.checksum,e)},dt&&(pt.updateBuffer=function(t){if(!mt(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=wt(this.checksum,e)}),pt.clone=function(){return new xt(this.checksum)},ft),bt.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return vt(1,t.toString())},bt.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=yt(t.toString());return vt(1,e)},dt&&(bt.fromBuffer=function(t){if(!mt(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return wt(1,e)}),bt),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var d,g,c,f,i,o,a,s=e,m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],y=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},l={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},h=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],u=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),w=!1,b=0;this.__bidiEngine__={};var x=function(t){var e=t.charCodeAt(),n=e>>8,r=l[n];return void 0!==r?s[256*r+(255&e)]:252===n||253===n?"AL":u.test(n)?"L":8===n?"R":"N"},p=function(t){for(var e,n=0;n<t.length;n++){if("L"===(e=x(t.charAt(n))))return!1;if("R"===e)return!0}return!1},N=function(t,e,n,r){var i,o,a,s,l=e[r];switch(l){case"L":case"R":w=!1;break;case"N":case"AN":break;case"EN":w&&(l="AN");break;case"AL":w=!0,l="R";break;case"WS":l="N";break;case"CS":r<1||r+1>=e.length||"EN"!==(i=n[r-1])&&"AN"!==i||"EN"!==(o=e[r+1])&&"AN"!==o?l="N":w&&(o="AN"),l=o===i?o:"N";break;case"ES":l="EN"===(i=0<r?n[r-1]:"B")&&r+1<e.length&&"EN"===e[r+1]?"EN":"N";break;case"ET":if(0<r&&"EN"===n[r-1]){l="EN";break}if(w){l="N";break}for(a=r+1,s=e.length;a<s&&"ET"===e[a];)a++;l=a<s&&"EN"===e[a]?"EN":"N";break;case"NSM":if(c&&!f){for(s=e.length,a=r+1;a<s&&"NSM"===e[a];)a++;if(a<s){var h=t[r],u=1425<=h&&h<=2303||64286===h;if(i=e[a],u&&("R"===i||"AL"===i)){l="R";break}}}l=r<1||"B"===(i=e[r-1])?"N":n[r-1];break;case"B":d=!(w=!1),l=b;break;case"S":g=!0,l="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":w=!1;break;case"BN":l="N"}return l},L=function(t,e,n){var r=t.split("");return n&&A(r,n,{hiLevel:b}),r.reverse(),e&&e.reverse(),r.join("")},A=function(t,e,n){var r,i,o,a,s,l=-1,h=t.length,u=0,c=[],f=b?y:m,p=[];for(g=d=w=!1,i=0;i<h;i++)p[i]=x(t[i]);for(o=0;o<h;o++){if(s=u,c[o]=N(t,p,c,o),r=240&(u=f[s][v[c[o]]]),u&=15,e[o]=a=f[u][5],0<r)if(16===r){for(i=l;i<o;i++)e[i]=1;l=-1}else l=-1;if(f[u][6])-1===l&&(l=o);else if(-1<l){for(i=l;i<o;i++)e[i]=a;l=-1}"B"===p[o]&&(e[o]=0),n.hiLevel|=a}g&&function(t,e,n){for(var r=0;r<n;r++)if("S"===t[r]){e[r]=b;for(var i=r-1;0<=i&&"WS"===t[i];i--)e[i]=b}}(p,e,h)},S=function(t,e,n,r,i){if(!(i.hiLevel<t)){if(1===t&&1===b&&!d)return e.reverse(),void(n&&n.reverse());for(var o,a,s,l,h=e.length,u=0;u<h;){if(r[u]>=t){for(s=u+1;s<h&&r[s]>=t;)s++;for(l=u,a=s-1;l<a;l++,a--)o=e[l],e[l]=e[a],e[a]=o,n&&(o=n[l],n[l]=n[a],n[a]=o);u=s}u++}}},_=function(t,e,n){var r=t.split(""),i={hiLevel:b};return n||(n=[]),A(r,n,i),function(t,e,n){if(0!==n.hiLevel&&a)for(var r,i=0;i<t.length;i++)1===e[i]&&0<=(r=h.indexOf(t[i]))&&(t[i]=h[r+1])}(r,n,i),S(2,r,e,n,i),S(1,r,e,n,i),r.join("")};return this.__bidiEngine__.doBidiReorder=function(t,e,n){if(function(t,e){if(e)for(var n=0;n<t.length;n++)e[n]=n;void 0===f&&(f=p(t)),void 0===o&&(o=p(t))}(t,e),c||!i||o)if(c&&i&&f^o)b=f?1:0,t=L(t,e,n);else if(!c&&i&&o)b=f?1:0,t=_(t,e,n),t=L(t,e);else if(!c||f||i||o){if(c&&!i&&f^o)t=L(t,e),t=f?(b=0,_(t,e,n)):(b=1,t=_(t,e,n),L(t,e));else if(c&&f&&!i&&o)b=1,t=_(t,e,n),t=L(t,e);else if(!c&&!i&&f^o){var r=a;f?(b=1,t=_(t,e,n),b=0,a=!1,t=_(t,e,n),a=r):(b=0,t=_(t,e,n),t=L(t,e),a=!(b=1),t=_(t,e,n),a=r,t=L(t,e))}}else b=0,t=_(t,e,n);else b=f?1:0,t=_(t,e,n);return t},this.__bidiEngine__.setOptions=function(t){t&&(c=t.isInputVisual,i=t.isOutputVisual,f=t.isInputRtl,o=t.isOutputRtl,a=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],o=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var e=t.text,n=(t.x,t.y,t.options||{}),r=(t.mutex,n.lang,[]);if("[object Array]"===Object.prototype.toString.call(e)){var i=0;for(r=[],i=0;i<e.length;i+=1)"[object Array]"===Object.prototype.toString.call(e[i])?r.push([o.doBidiReorder(e[i][0]),e[i][1],e[i][2]]):r.push([o.doBidiReorder(e[i])]);t.text=r}else t.text=o.doBidiReorder(e)}])}(lt),window.tmp=_t,Ft.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Ft.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(t){console.log("bit decode error:"+t)}},Ft.prototype.bit1=function(){var t=Math.ceil(this.width/8),e=t%4,n=0<=this.height?this.height-1:-this.height;for(n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var l=this.palette[o>>7-s&1];this.data[a+4*s]=l.blue,this.data[a+4*s+1]=l.green,this.data[a+4*s+2]=l.red,this.data[a+4*s+3]=255}0!=e&&(this.pos+=4-e)}},Ft.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,s=o>>4,l=15&o,h=this.palette[s];if(this.data[a]=h.blue,this.data[a+1]=h.green,this.data[a+2]=h.red,this.data[a+3]=255,2*i+1>=this.width)break;h=this.palette[l],this.data[a+4]=h.blue,this.data[a+4+1]=h.green,this.data[a+4+2]=h.red,this.data[a+4+3]=255}0!=e&&(this.pos+=4-e)}},Ft.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;0<=e;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[o]=a.red,this.data[o+1]=a.green,this.data[o+2]=a.blue,this.data[o+3]=255}else this.data[o]=255,this.data[o+1]=255,this.data[o+2]=255,this.data[o+3]=255}0!=t&&(this.pos+=4-t)}},Ft.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&e)/e*255|0,s=(o>>5&e)/e*255|0,l=(o>>10&e)/e*255|0,h=o>>15?255:0,u=r*this.width*4+4*i;this.data[u]=l,this.data[u+1]=s,this.data[u+2]=a,this.data[u+3]=h}this.pos+=t}},Ft.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var i=this.bottom_up?r:this.height-1-r,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&e)/e*255|0,l=(a>>5&n)/n*255|0,h=(a>>11)/e*255|0,u=i*this.width*4+4*o;this.data[u]=h,this.data[u+1]=l,this.data[u+2]=s,this.data[u+3]=255}this.pos+=t}},Ft.prototype.bit24=function(){for(var t=this.height-1;0<=t;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*n;this.data[a]=o,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},Ft.prototype.bit32=function(){for(var t=this.height-1;0<=t;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=o,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=a}},Ft.prototype.getData=function(){return this.data},window.tmp=Ft,
235
+/*
236
+   Copyright (c) 2013 Gildas Lormeau. All rights reserved.
237
+
238
+   Redistribution and use in source and binary forms, with or without
239
+   modification, are permitted provided that the following conditions are met:
240
+
241
+   1. Redistributions of source code must retain the above copyright notice,
242
+   this list of conditions and the following disclaimer.
243
+
244
+   2. Redistributions in binary form must reproduce the above copyright 
245
+   notice, this list of conditions and the following disclaimer in 
246
+   the documentation and/or other materials provided with the distribution.
247
+
248
+   3. The names of the authors may not be used to endorse or promote products
249
+   derived from this software without specific prior written permission.
250
+
251
+   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
252
+   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
253
+   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
254
+   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
255
+   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
256
+   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
257
+   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
258
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
259
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
260
+   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
261
+   */
262
+function(t){var d=15,g=573,e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ct(){var p=this;function l(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}p.build_tree=function(t){var e,n,r,i=p.dyn_tree,o=p.stat_desc.static_tree,a=p.stat_desc.elems,s=-1;for(t.heap_len=0,t.heap_max=g,e=0;e<a;e++)0!==i[2*e]?(t.heap[++t.heap_len]=s=e,t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=s<2?++s:0)]=1,t.depth[r]=0,t.opt_len--,o&&(t.static_len-=o[2*r+1]);for(p.max_code=s,e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(r=a;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(i,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,i[2*r]=i[2*e]+i[2*n],t.depth[r]=Math.max(t.depth[e],t.depth[n])+1,i[2*e+1]=i[2*n+1]=r,t.heap[1]=r++,t.pqdownheap(i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){var e,n,r,i,o,a,s=p.dyn_tree,l=p.stat_desc.static_tree,h=p.stat_desc.extra_bits,u=p.stat_desc.extra_base,c=p.stat_desc.max_length,f=0;for(i=0;i<=d;i++)t.bl_count[i]=0;for(s[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<g;e++)c<(i=s[2*s[2*(n=t.heap[e])+1]+1]+1)&&(i=c,f++),s[2*n+1]=i,n>p.max_code||(t.bl_count[i]++,o=0,u<=n&&(o=h[n-u]),a=s[2*n],t.opt_len+=a*(i+o),l&&(t.static_len+=a*(l[2*n+1]+o)));if(0!==f){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,f-=2}while(0<f);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--e])>p.max_code||(s[2*r+1]!=i&&(t.opt_len+=(i-s[2*r+1])*s[2*r],s[2*r+1]=i),n--)}}(t),function(t,e,n){var r,i,o,a=[],s=0;for(r=1;r<=d;r++)a[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=l(a[o]++,o))}(i,p.max_code,t.bl_count)}}function ft(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i}ct._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],ct.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],ct.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],ct.d_code=function(t){return t<256?e[t]:e[256+(t>>>7)]},ct.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ct.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ct.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ct.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],ft.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],ft.static_l_desc=new ft(ft.static_ltree,ct.extra_lbits,257,286,d),ft.static_d_desc=new ft(ft.static_dtree,ct.extra_dbits,0,30,d),ft.static_bl_desc=new ft(null,ct.extra_blbits,0,19,7);function n(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}var pt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],dt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function gt(t,e,n,r){var i=t[2*e],o=t[2*n];return i<o||i==o&&r[e]<=r[n]}function r(){var l,h,u,c,f,p,d,g,i,m,y,v,w,a,b,x,N,L,A,S,_,F,P,k,I,C,B,j,E,M,s,O,q,T,R,D,U,o,z,H,W,V=this,G=new ct,Y=new ct,J=new ct;function X(){var t;for(t=0;t<286;t++)s[2*t]=0;for(t=0;t<30;t++)O[2*t]=0;for(t=0;t<19;t++)q[2*t]=0;s[512]=1,V.opt_len=V.static_len=0,D=o=0}function K(t,e){var n,r,i=-1,o=t[1],a=0,s=7,l=4;for(0===o&&(s=138,l=3),t[2*(e+1)+1]=65535,n=0;n<=e;n++)r=o,o=t[2*(n+1)+1],++a<s&&r==o||(a<l?q[2*r]+=a:0!==r?(r!=i&&q[2*r]++,q[32]++):a<=10?q[34]++:q[36]++,i=r,l=(a=0)===o?(s=138,3):r==o?(s=6,3):(s=7,4))}function Z(t){V.pending_buf[V.pending++]=t}function Q(t){Z(255&t),Z(t>>>8&255)}function $(t,e){var n,r=e;16-r<W?(Q(H|=(n=t)<<W&65535),H=n>>>16-W,W+=r-16):(H|=t<<W&65535,W+=r)}function tt(t,e){var n=2*t;$(65535&e[n],65535&e[n+1])}function et(t,e){var n,r,i=-1,o=t[1],a=0,s=7,l=4;for(0===o&&(s=138,l=3),n=0;n<=e;n++)if(r=o,o=t[2*(n+1)+1],!(++a<s&&r==o)){if(a<l)for(;tt(r,q),0!=--a;);else 0!==r?(r!=i&&(tt(r,q),a--),tt(16,q),$(a-3,2)):a<=10?(tt(17,q),$(a-3,3)):(tt(18,q),$(a-11,7));i=r,l=(a=0)===o?(s=138,3):r==o?(s=6,3):(s=7,4)}}function nt(){16==W?(Q(H),W=H=0):8<=W&&(Z(255&H),H>>>=8,W-=8)}function rt(t,e){var n,r,i;if(V.pending_buf[U+2*D]=t>>>8&255,V.pending_buf[U+2*D+1]=255&t,V.pending_buf[T+D]=255&e,D++,0===t?s[2*e]++:(o++,t--,s[2*(ct._length_code[e]+256+1)]++,O[2*ct.d_code(t)]++),0==(8191&D)&&2<B){for(n=8*D,r=_-N,i=0;i<30;i++)n+=O[2*i]*(5+ct.extra_dbits[i]);if(n>>>=3,o<Math.floor(D/2)&&n<Math.floor(r/2))return!0}return D==R-1}function it(t,e){var n,r,i,o,a=0;if(0!==D)for(;n=V.pending_buf[U+2*a]<<8&65280|255&V.pending_buf[U+2*a+1],r=255&V.pending_buf[T+a],a++,0===n?tt(r,t):(tt((i=ct._length_code[r])+256+1,t),0!==(o=ct.extra_lbits[i])&&$(r-=ct.base_length[i],o),tt(i=ct.d_code(--n),e),0!==(o=ct.extra_dbits[i])&&$(n-=ct.base_dist[i],o)),a<D;);tt(256,t),z=t[513]}function ot(){8<W?Q(H):0<W&&Z(255&H),W=H=0}function at(t,e,n){var r,i,o;$(0+(n?1:0),3),r=t,i=e,o=!0,ot(),z=8,o&&(Q(i),Q(~i)),V.pending_buf.set(g.subarray(r,r+i),V.pending),V.pending+=i}function e(t,e,n){var r,i,o=0;0<B?(G.build_tree(V),Y.build_tree(V),o=function(){var t;for(K(s,G.max_code),K(O,Y.max_code),J.build_tree(V),t=18;3<=t&&0===q[2*ct.bl_order[t]+1];t--);return V.opt_len+=3*(t+1)+5+5+4,t}(),r=V.opt_len+3+7>>>3,(i=V.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5,e+4<=r&&-1!=t?at(t,e,n):i==r?($(2+(n?1:0),3),it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3),function(t,e,n){var r;for($(t-257,5),$(e-1,5),$(n-4,4),r=0;r<n;r++)$(q[2*ct.bl_order[r]+1],3);et(s,t-1),et(O,e-1)}(G.max_code+1,Y.max_code+1,o+1),it(s,O)),X(),n&&ot()}function st(t){e(0<=N?N:-1,_-N,t),N=_,l.flush_pending()}function lt(){var t,e,n,r;do{if(0===(r=i-P-_)&&0===_&&0===P)r=f;else if(-1==r)r--;else if(f+f-262<=_){for(g.set(g.subarray(f,f+f),0),F-=f,_-=f,N-=f,n=t=w;e=65535&y[--n],y[n]=f<=e?e-f:0,0!=--t;);for(n=t=f;e=65535&m[--n],m[n]=f<=e?e-f:0,0!=--t;);r+=f}if(0===l.avail_in)return;t=l.read_buf(g,_+P,r),3<=(P+=t)&&(v=((v=255&g[_])<<x^255&g[_+1])&b)}while(P<262&&0!==l.avail_in)}function ht(t){var e,n,r=I,i=_,o=k,a=f-262<_?_-(f-262):0,s=M,l=d,h=_+258,u=g[i+o-1],c=g[i+o];E<=k&&(r>>=2),P<s&&(s=P);do{if(g[(e=t)+o]==c&&g[e+o-1]==u&&g[e]==g[i]&&g[++e]==g[i+1]){i+=2,e++;do{}while(g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&i<h);if(n=258-(h-i),i=h-258,o<n){if(F=t,s<=(o=n))break;u=g[i+o-1],c=g[i+o]}}}while((t=65535&m[t&l])>a&&0!=--r);return o<=P?o:P}function ut(t){return t.total_in=t.total_out=0,t.msg=null,V.pending=0,V.pending_out=0,h=113,c=0,G.dyn_tree=s,G.stat_desc=ft.static_l_desc,Y.dyn_tree=O,Y.stat_desc=ft.static_d_desc,J.dyn_tree=q,J.stat_desc=ft.static_bl_desc,W=H=0,z=8,X(),function(){var t;for(i=2*f,t=y[w-1]=0;t<w-1;t++)y[t]=0;C=pt[B].max_lazy,E=pt[B].good_length,M=pt[B].nice_length,I=pt[B].max_chain,L=k=2,v=S=P=N=_=0}(),0}V.depth=[],V.bl_count=[],V.heap=[],s=[],O=[],q=[],V.pqdownheap=function(t,e){for(var n=V.heap,r=n[e],i=e<<1;i<=V.heap_len&&(i<V.heap_len&&gt(t,n[i+1],n[i],V.depth)&&i++,!gt(t,r,n[i],V.depth));)n[e]=n[i],e=i,i<<=1;n[e]=r},V.deflateInit=function(t,e,n,r,i,o){return r||(r=8),i||(i=8),o||(o=0),t.msg=null,-1==e&&(e=6),i<1||9<i||8!=r||n<9||15<n||e<0||9<e||o<0||2<o?-2:(t.dstate=V,d=(f=1<<(p=n))-1,b=(w=1<<(a=i+7))-1,x=Math.floor((a+3-1)/3),g=new Uint8Array(2*f),m=[],y=[],R=1<<i+6,V.pending_buf=new Uint8Array(4*R),u=4*R,U=Math.floor(R/2),T=3*R,B=e,j=o,ut(t))},V.deflateEnd=function(){return 42!=h&&113!=h&&666!=h?-2:(V.pending_buf=null,g=m=y=null,V.dstate=null,113==h?-3:0)},V.deflateParams=function(t,e,n){var r=0;return-1==e&&(e=6),e<0||9<e||n<0||2<n?-2:(pt[B].func!=pt[e].func&&0!==t.total_in&&(r=t.deflate(1)),B!=e&&(C=pt[B=e].max_lazy,E=pt[B].good_length,M=pt[B].nice_length,I=pt[B].max_chain),j=n,r)},V.deflateSetDictionary=function(t,e,n){var r,i=n,o=0;if(!e||42!=h)return-2;if(i<3)return 0;for(f-262<i&&(o=n-(i=f-262)),g.set(e.subarray(o,o+i),0),N=_=i,v=((v=255&g[0])<<x^255&g[1])&b,r=0;r<=i-3;r++)v=(v<<x^255&g[r+2])&b,m[r&d]=y[v],y[v]=r;return 0},V.deflate=function(t,e){var n,r,i,o,a,s;if(4<e||e<0)return-2;if(!t.next_out||!t.next_in&&0!==t.avail_in||666==h&&4!=e)return t.msg=dt[4],-2;if(0===t.avail_out)return t.msg=dt[7],-5;if(l=t,o=c,c=e,42==h&&(r=8+(p-8<<4)<<8,3<(i=(B-1&255)>>1)&&(i=3),r|=i<<6,0!==_&&(r|=32),h=113,Z((s=r+=31-r%31)>>8&255),Z(255&s)),0!==V.pending){if(l.flush_pending(),0===l.avail_out)return c=-1,0}else if(0===l.avail_in&&e<=o&&4!=e)return l.msg=dt[7],-5;if(666==h&&0!==l.avail_in)return t.msg=dt[7],-5;if(0!==l.avail_in||0!==P||0!=e&&666!=h){switch(a=-1,pt[B].func){case 0:a=function(t){var e,n=65535;for(u-5<n&&(n=u-5);;){if(P<=1){if(lt(),0===P&&0==t)return 0;if(0===P)break}if(_+=P,e=N+n,((P=0)===_||e<=_)&&(P=_-e,_=e,st(!1),0===l.avail_out))return 0;if(f-262<=_-N&&(st(!1),0===l.avail_out))return 0}return st(4==t),0===l.avail_out?4==t?2:0:4==t?3:1}(e);break;case 1:a=function(t){for(var e,n=0;;){if(P<262){if(lt(),P<262&&0==t)return 0;if(0===P)break}if(3<=P&&(v=(v<<x^255&g[_+2])&b,n=65535&y[v],m[_&d]=y[v],y[v]=_),0!==n&&(_-n&65535)<=f-262&&2!=j&&(L=ht(n)),3<=L)if(e=rt(_-F,L-3),P-=L,L<=C&&3<=P){for(L--;v=(v<<x^255&g[++_+2])&b,n=65535&y[v],m[_&d]=y[v],y[v]=_,0!=--L;);_++}else _+=L,L=0,v=((v=255&g[_])<<x^255&g[_+1])&b;else e=rt(0,255&g[_]),P--,_++;if(e&&(st(!1),0===l.avail_out))return 0}return st(4==t),0===l.avail_out?4==t?2:0:4==t?3:1}(e);break;case 2:a=function(t){for(var e,n,r=0;;){if(P<262){if(lt(),P<262&&0==t)return 0;if(0===P)break}if(3<=P&&(v=(v<<x^255&g[_+2])&b,r=65535&y[v],m[_&d]=y[v],y[v]=_),k=L,A=F,L=2,0!==r&&k<C&&(_-r&65535)<=f-262&&(2!=j&&(L=ht(r)),L<=5&&(1==j||3==L&&4096<_-F)&&(L=2)),3<=k&&L<=k){for(n=_+P-3,e=rt(_-1-A,k-3),P-=k-1,k-=2;++_<=n&&(v=(v<<x^255&g[_+2])&b,r=65535&y[v],m[_&d]=y[v],y[v]=_),0!=--k;);if(S=0,L=2,_++,e&&(st(!1),0===l.avail_out))return 0}else if(0!==S){if((e=rt(0,255&g[_-1]))&&st(!1),_++,P--,0===l.avail_out)return 0}else S=1,_++,P--}return 0!==S&&(e=rt(0,255&g[_-1]),S=0),st(4==t),0===l.avail_out?4==t?2:0:4==t?3:1}(e)}if(2!=a&&3!=a||(h=666),0==a||2==a)return 0===l.avail_out&&(c=-1),0;if(1==a){if(1==e)$(2,3),tt(256,ft.static_ltree),nt(),1+z+10-W<9&&($(2,3),tt(256,ft.static_ltree),nt()),z=7;else if(at(0,0,!1),3==e)for(n=0;n<w;n++)y[n]=0;if(l.flush_pending(),0===l.avail_out)return c=-1,0}}return 4!=e?0:1}}function i(){this.next_in_index=0,this.next_out_index=0,this.avail_in=0,this.total_in=0,this.avail_out=0,this.total_out=0}i.prototype={deflateInit:function(t,e){return this.dstate=new r,e||(e=d),this.dstate.deflateInit(this,t,e)},deflate:function(t){return this.dstate?this.dstate.deflate(this,t):-2},deflateEnd:function(){if(!this.dstate)return-2;var t=this.dstate.deflateEnd();return this.dstate=null,t},deflateParams:function(t,e){return this.dstate?this.dstate.deflateParams(this,t,e):-2},deflateSetDictionary:function(t,e){return this.dstate?this.dstate.deflateSetDictionary(this,t,e):-2},read_buf:function(t,e,n){var r=this.avail_in;return n<r&&(r=n),0===r?0:(this.avail_in-=r,t.set(this.next_in.subarray(this.next_in_index,this.next_in_index+r),e),this.next_in_index+=r,this.total_in+=r,r)},flush_pending:function(){var t=this,e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}};var o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var s=new i,l=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1),s.deflateInit(e),s.next_out=l,this.append=function(t,e){var n,r=[],i=0,o=0,a=0;if(t.length){s.next_in_index=0,s.next_in=t,s.avail_in=t.length;do{if(s.next_out_index=0,s.avail_out=512,0!=s.deflate(0))throw new Error("deflating: "+s.msg);s.next_out_index&&(512==s.next_out_index?r.push(new Uint8Array(l)):r.push(new Uint8Array(l.subarray(0,s.next_out_index)))),a+=s.next_out_index,e&&0<s.next_in_index&&s.next_in_index!=i&&(e(s.next_in_index),i=s.next_in_index)}while(0<s.avail_in||0===s.avail_out);return n=new Uint8Array(a),r.forEach(function(t){n.set(t,o),o+=t.length}),n}},this.flush=function(){var t,e,n=[],r=0,i=0;do{if(s.next_out_index=0,s.avail_out=512,1!=(t=s.deflate(4))&&0!=t)throw new Error("deflating: "+s.msg);0<512-s.avail_out&&n.push(new Uint8Array(l.subarray(0,s.next_out_index))),i+=s.next_out_index}while(0<s.avail_in||0===s.avail_out);return s.deflateEnd(),e=new Uint8Array(i),n.forEach(function(t){e.set(t,r),r+=t.length}),e}}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()),("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()).RGBColor=function(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var r in n)t==r&&(t=n[r]);for(var i=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],o=0;o<i.length;o++){var a=i[o].re,s=i[o].process,l=a.exec(t);l&&(e=s(l),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r,this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g,this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}},function(t){var n="+".charCodeAt(0),r="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),a="A".charCodeAt(0),s="-".charCodeAt(0),l="_".charCodeAt(0),u=function(t){var e=t.charCodeAt(0);return e===n||e===s?62:e===r||e===l?63:e<i?-1:e<i+10?e-i+26+26:e<a+26?e-a:e<o+26?e-o+26:void 0};t.API.TTFFont=function(){function i(t,e,n){var r;if(this.rawData=t,r=this.contents=new J(t),this.contents.pos=4,"ttcf"===r.readString(4)){if(!e)throw new Error("Must specify a font name for TTC files.");throw new Error("Font "+e+" not found in TTC file.")}r.pos=0,this.parse(),this.subset=new P(this),this.registerTTF()}return i.open=function(t,e,n,r){if("string"!=typeof n)throw new Error("Invalid argument supplied in TTFFont.open");return new i(function(t){var e,n,r,i,o,a;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var s=t.length;o="="===t.charAt(s-2)?2:"="===t.charAt(s-1)?1:0,a=new Uint8Array(3*t.length/4-o),r=0<o?t.length-4:t.length;var l=0;function h(t){a[l++]=t}for(n=e=0;e<r;e+=4,n+=3)h((16711680&(i=u(t.charAt(e))<<18|u(t.charAt(e+1))<<12|u(t.charAt(e+2))<<6|u(t.charAt(e+3))))>>16),h((65280&i)>>8),h(255&i);return 2===o?h(255&(i=u(t.charAt(e))<<2|u(t.charAt(e+1))>>4)):1===o&&(h((i=u(t.charAt(e))<<10|u(t.charAt(e+1))<<4|u(t.charAt(e+2))>>2)>>8&255),h(255&i)),a}(n),e,r)},i.prototype.parse=function(){return this.directory=new e(this.contents),this.head=new p(this),this.name=new b(this),this.cmap=new y(this),this.toUnicode=new Map,this.hhea=new g(this),this.maxp=new x(this),this.hmtx=new N(this),this.post=new v(this),this.os2=new m(this),this.loca=new F(this),this.glyf=new A(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.bbox).length;t<e;t++)i=n[t],r.push(Math.round(i*this.scaleFactor));return r}.call(this),this.stemV=0,this.post.exists?(e=255&(n=this.post.italic_angle),!0&(t=n>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+e)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},i.prototype.widthOfString=function(t,e,n){var r,i,o,a,s;for(i=a=o=0,s=(t=""+t).length;0<=s?a<s:s<a;i=0<=s?++a:--a)r=t.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/e)||0;return o*(e/1e3)},i.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1),n=e?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},i}();var h,J=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return 2147483648<=(t=this.readUInt32())?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n,r;for(n=[],e=r=0;0<=t?r<t:t<r;e=0<=t?++r:--r)n[e]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var e,n,r,i;for(i=[],e=n=0,r=t.length;0<=r?n<r:r<n;e=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(e)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,e,n,r,i,o,a,s;return t=this.readByte(),e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),o=this.readByte(),a=this.readByte(),s=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^e)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^o)+256*(255^a)+(255^s)+1):72057594037927940*t+281474976710656*e+1099511627776*n+4294967296*r+16777216*i+65536*o+256*a+s},t.prototype.writeLongLong=function(t){var e,n;return e=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n<t:t<n;0<=t?++n:--n)e.push(this.readByte());return e},t.prototype.write=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;n<r;n++)e=t[n],i.push(this.writeByte(e));return i},t}(),e=function(){var d;function t(t){var e,n,r;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:r<n;0<=r?++n:--n)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}return t.prototype.encode=function(t){var e,n,r,i,o,a,s,l,h,u,c,f,p;for(p in c=Object.keys(t).length,a=Math.log(2),h=16*Math.floor(Math.log(c)/a),i=Math.floor(h/a),l=16*c-h,(n=new J).writeInt(this.scalarType),n.writeShort(c),n.writeShort(h),n.writeShort(i),n.writeShort(l),r=16*c,s=n.pos+r,o=null,f=[],t)for(u=t[p],n.writeString(p),n.writeInt(d(u)),n.writeInt(s),n.writeInt(u.length),f=f.concat(u),"head"===p&&(o=s),s+=u.length;s%4;)f.push(0),s++;return n.write(f),e=2981146554-d(n.data),n.pos=o+8,n.writeUInt32(e),n.data},d=function(t){var e,n,r,i;for(t=L.call(t);t.length%4;)t.push(0);for(n=new J(t),r=e=0,i=t.length;r<i;r+=4)e+=n.readUInt32();return 4294967295&e},t}(),c={}.hasOwnProperty,f=function(t,e){for(var n in e)c.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};h=function(){function t(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var e;return(e=new J).writeInt(this.version),e.writeInt(this.revision),e.writeInt(this.checkSumAdjustment),e.writeInt(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.writeLongLong(this.created),e.writeLongLong(this.modified),e.writeShort(this.xMin),e.writeShort(this.yMin),e.writeShort(this.xMax),e.writeShort(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort(this.fontDirectionHint),e.writeShort(t),e.writeShort(this.glyphDataFormat),e.data},e}(),d=function(){function t(n,t){var e,r,i,o,a,s,l,h,u,c,f,p,d,g,m,y,v,w;switch(this.platformID=n.readUInt16(),this.encodingID=n.readShort(),this.offset=t+n.readInt(),u=n.pos,n.pos=this.offset,this.format=n.readUInt16(),this.length=n.readUInt16(),this.language=n.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(s=m=0;m<256;s=++m)this.codeMap[s]=n.readByte();break;case 4:for(f=n.readUInt16(),c=f/2,n.pos+=6,i=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),n.pos+=2,d=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),l=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),h=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),r=(this.length-n.pos+this.offset)/2,a=function(){var t,e;for(e=[],s=t=0;0<=r?t<r:r<t;s=0<=r?++t:--t)e.push(n.readUInt16());return e}(),s=y=0,w=i.length;y<w;s=++y)for(g=i[s],e=v=p=d[s];p<=g?v<=g:g<=v;e=p<=g?++v:--v)0===h[s]?o=e+l[s]:0!==(o=a[h[s]/2+(e-p)-(c-s)]||0)&&(o+=l[s]),this.codeMap[e]=65535&o}n.pos=u}return t.encode=function(t,e){var n,r,i,o,a,s,l,h,u,c,f,p,d,g,m,y,v,w,b,x,N,L,A,S,_,F,P,k,I,C,B,j,E,M,O,q,T,R,D,U,z,H,W,V,G,Y;switch(k=new J,o=Object.keys(t).sort(function(t,e){return t-e}),e){case"macroman":for(d=0,g=function(){var t,e;for(e=[],p=t=0;t<256;p=++t)e.push(0);return e}(),y={0:0},i={},I=0,E=o.length;I<E;I++)null==y[W=t[r=o[I]]]&&(y[W]=++d),i[r]={old:t[r],new:y[t[r]]},g[r]=y[t[r]];return k.writeUInt16(1),k.writeUInt16(0),k.writeUInt32(12),k.writeUInt16(0),k.writeUInt16(262),k.writeUInt16(0),k.write(g),{charMap:i,subtable:k.data,maxGlyphID:d+1};case"unicode":for(F=[],u=[],y={},n={},m=l=null,C=v=0,M=o.length;C<M;C++)null==y[b=t[r=o[C]]]&&(y[b]=++v),n[r]={old:b,new:y[b]},a=y[b]-r,null!=m&&a===l||(m&&u.push(m),F.push(r),l=a),m=r;for(m&&u.push(m),u.push(65535),F.push(65535),S=2*(A=F.length),L=2*Math.pow(Math.log(A)/Math.LN2,2),c=Math.log(L/2)/Math.LN2,N=2*A-L,s=[],x=[],f=[],p=B=0,O=F.length;B<O;p=++B){if(_=F[p],h=u[p],65535===_){s.push(0),x.push(0);break}if(32768<=_-(P=n[_].new))for(s.push(0),x.push(2*(f.length+A-p)),r=j=_;_<=h?j<=h:h<=j;r=_<=h?++j:--j)f.push(n[r].new);else s.push(P-_),x.push(0)}for(k.writeUInt16(3),k.writeUInt16(1),k.writeUInt32(12),k.writeUInt16(4),k.writeUInt16(16+8*A+2*f.length),k.writeUInt16(0),k.writeUInt16(S),k.writeUInt16(L),k.writeUInt16(c),k.writeUInt16(N),z=0,q=u.length;z<q;z++)r=u[z],k.writeUInt16(r);for(k.writeUInt16(0),H=0,T=F.length;H<T;H++)r=F[H],k.writeUInt16(r);for(V=0,R=s.length;V<R;V++)a=s[V],k.writeUInt16(a);for(G=0,D=x.length;G<D;G++)w=x[G],k.writeUInt16(w);for(Y=0,U=f.length;Y<U;Y++)d=f[Y],k.writeUInt16(d);return{charMap:n,subtable:k.data,maxGlyphID:v+1}}},t}(),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="cmap",e.prototype.parse=function(t){var e,n,r;for(t.pos=this.offset,this.version=t.readUInt16(),n=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=n?r<n:n<r;0<=n?++r:--r)e=new d(t,this.offset),this.tables.push(e),e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0},e.encode=function(t,e){var n,r;return null==e&&(e="macroman"),n=d.encode(t,e),(r=new J).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},e}(),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="OS/2",e.prototype.parse=function(n){if(n.pos=this.offset,this.version=n.readUInt16(),this.averageCharWidth=n.readShort(),this.weightClass=n.readUInt16(),this.widthClass=n.readUInt16(),this.type=n.readShort(),this.ySubscriptXSize=n.readShort(),this.ySubscriptYSize=n.readShort(),this.ySubscriptXOffset=n.readShort(),this.ySubscriptYOffset=n.readShort(),this.ySuperscriptXSize=n.readShort(),this.ySuperscriptYSize=n.readShort(),this.ySuperscriptXOffset=n.readShort(),this.ySuperscriptYOffset=n.readShort(),this.yStrikeoutSize=n.readShort(),this.yStrikeoutPosition=n.readShort(),this.familyClass=n.readShort(),this.panose=function(){var t,e;for(e=[],t=0;t<10;++t)e.push(n.readByte());return e}(),this.charRange=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(n.readInt());return e}(),this.vendorID=n.readString(4),this.selection=n.readShort(),this.firstCharIndex=n.readShort(),this.lastCharIndex=n.readShort(),0<this.version&&(this.ascent=n.readShort(),this.descent=n.readShort(),this.lineGap=n.readShort(),this.winAscent=n.readShort(),this.winDescent=n.readShort(),this.codePageRange=function(){var t,e;for(e=[],t=0;t<2;++t)e.push(n.readInt());return e}(),1<this.version))return this.xHeight=n.readShort(),this.capHeight=n.readShort(),this.defaultChar=n.readShort(),this.breakChar=n.readShort(),this.maxContext=n.readShort()},e}(),v=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="post",e.prototype.parse=function(r){var t,e,n,i;switch(r.pos=this.offset,this.format=r.readInt(),this.italicAngle=r.readInt(),this.underlinePosition=r.readShort(),this.underlineThickness=r.readShort(),this.isFixedPitch=r.readInt(),this.minMemType42=r.readInt(),this.maxMemType42=r.readInt(),this.minMemType1=r.readInt(),this.maxMemType1=r.readInt(),this.format){case 65536:break;case 131072:for(e=r.readUInt16(),this.glyphNameIndex=[],n=0;0<=e?n<e:e<n;0<=e?++n:--n)this.glyphNameIndex.push(r.readUInt16());for(this.names=[],i=[];r.pos<this.offset+this.length;)t=r.readByte(),i.push(this.names.push(r.readString(t)));return i;case 151552:return e=r.readUInt16(),this.offsets=r.read(e);case 196608:break;case 262144:return this.map=function(){var t,e,n;for(n=[],t=0,e=this.file.maxp.numGlyphs;0<=e?t<e:e<t;0<=e?++t:--t)n.push(r.readUInt32());return n}.call(this)}},e}(),w=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},b=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="name",e.prototype.parse=function(t){var e,n,r,i,o,a,s,l,h,u,c,f;for(t.pos=this.offset,t.readShort(),e=t.readShort(),a=t.readShort(),n=[],i=h=0;0<=e?h<e:e<h;i=0<=e?++h:--h)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+a+t.readShort()});for(s={},i=u=0,c=n.length;u<c;i=++u)r=n[i],t.pos=r.offset,l=t.readString(r.length),o=new w(l,r),null==s[f=r.nameID]&&(s[f]=[]),s[r.nameID].push(o);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(t){this.postscriptName=s[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},e}(),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(),N=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="hmtx",e.prototype.parse=function(n){var t,r,i,e,o,a,s;for(n.pos=this.offset,this.metrics=[],e=0,a=this.file.hhea.numberOfMetrics;0<=a?e<a:a<e;0<=a?++e:--e)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var t,e;for(e=[],t=0;0<=r?t<r:r<t;0<=r?++t:--t)e.push(n.readInt16());return e}(),this.widths=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.metrics).length;t<e;t++)i=n[t],r.push(i.advance);return r}.call(this),t=this.widths[this.widths.length-1],s=[],o=0;0<=r?o<r:r<o;0<=r?++o:--o)s.push(this.widths.push(t));return s},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),L=[].slice,A=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="glyf",e.prototype.parse=function(t){return this.cache={}},e.prototype.glyphFor=function(t){var e,n,r,i,o,a,s,l,h,u;return(t=t)in this.cache?this.cache[t]:(i=this.file.loca,e=this.file.contents,n=i.indexOf(t),0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n,o=(a=new J(e.read(r))).readShort(),l=a.readShort(),u=a.readShort(),s=a.readShort(),h=a.readShort(),this.cache[t]=-1===o?new _(a,l,u,s,h):new S(a,o,l,u,s,h),this.cache[t]))},e.prototype.encode=function(t,e,n){var r,i,o,a,s;for(o=[],i=[],a=0,s=e.length;a<s;a++)r=t[e[a]],i.push(o.length),r&&(o=o.concat(r.encode(n)));return i.push(o.length),{table:o,offsets:i}},e}(),S=function(){function t(t,e,n,r,i,o){this.raw=t,this.numberOfContours=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),_=function(){function t(t,e,n,r,i){var o,a;for(this.raw=t,this.xMin=e,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;a=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readShort()),32&a;)o.pos+=1&a?4:2,128&a?o.pos+=8:64&a?o.pos+=4:8&a&&(o.pos+=2)}return 1,8,32,64,128,t.prototype.encode=function(t){var e,n,r,i,o;for(n=new J(L.call(this.raw.data)),e=r=0,i=(o=this.glyphIDs).length;r<i;e=++r)o[e],n.pos=this.glyphOffsets[e];return n.data},t}(),F=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="loca",e.prototype.parse=function(r){var t;return r.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,e,n;for(n=[],t=0,e=this.length;t<e;t+=2)n.push(2*r.readUInt16());return n}.call(this):function(){var t,e,n;for(n=[],t=0,e=this.length;t<e;t+=4)n.push(r.readUInt32());return n}.call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,e){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,o=0;o<n.length;++o)if(n[o]=r,i<e.length&&e[i]==o){++i,n[o]=r;var a=this.offsets[o],s=this.offsets[o+1]-a;0<s&&(r+=s)}for(var l=new Array(4*n.length),h=0;h<n.length;++h)l[4*h+3]=255&n[h],l[4*h+2]=(65280&n[h])>>8,l[4*h+1]=(16711680&n[h])>>16,l[4*h]=(4278190080&n[h])>>24;return l},e}(),P=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,o,a,s;for(r={},o=0,a=t.length;o<a;o++)r[i=t[o]]=this.font.glyf.glyphFor(i);for(i in e=[],r)(null!=(n=r[i])?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(0<e.length)for(i in s=this.glyphsFor(e))n=s[i],r[i]=n;return r},t.prototype.encode=function(t,e){var n,r,i,o,a,s,l,h,u,c,f,p,d,g,m;for(r in n=y.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),f={0:0},m=n.charMap)f[(s=m[r]).old]=s.new;for(p in c=n.maxGlyphID,o)p in f||(f[p]=c++);return h=function(t){var e,n;for(e in n={},t)n[t[e]]=e;return n}(f),u=Object.keys(h).sort(function(t,e){return t-e}),d=function(){var t,e,n;for(n=[],t=0,e=u.length;t<e;t++)a=u[t],n.push(h[a]);return n}(),i=this.font.glyf.encode(o,d,f),l=this.font.loca.encode(i.offsets,d),g={cmap:this.font.cmap.raw(),glyf:i.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(e)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},t}();t.API.PDFObject=function(){var o;function a(){}return o=function(t,e){return(Array(e+1).join("0")+t).slice(-e)},a.convert=function(r){var i,t,e,n;if(Array.isArray(r))return"["+function(){var t,e,n;for(n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(a.convert(i));return n}().join(" ")+"]";if("string"==typeof r)return"/"+r;if(null!=r?r.isString:void 0)return"("+r+")";if(r instanceof Date)return"(D:"+o(r.getUTCFullYear(),4)+o(r.getUTCMonth(),2)+o(r.getUTCDate(),2)+o(r.getUTCHours(),2)+o(r.getUTCMinutes(),2)+o(r.getUTCSeconds(),2)+"Z)";if("[object Object]"!=={}.toString.call(r))return""+r;for(t in e=["<<"],r)n=r[t],e.push("/"+t+" "+a.convert(n));return e.push(">>"),e.join("\n")},a}()}(lt),
263
+/*
264
+  # PNG.js
265
+  # Copyright (c) 2011 Devon Govett
266
+  # MIT LICENSE
267
+  # 
268
+  # 
269
+  */
270
+Nt="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")(),Lt=function(){var h,n,r;function i(t){var e,n,r,i,o,a,s,l,h,u,c,f,p,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},a=null;;){switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":a&&this.animation.frames.push(a),this.pos+=4,a={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},o=this.readUInt16(),i=this.readUInt16()||100,a.delay=1e3*o/i,a.disposeOp=this.data[this.pos++],a.blendOp=this.data[this.pos++],a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-=4),t=(null!=a?a.data:void 0)||this.imgData,f=0;0<=e?f<e:e<f;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(e),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(u=r-this.transparency.indexed.length))for(p=0;0<=u?p<u:u<p;0<=u?++p:--p)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":s=(c=this.read(e)).indexOf(0),l=String.fromCharCode.apply(String,c.slice(0,s)),this.text[l]=String.fromCharCode.apply(String,c.slice(s+1));break;case"IEND":return a&&this.animation.frames.push(a),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e),(r=new XMLHttpRequest).open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof n?n(t):void 0},r.send(null)},i.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?e<t:t<e;0<=t?++e:--e)n.push(this.data[this.pos++]);return n},i.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.decodePixels=function(C){var B=this.pixelBitlength/8,j=new Uint8Array(this.width*this.height*B),E=0,M=this;if(null==C&&(C=this.imgData),0===C.length)return new Uint8Array(0);function t(t,e,n,r){var i,o,a,s,l,h,u,c,f,p,d,g,m,y,v,w,b,x,N,L,A,S=Math.ceil((M.width-t)/n),_=Math.ceil((M.height-e)/r),F=M.width==S&&M.height==_;for(y=B*S,g=F?j:new Uint8Array(y*_),h=C.length,o=m=0;m<_&&E<h;){switch(C[E++]){case 0:for(s=b=0;b<y;s=b+=1)g[o++]=C[E++];break;case 1:for(s=x=0;x<y;s=x+=1)i=C[E++],l=s<B?0:g[o-B],g[o++]=(i+l)%256;break;case 2:for(s=N=0;N<y;s=N+=1)i=C[E++],a=(s-s%B)/B,v=m&&g[(m-1)*y+a*B+s%B],g[o++]=(v+i)%256;break;case 3:for(s=L=0;L<y;s=L+=1)i=C[E++],a=(s-s%B)/B,l=s<B?0:g[o-B],v=m&&g[(m-1)*y+a*B+s%B],g[o++]=(i+Math.floor((l+v)/2))%256;break;case 4:for(s=A=0;A<y;s=A+=1)i=C[E++],a=(s-s%B)/B,l=s<B?0:g[o-B],0===m?v=w=0:(v=g[(m-1)*y+a*B+s%B],w=a&&g[(m-1)*y+(a-1)*B+s%B]),u=l+v-w,c=Math.abs(u-l),p=Math.abs(u-v),d=Math.abs(u-w),f=c<=p&&c<=d?l:p<=d?v:w,g[o++]=(i+f)%256;break;default:throw new Error("Invalid filter algorithm: "+C[E-1])}if(!F){var P=((e+m*r)*M.width+t)*B,k=m*y;for(s=0;s<S;s+=1){for(var I=0;I<B;I+=1)j[P++]=g[k++];P+=(n-1)*B}}m++}}return C=(C=new kt(C)).getBytes(),1==M.interlaceMethod?(t(0,0,8,8),t(4,0,8,8),t(0,4,4,8),t(2,0,4,4),t(0,2,2,4),t(1,0,2,2),t(0,1,1,2)):t(0,0,1,1),j},i.prototype.decodePalette=function(){var t,e,n,r,i,o,a,s,l;for(n=this.palette,o=this.transparency.indexed||[],i=new Uint8Array((o.length||0)+n.length),r=0,n.length,e=a=t=0,s=n.length;a<s;e=a+=3)i[r++]=n[e],i[r++]=n[e+1],i[r++]=n[e+2],i[r++]=null!=(l=o[t++])?l:255;return i},i.prototype.copyToImageData=function(t,e){var n,r,i,o,a,s,l,h,u,c,f;if(r=this.colors,u=null,n=this.hasAlphaChannel,this.palette.length&&(u=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(),r=4,n=!0),h=(i=t.data||t).length,a=u||e,o=s=0,1===r)for(;o<h;)l=u?4*e[o/4]:s,c=a[l++],i[o++]=c,i[o++]=c,i[o++]=c,i[o++]=n?a[l++]:255,s=l;else for(;o<h;)l=u?4*e[o/4]:s,i[o++]=a[l++],i[o++]=a[l++],i[o++]=a[l++],i[o++]=n?a[l++]:255,s=l},i.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};try{n=Nt.document.createElement("canvas"),r=n.getContext("2d")}catch(t){return-1}return h=function(t){var e;return r.width=t.width,r.height=t.height,r.clearRect(0,0,t.width,t.height),r.putImageData(t,0,0),(e=new Image).src=n.toDataURL(),e},i.prototype.decodeFrames=function(t){var e,n,r,i,o,a,s,l;if(this.animation){for(l=[],n=o=0,a=(s=this.animation.frames).length;o<a;n=++o)e=s[n],r=t.createImageData(e.width,e.height),i=this.decodePixels(new Uint8Array(e.data)),this.copyToImageData(r,i),e.imageData=r,l.push(e.image=h(r));return l}},i.prototype.renderFrame=function(t,e){var n,r,i;return n=(r=this.animation.frames)[e],i=r[e-1],0===e&&t.clearRect(0,0,this.width,this.height),1===(null!=i?i.disposeOp:void 0)?t.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&t.putImageData(i.imageData,i.xOffset,i.yOffset),0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height),t.drawImage(n.image,n.xOffset,n.yOffset)},i.prototype.animate=function(n){var r,i,o,a,s,t,l=this;return i=0,t=this.animation,a=t.numFrames,o=t.frames,s=t.numPlays,(r=function(){var t,e;if(t=i++%a,e=o[t],l.renderFrame(n,t),1<a&&i/a<s)return l.animation._timeout=setTimeout(r,e.delay)})()},i.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},i.prototype.render=function(t){var e,n;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext("2d"),this.animation?(this.decodeFrames(e),this.animate(e)):(n=e.createImageData(this.width,this.height),this.copyToImageData(n,this.decodePixels()),e.putImageData(n,0,0))},i}(),Nt.PNG=Lt;
271
+/*
272
+   * Extracted from pdf.js
273
+   * https://github.com/andreasgal/pdf.js
274
+   *
275
+   * Copyright (c) 2011 Mozilla Foundation
276
+   *
277
+   * Contributors: Andreas Gal <gal@mozilla.com>
278
+   *               Chris G Jones <cjones@mozilla.com>
279
+   *               Shaon Barman <shaon.barman@gmail.com>
280
+   *               Vivien Nicolas <21@vingtetun.org>
281
+   *               Justin D'Arcangelo <justindarc@gmail.com>
282
+   *               Yury Delendik
283
+   *
284
+   * 
285
+   */
286
+var Pt=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function(t){var e=this.buffer,n=e?e.byteLength:0;if(t<n)return e;for(var r=512;r<t;)r<<=1;for(var i=new Uint8Array(r),o=0;o<n;++o)i[o]=e[o];return this.buffer=i},getByte:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(t){var e=this.pos;if(t){this.ensureBuffer(e+t);for(var n=e+t;!this.eof&&this.bufferLength<n;)this.readBlock();var r=this.bufferLength;r<n&&(n=r)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}return this.pos=n,this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},t}(),kt=function(){if("undefined"!=typeof Uint32Array){var k=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),I=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),C=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),B=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],j=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return(t.prototype=Object.create(Pt.prototype)).getBits=function(t){for(var e,n=this.codeSize,r=this.codeBuf,i=this.bytes,o=this.bytesPos;n<t;)void 0===(e=i[o++])&&E("Bad encoding in flate stream"),r|=e<<n,n+=8;return e=r&(1<<t)-1,this.codeBuf=r>>t,this.codeSize=n-=t,this.bytesPos=o,e},t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,a=this.bytesPos;r<n;){var s;void 0===(s=o[a++])&&E("Bad encoding in flate stream"),i|=s<<r,r+=8}var l=e[i&(1<<n)-1],h=l>>16,u=65535&l;return(0==r||r<h||0==h)&&E("Bad encoding in flate stream"),this.codeBuf=i>>h,this.codeSize=r-h,this.bytesPos=a,u},t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;r<e;++r)t[r]>n&&(n=t[r]);for(var i=1<<n,o=new Uint32Array(i),a=1,s=0,l=2;a<=n;++a,s<<=1,l<<=1)for(var h=0;h<e;++h)if(t[h]==a){var u=0,c=s;for(r=0;r<a;++r)u=u<<1|1&c,c>>=1;for(r=u;r<i;r+=l)o[r]=a<<16|h;++s}return[o,n]},t.prototype.readBlock=function(){function t(t,e,n,r,i){for(var o=t.getBits(n)+r;0<o--;)e[l++]=i}var e=this.getBits(3);if(1&e&&(this.eof=!0),0!=(e>>=1)){var n,r;if(1==e)n=B,r=j;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,a=this.getBits(4)+4,s=Array(k.length),l=0;l<a;)s[k[l++]]=this.getBits(3);for(var h=this.generateHuffmanTable(s),u=0,c=(l=0,i+o),f=new Array(c);l<c;){var p=this.getCode(h);16==p?t(this,f,2,3,u):17==p?t(this,f,3,3,u=0):18==p?t(this,f,7,11,u=0):f[l++]=u=p}n=this.generateHuffmanTable(f.slice(0,i)),r=this.generateHuffmanTable(f.slice(i,c))}else E("Unknown block type in flate stream");for(var d=(_=this.buffer)?_.length:0,g=this.bufferLength;;){var m=this.getCode(n);if(m<256)d<=g+1&&(d=(_=this.ensureBuffer(g+1)).length),_[g++]=m;else{if(256==m)return void(this.bufferLength=g);var y=(m=I[m-=257])>>16;0<y&&(y=this.getBits(y));u=(65535&m)+y;m=this.getCode(r),0<(y=(m=C[m])>>16)&&(y=this.getBits(y));var v=(65535&m)+y;d<=g+u&&(d=(_=this.ensureBuffer(g+u)).length);for(var w=0;w<u;++w,++g)_[g]=_[g-v]}}}else{var b,x=this.bytes,N=this.bytesPos;void 0===(b=x[N++])&&E("Bad block header in flate stream");var L=b;void 0===(b=x[N++])&&E("Bad block header in flate stream"),L|=b<<8,void 0===(b=x[N++])&&E("Bad block header in flate stream");var A=b;void 0===(b=x[N++])&&E("Bad block header in flate stream"),(A|=b<<8)!=(65535&~L)&&E("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var S=this.bufferLength,_=this.ensureBuffer(S+L),F=S+L;this.bufferLength=F;for(var P=S;P<F;++P){if(void 0===(b=x[N++])){this.eof=!0;break}_[P]=b}this.bytesPos=N}},t}function E(t){throw new Error(t)}function t(t){var e=0,n=t[e++],r=t[e++];-1!=n&&-1!=r||E("Invalid header in flate stream"),8!=(15&n)&&E("Unknown compression method in flate stream"),((n<<8)+r)%31!=0&&E("Bad FCHECK in flate stream"),32&r&&E("FDICT bit set in flate stream"),this.bytes=t,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,Pt.call(this)}}();window.tmp=kt});try{module.exports=jsPDF}catch(t){}