diff --git a/static/css/plugins/fileinput/fileinput.css b/static/css/plugins/fileinput/fileinput.css new file mode 100644 index 0000000000000000000000000000000000000000..1a67a1786042cf31aa61baa0bc6e738a5f5ab1ad --- /dev/null +++ b/static/css/plugins/fileinput/fileinput.css @@ -0,0 +1,558 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Krajee default styling for bootstrap-fileinput. + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */ +.file-loading input[type=file], input[type=file].file-loading { + width: 0; + height: 0; +} + +.file-no-browse { + position: absolute; + left: 50%; + bottom: 20%; + width: 1px; + height: 1px; + font-size: 0; + opacity: 0; + border: none; + background: none; + outline: none; + box-shadow: none; +} + +.kv-hidden, .file-caption-icon, .file-zoom-dialog .modal-header:before, .file-zoom-dialog .modal-header:after, .file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button, .file-input-new .no-browse .input-group-btn, .file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button, .file-input-ajax-new .no-browse .input-group-btn, .hide-content .kv-file-content, .is-locked .fileinput-upload-button, .is-locked .fileinput-remove-button { + display: none; +} + +.btn-file input[type=file], .file-caption-icon, .file-preview .fileinput-remove, .krajee-default .file-thumb-progress, .file-zoom-dialog .btn-navigate, .file-zoom-dialog .floating-buttons { + position: absolute; +} + +.file-caption-icon .kv-caption-icon { + line-height: inherit; +} + +.file-input, .file-loading:before, .btn-file, .file-caption, .file-preview, .krajee-default.file-preview-frame, .krajee-default .file-thumbnail-footer, .file-zoom-dialog .modal-dialog { + position: relative; +} + +.file-error-message pre, .file-error-message ul, .krajee-default .file-actions, .krajee-default .file-other-error { + text-align: left; +} + +.file-error-message pre, .file-error-message ul { + margin: 0; +} + +.krajee-default .file-drag-handle, .krajee-default .file-upload-indicator { + float: left; + margin-top: 10px; + width: 16px; + height: 16px; +} + +.file-thumb-progress .progress, .file-thumb-progress .progress-bar { + font-family: Verdana, Helvetica, sans-serif; + font-size: 0.7rem; +} + +.krajee-default .file-thumb-progress .progress, .kv-upload-progress .progress { + background-color: #ccc; +} + +.krajee-default .file-caption-info, .krajee-default .file-size-info { + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 160px; + height: 15px; + margin: auto; +} + +.file-zoom-content > .file-object.type-video, .file-zoom-content > .file-object.type-flash, .file-zoom-content > .file-object.type-image { + max-width: 100%; + max-height: 100%; + width: auto; +} + +.file-zoom-content > .file-object.type-video, .file-zoom-content > .file-object.type-flash { + height: 100%; +} + +.file-zoom-content > .file-object.type-pdf, .file-zoom-content > .file-object.type-html, .file-zoom-content > .file-object.type-text, .file-zoom-content > .file-object.type-default { + width: 100%; +} + +.file-loading:before { + content: " Loading..."; + display: inline-block; + padding-left: 20px; + line-height: 16px; + font-size: 13px; + font-variant: small-caps; + color: #999; + background: transparent url(../../../img/loading.gif) top left no-repeat; +} + +.file-object { + margin: 0 0 -5px 0; + padding: 0; +} + +.btn-file { + overflow: hidden; +} + +.btn-file input[type=file] { + top: 0; + left: 0; + min-width: 100%; + min-height: 100%; + text-align: right; + opacity: 0; + background: none repeat scroll 0 0 transparent; + cursor: inherit; + display: block; +} + +.btn-file ::-ms-browse { + font-size: 10000px; + width: 100%; + height: 100%; +} + +.file-caption .file-caption-name { + width: 100%; + margin: 0; + padding: 0; + box-shadow: none; + border: none; + background: none; + outline: none; +} + +.file-caption.icon-visible .file-caption-icon { + display: inline-block; +} + +.file-caption.icon-visible .file-caption-name { + padding-left: 15px; +} + +.file-caption-icon { + left: 8px; +} + +.file-error-message { + color: #a94442; + background-color: #f2dede; + margin: 5px; + border: 1px solid #ebccd1; + border-radius: 4px; + padding: 15px; +} + +.file-error-message pre { + margin: 5px 0; +} + +.file-caption-disabled { + background-color: #eee; + cursor: not-allowed; + opacity: 1; +} + +.file-preview { + border-radius: 5px; + border: 1px solid #ddd; + padding: 8px; + width: 100%; + margin-bottom: 5px; +} + +.file-preview .btn-xs { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} + +.file-preview .fileinput-remove { + top: 1px; + right: 1px; + line-height: 10px; +} + +.file-preview .clickable { + cursor: pointer; +} + +.file-preview-image { + font: 40px Impact, Charcoal, sans-serif; + color: #008000; +} + +.krajee-default.file-preview-frame { + margin: 8px; + border: 1px solid rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2); + padding: 6px; + float: left; + text-align: center; +} + +.krajee-default.file-preview-frame .kv-file-content { + width: 213px; + height: 160px; +} + +.krajee-default .file-preview-other-frame { + display: flex; + align-items: center; + justify-content: center; +} + +.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered { + width: 400px; +} + +.krajee-default.file-preview-frame[data-template="audio"] .kv-file-content { + width: 240px; + height: 55px; +} + +.krajee-default.file-preview-frame .file-thumbnail-footer { + height: 70px; +} + +.krajee-default.file-preview-frame:not(.file-preview-error):hover { + border: 1px solid rgba(0, 0, 0, 0.3); + box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4); +} + +.krajee-default .file-preview-text { + display: block; + color: #428bca; + border: 1px solid #ddd; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + outline: none; + padding: 8px; + resize: none; +} + +.krajee-default .file-preview-html { + border: 1px solid #ddd; + padding: 8px; + overflow: auto; +} + +.krajee-default .file-other-icon { + font-size: 6em; + line-height: 1; +} + +.krajee-default .file-footer-buttons { + float: right; +} + +.krajee-default .file-footer-caption { + display: block; + text-align: center; + padding-top: 4px; + font-size: 11px; + color: #777; + margin-bottom: 30px; +} + +.file-upload-stats { + font-size: 10px; + text-align: center; + width: 100%; +} + +.kv-upload-progress .file-upload-stats { + font-size: 12px; + margin: -10px 0 5px; +} + +.krajee-default .file-preview-error { + opacity: 0.65; + box-shadow: none; +} + +.krajee-default .file-thumb-progress { + top: 37px; + left: 0; + right: 0; +} + +.krajee-default.kvsortable-ghost { + background: #e1edf7; + border: 2px solid #a1abff; +} + +.krajee-default .file-preview-other:hover { + opacity: 0.8; +} + +.krajee-default .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover { + color: #000; +} + +.kv-upload-progress .progress { + height: 20px; + margin: 10px 0; + overflow: hidden; +} + +.kv-upload-progress .progress-bar { + height: 20px; + font-family: Verdana, Helvetica, sans-serif; +} + +/*noinspection CssOverwrittenProperties*/ +.file-zoom-dialog .file-other-icon { + font-size: 22em; + font-size: 50vmin; +} + +.file-zoom-dialog .modal-dialog { + width: auto; +} + +.file-zoom-dialog .modal-header { + display: flex; + align-items: center; + justify-content: space-between; +} + +.file-zoom-dialog .btn-navigate { + padding: 0; + margin: -60px 0 0; + font-size: 60px; + background: transparent; + text-decoration: none; + outline: none; + opacity: 0.7; + top: 50%; + color: #1c94c4; +} + +.file-zoom-dialog .btn-navigate:not([disabled]):hover { + outline: none; + box-shadow: none; + opacity: 0.6; +} + +.file-zoom-dialog .floating-buttons { + top: 5px; + right: 10px; +} + +.file-zoom-dialog .btn-navigate[disabled] { + opacity: 0.3; +} + +.file-zoom-dialog .btn-prev { + left: 1px; +} + +.file-zoom-dialog .btn-next { + right: 1px; +} + +.file-zoom-dialog .kv-zoom-title { + font-weight: 300; + color: #999; + max-width: 50%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.file-input-new .no-browse .form-control { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.file-input-ajax-new .no-browse .form-control { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.file-caption-main { + width: 100%; +} + +.file-thumb-loading { + background: transparent url(../../../img/loading.gif) no-repeat scroll center center content-box !important; +} + +.file-drop-zone { + border: 1px dashed #aaa; + border-radius: 4px; + text-align: center; + vertical-align: middle; + margin: 12px 15px 12px 12px; + padding: 5px; +} + +.file-drop-zone.clickable:hover { + border: 2px dashed #999; +} + +.file-drop-zone.clickable:focus { + border: 2px solid #5acde2; +} + +.file-drop-zone .file-preview-thumbnails { + cursor: default; +} + +.file-drop-zone-title { + color: #aaa; + font-size: 1.6em; + padding: 85px 10px; + cursor: default; +} + +.file-highlighted { + border: 2px dashed #999 !important; + background-color: #eee; +} + +.file-uploading { + background: url(../../../img/loading-sm.gif) no-repeat center bottom 10px; + opacity: 0.65; +} + +.file-zoom-fullscreen .modal-dialog { + min-width: 100%; + margin: 0; +} + +.file-zoom-fullscreen .modal-content { + border-radius: 0; + box-shadow: none; + min-height: 100vh; +} + +.file-zoom-fullscreen .modal-body { + overflow-y: auto; +} + +.floating-buttons { + z-index: 3000; +} + +.floating-buttons .btn-kv { + margin-left: 3px; + z-index: 3000; +} + +.kv-zoom-actions .btn-kv { + margin-left: 3px; +} + +.file-zoom-content { + text-align: center; + min-height: 300px; +} + +.file-zoom-content .file-preview-image { + max-height: 100%; +} + +.file-zoom-content .file-preview-video { + max-height: 100%; +} + +.file-zoom-content > .file-object.type-image { + height: auto; + min-height: inherit; +} + +.file-zoom-content > .file-object.type-audio { + width: auto; + height: 30px; +} + +@media (min-width: 576px) { + .file-zoom-dialog .modal-dialog { + max-width: 500px; + } +} + +@media (min-width: 992px) { + .file-zoom-dialog .modal-lg { + max-width: 800px; + } +} + +@media (max-width: 767px) { + .file-preview-thumbnails { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + } + + .file-zoom-dialog .modal-header { + flex-direction: column; + } +} + +@media (max-width: 350px) { + .krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content { + width: 160px; + } +} + +@media (max-width: 420px) { + .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered { + width: 100%; + } +} + +.file-loading[dir=rtl]:before { + background: transparent url(../../../img/loading.gif) top right no-repeat; + padding-left: 0; + padding-right: 20px; +} + +.clickable .file-drop-zone-title { + cursor: pointer; +} + +.file-sortable .file-drag-handle:hover { + opacity: 0.7; +} + +.file-sortable .file-drag-handle { + cursor: grab; + opacity: 1; +} + +.file-grabbing, .file-grabbing * { + cursor: not-allowed !important; +} + +.file-grabbing .file-preview-thumbnails * { + cursor: grabbing !important; +} + +.file-preview-frame.sortable-chosen { + background-color: #d9edf7; + border-color: #17a2b8; + box-shadow: none !important; +} \ No newline at end of file diff --git a/static/css/plugins/fileinput/fileinput.min.css b/static/css/plugins/fileinput/fileinput.min.css new file mode 100644 index 0000000000000000000000000000000000000000..234e6f73df95aabe2f09951fa742f55e697c7ace --- /dev/null +++ b/static/css/plugins/fileinput/fileinput.min.css @@ -0,0 +1,547 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Krajee default styling for bootstrap-fileinput. + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */ +.btn-file input[type=file], .file-caption-icon, .file-no-browse, .file-preview .fileinput-remove, .file-zoom-dialog .btn-navigate, .file-zoom-dialog .floating-buttons, .krajee-default .file-thumb-progress { + position: absolute +} + +.file-loading input[type=file], input[type=file].file-loading { + width: 0; + height: 0 +} + +.file-no-browse { + left: 50%; + bottom: 20%; + width: 1px; + height: 1px; + font-size: 0; + opacity: 0; + border: none; + background: 0 0; + outline: 0; + box-shadow: none +} + +.file-caption-icon, .file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button, .file-input-ajax-new .no-browse .input-group-btn, .file-input-new .close, .file-input-new .file-preview, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button, .file-input-new .glyphicon-file, .file-input-new .no-browse .input-group-btn, .file-zoom-dialog .modal-header:after, .file-zoom-dialog .modal-header:before, .hide-content .kv-file-content, .is-locked .fileinput-remove-button, .is-locked .fileinput-upload-button, .kv-hidden { + display: none +} + +.file-caption-icon .kv-caption-icon { + line-height: inherit +} + +.btn-file, .file-caption, .file-input, .file-loading:before, .file-preview, .file-zoom-dialog .modal-dialog, .krajee-default .file-thumbnail-footer, .krajee-default.file-preview-frame { + position: relative +} + +.file-error-message pre, .file-error-message ul, .krajee-default .file-actions, .krajee-default .file-other-error { + text-align: left +} + +.file-error-message pre, .file-error-message ul { + margin: 0 +} + +.krajee-default .file-drag-handle, .krajee-default .file-upload-indicator { + float: left; + margin-top: 10px; + width: 16px; + height: 16px +} + +.file-thumb-progress .progress, .file-thumb-progress .progress-bar { + font-family: Verdana, Helvetica, sans-serif; + font-size: .7rem +} + +.krajee-default .file-thumb-progress .progress, .kv-upload-progress .progress { + background-color: #ccc +} + +.krajee-default .file-caption-info, .krajee-default .file-size-info { + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 160px; + height: 15px; + margin: auto +} + +.file-zoom-content > .file-object.type-flash, .file-zoom-content > .file-object.type-image, .file-zoom-content > .file-object.type-video { + max-width: 100%; + max-height: 100%; + width: auto +} + +.file-zoom-content > .file-object.type-flash, .file-zoom-content > .file-object.type-video { + height: 100% +} + +.file-zoom-content > .file-object.type-default, .file-zoom-content > .file-object.type-html, .file-zoom-content > .file-object.type-pdf, .file-zoom-content > .file-object.type-text { + width: 100% +} + +.file-loading:before { + content: " Loading..."; + display: inline-block; + padding-left: 20px; + line-height: 16px; + font-size: 13px; + font-variant: small-caps; + color: #999; + background: url(../../../img/loading.gif) top left no-repeat +} + +.file-object { + margin: 0 0 -5px; + padding: 0 +} + +.btn-file { + overflow: hidden +} + +.btn-file input[type=file] { + top: 0; + left: 0; + min-width: 100%; + min-height: 100%; + text-align: right; + opacity: 0; + background: none; + cursor: inherit; + display: block +} + +.btn-file ::-ms-browse { + font-size: 10000px; + width: 100%; + height: 100% +} + +.file-caption .file-caption-name { + width: 100%; + margin: 0; + padding: 0; + box-shadow: none; + border: none; + background: 0 0; + outline: 0 +} + +.file-caption.icon-visible .file-caption-icon { + display: inline-block +} + +.file-caption.icon-visible .file-caption-name { + padding-left: 15px +} + +.file-caption-icon { + left: 8px +} + +.file-error-message { + color: #a94442; + background-color: #f2dede; + margin: 5px; + border: 1px solid #ebccd1; + border-radius: 4px; + padding: 15px +} + +.file-error-message pre { + margin: 5px 0 +} + +.file-caption-disabled { + background-color: #eee; + cursor: not-allowed; + opacity: 1 +} + +.file-preview { + border-radius: 5px; + border: 1px solid #ddd; + padding: 8px; + width: 100%; + margin-bottom: 5px +} + +.file-preview .btn-xs { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px +} + +.file-preview .fileinput-remove { + top: 1px; + right: 1px; + line-height: 10px +} + +.file-preview .clickable { + cursor: pointer +} + +.file-preview-image { + font: 40px Impact, Charcoal, sans-serif; + color: green +} + +.krajee-default.file-preview-frame { + margin: 8px; + border: 1px solid rgba(0, 0, 0, .2); + box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2); + padding: 6px; + float: left; + text-align: center +} + +.krajee-default.file-preview-frame .kv-file-content { + width: 213px; + height: 160px +} + +.krajee-default .file-preview-other-frame { + display: flex; + align-items: center; + justify-content: center +} + +.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered { + width: 400px +} + +.krajee-default.file-preview-frame[data-template=audio] .kv-file-content { + width: 240px; + height: 55px +} + +.krajee-default.file-preview-frame .file-thumbnail-footer { + height: 70px +} + +.krajee-default.file-preview-frame:not(.file-preview-error):hover { + border: 1px solid rgba(0, 0, 0, .3); + box-shadow: 0 0 10px 0 rgba(0, 0, 0, .4) +} + +.krajee-default .file-preview-text { + display: block; + color: #428bca; + border: 1px solid #ddd; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + outline: 0; + padding: 8px; + resize: none +} + +.krajee-default .file-preview-html { + border: 1px solid #ddd; + padding: 8px; + overflow: auto +} + +.krajee-default .file-other-icon { + font-size: 6em; + line-height: 1 +} + +.krajee-default .file-footer-buttons { + float: right +} + +.krajee-default .file-footer-caption { + display: block; + text-align: center; + padding-top: 4px; + font-size: 11px; + color: #777; + margin-bottom: 30px +} + +.file-upload-stats { + font-size: 10px; + text-align: center; + width: 100% +} + +.kv-upload-progress .file-upload-stats { + font-size: 12px; + margin: -10px 0 5px +} + +.krajee-default .file-preview-error { + opacity: .65; + box-shadow: none +} + +.krajee-default .file-thumb-progress { + top: 37px; + left: 0; + right: 0 +} + +.krajee-default.kvsortable-ghost { + background: #e1edf7; + border: 2px solid #a1abff +} + +.krajee-default .file-preview-other:hover { + opacity: .8 +} + +.krajee-default .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover { + color: #000 +} + +.kv-upload-progress .progress { + height: 20px; + margin: 10px 0; + overflow: hidden +} + +.kv-upload-progress .progress-bar { + height: 20px; + font-family: Verdana, Helvetica, sans-serif +} + +.file-zoom-dialog .file-other-icon { + font-size: 22em; + font-size: 50vmin +} + +.file-zoom-dialog .modal-dialog { + width: auto +} + +.file-zoom-dialog .modal-header { + display: flex; + align-items: center; + justify-content: space-between +} + +.file-zoom-dialog .btn-navigate { + padding: 0; + margin: -60px 0 0; + font-size: 60px; + background: 0 0; + text-decoration: none; + outline: 0; + opacity: .7; + top: 50%; + color: #1c94c4 +} + +.file-zoom-dialog .btn-navigate:not([disabled]):hover { + outline: 0; + box-shadow: none; + opacity: .6 +} + +.file-zoom-dialog .floating-buttons { + top: 5px; + right: 10px +} + +.file-zoom-dialog .btn-navigate[disabled] { + opacity: .3 +} + +.file-zoom-dialog .btn-prev { + left: 1px +} + +.file-zoom-dialog .btn-next { + right: 1px +} + +.file-zoom-dialog .kv-zoom-title { + font-weight: 300; + color: #999; + max-width: 50%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis +} + +.file-input-ajax-new .no-browse .form-control, .file-input-new .no-browse .form-control { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px +} + +.file-caption-main { + width: 100% +} + +.file-thumb-loading { + background: url(../../../img/loading.gif) center center no-repeat content-box !important +} + +.file-drop-zone { + border: 1px dashed #aaa; + border-radius: 4px; + text-align: center; + vertical-align: middle; + margin: 12px 15px 12px 12px; + padding: 5px +} + +.file-drop-zone.clickable:hover { + border: 2px dashed #999 +} + +.file-drop-zone.clickable:focus { + border: 2px solid #5acde2 +} + +.file-drop-zone .file-preview-thumbnails { + cursor: default +} + +.file-drop-zone-title { + color: #aaa; + font-size: 1.6em; + padding: 85px 10px; + cursor: default +} + +.file-highlighted { + border: 2px dashed #999 !important; + background-color: #eee +} + +.file-uploading { + background: url(../../../img/loading-sm.gif) center bottom 10px no-repeat; + opacity: .65 +} + +.file-zoom-fullscreen .modal-dialog { + min-width: 100%; + margin: 0 +} + +.file-zoom-fullscreen .modal-content { + border-radius: 0; + box-shadow: none; + min-height: 100vh +} + +.file-zoom-fullscreen .modal-body { + overflow-y: auto +} + +.floating-buttons { + z-index: 3000 +} + +.floating-buttons .btn-kv { + margin-left: 3px; + z-index: 3000 +} + +.kv-zoom-actions .btn-kv { + margin-left: 3px +} + +.file-zoom-content { + text-align: center; + min-height: 300px +} + +.file-zoom-content .file-preview-image, .file-zoom-content .file-preview-video { + max-height: 100% +} + +.file-zoom-content > .file-object.type-image { + height: auto; + min-height: inherit +} + +.file-zoom-content > .file-object.type-audio { + width: auto; + height: 30px +} + +@media (min-width: 576px) { + .file-zoom-dialog .modal-dialog { + max-width: 500px + } +} + +@media (min-width: 992px) { + .file-zoom-dialog .modal-lg { + max-width: 800px + } +} + +@media (max-width: 767px) { + .file-preview-thumbnails { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column + } + + .file-zoom-dialog .modal-header { + flex-direction: column + } +} + +@media (max-width: 350px) { + .krajee-default.file-preview-frame:not([data-template=audio]) .kv-file-content { + width: 160px + } +} + +@media (max-width: 420px) { + .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered { + width: 100% + } +} + +.file-loading[dir=rtl]:before { + background: url(../../../loading.gif) top right no-repeat; + padding-left: 0; + padding-right: 20px +} + +.clickable .file-drop-zone-title { + cursor: pointer +} + +.file-sortable .file-drag-handle:hover { + opacity: .7 +} + +.file-sortable .file-drag-handle { + cursor: grab; + opacity: 1 +} + +.file-grabbing, .file-grabbing * { + cursor: not-allowed !important +} + +.file-grabbing .file-preview-thumbnails * { + cursor: grabbing !important +} + +.file-preview-frame.sortable-chosen { + background-color: #d9edf7; + border-color: #17a2b8; + box-shadow: none !important +} \ No newline at end of file diff --git a/static/css/plugins/fileinput/theme.css b/static/css/plugins/fileinput/theme.css new file mode 100644 index 0000000000000000000000000000000000000000..6871a697a53a59af32bfaf25197453799721f941 --- /dev/null +++ b/static/css/plugins/fileinput/theme.css @@ -0,0 +1,155 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`. + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */ +.theme-explorer .file-preview-frame { + border: 1px solid #ddd; + margin: 2px 0; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; +} +.theme-explorer .file-actions, +.theme-explorer .file-upload-indicator, .theme-explorer .file-drag-handle, .theme-explorer .explorer-frame .kv-file-content, .theme-explorer .file-actions, .explorer-frame .file-preview-other { + text-align: center; +} +.theme-explorer .file-upload-indicator, .theme-explorer .file-drag-handle { + position: absolute; + display: inline-block; + bottom: 8px; + right: 4px; + width: 16px; + height: 16px; + font-size: 16px; +} +.theme-explorer .file-thumb-progress .progress, .theme-explorer .explorer-caption { + display: block; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.theme-explorer .file-thumb-progress .progress { + margin-top: 5px; +} +.theme-explorer .explorer-caption, +.theme-explorer .file-footer-buttons { + padding: 5px; +} +.theme-explorer .file-footer-buttons { + text-align: right; +} +.theme-explorer .explorer-caption { + color: #777; + padding-top: 5px; +} +.theme-explorer .kvsortable-ghost { + opacity: 0.6; + background: #e1edf7; + border: 2px solid #a1abff; +} +.theme-explorer .file-preview .table { + margin: 0; +} +.theme-explorer .file-error-message ul { + padding: 5px 0 0 20px; +} +.explorer-frame .file-preview-text { + display: inline-block; + color: #428bca; + border: 1px solid #ddd; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + outline: none; + padding: 8px; + resize: none; +} +.explorer-frame .file-preview-html { + display: inline-block; + border: 1px solid #ddd; + padding: 8px; + overflow: auto; +} +.explorer-frame .file-other-icon { + font-size: 2.6em; +} +.explorer-frame:hover { + background-color: #f5f5f5; +} +.theme-explorer .file-preview-frame samp { + font-size: 0.9rem; +} +.theme-explorer .explorer-frame .kv-file-content { + width: 160px; + height: 80px; + padding: 5px; + text-align: left; +} +.theme-explorer .file-details-cell { + width: 60%; + font-size: 0.95rem; + text-align: left; + margin-right: auto; +} +.theme-explorer .file-actions-cell { + position: relative; + height: 80px; + width: 200px; +} +/*noinspection CssOverwrittenProperties*/ +.file-zoom-dialog .explorer-frame .file-other-icon { + font-size: 22em; + font-size: 50vmin; +} +@media only screen and (max-width: 1249px) { + .theme-explorer .file-preview-frame .file-details-cell { + width: 40%; + } +} +@media only screen and (max-width: 1023px) { + .theme-explorer .file-preview-frame .file-details-cell { + width: 30%; + } +} +@media only screen and (max-width: 767px) { + .theme-explorer .file-preview-frame .file-details-cell { + width: 200px; + } +} +@media only screen and (max-width: 575px) { + .theme-explorer .file-preview-frame { + flex-direction: column; + } + + .theme-explorer .file-preview-frame .kv-file-content { + width: auto; + text-align: center; + } + + .theme-explorer .file-details-cell { + width: 100px; + text-align: center; + margin-right: 0; + } + + .theme-explorer .file-preview-frame .kv-file-content, + .theme-explorer .file-details-cell, + .theme-explorer .file-actions-cell { + width: 100%; + } + + .theme-explorer .file-actions-cell { + height: auto; + } + + .theme-explorer .file-footer-buttons { + text-align: left; + } +} \ No newline at end of file diff --git a/static/css/plugins/fileinput/theme.min.css b/static/css/plugins/fileinput/theme.min.css new file mode 100644 index 0000000000000000000000000000000000000000..98ab597072bec68020d6c15f0097bc71d00f1ead --- /dev/null +++ b/static/css/plugins/fileinput/theme.min.css @@ -0,0 +1,12 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`. + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */.theme-explorer .file-preview-frame{border:1px solid #ddd;margin:2px 0;width:100%;display:flex;justify-content:space-between;align-items:center}.explorer-frame .file-preview-other,.theme-explorer .explorer-frame .kv-file-content,.theme-explorer .file-actions,.theme-explorer .file-drag-handle,.theme-explorer .file-upload-indicator{text-align:center}.theme-explorer .file-drag-handle,.theme-explorer .file-upload-indicator{position:absolute;display:inline-block;bottom:8px;right:4px;width:16px;height:16px;font-size:16px}.theme-explorer .explorer-caption,.theme-explorer .file-thumb-progress .progress{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.theme-explorer .file-thumb-progress .progress{margin-top:5px}.theme-explorer .explorer-caption,.theme-explorer .file-footer-buttons{padding:5px}.theme-explorer .file-footer-buttons{text-align:right}.theme-explorer .explorer-caption{color:#777;padding-top:5px}.theme-explorer .kvsortable-ghost{opacity:.6;background:#e1edf7;border:2px solid #a1abff}.theme-explorer .file-preview .table{margin:0}.theme-explorer .file-error-message ul{padding:5px 0 0 20px}.explorer-frame .file-preview-text{display:inline-block;color:#428bca;border:1px solid #ddd;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;outline:0;padding:8px;resize:none}.explorer-frame .file-preview-html{display:inline-block;border:1px solid #ddd;padding:8px;overflow:auto}.explorer-frame .file-other-icon{font-size:2.6em}.explorer-frame:hover{background-color:#f5f5f5}.theme-explorer .file-preview-frame samp{font-size:.9rem}.theme-explorer .explorer-frame .kv-file-content{width:160px;height:80px;padding:5px;text-align:left}.theme-explorer .file-details-cell{width:60%;font-size:.95rem;text-align:left;margin-right:auto}.theme-explorer .file-actions-cell{position:relative;height:80px;width:200px}.file-zoom-dialog .explorer-frame .file-other-icon{font-size:22em;font-size:50vmin}@media only screen and (max-width:1249px){.theme-explorer .file-preview-frame .file-details-cell{width:40%}}@media only screen and (max-width:1023px){.theme-explorer .file-preview-frame .file-details-cell{width:30%}}@media only screen and (max-width:767px){.theme-explorer .file-preview-frame .file-details-cell{width:200px}}@media only screen and (max-width:575px){.theme-explorer .file-preview-frame{flex-direction:column}.theme-explorer .file-preview-frame .kv-file-content{text-align:center}.theme-explorer .file-details-cell{text-align:center;margin-right:0}.theme-explorer .file-actions-cell,.theme-explorer .file-details-cell,.theme-explorer .file-preview-frame .kv-file-content{width:100%}.theme-explorer .file-actions-cell{height:auto}.theme-explorer .file-footer-buttons{text-align:left}} \ No newline at end of file diff --git a/static/img/loading-sm.gif b/static/img/loading-sm.gif new file mode 100644 index 0000000000000000000000000000000000000000..44e3b7a0f702aa1d301468b1d6c1d74d45dfdfa4 Binary files /dev/null and b/static/img/loading-sm.gif differ diff --git a/static/img/loading.gif b/static/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ea146c0253f2e500ca022050f4353be456e6d4d Binary files /dev/null and b/static/img/loading.gif differ diff --git a/static/js/demo/analysis/data1.json b/static/js/demo/analysis/data1.json index 7e93517a984c74d112b1498d889a121fa410bae5..44cf6fb04d8374d7032f4b8f0724102b9fbd68eb 100644 --- a/static/js/demo/analysis/data1.json +++ b/static/js/demo/analysis/data1.json @@ -5,141 +5,131 @@ "course": "java", "chapter": "第一章", "section":"第一节", - "start_time":"2019-12-10", + "start_time":"2019-12-10 16:23:01", "start_location": "第一章第一节", - "end_time": "2020-1-10", + "end_time": "2020-1-10 17:18:19", "end_location":"第二章第一节", "maximum_overshoot":"50小时", "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"李四", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - }, - { - "stu_id":17376001, - "name":"张三", - "course": "java", - "chapter": "第一章", - "section":"第一节", - "start_time":"2019-12-10", - "start_location": "第一章第一节", - "end_time": "2020-1-10", - "end_location":"第二章第一节", - "maximum_overshoot":"50小时", - "video_time": "60小时" - } + },{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +},{ + "stu_id":17376001, + "name":"张三", + "course": "java", + "chapter": "第一章", + "section":"第一节", + "start_time":"2019-12-10 16:23:01", + "start_location": "第一章第一节", + "end_time": "2020-1-10 17:18:19", + "end_location":"第二章第一节", + "maximum_overshoot":"50小时", + "video_time": "60小时" +} ] \ No newline at end of file diff --git a/static/js/demo/exam/exam.json b/static/js/demo/exam/exam.json new file mode 100644 index 0000000000000000000000000000000000000000..ff024662bc515ecdd880be9589f11ffbb8d25684 --- /dev/null +++ b/static/js/demo/exam/exam.json @@ -0,0 +1,51 @@ +[ + { + "id": 0, + "sectionName": "我是测试数据1", + "sectionDescription": "我是章节描述1", + "testQuestions": [ + { + "id": 0, + "testQuestionsId": 1, + "score": 10, + "title": "实现九九乘法表", + "myTopicOrShareTop": "myTopic" + }, + { + "id": 1, + "testQuestionsId": 2, + "score": 10, + "title": "选出计算机系统里的最开始的时间", + "myTopicOrShareTop": "myTopic" + }, + { + "id": 2, + "testQuestionsId": 3, + "score": 10, + "title": "选出计算机系统里的最开始的时间", + "myTopicOrShareTop": "shareTopic" + } + ] + }, + { + "id": 1, + "sectionName": "我是测试数据2", + "sectionDescription": "我是章节描述2", + "testQuestions": [ + { + "id": 0, + "testQuestionsId": 1, + "score": 10, + "title": "实现九九乘法表", + "myTopicOrShareTop": "shareTopic" + }, + { + "id": 1, + "testQuestionsId": 2, + "score": 10, + "title": "选出计算机系统里的最开始的时间", + "myTopicOrShareTop": "myTopic" + } + ] + } +] \ No newline at end of file diff --git a/static/js/demo/exam/examManagementList.json b/static/js/demo/exam/examManagementList.json index be50656a7b1cabe2c4785c2ac8ae3026f73304f2..e7f5ad98b60a0ad5a9e169fd221664f3a32f39de 100644 --- a/static/js/demo/exam/examManagementList.json +++ b/static/js/demo/exam/examManagementList.json @@ -1,17 +1,164 @@ [ { + "id": 1, "name":"张三", "examinee": "zhangsan", "examineeGroup": "扬州公司", "idNumber": "2011001", "startTime": "2020-06-08 14:18:00", "endTime": "2020-06-08 14:18:08", - "examTime": 0, - "correctingState": true, + "examTime": 120, + "correctingState": "true", "score": 57, "source": "116.236.48.13", "testTime": "120", "passMark": 60, - "totalPoints": 120 + "totalPoints": 120, + "canTestTimes": 3, + "currentNumber" : 1, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "中级开发工程师", + "state": "正常", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 2, + "name":"李四", + "examinee": "lisi", + "examineeGroup": "扬州公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "false", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "currentNumber" : 1, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "中级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 3, + "name":"王五", + "examinee": "wangwu", + "examineeGroup": "扬州公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "true", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "currentNumber" : 1, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "中级开发工程师", + "state": "正常", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 4, + "name":"赵六", + "examinee": "zhaoliu", + "examineeGroup": "无锡分公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "true", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "currentNumber" : 1, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "初级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 5, + "name":"洪七", + "examinee": "洪七", + "examineeGroup": "无锡分公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "false", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "currentNumber" : 1, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "初级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 6, + "name":"赵六", + "examinee": "zhaoliu", + "examineeGroup": "无锡分公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "true", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "currentNumber" : 1, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "初级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" } ] \ No newline at end of file diff --git a/static/js/demo/exam/markExamPapersIFrame.json b/static/js/demo/exam/markExamPapersIFrame.json new file mode 100644 index 0000000000000000000000000000000000000000..a42cae89e8d297b0038de49b7d665dda5e0b55ef --- /dev/null +++ b/static/js/demo/exam/markExamPapersIFrame.json @@ -0,0 +1,95 @@ +{ + "id" : 1, + "value" : [ + { + "id" : 1, + "topic" : "下列哪一项不属于阴阳偏衰的病理", + "score" : "1.5", + "stu_answer" : "A", + "sta_answer" : "A", + "option" : ["我是选项A,我是该题答案","我是选项B","我是选项C","我是选项D"], + "question_types" : "单选题", + "points_scored" : "1.5" + }, + { + "id" : 2, + "topic" : "中医学理论体系以___为主导思想,以___生理、病理为基础。", + "score" : "3", + "stu_answer" : "未作答", + "sta_answer" : "整体观念 脏腑经络", + "option" : [], + "question_types" : "填空题", + "points_scored" : "0" + }, + { + "id" : 3, + "topic" : "名词解释:培土生金", + "score" : "5", + "stu_answer" : "未作答", + "sta_answer" : " 培土生金是补脾益气而补益肺气的方法又称补养脾肺法。适用于脾胃虚弱而不能养肺之证。", + "option" : [], + "question_types" : "名词解释", + "points_scored" : "0" + }, + { + "id" : 4, + "topic" : "怎样理解“阴在内阳之地也阳在外阴之使也”", + "score" : "8.5", + "stu_answer" : "我的答案是对的", + "sta_answer" : " 其意是指阴阳相互依存。阴代表物质阳代表功能物质居于体内所以说“阴在内”功能 表现于外所以说“阳在外”。在外的功能阳\uE00A是在内的物质阴\uE00A运动的表现故说阳为阴之使。 在内的阴是产生机能活动的物质基础故说阴为阳之守。张景岳说\uE00C“守者守于中使者运于外”。", + "option" : [], + "question_types" : "简答题", + "points_scored" : "0" + }, + { + "id" : 5, + "topic" : "试用阴阳学说说明人体的病理变化(要点及论述)", + "score" : "1.5", + "stu_answer" : "未作答", + "sta_answer" : "阴阳学说认为疾病的发生是阴阳失去相对平衡出现偏盛或偏衰的结果。疾病的发生、发展 关系正气人体的抗病机能\uE00A与邪气致病因素\uE00A两个方面。病邪有阴邪和阳邪之分正气包括阴精和 阳气两个部分当邪气侵袭人体邪正抗争而导致阴阳平衡被打破出现阴阳偏胜或偏衰的时候就会 发生各种相应的病证。例如阳邪致病则是致阳偏盛的实热证。阳胜的病变又必然损伤人体的阴液。所 以说“阳胜则热”“阳胜则阴病”。阴邪致病则导致阴偏盛的寒实证。阴胜的病变又必然损伤人体的阳 气。所以说“阴胜阳寒”“阴胜则阳病”。又如阴阳偏衰的病证人体的阳气虚损不能制阴则阴相对 偏盛而出现寒象所以说“阳虚则寒”。若人体的阴液不足不能制阳则出现阳相对偏亢的热象所以 说\uE00C“阴虚则热”。在阴阳偏衰的病者中还会出现阳损及阴阴损及阳阴阳俱损最终导致阴阳两虚 证。此外还有阴阳的转化阴阳格拒和阴阳亡失等尽管其病理变化复杂多端但均可用阴阳失调来 概括说明。“阳胜则热阴胜则寒阳虚则寒阴虚则热”是中医学病理总纲。", + "option" : [], + "question_types" : "论述题", + "points_scored" : "0" + }, + { + "id" : 6, + "topic" : "请用c语言写出九九乘法表", + "score" : "20", + "stu_answer" : "#includemain(){ int x,y,z; for(x=1;x<=9;x++) { for(y=1;y<=x;y++){ z=x*y; printf(\"%d*%d=%d \",y,x,z); } printf(\"); }}", + "sta_answer" : "#includemain(){ int x,y,z; for(x=1;x<=9;x++) { for(y=1;y<=x;y++){ z=x*y; printf(\"%d*%d=%d \",y,x,z); } printf(\"\") }}", + "option" : [], + "question_types" : "编程题", + "points_scored" : "0" + }, + { + "id" : 7, + "topic" : "我是来测试的,我是单选题,这题答案是C", + "score" : "1.5", + "stu_answer" : "A", + "sta_answer" : "C", + "option" : ["我是选项A","我是选项B","我是选项C,我是该题答案","我是选项D"], + "question_types" : "单选题", + "points_scored" : "0" + }, + { + "id" : 8, + "topic" : "我是来测试的,我是编程题", + "score" : "20", + "stu_answer" : "{ z=x*y; printf(\"%d*%d=%d \",y,x,z); } printf(\"\");", + "sta_answer" : "main(){ int x,y,z; for(x=1;x<=9;x++) { for(y=1;y<=x;y++){", + "option" : [], + "question_types" : "编程题", + "points_scored" : "0" + }, + { + "id" : 9, + "topic" : "我是来测试的,我是论述题", + "score" : "15", + "stu_answer" : "未作答", + "sta_answer" : "阴阳学说认为疾病的发生是阴阳失去相对平衡出现偏盛或偏衰的结果。疾病的发生、发展 关系正气\uE009人体的抗病机能\uE00A与邪气\uE009致病因素\uE00A两个方面。病邪有阴邪和阳邪之分正气包括阴精和 阳气两个部分当邪", + "option" : [], + "question_types" : "论述题", + "points_scored" : "0" + } + ] +} \ No newline at end of file diff --git a/static/js/demo/exam/markExamPapersIFrame2.json b/static/js/demo/exam/markExamPapersIFrame2.json new file mode 100644 index 0000000000000000000000000000000000000000..fba0ebaf68d11d6c5de37b91dc7352a45cd77698 --- /dev/null +++ b/static/js/demo/exam/markExamPapersIFrame2.json @@ -0,0 +1,221 @@ +[{ + "id" : 1, + "value" : [ + { + "id" : 1, + "topic" : "我是论答题1-1", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 2, + "topic" : "我是论答题1-2", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 3, + "topic" : "我是论答题1-3", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 4, + "topic" : "我是论答题1-4", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 5, + "topic" : "我是论答题1-5", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + } + ] +}, + { + "id" : 2, + "value" : [ + { + "id" : 1, + "topic" : "我是论答题2-1", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 2, + "topic" : "我是论答题2-2", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 3, + "topic" : "我是论答题2-3", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 4, + "topic" : "我是论答题2-4", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 5, + "topic" : "我是论答题2-5", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + } + ] + }, + { + "id" : 3, + "value" : [ + { + "id" : 1, + "topic" : "我是论答题3-1", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 2, + "topic" : "我是论答题3-2", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 3, + "topic" : "我是论答题3-3", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 4, + "topic" : "我是论答题3-4", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 5, + "topic" : "我是论答题3-5", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + } + ] + }, + { + "id" : 4, + "value" : [ + { + "id" : 1, + "topic" : "我是论答题4-1", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 2, + "topic" : "我是论答题4-2", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 3, + "topic" : "我是论答题4-3", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 4, + "topic" : "我是论答题4-4", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + }, + { + "id" : 5, + "topic" : "我是论答题4-5", + "score" : "15", + "stu_answer" : "我是用户答案,用来测试的数据", + "sta_answer" : "我是标准答案,用来测试对比的数据", + "option" : [], + "question_types" : "论答题", + "points_scored" : "0" + } + ] + } +] \ No newline at end of file diff --git a/static/js/demo/exam/testClassGroupData.json b/static/js/demo/exam/testClassGroupData.json new file mode 100644 index 0000000000000000000000000000000000000000..7475f24fb59feddfa3041cf7092f5c9df98922f3 --- /dev/null +++ b/static/js/demo/exam/testClassGroupData.json @@ -0,0 +1,50 @@ +[ + { + "id": 1, + "clazz": "软件1班-测试数据", + "state": "启用", + "check": true, + "studentsNumber": 3 + }, + { + "id": 2, + "clazz": "软件2班-测试数据", + "state": "禁用", + "check": false, + "studentsNumber": 10 + }, + { + "id": 3, + "clazz": "软件3班-测试数据", + "state": "启用", + "studentsNumber": 58 + }, + { + "id": 4, + "clazz": "软件4班-测试数据", + "state": "启用", + "check": false, + "studentsNumber": 47 + }, + { + "id": 5, + "clazz": "软件5班-测试数据", + "state": "启用", + "check": false, + "studentsNumber": 30 + }, + { + "id": 6, + "clazz": "软件6班-测试数据", + "state": "启用", + "check": true, + "studentsNumber": 36 + }, + { + "id": 7, + "clazz": "软件7班-测试数据", + "state": "启用", + "check": false, + "studentsNumber": 5 + } +] \ No newline at end of file diff --git a/static/js/demo/exam/testQuestions.json b/static/js/demo/exam/testQuestions.json new file mode 100644 index 0000000000000000000000000000000000000000..2d2bee5d09b3e1ac09c177f33967a169f5da2e9b --- /dev/null +++ b/static/js/demo/exam/testQuestions.json @@ -0,0 +1,5 @@ +[ + {"score": 1.0,"id":10, "item": "JAVA面向对象三大特性是什么?"}, + {"score": 1.0, "id": 11, "item": "Servlet的生命周期方法有哪些?"}, + {"score": 1.0, "id": 12, "item": "SpringMVC的前置控制器叫什么?"} +] \ No newline at end of file diff --git a/static/js/demo/exam/testQuestionsListTest.json b/static/js/demo/exam/testQuestionsListTest.json index 599c9ecba3a8cf680bed9aa9567375892e49e64f..cd8a7dd3daee470b9f7621831d333f47cdc6b427 100644 --- a/static/js/demo/exam/testQuestionsListTest.json +++ b/static/js/demo/exam/testQuestionsListTest.json @@ -1,7 +1,7 @@ [ { "id": "1", - "testPaperName":"英语4级考试", + "testPaperName": "英语4级考试", "testSubjects": "数学模拟考", "trySorting": "随机排序", "paperShow": "整卷展示", @@ -14,11 +14,11 @@ "titleNumber": "10", "singleTopicScore": "60.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "68.00", - "adminPermissions": "0", + "adminPermissions": "完全私有", "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", @@ -26,7 +26,7 @@ }, { "id": "2", - "testPaperName":"三年高考,六年模拟", + "testPaperName": "三年高考,六年模拟", "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", @@ -39,19 +39,19 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "3", - "testPaperName":"C语言基础测试", + "testPaperName": "C语言基础测试", "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", @@ -66,21 +66,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "4", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -92,23 +89,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "88.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "5", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -120,23 +114,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "100.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "6", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -150,21 +141,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "7", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -176,23 +164,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "8", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -204,23 +189,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "9", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -234,21 +216,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "10", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -260,23 +239,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "11", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -288,23 +264,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "12", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -318,21 +291,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "13", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -344,23 +314,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "14", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -372,23 +339,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "15", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -402,21 +366,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "16", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -428,23 +389,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "17", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -456,11 +414,11 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", + "adminPermissions": "完全私有", "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", @@ -468,11 +426,8 @@ }, { "id": "18", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -484,23 +439,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "19", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -514,21 +466,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "20", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -540,23 +489,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "78.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "21", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -568,23 +514,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "22", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -598,10 +541,10 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" diff --git a/static/js/demo/exam/testStudentGroupData.json b/static/js/demo/exam/testStudentGroupData.json new file mode 100644 index 0000000000000000000000000000000000000000..5a3e71cdebeac7cd0745bd70911c35f310a895e3 --- /dev/null +++ b/static/js/demo/exam/testStudentGroupData.json @@ -0,0 +1,65 @@ +[ + { + "id": 1, + "name": "张三-测试数据", + "stuId": "zdu20201911", + "state": "启用", + "check": true, + "registrationTime": "2020-07-11 09:20:10", + "clazz": "软件1班" + }, + { + "id": 2, + "name": "李四-测试数据", + "stuId": "zdu20201912", + "state": "禁用", + "check": false, + "registrationTime": "2020-07-06 09:20:10", + "clazz": "软件2班" + }, + { + "id": 3, + "name": "王五-测试数据", + "stuId": "zdu20201913", + "state": "启用", + "check": false, + "registrationTime": "2020-07-08 09:20:10", + "clazz": "软件3班" + }, + { + "id": 4, + "name": "赵六-测试数据", + "stuId": "zdu20201914", + "state": "启用", + "check": false, + "registrationTime": "2020-07-02 09:20:10", + "clazz": "软件4班" + }, + { + "id": 5, + "name": "余七-测试数据", + "stuId": "zdu20201915", + "state": "启用", + "check": false, + "registrationTime": "2020-10-06 09:20:10", + "clazz": "软件5班" + }, + { + "id": 6, + "name": "绉八-测试数据", + "stuId": "zdu20201916", + "state": "启用", + "check": true, + "registrationTime": "2020-09-06 09:20:10", + "clazz": "软件6班" + }, + { + "id": 7, + "name": "茂九-测试数据", + "stuId": "zdu20201917", + "state": "启用", + "check": false, + "registrationTime": "2020-07-08 09:20:10", + "clazz": "软件7班" + } +] \ No newline at end of file diff --git a/static/js/demo/exam/test_question_management.json b/static/js/demo/exam/test_question_management.json index f1d8d5d5f30930b9bd64d11757ac37e804052d3d..d5d5fd53c6c5b1ba3884fcb1052ad36b96c96786 100644 --- a/static/js/demo/exam/test_question_management.json +++ b/static/js/demo/exam/test_question_management.json @@ -2,28 +2,134 @@ { "id": 1, "question_bank": "编程题库", - "type": "编程题", + "type": "问答题", "status": "正常", - "difficulty": "一般", + "lebel": [ + "JAVASE", + "JAVA基础", + "JAVA训练" + ], + "difficulty": "极易", "question_stem": "实现九九乘法表", - "last_modified": "admin1,2020-06-16 17:14:34" + "founder": "admin", + "modified_by": "admin", + "creation_time": "2020-06-16 17:14:34", + "change_modified": "2020-06-16 17:14:34", + "option_settings": null, + "source_test": "原创", + "test_answer": "public class ForDemo{\n public static void main(String[] args)\n {\n System.out.println(\"乘法口诀表:\");\n for(int i=1;i<=9;i++)\n {\n for(int j=1;j<=i;j++)\n System.out.print(j+\"*\"+i+\"=\"+j*i+\"\\t\");\n }\n System.out.println();\n }\n }\n }", + "answer_analysis": "在上述代码中,首先声明两个变量分别是 i 和 j,接着使用了两个 for 循环语句,其中外层 for 语句用来控制输出行数,而内层 for 语句用来控制输出列数并由其所在的行数控制。" }, { "id": 2, "question_bank": "选择题库", "type": "单选题", "status": "禁用", - "difficulty": "一般", + "lebel": [ + "计算机系统" + ], + "difficulty": "容易", "question_stem": "选出计算机系统里的最开始的时间", - "last_modified": "admin1,2020-06-16 17:14:34" + "founder": "admin2", + "modified_by": "admin2", + "creation_time": "2020-06-16 17:14:35", + "change_modified": "2020-06-16 17:14:35", + "option_settings": { + "单选A": "单选答案A", + "单选B": "单选答案B", + "单选C": "单选答案C", + "单选D": "单选答案D", + "单选E": "单选答案E" + }, + "source_test": "经典例题", + "test_answer": "单选答案B", + "answer_analysis": "ABCDE" }, { "id": 3, "question_bank": "解答题库", - "type": "问答题", + "type": "多选题", + "status": "正常", + "lebel": [ + "多选题" + ], + "difficulty": "一般", + "question_stem": "多选题", + "founder": "admin2", + "modified_by": "admin2", + "creation_time": "2020-06-16 17:14:35", + "change_modified": "2020-06-16 17:14:35", + "option_settings": { + "多选A": "多选答案A", + "多选B": "多选答案B", + "多选C": "多选答案C", + "多选D": "多选答案D", + "多选E": "多选答案E" + }, + "source_test": "重点题", + "test_answer": "多选答案A,多选答案B,多选答案C", + "answer_analysis": "ABCDE" + }, + { + "id": 4, + "question_bank": "解答题库", + "type": "判断题", + "status": "禁用", + "lebel": [ + "判断题" + ], + "difficulty": "较难", + "question_stem": "判断题", + "founder": "admin2", + "modified_by": "admin2", + "creation_time": "2020-06-16 17:14:35", + "change_modified": "2020-06-16 17:14:35", + "option_settings": null, + "source_test": "难点例题", + "test_answer": "错误", + "answer_analysis": "易错题" + }, + { + "id": 5, + "question_bank": "解答题库", + "type": "填空题", + "status": "禁用", + "lebel": [ + "填空题" + ], + "difficulty": "极难", + "question_stem": "填空题", + "founder": "admin2", + "modified_by": "admin2", + "creation_time": "2020-06-16 17:14:35", + "change_modified": "2020-06-16 17:14:35", + "option_settings": null, + "source_test": "原创", + "test_answer": { + "填空1": "A", + "填空2": "B", + "填空3": "C", + "填空4": "D" + }, + "answer_analysis": "填空题" + }, + { + "id": 6, + "question_bank": "解答题库", + "type": "附件题", "status": "正常", + "lebel": [ + "附件题" + ], "difficulty": "一般", - "question_stem": "MySQL数据库的事务的特性", - "last_modified": "admin1,2020-06-16 17:14:34" + "question_stem": "附件题", + "founder": "admin2", + "modified_by": "admin2", + "creation_time": "2020-06-16 17:14:35", + "change_modified": "2020-06-16 17:14:35", + "option_settings": null, + "source_test": "原创", + "test_answer": "/upload/files/20200707/15941097831412hj8eovi4y.doc", + "answer_analysis": "附件题" } ] \ No newline at end of file diff --git a/static/js/demo/log/log.json b/static/js/demo/log/log.json index 1ad9c987eaa945cdb867264d813dc0fb0b8519c5..bac2260ad0a9f0de197dfd88b7c75b3393774480 100644 --- a/static/js/demo/log/log.json +++ b/static/js/demo/log/log.json @@ -98,5 +98,50 @@ "UserName":"admin", "Type":"后台管理端", "CountTime":"2020-06-15 11:22:12" +},{ + "Id": 12, + "LogThime":"系统配置-参数信息", + "IpAddress":"127.0.0.1", + "RequestAddress":"system/toSystemDirect", + "RequestType":"GET", + "UserName":"admin", + "Type":"后台管理端", + "CountTime":"2020-06-15 11:22:12" +},{ + "Id": 13, + "LogThime":"系统配置-参数信息", + "IpAddress":"127.0.0.1", + "RequestAddress":"system/toSystemDirect", + "RequestType":"GET", + "UserName":"admin", + "Type":"后台管理端", + "CountTime":"2020-06-15 11:22:12" +},{ + "Id": 14, + "LogThime":"系统配置-参数信息", + "IpAddress":"127.0.0.1", + "RequestAddress":"system/toSystemDirect", + "RequestType":"GET", + "UserName":"admin", + "Type":"后台管理端", + "CountTime":"2020-06-15 11:22:12" +},{ + "Id": 15, + "LogThime":"系统配置-参数信息", + "IpAddress":"127.0.0.1", + "RequestAddress":"system/toSystemDirect", + "RequestType":"GET", + "UserName":"admin", + "Type":"后台管理端", + "CountTime":"2020-06-15 11:22:12" +},{ + "Id": 16, + "LogThime":"系统配置-参数信息", + "IpAddress":"127.0.0.1", + "RequestAddress":"system/toSystemDirect", + "RequestType":"GET", + "UserName":"admin", + "Type":"后台管理端", + "CountTime":"2020-06-15 11:22:12" } ] \ No newline at end of file diff --git a/static/js/demo/notice/advice.json b/static/js/demo/notice/advice.json index 72658adc00765bb26b86062dd7c05e4e47aae580..0f1f4865931e16ef5061d0e9dc7380cf67925845 100644 --- a/static/js/demo/notice/advice.json +++ b/static/js/demo/notice/advice.json @@ -1,98 +1,74 @@ [ { - "ID": 1, "Title": "国际事件", "Content": "2020年6月菲律宾庆祝独立日", - "Publisher":"谭健","Type": "国际新闻", "Time":"2020-6-10" + "ID": 1, "Publisher": "李某", "Content": "模块太多了,都不知道从哪里找。。。", + "Email":"163@hjd.com","Time":"2020-6-10" }, { - "ID": 2, "Title": "新冠疫苗", "Content": "环球时报证实国企员工可以接种新冠疫苗", - "Publisher":"张一丰","Type":"国内新闻","Time": "2020-6-10" + "ID": 2, "Publisher": "张某", "Content": "有些模块里面的子页面太多了,使用起来有种眼花缭乱的感觉。。。", + "Email":"2365@hkjasdhfjh.com","Time": "2020-6-10" }, { - "ID": 3, "Title": "广州又添加新感染者", "Content": "6月12日上午,广州发现新感染者", - "Publisher":"张少维","Type":"国内新闻","Time": "2020-6-10" + "ID": 3, "Publisher": "陈某", "Content": "有些页面的页面显示效果不同,用起来感觉有点不协调。。。", + "Email":"17883@ahier.com","Time": "2020-6-10" }, { - "ID": 4, "Title": "党政一把手再次进京", "Content": "这几天,有五位省级党政一把手又来了北京", - "Publisher":"叶建雄","Type":"国内新闻","Time": "2020-6-10" + "ID": 4, "Publisher": "钟某某", "Content": "“社会我磊哥,人帅姑娘多”,写的模块很不错。。。", + "Email":"19835774@adafh.com","Time": "2020-6-10" }, { - "ID": 5, "Title": "英国抛香港问题半年报告", "Content": "当地时间6月11日,英国外交和联邦事务部发布了关于《中英联合声明》的半年报告", - "Publisher":"张奇","Type":"国内新闻","Time": "2020-6-10" + "ID": 5, "Publisher": "叶某", "Content": "这个app的整体风格是不错的,从设计理念,风格,到代码的具体实现都体现了编写者的实力水平。。。", + "Email":"313493459@qiuerioq.com","Time": "2020-6-10" }, { - "ID": 6, "Title": "法官再次拒绝黎智英离港申请", "Content": "涉港国安立法决定公布后,有“港独”头目弃保潜逃", - "Publisher":"陈聪","Type":"国内新闻","Time": "2020-6-10" + "ID": 6, "Publisher": "赵某", "Content": "总体来说,这个app还是不错的,希望再接再厉。。。", + "Email":"137438@afioa.com","Time": "2020-6-10" }, { - "ID": 7, "Title": "汲斌昌任山东省副省长", "Content": "6月12日上午,山东省十三届人大常委会第二十次会议经过表决,决定任命汲斌昌为山东省副省长", - "Publisher":"钟磊","Type":"国内新闻","Time": "2020-6-10" + "ID": 7, "Publisher": "李某", "Content": "模块太多了,都不知道从哪里找。。。", + "Email":"163@hjd.com","Time":"2020-6-10" }, { - "ID": 8, "Title": "中国无法和平崛起", "Content": "当下中美关系面临挑战,冷战话语复苏", - "Publisher":"王少鹏","Type":"国内新闻","Time": "2020-6-10" -}, - { - "ID": 9, "Title": "《国歌条例》今日刊宪实施", "Content": "《国歌条例》今日刊宪实施 升旗仪式、官方宣誓时要奏唱国歌", - "Publisher":"陈鑫","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 10, "Title": "世界第七!", "Content": "世界第七!乌东德水电站大坝工程全线贯通", - "Publisher":"杨万仁","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 11, "Title": "任正非说“杀出一条血路”", "Content": "西方舆论以有意无意的错误翻译来误读、抹黑、构陷中国", - "Publisher":"叶加飞","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 12, "Title": "市场部", "Content": "行政部", - "Publisher":"记者","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 1, "Title": "国际事件", "Content": "2020年6月菲律宾庆祝独立日", - "Publisher":"谭健","Type": "国际新闻", "Time":"2020-6-10" - }, - { - "ID": 2, "Title": "新冠疫苗", "Content": "环球时报证实国企员工可以接种新冠疫苗", - "Publisher":"张一丰","Type":"国内新闻","Time": "2020-6-10" + "ID": 8, "Publisher": "张某", "Content": "有些模块里面的子页面太多了,使用起来有种眼花缭乱的感觉。。。", + "Email":"2365@hkjasdhfjh.com","Time": "2020-6-10" }, { - "ID": 3, "Title": "广州又添加新感染者", "Content": "6月12日上午,广州发现新感染者", - "Publisher":"张少维","Type":"国内新闻","Time": "2020-6-10" + "ID": 9, "Publisher": "陈某", "Content": "有些页面的页面显示效果不同,用起来感觉有点不协调。。。", + "Email":"17883@ahier.com","Time": "2020-6-10" }, { - "ID": 4, "Title": "党政一把手再次进京", "Content": "这几天,有五位省级党政一把手又来了北京", - "Publisher":"叶建雄","Type":"国内新闻","Time": "2020-6-10" + "ID": 10, "Publisher": "赵某", "Content": "总体来说,这个app还是不错的,希望再接再厉。。。", + "Email":"19835774@adafh.com","Time": "2020-6-10" }, { - "ID": 5, "Title": "英国抛香港问题半年报告", "Content": "当地时间6月11日,英国外交和联邦事务部发布了其第46次关于《中英联合声明》的半年报告", - "Publisher":"张奇","Type":"国内新闻","Time": "2020-6-10" + "ID": 11, "Publisher": "叶某", "Content": "这个app的整体风格是不错的,从设计理念,风格,到代码的具体实现都体现了编写者的实力水平。。。", + "Email":"313493459@qiuerioq.com","Time": "2020-6-10" }, { - "ID": 6, "Title": "法官再次拒绝黎智英离港申请", "Content": "涉港国安立法决定公布后,有“港独”头目弃保潜逃", - "Publisher":"陈聪","Type":"国内新闻","Time": "2020-6-10" + "ID": 12, "Publisher": "谭某", "Content": "“社会我磊哥,人帅姑娘多”,写的模块很不错。。。", + "Email":"137438@afioa.com","Time": "2020-6-10" }, { - "ID": 7, "Title": "汲斌昌任山东省副省长", "Content": "6月12日上午,山东省十三届人大常委会第二十次会议经过表决,决定任命汲斌昌为山东省副省长", - "Publisher":"钟磊","Type":"国内新闻","Time": "2020-6-10" + "ID": 13, "Publisher": "李某", "Content": "模块太多了,都不知道从哪里找。。。", + "Email":"163@hjd.com","Time":"2020-6-10" }, { - "ID": 8, "Title": "中国无法和平崛起", "Content": "当下中美关系面临挑战,冷战话语复苏", - "Publisher":"王少鹏","Type":"国内新闻","Time": "2020-6-10" + "ID": 14, "Publisher": "张某", "Content": "有些模块里面的子页面太多了,使用起来有种眼花缭乱的感觉。。。", + "Email":"2365@hkjasdhfjh.com","Time": "2020-6-10" }, { - "ID": 9, "Title": "《国歌条例》今日刊宪实施", "Content": "《国歌条例》今日刊宪实施 升旗仪式、官方宣誓时要奏唱国歌", - "Publisher":"陈鑫","Type":"国内新闻","Time": "2020-6-10" + "ID": 15, "Publisher": "陈某", "Content": "有些页面的页面显示效果不同,用起来感觉有点不协调。。。", + "Email":"17883@ahier.com","Time": "2020-6-10" }, { - "ID": 10, "Title": "世界第七!", "Content": "世界第七!乌东德水电站大坝工程全线贯通", - "Publisher":"杨万仁","Type":"国内新闻","Time": "2020-6-10" + "ID": 16, "Publisher": "赵某", "Content": "总体来说,这个app还是不错的,希望再接再厉。。。", + "Email":"19835774@adafh.com","Time": "2020-6-10" }, { - "ID": 11, "Title": "任正非说“杀出一条血路”", "Content": "西方舆论以有意无意的错误翻译来误读、抹黑、构陷中国", - "Publisher":"叶加飞","Type":"国内新闻","Time": "2020-6-10" + "ID": 17, "Publisher": "叶某", "Content": "这个app的整体风格是不错的,从设计理念,风格,到代码的具体实现都体现了编写者的实力水平。。。", + "Email":"313493459@qiuerioq.com","Time": "2020-6-10" }, { - "ID": 12, "Title": "市场部", "Content": "行政部", - "Publisher":"记者","Type":"国内新闻","Time": "2020-6-10" + "ID": 18, "Publisher": "谭某", "Content": "“社会我磊哥,人帅姑娘多”,写的模块很不错。。。", + "Email":"137438@afioa.com","Time": "2020-6-10" } ] \ No newline at end of file diff --git a/static/js/demo/notice/newList.json b/static/js/demo/notice/newList.json index 72658adc00765bb26b86062dd7c05e4e47aae580..ad49ca2ff55693886b6aeabb21696d2b4b6da7ca 100644 --- a/static/js/demo/notice/newList.json +++ b/static/js/demo/notice/newList.json @@ -48,51 +48,51 @@ "Publisher":"记者","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 1, "Title": "国际事件", "Content": "2020年6月菲律宾庆祝独立日", + "ID": 13, "Title": "国际事件", "Content": "2020年6月菲律宾庆祝独立日", "Publisher":"谭健","Type": "国际新闻", "Time":"2020-6-10" }, { - "ID": 2, "Title": "新冠疫苗", "Content": "环球时报证实国企员工可以接种新冠疫苗", + "ID": 14, "Title": "新冠疫苗", "Content": "环球时报证实国企员工可以接种新冠疫苗", "Publisher":"张一丰","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 3, "Title": "广州又添加新感染者", "Content": "6月12日上午,广州发现新感染者", + "ID": 15, "Title": "广州又添加新感染者", "Content": "6月12日上午,广州发现新感染者", "Publisher":"张少维","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 4, "Title": "党政一把手再次进京", "Content": "这几天,有五位省级党政一把手又来了北京", + "ID": 16, "Title": "党政一把手再次进京", "Content": "这几天,有五位省级党政一把手又来了北京", "Publisher":"叶建雄","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 5, "Title": "英国抛香港问题半年报告", "Content": "当地时间6月11日,英国外交和联邦事务部发布了其第46次关于《中英联合声明》的半年报告", + "ID": 17, "Title": "英国抛香港问题半年报告", "Content": "当地时间6月11日,英国外交和联邦事务部发布了其第46次关于《中英联合声明》的半年报告", "Publisher":"张奇","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 6, "Title": "法官再次拒绝黎智英离港申请", "Content": "涉港国安立法决定公布后,有“港独”头目弃保潜逃", + "ID": 18, "Title": "法官再次拒绝黎智英离港申请", "Content": "涉港国安立法决定公布后,有“港独”头目弃保潜逃", "Publisher":"陈聪","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 7, "Title": "汲斌昌任山东省副省长", "Content": "6月12日上午,山东省十三届人大常委会第二十次会议经过表决,决定任命汲斌昌为山东省副省长", + "ID": 19, "Title": "汲斌昌任山东省副省长", "Content": "6月12日上午,山东省十三届人大常委会第二十次会议经过表决,决定任命汲斌昌为山东省副省长", "Publisher":"钟磊","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 8, "Title": "中国无法和平崛起", "Content": "当下中美关系面临挑战,冷战话语复苏", + "ID": 20, "Title": "中国无法和平崛起", "Content": "当下中美关系面临挑战,冷战话语复苏", "Publisher":"王少鹏","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 9, "Title": "《国歌条例》今日刊宪实施", "Content": "《国歌条例》今日刊宪实施 升旗仪式、官方宣誓时要奏唱国歌", + "ID": 21, "Title": "《国歌条例》今日刊宪实施", "Content": "《国歌条例》今日刊宪实施 升旗仪式、官方宣誓时要奏唱国歌", "Publisher":"陈鑫","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 10, "Title": "世界第七!", "Content": "世界第七!乌东德水电站大坝工程全线贯通", + "ID": 22, "Title": "世界第七!", "Content": "世界第七!乌东德水电站大坝工程全线贯通", "Publisher":"杨万仁","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 11, "Title": "任正非说“杀出一条血路”", "Content": "西方舆论以有意无意的错误翻译来误读、抹黑、构陷中国", + "ID": 22, "Title": "任正非说“杀出一条血路”", "Content": "西方舆论以有意无意的错误翻译来误读、抹黑、构陷中国", "Publisher":"叶加飞","Type":"国内新闻","Time": "2020-6-10" }, { - "ID": 12, "Title": "市场部", "Content": "行政部", + "ID": 23, "Title": "市场部", "Content": "行政部", "Publisher":"记者","Type":"国内新闻","Time": "2020-6-10" } ] \ No newline at end of file diff --git a/static/js/demo/notice/notice.json b/static/js/demo/notice/notice.json index 1f13d44787986926d96b5747df540c2f898c5e20..4807621dc51b7b579d0e19969d3082fac94364f6 100644 --- a/static/js/demo/notice/notice.json +++ b/static/js/demo/notice/notice.json @@ -1,98 +1,74 @@ [ { - "ID": 1, "Title": "国际事件", "Content": "2020年6月菲律宾庆祝独立日", - "Publisher":"谭健","Type": "国际新闻", "Time":"2020-6-10" + "ID": 1, "Title": "停水!", "Content": "停水!太原6月30日至7月1日最新停水公告,最长24小时!", + "status":"不发布","Publisher":" ","Type": "生活类型", "Time":"2020-6-10" }, { - "ID": 2, "Title": "新冠疫苗", "Content": "环球时报证实国企员工可以接种新冠疫苗", - "Publisher":"张一丰","Type":"国内新闻","Time": "2020-6-10" + "ID": 2, "Title": "透露利好 15股有望爆发", "Content": "公司持续在智能无人系统方向进行研发投入,已形成较完善的产品体系和具有核心竞争力的产品,上半年新业务取得突破性进展,原有核心业务也较快增长。", + "status":"发布","Publisher":"李四","Type":"财经类型","Time": "2020-6-10" }, { - "ID": 3, "Title": "广州又添加新感染者", "Content": "6月12日上午,广州发现新感染者", - "Publisher":"张少维","Type":"国内新闻","Time": "2020-6-10" + "ID": 3, "Title": "安新县应对新冠肺炎疫情", "Content": "当前,全县疫情防控形势异常严峻。为切实做好新冠肺炎疫情防控工作,最大限度地防止疫情输入和传播,保障人民群众生命安全和身体健。", + "status":"发布","Publisher":"王五","Type":"疫情公告","Time": "2020-6-10" }, { - "ID": 4, "Title": "党政一把手再次进京", "Content": "这几天,有五位省级党政一把手又来了北京", - "Publisher":"叶建雄","Type":"国内新闻","Time": "2020-6-10" + "ID": 4, "Title": "湖北又一地发布复学复课公告", "Content": "普通高中高二年级7月9日复学,暑期放假时间最迟不晚于7月底。", + "status":"不发布","Publisher":" ","Type":"学校开学","Time": "2020-6-10" }, { - "ID": 5, "Title": "英国抛香港问题半年报告", "Content": "当地时间6月11日,英国外交和联邦事务部发布了其第46次关于《中英联合声明》的半年报告", - "Publisher":"张奇","Type":"国内新闻","Time": "2020-6-10" + "ID": 5, "Title": "ST游久独立董事辞职公告", "Content": "上海游久游戏股份有限公司独立董事辞职公告 本公司董事会及全体董事保证本公告内容不存在任何虚假记载、误导性陈述或者重大遗漏。", + "status":"发布","Publisher":"孙七","Type":"企业公告","Time": "2020-6-10" }, { - "ID": 6, "Title": "法官再次拒绝黎智英离港申请", "Content": "涉港国安立法决定公布后,有“港独”头目弃保潜逃", - "Publisher":"陈聪","Type":"国内新闻","Time": "2020-6-10" + "ID": 6, "Title": "益生股份", "Content": "关于补选职工代表监事的公告山东益生种畜禽股份有限公司关于职工代表监事辞职并补选职工代表监事的公告本公司及监事会全体成员保证信息披露的内容真实", + "status":"发布","Publisher":"钟八","Type":"企业公告","Time": "2020-6-10" }, { - "ID": 7, "Title": "汲斌昌任山东省副省长", "Content": "6月12日上午,山东省十三届人大常委会第二十次会议经过表决,决定任命汲斌昌为山东省副省长", - "Publisher":"钟磊","Type":"国内新闻","Time": "2020-6-10" + "ID": 7, "Title": "停水!", "Content": "停水!太原6月30日至7月1日最新停水公告,最长24小时!", + "status":"发布","Publisher":"张三","Type": "生活类型", "Time":"2020-6-10" }, { - "ID": 8, "Title": "中国无法和平崛起", "Content": "当下中美关系面临挑战,冷战话语复苏", - "Publisher":"王少鹏","Type":"国内新闻","Time": "2020-6-10" -}, - { - "ID": 9, "Title": "《国歌条例》今日刊宪实施", "Content": "《国歌条例》今日刊宪实施 升旗仪式、官方宣誓时要奏唱国歌", - "Publisher":"陈鑫","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 10, "Title": "世界第七!", "Content": "世界第七!乌东德水电站大坝工程全线贯通", - "Publisher":"杨万仁","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 11, "Title": "任正非说“杀出一条血路”", "Content": "西方舆论以有意无意的错误翻译来误读、抹黑、构陷中国", - "Publisher":"叶加飞","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 12, "Title": "市场部", "Content": "行政部", - "Publisher":"记者","Type":"国内新闻","Time": "2020-6-10" - }, - { - "ID": 1, "Title": "国际事件", "Content": "2020年6月菲律宾庆祝独立日", - "Publisher":"谭健","Type": "国际新闻", "Time":"2020-6-10" - }, - { - "ID": 2, "Title": "新冠疫苗", "Content": "环球时报证实国企员工可以接种新冠疫苗", - "Publisher":"张一丰","Type":"国内新闻","Time": "2020-6-10" + "ID": 8, "Title": "透露利好 15股有望爆发", "Content": "公司持续在智能无人系统方向进行研发投入,已形成较完善的产品体系和具有核心竞争力的产品,上半年新业务取得突破性进展,原有核心业务也较快增长。", + "status":"不发布","Publisher":"李四","Type":"财经类型","Time": "2020-6-10" }, { - "ID": 3, "Title": "广州又添加新感染者", "Content": "6月12日上午,广州发现新感染者", - "Publisher":"张少维","Type":"国内新闻","Time": "2020-6-10" + "ID": 9, "Title": "安新县应对新冠肺炎疫情", "Content": "当前,全县疫情防控形势异常严峻。为切实做好新冠肺炎疫情防控工作,最大限度地防止疫情输入和传播,保障人民群众生命安全和身体健。", + "status":"不发布","Publisher":"王五","Type":"疫情公告","Time": "2020-6-10" }, { - "ID": 4, "Title": "党政一把手再次进京", "Content": "这几天,有五位省级党政一把手又来了北京", - "Publisher":"叶建雄","Type":"国内新闻","Time": "2020-6-10" + "ID": 10, "Title": "湖北又一地发布复学复课公告", "Content": "普通高中高二年级7月9日复学,暑期放假时间最迟不晚于7月底。", + "status":"发布","Publisher":"赵六","Type":"学校开学","Time": "2020-6-10" }, { - "ID": 5, "Title": "英国抛香港问题半年报告", "Content": "当地时间6月11日,英国外交和联邦事务部发布了关于《中英联合声明》的半年报告", - "Publisher":"张奇","Type":"国内新闻","Time": "2020-6-10" + "ID": 11, "Title": "ST游久独立董事辞职公告", "Content": "上海游久游戏股份有限公司独立董事辞职公告 本公司董事会及全体董事保证本公告内容不存在任何虚假记载、误导性陈述或者重大遗漏。", + "status":"发布","Publisher":"孙七","Type":"企业公告","Time": "2020-6-10" }, { - "ID": 6, "Title": "法官再次拒绝黎智英离港申请", "Content": "涉港国安立法决定公布后,有“港独”头目弃保潜逃", - "Publisher":"陈聪","Type":"国内新闻","Time": "2020-6-10" + "ID": 12, "Title": "益生股份", "Content": "关于补选职工代表监事的公告山东益生种畜禽股份有限公司关于职工代表监事辞职并补选职工代表监事的公告本公司及监事会全体成员保证信息披露的内容真实", + "status":"不发布","Publisher":"钟八","Type":"企业公告","Time": "2020-6-10" }, { - "ID": 7, "Title": "汲斌昌任山东省副省长", "Content": "6月12日上午,山东省十三届人大常委会第二十次会议经过表决,决定任命汲斌昌为山东省副省长", - "Publisher":"钟磊","Type":"国内新闻","Time": "2020-6-10" + "ID": 13, "Title": "停水!", "Content": "停水!太原6月30日至7月1日最新停水公告,最长24小时!", + "status":"发布","Publisher":"张三","Type": "生活类型", "Time":"2020-6-10" }, { - "ID": 8, "Title": "中国无法和平崛起", "Content": "当下中美关系面临挑战,冷战话语复苏", - "Publisher":"王少鹏","Type":"国内新闻","Time": "2020-6-10" + "ID": 14, "Title": "透露利好 15股有望爆发", "Content": "公司持续在智能无人系统方向进行研发投入,已形成较完善的产品体系和具有核心竞争力的产品,上半年新业务取得突破性进展,原有核心业务也较快增长。", + "status":"发布","Publisher":"李四","Type":"财经类型","Time": "2020-6-10" }, { - "ID": 9, "Title": "《国歌条例》今日刊宪实施", "Content": "《国歌条例》今日刊宪实施 升旗仪式、官方宣誓时要奏唱国歌", - "Publisher":"陈鑫","Type":"国内新闻","Time": "2020-6-10" + "ID": 15, "Title": "安新县应对新冠肺炎疫情", "Content": "当前,全县疫情防控形势异常严峻。为切实做好新冠肺炎疫情防控工作,最大限度地防止疫情输入和传播,保障人民群众生命安全和身体健。", + "status":"不发布","Publisher":"王五","Type":"疫情公告","Time": "2020-6-10" }, { - "ID": 10, "Title": "世界第七!", "Content": "世界第七!乌东德水电站大坝工程全线贯通", - "Publisher":"杨万仁","Type":"国内新闻","Time": "2020-6-10" + "ID": 16, "Title": "湖北又一地发布复学复课公告", "Content": "普通高中高二年级7月9日复学,暑期放假时间最迟不晚于7月底。", + "status":"不发布","Publisher":"赵六","Type":"学校开学","Time": "2020-6-10" }, { - "ID": 11, "Title": "任正非说“杀出一条血路”", "Content": "西方舆论以有意无意的错误翻译来误读、抹黑、构陷中国", - "Publisher":"叶加飞","Type":"国内新闻","Time": "2020-6-10" + "ID": 17, "Title": "ST游久独立董事辞职公告", "Content": "上海游久游戏股份有限公司独立董事辞职公告 本公司董事会及全体董事保证本公告内容不存在任何虚假记载、误导性陈述或者重大遗漏。", + "status":"不发布","Publisher":"孙七","Type":"企业公告","Time": "2020-6-10" }, { - "ID": 12, "Title": "市场部", "Content": "行政部", - "Publisher":"记者","Type":"国内新闻","Time": "2020-6-10" + "ID": 18, "Title": "益生股份", "Content": "关于补选职工代表监事的公告山东益生种畜禽股份有限公司关于职工代表监事辞职并补选职工代表监事的公告本公司及监事会全体成员保证信息披露的内容真实", + "status":"发布","Publisher":"钟八","Type":"企业公告","Time": "2020-6-10" } ] \ No newline at end of file diff --git a/static/js/demo/privilege/roleList_table_test.json b/static/js/demo/privilege/roleList_table_test.json index 959854bc218e59a29ff2b36da7350e9339082aef..db888e794be7f4a9b3ef165d95d711fabcda5259 100644 --- a/static/js/demo/privilege/roleList_table_test.json +++ b/static/js/demo/privilege/roleList_table_test.json @@ -21,7 +21,7 @@ }, { "id": 5, - "groupName": "角色5", + "roleName": "角色5", "createTime": "2018-08-10" }, { diff --git a/static/js/demo/resources/videoMgmt_table_test.json b/static/js/demo/resources/videoMgmt_table_test.json new file mode 100644 index 0000000000000000000000000000000000000000..529945935bfc704ac2c1960f31417f3d72a2fa8c --- /dev/null +++ b/static/js/demo/resources/videoMgmt_table_test.json @@ -0,0 +1,128 @@ +[ + { + "id": 1, + "pid": null, + "videoMsg": "JSP讲解", + "times": "共18节", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": true + }, + { + "id": 2, + "pid": null, + "videoMsg": "MVC模式", + "times": "共4节", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": true + }, + { + "id": 3, + "pid": null, + "videoMsg": "Servlet讲解", + "times": "共3节", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": true + }, + { + "id": 4, + "pid": 1, + "videoMsg": "JSP(1)", + "origin": "快程乐码", + "times": "共1节", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 5, + "pid": 0, + "videoMsg": "JQuery讲解", + "origin": "张三", + "times": "共1节", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 6, + "pid": 0, + "videoMsg": "Ajax讲解", + "times": "共1节", + "origin": "张三", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 7, + "pid": 1, + "videoMsg": "JSP(2)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 8, + "pid": 1, + "videoMsg": "JSP(3)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 9, + "pid": 2, + "videoMsg": "MVC(1)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 10, + "pid": 2, + "videoMsg": "MVC(2)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 11, + "pid": 2, + "videoMsg": "MVC(3)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 12, + "pid": 2, + "videoMsg": "MVC(4)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 13, + "pid": 3, + "videoMsg": "Servlet(1)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 14, + "pid": 3, + "videoMsg": "Servlet(2)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + }, + { + "id": 15, + "pid": 3, + "videoMsg": "Servlet(3)", + "origin": "快程乐码", + "status": "已全部通过审核", + "isDir": false + } +] \ No newline at end of file diff --git a/static/js/jquery.min.js b/static/js/jquery.min.js index 49990d6e14503798f142dcb0d5b23cb0c8f80244..8e78af5b9d23b22fd2f0f34fb33ddb1acaf0e8e9 100644 --- a/static/js/jquery.min.js +++ b/static/js/jquery.min.js @@ -1,4 +1,2435 @@ /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ -return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("'; + tGdocs = ''; + tVideo = '\n'; + tAudio = '\n'; + tFlash = '\n'; + tPdf = '\n'; + tObject = '\n' + '\n' + + $h.OBJECT_PARAMS + ' ' + $h.DEFAULT_PREVIEW + '\n\n'; + tOther = '
\n' + $h.DEFAULT_PREVIEW + '\n
\n'; + tZoomCache = ''; + vDefaultDim = {width: '100%', height: '100%', 'min-height': '480px'}; + if (self._isPdfRendered()) { + tPdf = self.pdfRendererTemplate.replace('{renderer}', self._encodeURI(self.pdfRendererUrl)); + } + self.defaults = { + layoutTemplates: { + main1: tMain1, + main2: tMain2, + preview: tPreview, + close: tClose, + fileIcon: tFileIcon, + caption: tCaption, + modalMain: tModalMain, + modal: tModal, + progress: tProgress, + stats: tStats, + size: tSize, + footer: tFooter, + indicator: tIndicator, + actions: tActions, + actionDelete: tActionDelete, + actionUpload: tActionUpload, + actionDownload: tActionDownload, + actionZoom: tActionZoom, + actionDrag: tActionDrag, + btnDefault: tBtnDefault, + btnLink: tBtnLink, + btnBrowse: tBtnBrowse, + zoomCache: tZoomCache + }, + previewMarkupTags: { + tagBefore1: tTagBef1, + tagBefore2: tTagBef2, + tagAfter: tTagAft + }, + previewContentTemplates: { + generic: tGeneric, + html: tHtml, + image: tImage, + text: tText, + office: tOffice, + gdocs: tGdocs, + video: tVideo, + audio: tAudio, + flash: tFlash, + object: tObject, + pdf: tPdf, + other: tOther + }, + allowedPreviewTypes: ['image', 'html', 'text', 'video', 'audio', 'flash', 'pdf', 'object'], + previewTemplates: {}, + previewSettings: { + image: {width: 'auto', height: 'auto', 'max-width': '100%', 'max-height': '100%'}, + html: {width: '213px', height: '160px'}, + text: {width: '213px', height: '160px'}, + office: {width: '213px', height: '160px'}, + gdocs: {width: '213px', height: '160px'}, + video: {width: '213px', height: '160px'}, + audio: {width: '100%', height: '30px'}, + flash: {width: '213px', height: '160px'}, + object: {width: '213px', height: '160px'}, + pdf: {width: '100%', height: '160px', 'position': 'relative'}, + other: {width: '213px', height: '160px'} + }, + previewSettingsSmall: { + image: {width: 'auto', height: 'auto', 'max-width': '100%', 'max-height': '100%'}, + html: {width: '100%', height: '160px'}, + text: {width: '100%', height: '160px'}, + office: {width: '100%', height: '160px'}, + gdocs: {width: '100%', height: '160px'}, + video: {width: '100%', height: 'auto'}, + audio: {width: '100%', height: '30px'}, + flash: {width: '100%', height: 'auto'}, + object: {width: '100%', height: 'auto'}, + pdf: {width: '100%', height: '160px'}, + other: {width: '100%', height: '160px'} + }, + previewZoomSettings: { + image: {width: 'auto', height: 'auto', 'max-width': '100%', 'max-height': '100%'}, + html: vDefaultDim, + text: vDefaultDim, + office: {width: '100%', height: '100%', 'max-width': '100%', 'min-height': '480px'}, + gdocs: {width: '100%', height: '100%', 'max-width': '100%', 'min-height': '480px'}, + video: {width: 'auto', height: '100%', 'max-width': '100%'}, + audio: {width: '100%', height: '30px'}, + flash: {width: 'auto', height: '480px'}, + object: {width: 'auto', height: '100%', 'max-width': '100%', 'min-height': '480px'}, + pdf: vDefaultDim, + other: {width: 'auto', height: '100%', 'min-height': '480px'} + }, + mimeTypeAliases: { + 'video/quicktime': 'video/mp4' + }, + fileTypeSettings: { + image: function (vType, vName) { + return ($h.compare(vType, 'image.*') && !$h.compare(vType, /(tiff?|wmf)$/i) || + $h.compare(vName, /\.(gif|png|jpe?g)$/i)); + }, + html: function (vType, vName) { + return $h.compare(vType, 'text/html') || $h.compare(vName, /\.(htm|html)$/i); + }, + office: function (vType, vName) { + return $h.compare(vType, /(word|excel|powerpoint|office)$/i) || + $h.compare(vName, /\.(docx?|xlsx?|pptx?|pps|potx?)$/i); + }, + gdocs: function (vType, vName) { + return $h.compare(vType, /(word|excel|powerpoint|office|iwork-pages|tiff?)$/i) || + $h.compare(vName, + /\.(docx?|xlsx?|pptx?|pps|potx?|rtf|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i); + }, + text: function (vType, vName) { + return $h.compare(vType, 'text.*') || $h.compare(vName, /\.(xml|javascript)$/i) || + $h.compare(vName, /\.(txt|md|csv|nfo|ini|json|php|js|css)$/i); + }, + video: function (vType, vName) { + return $h.compare(vType, 'video.*') && ($h.compare(vType, /(ogg|mp4|mp?g|mov|webm|3gp)$/i) || + $h.compare(vName, /\.(og?|mp4|webm|mp?g|mov|3gp)$/i)); + }, + audio: function (vType, vName) { + return $h.compare(vType, 'audio.*') && ($h.compare(vName, /(ogg|mp3|mp?g|wav)$/i) || + $h.compare(vName, /\.(og?|mp3|mp?g|wav)$/i)); + }, + flash: function (vType, vName) { + return $h.compare(vType, 'application/x-shockwave-flash', true) || $h.compare(vName, + /\.(swf)$/i); + }, + pdf: function (vType, vName) { + return $h.compare(vType, 'application/pdf', true) || $h.compare(vName, /\.(pdf)$/i); + }, + object: function () { + return true; + }, + other: function () { + return true; + } + }, + fileActionSettings: { + showRemove: true, + showUpload: true, + showDownload: true, + showZoom: true, + showDrag: true, + removeIcon: '', + removeClass: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + removeErrorClass: 'btn btn-sm btn-kv btn-danger', + removeTitle: 'Remove file', + uploadIcon: '', + uploadClass: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + uploadTitle: 'Upload file', + uploadRetryIcon: '', + uploadRetryTitle: 'Retry upload', + downloadIcon: '', + downloadClass: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + downloadTitle: 'Download file', + zoomIcon: '', + zoomClass: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + zoomTitle: 'View Details', + dragIcon: '', + dragClass: 'text-info', + dragTitle: 'Move / Rearrange', + dragSettings: {}, + indicatorNew: '', + indicatorSuccess: '', + indicatorError: '', + indicatorLoading: '', + indicatorPaused: '', + indicatorNewTitle: 'Not uploaded yet', + indicatorSuccessTitle: 'Uploaded', + indicatorErrorTitle: 'Upload Error', + indicatorLoadingTitle: 'Uploading …', + indicatorPausedTitle: 'Upload Paused' + } + }; + $.each(self.defaults, function (key, setting) { + if (key === 'allowedPreviewTypes') { + if (self.allowedPreviewTypes === undefined) { + self.allowedPreviewTypes = setting; + } + return; + } + self[key] = $.extend(true, {}, setting, self[key]); + }); + self._initPreviewTemplates(); + }, + _initPreviewTemplates: function () { + var self = this, tags = self.previewMarkupTags, tagBef, tagAft = tags.tagAfter; + $.each(self.previewContentTemplates, function (key, value) { + if ($h.isEmpty(self.previewTemplates[key])) { + tagBef = tags.tagBefore2; + if (key === 'generic' || key === 'image' || key === 'html' || key === 'text') { + tagBef = tags.tagBefore1; + } + if (self._isPdfRendered() && key === 'pdf') { + tagBef = tagBef.replace('kv-file-content', 'kv-file-content kv-pdf-rendered'); + } + self.previewTemplates[key] = tagBef + value + tagAft; + } + }); + }, + _initPreviewCache: function () { + var self = this; + self.previewCache = { + data: {}, + init: function () { + var content = self.initialPreview; + if (content.length > 0 && !$h.isArray(content)) { + content = content.split(self.initialPreviewDelimiter); + } + self.previewCache.data = { + content: content, + config: self.initialPreviewConfig, + tags: self.initialPreviewThumbTags + }; + }, + count: function (skipNull) { + if (!self.previewCache.data || !self.previewCache.data.content) { + return 0; + } + if (skipNull) { + var chk = self.previewCache.data.content.filter(function (n) { + return n !== null; + }); + return chk.length; + } + return self.previewCache.data.content.length; + }, + get: function (i, isDisabled) { + var ind = $h.INIT_FLAG + i, data = self.previewCache.data, config = data.config[i], + content = data.content[i], out, $tmp, cat, ftr, + fname, ftype, frameClass, asData = $h.ifSet('previewAsData', config, self.initialPreviewAsData), + a = config ? {title: config.title || null, alt: config.alt || null} : {title: null, alt: null}, + parseTemplate = function (cat, dat, fname, ftype, ftr, ind, fclass, t) { + var fc = ' file-preview-initial ' + $h.SORT_CSS + (fclass ? ' ' + fclass : ''), + id = self.previewInitId + '-' + ind, + fileId = config && config.fileId || id; + /** @namespace config.zoomData */ + return self._generatePreviewTemplate(cat, dat, fname, ftype, id, fileId, false, null, fc, + ftr, ind, t, a, config && config.zoomData || dat); + }; + if (!content || !content.length) { + return ''; + } + isDisabled = isDisabled === undefined ? true : isDisabled; + cat = $h.ifSet('type', config, self.initialPreviewFileType || 'generic'); + fname = $h.ifSet('filename', config, $h.ifSet('caption', config)); + ftype = $h.ifSet('filetype', config, cat); + ftr = self.previewCache.footer(i, isDisabled, (config && config.size || null)); + frameClass = $h.ifSet('frameClass', config); + if (asData) { + out = parseTemplate(cat, content, fname, ftype, ftr, ind, frameClass); + } else { + out = parseTemplate('generic', content, fname, ftype, ftr, ind, frameClass, cat) + .setTokens({'content': data.content[i]}); + } + if (data.tags.length && data.tags[i]) { + out = $h.replaceTags(out, data.tags[i]); + } + /** @namespace config.frameAttr */ + if (!$h.isEmpty(config) && !$h.isEmpty(config.frameAttr)) { + $tmp = $h.createElement(out); + $tmp.find('.file-preview-initial').attr(config.frameAttr); + out = $tmp.html(); + $tmp.remove(); + } + return out; + }, + clean: function (data) { + data.content = $h.cleanArray(data.content); + data.config = $h.cleanArray(data.config); + data.tags = $h.cleanArray(data.tags); + self.previewCache.data = data; + }, + add: function (content, config, tags, append) { + var data = self.previewCache.data, index; + if (!content || !content.length) { + return 0; + } + index = content.length - 1; + if (!$h.isArray(content)) { + content = content.split(self.initialPreviewDelimiter); + } + if (append && data.content) { + index = data.content.push(content[0]) - 1; + data.config[index] = config; + data.tags[index] = tags; + } else { + data.content = content; + data.config = config; + data.tags = tags; + } + self.previewCache.clean(data); + return index; + }, + set: function (content, config, tags, append) { + var data = self.previewCache.data, i, chk; + if (!content || !content.length) { + return; + } + if (!$h.isArray(content)) { + content = content.split(self.initialPreviewDelimiter); + } + chk = content.filter(function (n) { + return n !== null; + }); + if (!chk.length) { + return; + } + if (data.content === undefined) { + data.content = []; + } + if (data.config === undefined) { + data.config = []; + } + if (data.tags === undefined) { + data.tags = []; + } + if (append) { + for (i = 0; i < content.length; i++) { + if (content[i]) { + data.content.push(content[i]); + } + } + for (i = 0; i < config.length; i++) { + if (config[i]) { + data.config.push(config[i]); + } + } + for (i = 0; i < tags.length; i++) { + if (tags[i]) { + data.tags.push(tags[i]); + } + } + } else { + data.content = content; + data.config = config; + data.tags = tags; + } + self.previewCache.clean(data); + }, + unset: function (index) { + var chk = self.previewCache.count(), rev = self.reversePreviewOrder; + if (!chk) { + return; + } + if (chk === 1) { + self.previewCache.data.content = []; + self.previewCache.data.config = []; + self.previewCache.data.tags = []; + self.initialPreview = []; + self.initialPreviewConfig = []; + self.initialPreviewThumbTags = []; + return; + } + self.previewCache.data.content = $h.spliceArray(self.previewCache.data.content, index, rev); + self.previewCache.data.config = $h.spliceArray(self.previewCache.data.config, index, rev); + self.previewCache.data.tags = $h.spliceArray(self.previewCache.data.tags, index, rev); + var data = $.extend(true, {}, self.previewCache.data); + self.previewCache.clean(data); + }, + out: function () { + var html = '', caption, len = self.previewCache.count(), i, content; + if (len === 0) { + return {content: '', caption: ''}; + } + for (i = 0; i < len; i++) { + content = self.previewCache.get(i); + html = self.reversePreviewOrder ? (content + html) : (html + content); + } + caption = self._getMsgSelected(len); + return {content: html, caption: caption}; + }, + footer: function (i, isDisabled, size) { + var data = self.previewCache.data || {}; + if ($h.isEmpty(data.content)) { + return ''; + } + if ($h.isEmpty(data.config) || $h.isEmpty(data.config[i])) { + data.config[i] = {}; + } + isDisabled = isDisabled === undefined ? true : isDisabled; + var config = data.config[i], caption = $h.ifSet('caption', config), a, + width = $h.ifSet('width', config, 'auto'), url = $h.ifSet('url', config, false), + key = $h.ifSet('key', config, null), fileId = $h.ifSet('fileId', config, null), + fs = self.fileActionSettings, initPreviewShowDel = self.initialPreviewShowDelete || false, + downloadInitialUrl = !self.initialPreviewDownloadUrl ? '' : + self.initialPreviewDownloadUrl + '?key=' + key + (fileId ? '&fileId=' + fileId : ''), + dUrl = config.downloadUrl || downloadInitialUrl, + dFil = config.filename || config.caption || '', + initPreviewShowDwl = !!(dUrl), + sDel = $h.ifSet('showRemove', config, initPreviewShowDel), + sDwl = $h.ifSet('showDownload', config, $h.ifSet('showDownload', fs, initPreviewShowDwl)), + sZm = $h.ifSet('showZoom', config, $h.ifSet('showZoom', fs, true)), + sDrg = $h.ifSet('showDrag', config, $h.ifSet('showDrag', fs, true)), + dis = (url === false) && isDisabled; + sDwl = sDwl && config.downloadUrl !== false && !!dUrl; + a = self._renderFileActions(config, false, sDwl, sDel, sZm, sDrg, dis, url, key, true, dUrl, dFil); + return self._getLayoutTemplate('footer').setTokens({ + 'progress': self._renderThumbProgress(), + 'actions': a, + 'caption': caption, + 'size': self._getSize(size), + 'width': width, + 'indicator': '' + }); + } + }; + self.previewCache.init(); + }, + _isPdfRendered: function () { + var self = this, useLib = self.usePdfRenderer, + flag = typeof useLib === 'function' ? useLib() : !!useLib; + return flag && self.pdfRendererUrl; + }, + _handler: function ($el, event, callback) { + var self = this, ns = self.namespace, ev = event.split(' ').join(ns + ' ') + ns; + if (!$el || !$el.length) { + return; + } + $el.off(ev).on(ev, callback); + }, + _encodeURI: function (vUrl) { + var self = this; + return self.encodeUrl ? encodeURI(vUrl) : vUrl; + }, + _log: function (msg, tokens) { + var self = this, id = self.$element.attr('id'); + if (!self.showConsoleLogs) { + return; + } + if (id) { + msg = '"' + id + '": ' + msg; + } + msg = 'bootstrap-fileinput: ' + msg; + if (typeof tokens === 'object') { + msg = msg.setTokens(tokens); + } + if (window.console && typeof window.console.log !== 'undefined') { + window.console.log(msg); + } else { + window.alert(msg); + } + }, + _validate: function () { + var self = this, status = self.$element.attr('type') === 'file'; + if (!status) { + self._log($h.logMessages.badInputType); + } + return status; + }, + _errorsExist: function () { + var self = this, $err, $errList = self.$errorContainer.find('li'); + if ($errList.length) { + return true; + } + $err = $h.createElement(self.$errorContainer.html()); + $err.find('.kv-error-close').remove(); + $err.find('ul').remove(); + return !!$.trim($err.text()).length; + }, + _errorHandler: function (evt, caption) { + var self = this, err = evt.target.error, showError = function (msg) { + self._showError(msg.replace('{name}', caption)); + }; + /** @namespace err.NOT_FOUND_ERR */ + /** @namespace err.SECURITY_ERR */ + /** @namespace err.NOT_READABLE_ERR */ + if (err.code === err.NOT_FOUND_ERR) { + showError(self.msgFileNotFound); + } else { + if (err.code === err.SECURITY_ERR) { + showError(self.msgFileSecured); + } else { + if (err.code === err.NOT_READABLE_ERR) { + showError(self.msgFileNotReadable); + } else { + if (err.code === err.ABORT_ERR) { + showError(self.msgFilePreviewAborted); + } else { + showError(self.msgFilePreviewError); + } + } + } + } + }, + _addError: function (msg) { + var self = this, $error = self.$errorContainer; + if (msg && $error.length) { + $h.setHtml($error, self.errorCloseButton + msg); + self._handler($error.find('.kv-error-close'), 'click', function () { + setTimeout(function () { + if (self.showPreview && !self.getFrames().length) { + self.clear(); + } + $error.fadeOut('slow'); + }, self.processDelay); + }); + } + }, + _setValidationError: function (css) { + var self = this; + css = (css ? css + ' ' : '') + 'has-error'; + self.$container.removeClass(css).addClass('has-error'); + $h.addCss(self.$captionContainer, 'is-invalid'); + }, + _resetErrors: function (fade) { + var self = this, $error = self.$errorContainer; + if (self.isPersistentError) { + return; + } + self.isError = false; + self.$container.removeClass('has-error'); + self.$captionContainer.removeClass('is-invalid'); + $error.html(''); + if (fade) { + $error.fadeOut('slow'); + } else { + $error.hide(); + } + }, + _showFolderError: function (folders) { + var self = this, $error = self.$errorContainer, msg; + if (!folders) { + return; + } + if (!self.isAjaxUpload) { + self._clearFileInput(); + } + msg = self.msgFoldersNotAllowed.replace('{n}', folders); + self._addError(msg); + self._setValidationError(); + $error.fadeIn(self.fadeDelay); + self._raise('filefoldererror', [folders, msg]); + }, + _showFileError: function (msg, params, event) { + var self = this, $error = self.$errorContainer, ev = event || 'fileuploaderror', + fId = params && params.fileId || '', e = params && params.id ? + '
  • ' + msg + '
  • ' : '
  • ' + msg + '
  • '; + + if ($error.find('ul').length === 0) { + self._addError('
      ' + e + '
    '); + } else { + $error.find('ul').append(e); + } + $error.fadeIn(self.fadeDelay); + self._raise(ev, [params, msg]); + self._setValidationError('file-input-new'); + return true; + }, + _showError: function (msg, params, event) { + var self = this, $error = self.$errorContainer, ev = event || 'fileerror'; + params = params || {}; + params.reader = self.reader; + self._addError(msg); + $error.fadeIn(self.fadeDelay); + self._raise(ev, [params, msg]); + if (!self.isAjaxUpload) { + self._clearFileInput(); + } + self._setValidationError('file-input-new'); + self.$btnUpload.attr('disabled', true); + return true; + }, + _noFilesError: function (params) { + var self = this, label = self.minFileCount > 1 ? self.filePlural : self.fileSingle, + msg = self.msgFilesTooLess.replace('{n}', self.minFileCount).replace('{files}', label), + $error = self.$errorContainer; + msg = '
  • ' + msg + '
  • '; + if ($error.find('ul').length === 0) { + self._addError('
      ' + msg + '
    '); + } else { + $error.find('ul').append(msg); + } + self.isError = true; + self._updateFileDetails(0); + $error.fadeIn(self.fadeDelay); + self._raise('fileerror', [params, msg]); + self._clearFileInput(); + self._setValidationError(); + }, + _parseError: function (operation, jqXHR, errorThrown, fileName) { + /** @namespace jqXHR.responseJSON */ + var self = this, errMsg = $.trim(errorThrown + ''), textPre, errText, text; + errText = jqXHR.responseJSON && jqXHR.responseJSON.error ? jqXHR.responseJSON.error.toString() : ''; + text = errText ? errText : jqXHR.responseText; + if (self.cancelling && self.msgUploadAborted) { + errMsg = self.msgUploadAborted; + } + if (self.showAjaxErrorDetails && text) { + if (errText) { + errMsg = $.trim(errText + ''); + } else { + text = $.trim(text.replace(/\n\s*\n/g, '\n')); + textPre = text.length ? '
    ' + text + '
    ' : ''; + errMsg += errMsg ? textPre : text; + } + } + if (!errMsg) { + errMsg = self.msgAjaxError.replace('{operation}', operation); + } + self.cancelling = false; + return fileName ? '' + fileName + ': ' + errMsg : errMsg; + }, + _parseFileType: function (type, name) { + var self = this, isValid, vType, cat, i, types = self.allowedPreviewTypes || []; + if (type === 'application/text-plain') { + return 'text'; + } + for (i = 0; i < types.length; i++) { + cat = types[i]; + isValid = self.fileTypeSettings[cat]; + vType = isValid(type, name) ? cat : ''; + if (!$h.isEmpty(vType)) { + return vType; + } + } + return 'other'; + }, + _getPreviewIcon: function (fname) { + var self = this, ext, out = null; + if (fname && fname.indexOf('.') > -1) { + ext = fname.split('.').pop(); + if (self.previewFileIconSettings) { + out = self.previewFileIconSettings[ext] || self.previewFileIconSettings[ext.toLowerCase()] || null; + } + if (self.previewFileExtSettings) { + $.each(self.previewFileExtSettings, function (key, func) { + if (self.previewFileIconSettings[key] && func(ext)) { + out = self.previewFileIconSettings[key]; + //noinspection UnnecessaryReturnStatementJS + return; + } + }); + } + } + return out || self.previewFileIcon; + }, + _parseFilePreviewIcon: function (content, fname) { + var self = this, icn = self._getPreviewIcon(fname), out = content; + if (out.indexOf('{previewFileIcon}') > -1) { + out = out.setTokens({'previewFileIconClass': self.previewFileIconClass, 'previewFileIcon': icn}); + } + return out; + }, + _raise: function (event, params) { + var self = this, e = $.Event(event); + if (params !== undefined) { + self.$element.trigger(e, params); + } else { + self.$element.trigger(e); + } + if (e.isDefaultPrevented() || e.result === false) { + return false; + } + switch (event) { + // ignore these events + case 'filebatchuploadcomplete': + case 'filebatchuploadsuccess': + case 'fileuploaded': + case 'fileclear': + case 'filecleared': + case 'filereset': + case 'fileerror': + case 'filefoldererror': + case 'fileuploaderror': + case 'filebatchuploaderror': + case 'filedeleteerror': + case 'filecustomerror': + case 'filesuccessremove': + break; + // receive data response via `filecustomerror` event` + default: + if (!self.ajaxAborted) { + self.ajaxAborted = e.result; + } + break; + } + return true; + }, + _listenFullScreen: function (isFullScreen) { + var self = this, $modal = self.$modal, $btnFull, $btnBord; + if (!$modal || !$modal.length) { + return; + } + $btnFull = $modal && $modal.find('.btn-fullscreen'); + $btnBord = $modal && $modal.find('.btn-borderless'); + if (!$btnFull.length || !$btnBord.length) { + return; + } + $btnFull.removeClass('active').attr('aria-pressed', 'false'); + $btnBord.removeClass('active').attr('aria-pressed', 'false'); + if (isFullScreen) { + $btnFull.addClass('active').attr('aria-pressed', 'true'); + } else { + $btnBord.addClass('active').attr('aria-pressed', 'true'); + } + if ($modal.hasClass('file-zoom-fullscreen')) { + self._maximizeZoomDialog(); + } else { + if (isFullScreen) { + self._maximizeZoomDialog(); + } else { + $btnBord.removeClass('active').attr('aria-pressed', 'false'); + } + } + }, + _listen: function () { + var self = this, $el = self.$element, $form = self.$form, $cont = self.$container, fullScreenEvents; + self._handler($el, 'click', function (e) { + if ($el.hasClass('file-no-browse')) { + if ($el.data('zoneClicked')) { + $el.data('zoneClicked', false); + } else { + e.preventDefault(); + } + } + }); + self._handler($el, 'change', $.proxy(self._change, self)); + if (self.showBrowse) { + self._handler(self.$btnFile, 'click', $.proxy(self._browse, self)); + } + self._handler($cont.find('.fileinput-remove:not([disabled])'), 'click', $.proxy(self.clear, self)); + self._handler($cont.find('.fileinput-cancel'), 'click', $.proxy(self.cancel, self)); + self._handler($cont.find('.fileinput-pause'), 'click', $.proxy(self.pause, self)); + self._initDragDrop(); + self._handler($form, 'reset', $.proxy(self.clear, self)); + if (!self.isAjaxUpload) { + self._handler($form, 'submit', $.proxy(self._submitForm, self)); + } + self._handler(self.$container.find('.fileinput-upload'), 'click', $.proxy(self._uploadClick, self)); + self._handler($(window), 'resize', function () { + self._listenFullScreen(screen.width === window.innerWidth && screen.height === window.innerHeight); + }); + fullScreenEvents = 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange'; + self._handler($(document), fullScreenEvents, function () { + self._listenFullScreen($h.checkFullScreen()); + }); + self._autoFitContent(); + self._initClickable(); + self._refreshPreview(); + }, + _autoFitContent: function () { + var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, + self = this, config = width < 400 ? (self.previewSettingsSmall || self.defaults.previewSettingsSmall) : + (self.previewSettings || self.defaults.previewSettings), sel; + $.each(config, function (cat, settings) { + sel = '.file-preview-frame .file-preview-' + cat; + self.$preview.find(sel + '.kv-preview-data,' + sel + ' .kv-preview-data').css(settings); + }); + }, + _scanDroppedItems: function (item, files, path) { + path = path || ''; + var self = this, i, dirReader, readDir, errorHandler = function (e) { + self._log($h.logMessages.badDroppedFiles); + self._log(e); + }; + if (item.isFile) { + item.file(function (file) { + if (path) { + file.newPath = path + file.name; + } + files.push(file); + }, errorHandler); + } else { + if (item.isDirectory) { + dirReader = item.createReader(); + readDir = function () { + dirReader.readEntries(function (entries) { + if (entries && entries.length > 0) { + for (i = 0; i < entries.length; i++) { + self._scanDroppedItems(entries[i], files, path + item.name + '/'); + } + // recursively call readDir() again, since browser can only handle first 100 entries. + readDir(); + } + return null; + }, errorHandler); + }; + readDir(); + } + } + + }, + _initDragDrop: function () { + var self = this, $zone = self.$dropZone; + if (self.dropZoneEnabled && self.showPreview) { + self._handler($zone, 'dragenter dragover', $.proxy(self._zoneDragEnter, self)); + self._handler($zone, 'dragleave', $.proxy(self._zoneDragLeave, self)); + self._handler($zone, 'drop', $.proxy(self._zoneDrop, self)); + self._handler($(document), 'dragenter dragover drop', self._zoneDragDropInit); + } + }, + _zoneDragDropInit: function (e) { + e.stopPropagation(); + e.preventDefault(); + }, + _zoneDragEnter: function (e) { + var self = this, dataTransfer = e.originalEvent.dataTransfer, + hasFiles = $.inArray('Files', dataTransfer.types) > -1; + self._zoneDragDropInit(e); + if (self.isDisabled || !hasFiles) { + e.originalEvent.dataTransfer.effectAllowed = 'none'; + e.originalEvent.dataTransfer.dropEffect = 'none'; + return; + } + if (self._raise('fileDragEnter', {'sourceEvent': e, 'files': dataTransfer.types.Files})) { + $h.addCss(self.$dropZone, 'file-highlighted'); + } + }, + _zoneDragLeave: function (e) { + var self = this; + self._zoneDragDropInit(e); + if (self.isDisabled) { + return; + } + if (self._raise('fileDragLeave', {'sourceEvent': e})) { + self.$dropZone.removeClass('file-highlighted'); + } + + }, + _zoneDrop: function (e) { + /** @namespace e.originalEvent.dataTransfer */ + var self = this, i, $el = self.$element, dataTransfer = e.originalEvent.dataTransfer, + files = dataTransfer.files, items = dataTransfer.items, folders = $h.getDragDropFolders(items), + processFiles = function () { + if (!self.isAjaxUpload) { + self.changeTriggered = true; + $el.get(0).files = files; + setTimeout(function () { + self.changeTriggered = false; + $el.trigger('change' + self.namespace); + }, self.processDelay); + } else { + self._change(e, files); + } + self.$dropZone.removeClass('file-highlighted'); + }; + e.preventDefault(); + if (self.isDisabled || $h.isEmpty(files)) { + return; + } + if (!self._raise('fileDragDrop', {'sourceEvent': e, 'files': files})) { + return; + } + if (folders > 0) { + if (!self.isAjaxUpload) { + self._showFolderError(folders); + return; + } + files = []; + for (i = 0; i < items.length; i++) { + var item = items[i].webkitGetAsEntry(); + if (item) { + self._scanDroppedItems(item, files); + } + } + setTimeout(function () { + processFiles(); + }, 500); + } else { + processFiles(); + } + }, + _uploadClick: function (e) { + var self = this, $btn = self.$container.find('.fileinput-upload'), $form, + isEnabled = !$btn.hasClass('disabled') && $h.isEmpty($btn.attr('disabled')); + if (e && e.isDefaultPrevented()) { + return; + } + if (!self.isAjaxUpload) { + if (isEnabled && $btn.attr('type') !== 'submit') { + $form = $btn.closest('form'); + // downgrade to normal form submit if possible + if ($form.length) { + $form.trigger('submit'); + } + e.preventDefault(); + } + return; + } + e.preventDefault(); + if (isEnabled) { + self.upload(); + } + }, + _submitForm: function () { + var self = this; + return self._isFileSelectionValid() && !self._abort({}); + }, + _clearPreview: function () { + var self = this, + $thumbs = self.showUploadedThumbs ? self.getFrames(':not(.file-preview-success)') : self.getFrames(); + $thumbs.each(function () { + var $thumb = $(this); + $thumb.remove(); + }); + if (!self.getFrames().length || !self.showPreview) { + self._resetUpload(); + } + self._validateDefaultPreview(); + }, + _initSortable: function () { + var self = this, $el = self.$preview, settings, selector = '.' + $h.SORT_CSS, $cont, $body = $('body'), + $html = $('html'), rev = self.reversePreviewOrder, Sortable = window.Sortable, beginGrab, endGrab; + if (!Sortable || $el.find(selector).length === 0) { + return; + } + $cont = $body.length ? $body : ($html.length ? $html : self.$container); + beginGrab = function () { + $cont.addClass('file-grabbing'); + }; + endGrab = function () { + $cont.removeClass('file-grabbing'); + }; + //noinspection JSUnusedGlobalSymbols + settings = { + handle: '.drag-handle-init', + dataIdAttr: 'data-fileid', + animation: 600, + draggable: selector, + scroll: false, + forceFallback: true, + onChoose: beginGrab, + onStart: beginGrab, + onUnchoose: endGrab, + onEnd: endGrab, + onSort: function (e) { + var oldIndex = e.oldIndex, newIndex = e.newIndex, i = 0, len = self.initialPreviewConfig.length, + exceedsLast = len > 0 && newIndex >= len, $item = $(e.item), $first; + if (exceedsLast) { + newIndex = len - 1; + } + self.initialPreview = $h.moveArray(self.initialPreview, oldIndex, newIndex, rev); + self.initialPreviewConfig = $h.moveArray(self.initialPreviewConfig, oldIndex, newIndex, rev); + self.previewCache.init(); + self.getFrames('.file-preview-initial').each(function () { + $(this).attr('data-fileindex', $h.INIT_FLAG + i); + i++; + }); + if (exceedsLast) { + $first = self.getFrames(':not(.file-preview-initial):first'); + if ($first.length) { + $item.slideUp(function () { + $item.insertBefore($first).slideDown(); + }); + } + } + self._raise('filesorted', { + previewId: $item.attr('id'), + 'oldIndex': oldIndex, + 'newIndex': newIndex, + stack: self.initialPreviewConfig + }); + }, + }; + $.extend(true, settings, self.fileActionSettings.dragSettings); + if (self.sortable) { + self.sortable.destroy(); + } + self.sortable = Sortable.create($el[0], settings); + }, + _setPreviewContent: function (content) { + var self = this; + $h.setHtml(self.$preview, content); + self._autoFitContent(); + }, + _initPreviewImageOrientations: function () { + var self = this, i = 0, canOrientImage = self.canOrientImage; + if (!self.autoOrientImageInitial && !canOrientImage) { + return; + } + self.getFrames('.file-preview-initial').each(function () { + var $thumb = $(this), $img, $zoomImg, id, config = self.initialPreviewConfig[i]; + /** @namespace config.exif */ + if (config && config.exif && config.exif.Orientation) { + id = $thumb.attr('id'); + $img = $thumb.find('>.kv-file-content img'); + $zoomImg = self._getZoom(id, ' >.kv-file-content img'); + if (canOrientImage) { + $img.css('image-orientation', (self.autoOrientImageInitial ? 'from-image' : 'none')); + } else { + self.setImageOrientation($img, $zoomImg, config.exif.Orientation, $thumb); + } + } + i++; + }); + }, + _initPreview: function (isInit) { + var self = this, cap = self.initialCaption || '', out; + if (!self.previewCache.count(true)) { + self._clearPreview(); + if (isInit) { + self._setCaption(cap); + } else { + self._initCaption(); + } + return; + } + out = self.previewCache.out(); + cap = isInit && self.initialCaption ? self.initialCaption : out.caption; + self._setPreviewContent(out.content); + self._setInitThumbAttr(); + self._setCaption(cap); + self._initSortable(); + if (!$h.isEmpty(out.content)) { + self.$container.removeClass('file-input-new'); + } + self._initPreviewImageOrientations(); + }, + _getZoomButton: function (type) { + var self = this, label = self.previewZoomButtonIcons[type], css = self.previewZoomButtonClasses[type], + title = ' title="' + (self.previewZoomButtonTitles[type] || '') + '" ', + params = title + (type === 'close' ? ' data-dismiss="modal" aria-hidden="true"' : ''); + if (type === 'fullscreen' || type === 'borderless' || type === 'toggleheader') { + params += ' data-toggle="button" aria-pressed="false" autocomplete="off"'; + } + return ''; + }, + _getModalContent: function () { + var self = this; + return self._getLayoutTemplate('modal').setTokens({ + 'rtl': self.rtl ? ' kv-rtl' : '', + 'zoomFrameClass': self.frameClass, + 'heading': self.msgZoomModalHeading, + 'prev': self._getZoomButton('prev'), + 'next': self._getZoomButton('next'), + 'toggleheader': self._getZoomButton('toggleheader'), + 'fullscreen': self._getZoomButton('fullscreen'), + 'borderless': self._getZoomButton('borderless'), + 'close': self._getZoomButton('close') + }); + }, + _listenModalEvent: function (event) { + var self = this, $modal = self.$modal, getParams = function (e) { + return { + sourceEvent: e, + previewId: $modal.data('previewId'), + modal: $modal + }; + }; + $modal.on(event + '.bs.modal', function (e) { + var $btnFull = $modal.find('.btn-fullscreen'), $btnBord = $modal.find('.btn-borderless'); + if ($modal.data('fileinputPluginId') === self.$element.attr('id')) { + self._raise('filezoom' + event, getParams(e)); + } + if (event === 'shown') { + $btnBord.removeClass('active').attr('aria-pressed', 'false'); + $btnFull.removeClass('active').attr('aria-pressed', 'false'); + if ($modal.hasClass('file-zoom-fullscreen')) { + self._maximizeZoomDialog(); + if ($h.checkFullScreen()) { + $btnFull.addClass('active').attr('aria-pressed', 'true'); + } else { + $btnBord.addClass('active').attr('aria-pressed', 'true'); + } + } + } + }); + }, + _initZoom: function () { + var self = this, $dialog, modalMain = self._getLayoutTemplate('modalMain'), modalId = '#' + $h.MODAL_ID; + if (!self.showPreview) { + return; + } + self.$modal = $(modalId); + if (!self.$modal || !self.$modal.length) { + $dialog = $h.createElement($h.cspBuffer.stash(modalMain)).insertAfter(self.$container); + self.$modal = $(modalId).insertBefore($dialog); + $h.cspBuffer.apply(self.$modal); + $dialog.remove(); + } + $h.initModal(self.$modal); + self.$modal.html($h.cspBuffer.stash(self._getModalContent())); + $h.cspBuffer.apply(self.$modal); + $.each($h.MODAL_EVENTS, function (key, event) { + self._listenModalEvent(event); + }); + }, + _initZoomButtons: function () { + var self = this, previewId = self.$modal.data('previewId') || '', $first, $last, + thumbs = self.getFrames().toArray(), len = thumbs.length, $prev = self.$modal.find('.btn-prev'), + $next = self.$modal.find('.btn-next'); + if (thumbs.length < 2) { + $prev.hide(); + $next.hide(); + return; + } else { + $prev.show(); + $next.show(); + } + if (!len) { + return; + } + $first = $(thumbs[0]); + $last = $(thumbs[len - 1]); + $prev.removeAttr('disabled'); + $next.removeAttr('disabled'); + if ($first.length && $first.attr('id') === previewId) { + $prev.attr('disabled', true); + } + if ($last.length && $last.attr('id') === previewId) { + $next.attr('disabled', true); + } + }, + _maximizeZoomDialog: function () { + var self = this, $modal = self.$modal, $head = $modal.find('.modal-header:visible'), + $foot = $modal.find('.modal-footer:visible'), $body = $modal.find('.modal-body'), + h = $(window).height(), diff = 0; + $modal.addClass('file-zoom-fullscreen'); + if ($head && $head.length) { + h -= $head.outerHeight(true); + } + if ($foot && $foot.length) { + h -= $foot.outerHeight(true); + } + if ($body && $body.length) { + diff = $body.outerHeight(true) - $body.height(); + h -= diff; + } + $modal.find('.kv-zoom-body').height(h); + }, + _resizeZoomDialog: function (fullScreen) { + var self = this, $modal = self.$modal, $btnFull = $modal.find('.btn-fullscreen'), + $btnBord = $modal.find('.btn-borderless'); + if ($modal.hasClass('file-zoom-fullscreen')) { + $h.toggleFullScreen(false); + if (!fullScreen) { + if (!$btnFull.hasClass('active')) { + $modal.removeClass('file-zoom-fullscreen'); + self.$modal.find('.kv-zoom-body').css('height', self.zoomModalHeight); + } else { + $btnFull.removeClass('active').attr('aria-pressed', 'false'); + } + } else { + if (!$btnFull.hasClass('active')) { + $modal.removeClass('file-zoom-fullscreen'); + self._resizeZoomDialog(true); + if ($btnBord.hasClass('active')) { + $btnBord.removeClass('active').attr('aria-pressed', 'false'); + } + } + } + } else { + if (!fullScreen) { + self._maximizeZoomDialog(); + return; + } + $h.toggleFullScreen(true); + } + $modal.focus(); + }, + _setZoomContent: function ($frame, animate) { + var self = this, $content, tmplt, body, title, $body, $dataEl, config, previewId = $frame.attr('id'), + $zoomPreview = self._getZoom(previewId), $modal = self.$modal, $tmp, + $btnFull = $modal.find('.btn-fullscreen'), $btnBord = $modal.find('.btn-borderless'), cap, size, + $btnTogh = $modal.find('.btn-toggleheader'); + tmplt = $zoomPreview.attr('data-template') || 'generic'; + $content = $zoomPreview.find('.kv-file-content'); + body = $content.length ? $content.html() : ''; + cap = $frame.data('caption') || ''; + size = $frame.data('size') || ''; + title = cap + ' ' + size; + $modal.find('.kv-zoom-title').attr('title', $('
    ').html(title).text()).html(title); + $body = $modal.find('.kv-zoom-body'); + $modal.removeClass('kv-single-content'); + if (animate) { + $tmp = $body.addClass('file-thumb-loading').clone().insertAfter($body); + $h.setHtml($body, body).hide(); + $tmp.fadeOut('fast', function () { + $body.fadeIn('fast', function () { + $body.removeClass('file-thumb-loading'); + }); + $tmp.remove(); + }); + } else { + $h.setHtml($body, body); + } + config = self.previewZoomSettings[tmplt]; + if (config) { + $dataEl = $body.find('.kv-preview-data'); + $h.addCss($dataEl, 'file-zoom-detail'); + $.each(config, function (key, value) { + $dataEl.css(key, value); + if (($dataEl.attr('width') && key === 'width') || ($dataEl.attr('height') && key === 'height')) { + $dataEl.removeAttr(key); + } + }); + } + $modal.data('previewId', previewId); + self._handler($modal.find('.btn-prev'), 'click', function () { + self._zoomSlideShow('prev', previewId); + }); + self._handler($modal.find('.btn-next'), 'click', function () { + self._zoomSlideShow('next', previewId); + }); + self._handler($btnFull, 'click', function () { + self._resizeZoomDialog(true); + }); + self._handler($btnBord, 'click', function () { + self._resizeZoomDialog(false); + }); + self._handler($btnTogh, 'click', function () { + var $header = $modal.find('.modal-header'), $floatBar = $modal.find('.modal-body .floating-buttons'), + ht, $actions = $header.find('.kv-zoom-actions'), resize = function (height) { + var $body = self.$modal.find('.kv-zoom-body'), h = self.zoomModalHeight; + if ($modal.hasClass('file-zoom-fullscreen')) { + h = $body.outerHeight(true); + if (!height) { + h = h - $header.outerHeight(true); + } + } + $body.css('height', height ? h + height : h); + }; + if ($header.is(':visible')) { + ht = $header.outerHeight(true); + $header.slideUp('slow', function () { + $actions.find('.btn').appendTo($floatBar); + resize(ht); + }); + } else { + $floatBar.find('.btn').appendTo($actions); + $header.slideDown('slow', function () { + resize(); + }); + } + $modal.focus(); + }); + self._handler($modal, 'keydown', function (e) { + var key = e.which || e.keyCode, $prev = $(this).find('.btn-prev'), $next = $(this).find('.btn-next'), + vId = $(this).data('previewId'), vPrevKey = self.rtl ? 39 : 37, vNextKey = self.rtl ? 37 : 39; + if (key === vPrevKey && $prev.length && !$prev.attr('disabled')) { + self._zoomSlideShow('prev', vId); + } + if (key === vNextKey && $next.length && !$next.attr('disabled')) { + self._zoomSlideShow('next', vId); + } + }); + }, + _showModal: function ($frame) { + var self = this, $modal = self.$modal; + if (!$frame || !$frame.length) { + return; + } + $h.initModal($modal); + $h.setHtml($modal, self._getModalContent()); + self._setZoomContent($frame); + $modal.data('fileinputPluginId', self.$element.attr('id')); + $modal.modal('show'); + self._initZoomButtons(); + }, + _zoomPreview: function ($btn) { + var self = this, $frame; + if (!$btn.length) { + throw 'Cannot zoom to detailed preview!'; + } + $frame = $btn.closest($h.FRAMES); + self._showModal($frame); + }, + _zoomSlideShow: function (dir, previewId) { + var self = this, $btn = self.$modal.find('.kv-zoom-actions .btn-' + dir), $targFrame, i, $thumb, + thumbsData = self.getFrames().toArray(), thumbs = [], len = thumbsData.length, out; + if ($btn.attr('disabled')) { + return; + } + for (i = 0; i < len; i++) { + $thumb = $(thumbsData[i]); + if ($thumb && $thumb.length && $thumb.find('.kv-file-zoom:visible').length) { + thumbs.push(thumbsData[i]); + } + } + len = thumbs.length; + for (i = 0; i < len; i++) { + if ($(thumbs[i]).attr('id') === previewId) { + out = dir === 'prev' ? i - 1 : i + 1; + break; + } + } + if (out < 0 || out >= len || !thumbs[out]) { + return; + } + $targFrame = $(thumbs[out]); + if ($targFrame.length) { + self._setZoomContent($targFrame, true); + } + self._initZoomButtons(); + self._raise('filezoom' + dir, {'previewId': previewId, modal: self.$modal}); + }, + _initZoomButton: function () { + var self = this; + self.$preview.find('.kv-file-zoom').each(function () { + var $el = $(this); + self._handler($el, 'click', function () { + self._zoomPreview($el); + }); + }); + }, + _inputFileCount: function () { + return this.$element[0].files.length; + }, + _refreshPreview: function () { + var self = this, files; + if ((!self._inputFileCount() && !self.isAjaxUpload) || !self.showPreview || !self.isPreviewable) { + return; + } + if (self.isAjaxUpload) { + if (self.fileManager.count() > 0) { + files = $.extend(true, {}, self.fileManager.stack); + self.fileManager.clear(); + self._clearFileInput(); + } else { + files = self.$element[0].files; + } + } else { + files = self.$element[0].files; + } + if (files && files.length) { + self.readFiles(files); + self._setFileDropZoneTitle(); + } + }, + _clearObjects: function ($el) { + $el.find('video audio').each(function () { + this.pause(); + $(this).remove(); + }); + $el.find('img object div').each(function () { + $(this).remove(); + }); + }, + _clearFileInput: function () { + var self = this, $el = self.$element, $srcFrm, $tmpFrm, $tmpEl; + if (!self._inputFileCount()) { + return; + } + $srcFrm = $el.closest('form'); + $tmpFrm = $(document.createElement('form')); + $tmpEl = $(document.createElement('div')); + $el.before($tmpEl); + if ($srcFrm.length) { + $srcFrm.after($tmpFrm); + } else { + $tmpEl.after($tmpFrm); + } + $tmpFrm.append($el).trigger('reset'); + $tmpEl.before($el).remove(); + $tmpFrm.remove(); + }, + _resetUpload: function () { + var self = this; + self.uploadCache = []; + self.$btnUpload.removeAttr('disabled'); + self._setProgress(0); + self._hideProgress(); + self._resetErrors(false); + self._initAjax(); + self.fileManager.clearImages(); + self._resetCanvas(); + if (self.overwriteInitial) { + self.initialPreview = []; + self.initialPreviewConfig = []; + self.initialPreviewThumbTags = []; + self.previewCache.data = { + content: [], + config: [], + tags: [] + }; + } + }, + _resetCanvas: function () { + var self = this; + if (self.canvas && self.imageCanvasContext) { + self.imageCanvasContext.clearRect(0, 0, self.canvas.width, self.canvas.height); + } + }, + _hasInitialPreview: function () { + var self = this; + return !self.overwriteInitial && self.previewCache.count(true); + }, + _resetPreview: function () { + var self = this, out, cap, $div, hasSuc = self.showUploadedThumbs, hasErr = !self.removeFromPreviewOnError, + includeProcessed = (hasSuc || hasErr) && self.isDuplicateError; + if (self.previewCache.count(true)) { + out = self.previewCache.out(); + if (includeProcessed) { + $div = $h.createElement('').insertAfter(self.$container); + self.getFrames().each(function () { + var $thumb = $(this); + if ((hasSuc && $thumb.hasClass('file-preview-success')) || + (hasErr && $thumb.hasClass('file-preview-error'))) { + $div.append($thumb); + } + }); + } + self._setPreviewContent(out.content); + self._setInitThumbAttr(); + cap = self.initialCaption ? self.initialCaption : out.caption; + self._setCaption(cap); + if (includeProcessed) { + $div.contents().appendTo(self.$preview); + $div.remove(); + } + } else { + self._clearPreview(); + self._initCaption(); + } + if (self.showPreview) { + self._initZoom(); + self._initSortable(); + } + self.isDuplicateError = false; + }, + _clearDefaultPreview: function () { + var self = this; + self.$preview.find('.file-default-preview').remove(); + }, + _validateDefaultPreview: function () { + var self = this; + if (!self.showPreview || $h.isEmpty(self.defaultPreviewContent)) { + return; + } + self._setPreviewContent('
    ' + self.defaultPreviewContent + '
    '); + self.$container.removeClass('file-input-new'); + self._initClickable(); + }, + _resetPreviewThumbs: function (isAjax) { + var self = this, out; + if (isAjax) { + self._clearPreview(); + self.clearFileStack(); + return; + } + if (self._hasInitialPreview()) { + out = self.previewCache.out(); + self._setPreviewContent(out.content); + self._setInitThumbAttr(); + self._setCaption(out.caption); + self._initPreviewActions(); + } else { + self._clearPreview(); + } + }, + _getLayoutTemplate: function (t) { + var self = this, template = self.layoutTemplates[t]; + if ($h.isEmpty(self.customLayoutTags)) { + return template; + } + return $h.replaceTags(template, self.customLayoutTags); + }, + _getPreviewTemplate: function (t) { + var self = this, templates = self.previewTemplates, template = templates[t] || templates.other; + if ($h.isEmpty(self.customPreviewTags)) { + return template; + } + return $h.replaceTags(template, self.customPreviewTags); + }, + _getOutData: function (formdata, jqXHR, responseData, filesData) { + var self = this; + jqXHR = jqXHR || {}; + responseData = responseData || {}; + filesData = filesData || self.fileManager.list(); + return { + formdata: formdata, + files: filesData, + filenames: self.filenames, + filescount: self.getFilesCount(), + extra: self._getExtraData(), + response: responseData, + reader: self.reader, + jqXHR: jqXHR + }; + }, + _getMsgSelected: function (n) { + var self = this, strFiles = n === 1 ? self.fileSingle : self.filePlural; + return n > 0 ? self.msgSelected.replace('{n}', n).replace('{files}', strFiles) : self.msgNoFilesSelected; + }, + _getFrame: function (id, skipWarning) { + var self = this, $frame = $h.getFrameElement(self.$preview, id); + if (self.showPreview && !skipWarning && !$frame.length) { + self._log($h.logMessages.invalidThumb, {id: id}); + } + return $frame; + }, + _getZoom: function (id, selector) { + var self = this, $frame = $h.getZoomElement(self.$preview, id, selector); + if (self.showPreview && !$frame.length) { + self._log($h.logMessages.invalidThumb, {id: id}); + } + return $frame; + }, + _getThumbs: function (css) { + css = css || ''; + return this.getFrames(':not(.file-preview-initial)' + css); + }, + _getThumbId: function (fileId) { + var self = this; + return self.previewInitId + '-' + fileId; + }, + _getExtraData: function (fileId, index) { + var self = this, data = self.uploadExtraData; + if (typeof self.uploadExtraData === 'function') { + data = self.uploadExtraData(fileId, index); + } + return data; + }, + _initXhr: function (xhrobj, fileId, fileCount) { + var self = this, fm = self.fileManager, func = function (event) { + var pct = 0, total = event.total, loaded = event.loaded || event.position, + stats = fm.getUploadStats(fileId, loaded, total); + /** @namespace event.lengthComputable */ + if (event.lengthComputable && !self.enableResumableUpload) { + pct = $h.round(loaded / total * 100); + } + if (fileId) { + self._setFileUploadStats(fileId, pct, fileCount, stats); + } else { + self._setProgress(pct, null, null, self._getStats(stats)); + } + self._raise('fileajaxprogress', [stats]); + }; + if (xhrobj.upload) { + if (self.progressDelay) { + func = $h.debounce(func, self.progressDelay); + } + xhrobj.upload.addEventListener('progress', func, false); + } + return xhrobj; + }, + _initAjaxSettings: function () { + var self = this; + self._ajaxSettings = $.extend(true, {}, self.ajaxSettings); + self._ajaxDeleteSettings = $.extend(true, {}, self.ajaxDeleteSettings); + }, + _mergeAjaxCallback: function (funcName, srcFunc, type) { + var self = this, settings = self._ajaxSettings, flag = self.mergeAjaxCallbacks, targFunc; + if (type === 'delete') { + settings = self._ajaxDeleteSettings; + flag = self.mergeAjaxDeleteCallbacks; + } + targFunc = settings[funcName]; + if (flag && typeof targFunc === 'function') { + if (flag === 'before') { + settings[funcName] = function () { + targFunc.apply(this, arguments); + srcFunc.apply(this, arguments); + }; + } else { + settings[funcName] = function () { + srcFunc.apply(this, arguments); + targFunc.apply(this, arguments); + }; + } + } else { + settings[funcName] = srcFunc; + } + }, + _ajaxSubmit: function (fnBefore, fnSuccess, fnComplete, fnError, formdata, fileId, index, vUrl) { + var self = this, settings, defaults, data, ajaxTask; + if (!self._raise('filepreajax', [formdata, fileId, index])) { + return; + } + formdata.append('initialPreview', JSON.stringify(self.initialPreview)); + formdata.append('initialPreviewConfig', JSON.stringify(self.initialPreviewConfig)); + formdata.append('initialPreviewThumbTags', JSON.stringify(self.initialPreviewThumbTags)); + self._initAjaxSettings(); + self._mergeAjaxCallback('beforeSend', fnBefore); + self._mergeAjaxCallback('success', fnSuccess); + self._mergeAjaxCallback('complete', fnComplete); + self._mergeAjaxCallback('error', fnError); + vUrl = vUrl || self.uploadUrlThumb || self.uploadUrl; + if (typeof vUrl === 'function') { + vUrl = vUrl(); + } + data = self._getExtraData(fileId, index) || {}; + if (typeof data === 'object') { + $.each(data, function (key, value) { + formdata.append(key, value); + }); + } + defaults = { + xhr: function () { + var xhrobj = $.ajaxSettings.xhr(); + return self._initXhr(xhrobj, fileId, self.fileManager.count()); + }, + url: self._encodeURI(vUrl), + type: 'POST', + dataType: 'json', + data: formdata, + cache: false, + processData: false, + contentType: false + }; + settings = $.extend(true, {}, defaults, self._ajaxSettings); + ajaxTask = self.taskManager.addTask(fileId + '-' + index, function () { + var self = this.self, config, xhr; + config = self.ajaxQueue.shift(); + xhr = $.ajax(config); + self.ajaxRequests.push(xhr); + }); + self.ajaxQueue.push(settings); + ajaxTask.runWithContext({self: self}); + }, + _mergeArray: function (prop, content) { + var self = this, arr1 = $h.cleanArray(self[prop]), arr2 = $h.cleanArray(content); + self[prop] = arr1.concat(arr2); + }, + _initUploadSuccess: function (out, $thumb, allFiles) { + var self = this, append, data, index, $div, $newCache, content, config, tags, id, i; + if (!self.showPreview || typeof out !== 'object' || $.isEmptyObject(out)) { + self._resetCaption(); + return; + } + if (out.initialPreview !== undefined && out.initialPreview.length > 0) { + self.hasInitData = true; + content = out.initialPreview || []; + config = out.initialPreviewConfig || []; + tags = out.initialPreviewThumbTags || []; + append = out.append === undefined || out.append; + if (content.length > 0 && !$h.isArray(content)) { + content = content.split(self.initialPreviewDelimiter); + } + if (content.length) { + self._mergeArray('initialPreview', content); + self._mergeArray('initialPreviewConfig', config); + self._mergeArray('initialPreviewThumbTags', tags); + } + if ($thumb !== undefined) { + if (!allFiles) { + index = self.previewCache.add(content[0], config[0], tags[0], append); + data = self.previewCache.get(index, false); + $div = $h.createElement(data).hide().appendTo($thumb); + $newCache = $div.find('.kv-zoom-cache'); + if ($newCache && $newCache.length) { + $newCache.appendTo($thumb); + } + $thumb.fadeOut('slow', function () { + var $newThumb = $div.find('.file-preview-frame'); + if ($newThumb && $newThumb.length) { + $newThumb.insertBefore($thumb).fadeIn('slow').css('display:inline-block'); + } + self._initPreviewActions(); + self._clearFileInput(); + $thumb.remove(); + $div.remove(); + self._initSortable(); + }); + } else { + id = $thumb.attr('id'); + i = self._getUploadCacheIndex(id); + if (i !== null) { + self.uploadCache[i] = { + id: id, + content: content[0], + config: config[0] || [], + tags: tags[0] || [], + append: append + }; + } + } + } else { + self.previewCache.set(content, config, tags, append); + self._initPreview(); + self._initPreviewActions(); + } + } + self._resetCaption(); + }, + _getUploadCacheIndex: function (id) { + var self = this, i, len = self.uploadCache.length, config; + for (i = 0; i < len; i++) { + config = self.uploadCache[i]; + if (config.id === id) { + return i; + } + } + return null; + }, + _initSuccessThumbs: function () { + var self = this; + if (!self.showPreview) { + return; + } + self._getThumbs($h.FRAMES + '.file-preview-success').each(function () { + var $thumb = $(this), $remove = $thumb.find('.kv-file-remove'); + $remove.removeAttr('disabled'); + self._handler($remove, 'click', function () { + var id = $thumb.attr('id'), + out = self._raise('filesuccessremove', [id, $thumb.attr('data-fileindex')]); + $h.cleanMemory($thumb); + if (out === false) { + return; + } + $thumb.fadeOut('slow', function () { + $thumb.remove(); + if (!self.getFrames().length) { + self.reset(); + } + }); + }); + }); + }, + _updateInitialPreview: function () { + var self = this, u = self.uploadCache; + if (self.showPreview) { + $.each(u, function (key, setting) { + self.previewCache.add(setting.content, setting.config, setting.tags, setting.append); + }); + if (self.hasInitData) { + self._initPreview(); + self._initPreviewActions(); + } + } + }, + _uploadSingle: function (i, id, isBatch) { + var self = this, fm = self.fileManager, count = fm.count(), formdata = new FormData(), outData, + previewId = self._getThumbId(id), $thumb, chkComplete, $btnUpload, $btnDelete, + hasPostData = count > 0 || !$.isEmptyObject(self.uploadExtraData), uploadFailed, $prog, fnBefore, + errMsg, fnSuccess, fnComplete, fnError, updateUploadLog, op = self.ajaxOperations.uploadThumb, + fileObj = fm.getFile(id), params = {id: previewId, index: i, fileId: id}, + fileName = self.fileManager.getFileName(id, true); + if (self.enableResumableUpload) { // not enabled for resumable uploads + return; + } + if (self.showPreview) { + $thumb = self.fileManager.getThumb(id); + $prog = $thumb.find('.file-thumb-progress'); + $btnUpload = $thumb.find('.kv-file-upload'); + $btnDelete = $thumb.find('.kv-file-remove'); + $prog.show(); + } + if (count === 0 || !hasPostData || (self.showPreview && $btnUpload && $btnUpload.hasClass('disabled')) || + self._abort(params)) { + return; + } + updateUploadLog = function () { + if (!uploadFailed) { + fm.removeFile(id); + } else { + fm.errors.push(id); + } + fm.setProcessed(id); + if (fm.isProcessed()) { + self.fileBatchCompleted = true; + chkComplete(); + } + }; + chkComplete = function () { + var $initThumbs; + if (!self.fileBatchCompleted) { + return; + } + setTimeout(function () { + var triggerReset = fm.count() === 0, errCount = fm.errors.length; + self._updateInitialPreview(); + self.unlock(triggerReset); + if (triggerReset) { + self._clearFileInput(); + } + $initThumbs = self.$preview.find('.file-preview-initial'); + if (self.uploadAsync && $initThumbs.length) { + $h.addCss($initThumbs, $h.SORT_CSS); + self._initSortable(); + } + self._raise('filebatchuploadcomplete', [fm.stack, self._getExtraData()]); + if (!self.retryErrorUploads || errCount === 0) { + fm.clear(); + } + self._setProgress(101); + self.ajaxAborted = false; + }, self.processDelay); + }; + fnBefore = function (jqXHR) { + outData = self._getOutData(formdata, jqXHR); + fm.initStats(id); + self.fileBatchCompleted = false; + if (!isBatch) { + self.ajaxAborted = false; + } + if (self.showPreview) { + if (!$thumb.hasClass('file-preview-success')) { + self._setThumbStatus($thumb, 'Loading'); + $h.addCss($thumb, 'file-uploading'); + } + $btnUpload.attr('disabled', true); + $btnDelete.attr('disabled', true); + } + if (!isBatch) { + self.lock(); + } + if (fm.errors.indexOf(id) !== -1) { + delete fm.errors[id]; + } + self._raise('filepreupload', [outData, previewId, i]); + $.extend(true, params, outData); + if (self._abort(params)) { + jqXHR.abort(); + if (!isBatch) { + self._setThumbStatus($thumb, 'New'); + $thumb.removeClass('file-uploading'); + $btnUpload.removeAttr('disabled'); + $btnDelete.removeAttr('disabled'); + self.unlock(); + } + self._setProgressCancelled(); + } + }; + fnSuccess = function (data, textStatus, jqXHR) { + var pid = self.showPreview && $thumb.attr('id') ? $thumb.attr('id') : previewId; + outData = self._getOutData(formdata, jqXHR, data); + $.extend(true, params, outData); + setTimeout(function () { + if ($h.isEmpty(data) || $h.isEmpty(data.error)) { + if (self.showPreview) { + self._setThumbStatus($thumb, 'Success'); + $btnUpload.hide(); + self._initUploadSuccess(data, $thumb, isBatch); + self._setProgress(101, $prog); + } + self._raise('fileuploaded', [outData, pid, i]); + if (!isBatch) { + self.fileManager.remove($thumb); + } else { + updateUploadLog(); + } + } else { + uploadFailed = true; + errMsg = self._parseError(op, jqXHR, self.msgUploadError, self.fileManager.getFileName(id)); + self._showFileError(errMsg, params); + self._setPreviewError($thumb, true); + if (!self.retryErrorUploads) { + $btnUpload.hide(); + } + if (isBatch) { + updateUploadLog(); + } + self._setProgress(101, self._getFrame(pid).find('.file-thumb-progress'), + self.msgUploadError); + } + }, self.processDelay); + }; + fnComplete = function () { + if (self.showPreview) { + $btnUpload.removeAttr('disabled'); + $btnDelete.removeAttr('disabled'); + $thumb.removeClass('file-uploading'); + } + if (!isBatch) { + self.unlock(false); + self._clearFileInput(); + } else { + chkComplete(); + } + self._initSuccessThumbs(); + }; + fnError = function (jqXHR, textStatus, errorThrown) { + errMsg = self._parseError(op, jqXHR, errorThrown, self.fileManager.getFileName(id)); + uploadFailed = true; + setTimeout(function () { + var $prog; + if (isBatch) { + updateUploadLog(); + } + self.fileManager.setProgress(id, 100); + self._setPreviewError($thumb, true); + if (!self.retryErrorUploads) { + $btnUpload.hide(); + } + $.extend(true, params, self._getOutData(formdata, jqXHR)); + self._setProgress(101, self.$progress, self.msgAjaxProgressError.replace('{operation}', op)); + $prog = self.showPreview && $thumb ? $thumb.find('.file-thumb-progress') : ''; + self._setProgress(101, $prog, self.msgUploadError); + self._showFileError(errMsg, params); + }, self.processDelay); + }; + formdata.append(self.uploadFileAttr, fileObj.file, fileName); + self._setUploadData(formdata, {fileId: id}); + self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError, formdata, id, i); + }, + _uploadBatch: function () { + var self = this, fm = self.fileManager, total = fm.total(), params = {}, fnBefore, fnSuccess, fnError, + fnComplete, hasPostData = total > 0 || !$.isEmptyObject(self.uploadExtraData), errMsg, + setAllUploaded, formdata = new FormData(), op = self.ajaxOperations.uploadBatch; + if (total === 0 || !hasPostData || self._abort(params)) { + return; + } + setAllUploaded = function () { + self.fileManager.clear(); + self._clearFileInput(); + }; + fnBefore = function (jqXHR) { + self.lock(); + fm.initStats(); + var outData = self._getOutData(formdata, jqXHR); + self.ajaxAborted = false; + if (self.showPreview) { + self._getThumbs().each(function () { + var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload'), + $btnDelete = $thumb.find('.kv-file-remove'); + if (!$thumb.hasClass('file-preview-success')) { + self._setThumbStatus($thumb, 'Loading'); + $h.addCss($thumb, 'file-uploading'); + } + $btnUpload.attr('disabled', true); + $btnDelete.attr('disabled', true); + }); + } + self._raise('filebatchpreupload', [outData]); + if (self._abort(outData)) { + jqXHR.abort(); + self._getThumbs().each(function () { + var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload'), + $btnDelete = $thumb.find('.kv-file-remove'); + if ($thumb.hasClass('file-preview-loading')) { + self._setThumbStatus($thumb, 'New'); + $thumb.removeClass('file-uploading'); + } + $btnUpload.removeAttr('disabled'); + $btnDelete.removeAttr('disabled'); + }); + self._setProgressCancelled(); + } + }; + fnSuccess = function (data, textStatus, jqXHR) { + /** @namespace data.errorkeys */ + var outData = self._getOutData(formdata, jqXHR, data), key = 0, + $thumbs = self._getThumbs(':not(.file-preview-success)'), + keys = $h.isEmpty(data) || $h.isEmpty(data.errorkeys) ? [] : data.errorkeys; + + if ($h.isEmpty(data) || $h.isEmpty(data.error)) { + self._raise('filebatchuploadsuccess', [outData]); + setAllUploaded(); + if (self.showPreview) { + $thumbs.each(function () { + var $thumb = $(this); + self._setThumbStatus($thumb, 'Success'); + $thumb.removeClass('file-uploading'); + $thumb.find('.kv-file-upload').hide().removeAttr('disabled'); + }); + self._initUploadSuccess(data); + } else { + self.reset(); + } + self._setProgress(101); + } else { + if (self.showPreview) { + $thumbs.each(function () { + var $thumb = $(this); + $thumb.removeClass('file-uploading'); + $thumb.find('.kv-file-upload').removeAttr('disabled'); + $thumb.find('.kv-file-remove').removeAttr('disabled'); + if (keys.length === 0 || $.inArray(key, keys) !== -1) { + self._setPreviewError($thumb, true); + if (!self.retryErrorUploads) { + $thumb.find('.kv-file-upload').hide(); + self.fileManager.remove($thumb); + } + } else { + $thumb.find('.kv-file-upload').hide(); + self._setThumbStatus($thumb, 'Success'); + self.fileManager.remove($thumb); + } + if (!$thumb.hasClass('file-preview-error') || self.retryErrorUploads) { + key++; + } + }); + self._initUploadSuccess(data); + } + errMsg = self._parseError(op, jqXHR, self.msgUploadError); + self._showFileError(errMsg, outData, 'filebatchuploaderror'); + self._setProgress(101, self.$progress, self.msgUploadError); + } + }; + fnComplete = function () { + self.unlock(); + self._initSuccessThumbs(); + self._clearFileInput(); + self._raise('filebatchuploadcomplete', [self.fileManager.stack, self._getExtraData()]); + }; + fnError = function (jqXHR, textStatus, errorThrown) { + var outData = self._getOutData(formdata, jqXHR); + errMsg = self._parseError(op, jqXHR, errorThrown); + self._showFileError(errMsg, outData, 'filebatchuploaderror'); + self.uploadFileCount = total - 1; + if (!self.showPreview) { + return; + } + self._getThumbs().each(function () { + var $thumb = $(this); + $thumb.removeClass('file-uploading'); + if (self.fileManager.getFile($thumb.attr('data-fileid'))) { + self._setPreviewError($thumb); + } + }); + self._getThumbs().removeClass('file-uploading'); + self._getThumbs(' .kv-file-upload').removeAttr('disabled'); + self._getThumbs(' .kv-file-delete').removeAttr('disabled'); + self._setProgress(101, self.$progress, self.msgAjaxProgressError.replace('{operation}', op)); + }; + var ctr = 0; + $.each(self.fileManager.stack, function (key, data) { + if (!$h.isEmpty(data.file)) { + formdata.append(self.uploadFileAttr, data.file, (data.nameFmt || ('untitled_' + ctr))); + } + ctr++; + }); + self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError, formdata); + }, + _uploadExtraOnly: function () { + var self = this, params = {}, fnBefore, fnSuccess, fnComplete, fnError, formdata = new FormData(), errMsg, + op = self.ajaxOperations.uploadExtra; + if (self._abort(params)) { + return; + } + fnBefore = function (jqXHR) { + self.lock(); + var outData = self._getOutData(formdata, jqXHR); + self._raise('filebatchpreupload', [outData]); + self._setProgress(50); + params.data = outData; + params.xhr = jqXHR; + if (self._abort(params)) { + jqXHR.abort(); + self._setProgressCancelled(); + } + }; + fnSuccess = function (data, textStatus, jqXHR) { + var outData = self._getOutData(formdata, jqXHR, data); + if ($h.isEmpty(data) || $h.isEmpty(data.error)) { + self._raise('filebatchuploadsuccess', [outData]); + self._clearFileInput(); + self._initUploadSuccess(data); + self._setProgress(101); + } else { + errMsg = self._parseError(op, jqXHR, self.msgUploadError); + self._showFileError(errMsg, outData, 'filebatchuploaderror'); + } + }; + fnComplete = function () { + self.unlock(); + self._clearFileInput(); + self._raise('filebatchuploadcomplete', [self.fileManager.stack, self._getExtraData()]); + }; + fnError = function (jqXHR, textStatus, errorThrown) { + var outData = self._getOutData(formdata, jqXHR); + errMsg = self._parseError(op, jqXHR, errorThrown); + params.data = outData; + self._showFileError(errMsg, outData, 'filebatchuploaderror'); + self._setProgress(101, self.$progress, self.msgAjaxProgressError.replace('{operation}', op)); + }; + self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError, formdata); + }, + _deleteFileIndex: function ($frame) { + var self = this, ind = $frame.attr('data-fileindex'), rev = self.reversePreviewOrder; + if (ind.substring(0, 5) === $h.INIT_FLAG) { + ind = parseInt(ind.replace($h.INIT_FLAG, '')); + self.initialPreview = $h.spliceArray(self.initialPreview, ind, rev); + self.initialPreviewConfig = $h.spliceArray(self.initialPreviewConfig, ind, rev); + self.initialPreviewThumbTags = $h.spliceArray(self.initialPreviewThumbTags, ind, rev); + self.getFrames().each(function () { + var $nFrame = $(this), nInd = $nFrame.attr('data-fileindex'); + if (nInd.substring(0, 5) === $h.INIT_FLAG) { + nInd = parseInt(nInd.replace($h.INIT_FLAG, '')); + if (nInd > ind) { + nInd--; + $nFrame.attr('data-fileindex', $h.INIT_FLAG + nInd); + } + } + }); + } + }, + _resetCaption: function () { + var self = this; + setTimeout(function () { + var cap, n, chk = self.previewCache.count(true), len = self.fileManager.count(), file, + incomplete = ':not(.file-preview-success):not(.file-preview-error)', + hasThumb = self.showPreview && self.getFrames(incomplete).length; + if (len === 0 && chk === 0 && !hasThumb) { + self.reset(); + } else { + n = chk + len; + if (n > 1) { + cap = self._getMsgSelected(n); + } else { + file = self.fileManager.getFirstFile(); + cap = file ? file.nameFmt : '_'; + } + self._setCaption(cap); + } + }, self.processDelay); + }, + _initFileActions: function () { + var self = this; + if (!self.showPreview) { + return; + } + self._initZoomButton(); + self.getFrames(' .kv-file-remove').each(function () { + var $el = $(this), $frame = $el.closest($h.FRAMES), hasError, id = $frame.attr('id'), + ind = $frame.attr('data-fileindex'), status; + self._handler($el, 'click', function () { + status = self._raise('filepreremove', [id, ind]); + if (status === false || !self._validateMinCount()) { + return false; + } + hasError = $frame.hasClass('file-preview-error'); + $h.cleanMemory($frame); + $frame.fadeOut('slow', function () { + self.fileManager.remove($frame); + self._clearObjects($frame); + $frame.remove(); + if (id && hasError) { + self.$errorContainer.find('li[data-thumb-id="' + id + '"]').fadeOut('fast', function () { + $(this).remove(); + if (!self._errorsExist()) { + self._resetErrors(); + } + }); + } + self._clearFileInput(); + self._resetCaption(); + self._raise('fileremoved', [id, ind]); + }); + }); + }); + self.getFrames(' .kv-file-upload').each(function () { + var $el = $(this); + self._handler($el, 'click', function () { + var $frame = $el.closest($h.FRAMES), fileId = $frame.attr('data-fileid'); + self._hideProgress(); + if ($frame.hasClass('file-preview-error') && !self.retryErrorUploads) { + return; + } + self._uploadSingle(self.fileManager.getIndex(fileId), fileId, false); + }); + }); + }, + _initPreviewActions: function () { + var self = this, $preview = self.$preview, deleteExtraData = self.deleteExtraData || {}, + btnRemove = $h.FRAMES + ' .kv-file-remove', settings = self.fileActionSettings, + origClass = settings.removeClass, errClass = settings.removeErrorClass, + resetProgress = function () { + var hasFiles = self.isAjaxUpload ? self.previewCache.count(true) : self._inputFileCount(); + if (!self.getFrames().length && !hasFiles) { + self._setCaption(''); + self.reset(); + self.initialCaption = ''; + } + }; + self._initZoomButton(); + $preview.find(btnRemove).each(function () { + var $el = $(this), vUrl = $el.data('url') || self.deleteUrl, vKey = $el.data('key'), errMsg, fnBefore, + fnSuccess, fnError, op = self.ajaxOperations.deleteThumb; + if ($h.isEmpty(vUrl) || vKey === undefined) { + return; + } + if (typeof vUrl === 'function') { + vUrl = vUrl(); + } + var $frame = $el.closest($h.FRAMES), cache = self.previewCache.data, settings, params, config, + fileName, extraData, index = $frame.attr('data-fileindex'); + index = parseInt(index.replace($h.INIT_FLAG, '')); + config = $h.isEmpty(cache.config) && $h.isEmpty(cache.config[index]) ? null : cache.config[index]; + extraData = $h.isEmpty(config) || $h.isEmpty(config.extra) ? deleteExtraData : config.extra; + fileName = config && (config.filename || config.caption) || ''; + if (typeof extraData === 'function') { + extraData = extraData(); + } + params = {id: $el.attr('id'), key: vKey, extra: extraData}; + fnBefore = function (jqXHR) { + self.ajaxAborted = false; + self._raise('filepredelete', [vKey, jqXHR, extraData]); + if (self._abort()) { + jqXHR.abort(); + } else { + $el.removeClass(errClass); + $h.addCss($frame, 'file-uploading'); + $h.addCss($el, 'disabled ' + origClass); + } + }; + fnSuccess = function (data, textStatus, jqXHR) { + var n, cap; + if (!$h.isEmpty(data) && !$h.isEmpty(data.error)) { + params.jqXHR = jqXHR; + params.response = data; + errMsg = self._parseError(op, jqXHR, self.msgDeleteError, fileName); + self._showFileError(errMsg, params, 'filedeleteerror'); + $frame.removeClass('file-uploading'); + $el.removeClass('disabled ' + origClass).addClass(errClass); + resetProgress(); + return; + } + $frame.removeClass('file-uploading').addClass('file-deleted'); + $frame.fadeOut('slow', function () { + index = parseInt(($frame.attr('data-fileindex')).replace($h.INIT_FLAG, '')); + self.previewCache.unset(index); + self._deleteFileIndex($frame); + n = self.previewCache.count(true); + cap = n > 0 ? self._getMsgSelected(n) : ''; + self._setCaption(cap); + self._raise('filedeleted', [vKey, jqXHR, extraData]); + self._clearObjects($frame); + $frame.remove(); + resetProgress(); + }); + }; + fnError = function (jqXHR, textStatus, errorThrown) { + var errMsg = self._parseError(op, jqXHR, errorThrown, fileName); + params.jqXHR = jqXHR; + params.response = {}; + self._showFileError(errMsg, params, 'filedeleteerror'); + $frame.removeClass('file-uploading'); + $el.removeClass('disabled ' + origClass).addClass(errClass); + resetProgress(); + }; + self._initAjaxSettings(); + self._mergeAjaxCallback('beforeSend', fnBefore, 'delete'); + self._mergeAjaxCallback('success', fnSuccess, 'delete'); + self._mergeAjaxCallback('error', fnError, 'delete'); + settings = $.extend(true, {}, { + url: self._encodeURI(vUrl), + type: 'POST', + dataType: 'json', + data: $.extend(true, {}, {key: vKey}, extraData) + }, self._ajaxDeleteSettings); + self._handler($el, 'click', function () { + if (!self._validateMinCount()) { + return false; + } + self.ajaxAborted = false; + self._raise('filebeforedelete', [vKey, extraData]); + //noinspection JSUnresolvedVariable,JSHint + if (self.ajaxAborted instanceof Promise) { + self.ajaxAborted.then(function (result) { + if (!result) { + $.ajax(settings); + } + }); + } else { + if (!self.ajaxAborted) { + $.ajax(settings); + } + } + }); + }); + }, + _hideFileIcon: function () { + var self = this; + if (self.overwriteInitial) { + self.$captionContainer.removeClass('icon-visible'); + } + }, + _showFileIcon: function () { + var self = this; + $h.addCss(self.$captionContainer, 'icon-visible'); + }, + _getSize: function (bytes, sizes) { + var self = this, size = parseFloat(bytes), i, func = self.fileSizeGetter, out; + if (!$.isNumeric(bytes) || !$.isNumeric(size)) { + return ''; + } + if (typeof func === 'function') { + out = func(size); + } else { + if (size === 0) { + out = '0.00 B'; + } else { + i = Math.floor(Math.log(size) / Math.log(1024)); + if (!sizes) { + sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + } + out = (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + sizes[i]; + } + } + return self._getLayoutTemplate('size').replace('{sizeText}', out); + }, + _getFileType: function (ftype) { + var self = this; + return self.mimeTypeAliases[ftype] || ftype; + }, + _generatePreviewTemplate: function ( + cat, + data, + fname, + ftype, + previewId, + fileId, + isError, + size, + frameClass, + foot, + ind, + templ, + attrs, + zoomData + ) { + var self = this, caption = self.slug(fname), prevContent, zoomContent = '', styleAttribs = '', + screenW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, + config, title = caption, alt = caption, typeCss = 'type-default', getContent, + footer = foot || self._renderFileFooter(cat, caption, size, 'auto', isError), + forcePrevIcon = self.preferIconicPreview, forceZoomIcon = self.preferIconicZoomPreview, + newCat = forcePrevIcon ? 'other' : cat; + config = screenW < 400 ? (self.previewSettingsSmall[newCat] || self.defaults.previewSettingsSmall[newCat]) : + (self.previewSettings[newCat] || self.defaults.previewSettings[newCat]); + if (config) { + $.each(config, function (key, val) { + styleAttribs += key + ':' + val + ';'; + }); + } + getContent = function (c, d, zoom, frameCss) { + var id = zoom ? 'zoom-' + previewId : previewId, tmplt = self._getPreviewTemplate(c), + css = (frameClass || '') + ' ' + frameCss; + if (self.frameClass) { + css = self.frameClass + ' ' + css; + } + if (zoom) { + css = css.replace(' ' + $h.SORT_CSS, ''); + } + tmplt = self._parseFilePreviewIcon(tmplt, fname); + if (c === 'text') { + d = $h.htmlEncode(d); + } + if (cat === 'object' && !ftype) { + $.each(self.defaults.fileTypeSettings, function (key, func) { + if (key === 'object' || key === 'other') { + return; + } + if (func(fname, ftype)) { + typeCss = 'type-' + key; + } + }); + } + if (!$h.isEmpty(attrs)) { + if (attrs.title !== undefined && attrs.title !== null) { + title = attrs.title; + } + if (attrs.alt !== undefined && attrs.alt !== null) { + title = attrs.alt; + } + } + return tmplt.setTokens({ + 'previewId': id, + 'caption': caption, + 'title': title, + 'alt': alt, + 'frameClass': css, + 'type': self._getFileType(ftype), + 'fileindex': ind, + 'fileid': fileId || '', + 'typeCss': typeCss, + 'footer': footer, + 'data': d, + 'template': templ || cat, + 'style': styleAttribs ? 'style="' + styleAttribs + '"' : '' + }); + }; + ind = ind || previewId.slice(previewId.lastIndexOf('-') + 1); + if (self.fileActionSettings.showZoom) { + zoomContent = getContent((forceZoomIcon ? 'other' : cat), zoomData ? zoomData : data, true, + 'kv-zoom-thumb'); + } + zoomContent = '\n' + self._getLayoutTemplate('zoomCache').replace('{zoomContent}', zoomContent); + if (typeof self.sanitizeZoomCache === 'function') { + zoomContent = self.sanitizeZoomCache(zoomContent); + } + prevContent = getContent((forcePrevIcon ? 'other' : cat), data, false, 'kv-preview-thumb'); + return prevContent.setTokens({zoomCache: zoomContent}); + }, + _addToPreview: function ($preview, content) { + var self = this, $el; + content = $h.cspBuffer.stash(content); + $el = self.reversePreviewOrder ? $preview.prepend(content) : $preview.append(content); + $h.cspBuffer.apply($preview); + return $el; + }, + _previewDefault: function (file, isDisabled) { + var self = this, $preview = self.$preview; + if (!self.showPreview) { + return; + } + var fname = $h.getFileName(file), ftype = file ? file.type : '', content, size = file.size || 0, + caption = self._getFileName(file, ''), isError = isDisabled === true && !self.isAjaxUpload, + data = $h.createObjectURL(file), fileId = self.fileManager.getId(file), + previewId = self._getThumbId(fileId); + self._clearDefaultPreview(); + content = self._generatePreviewTemplate('other', data, fname, ftype, previewId, fileId, isError, size); + self._addToPreview($preview, content); + self._setThumbAttr(previewId, caption, size); + if (isDisabled === true && self.isAjaxUpload) { + self._setThumbStatus(self._getFrame(previewId), 'Error'); + } + }, + _previewFile: function (i, file, theFile, data, fileInfo) { + if (!this.showPreview) { + return; + } + var self = this, fname = $h.getFileName(file), ftype = fileInfo.type, caption = fileInfo.name, + cat = self._parseFileType(ftype, fname), content, $preview = self.$preview, fsize = file.size || 0, + iData = (cat === 'text' || cat === 'html' || cat === 'image') ? theFile.target.result : data, + fileId = self.fileManager.getId(file), previewId = self._getThumbId(fileId); + /** @namespace window.DOMPurify */ + if (cat === 'html' && self.purifyHtml && window.DOMPurify) { + iData = window.DOMPurify.sanitize(iData); + } + content = self._generatePreviewTemplate(cat, iData, fname, ftype, previewId, fileId, false, fsize); + self._clearDefaultPreview(); + self._addToPreview($preview, content); + var $thumb = self._getFrame(previewId); + self._validateImageOrientation($thumb.find('img'), file, previewId, fileId, caption, ftype, fsize, iData); + self._setThumbAttr(previewId, caption, fsize); + self._initSortable(); + }, + _setThumbAttr: function (id, caption, size) { + var self = this, $frame = self._getFrame(id); + if ($frame.length) { + size = size && size > 0 ? self._getSize(size) : ''; + $frame.data({'caption': caption, 'size': size}); + } + }, + _setInitThumbAttr: function () { + var self = this, data = self.previewCache.data, len = self.previewCache.count(true), config, + caption, size, previewId; + if (len === 0) { + return; + } + for (var i = 0; i < len; i++) { + config = data.config[i]; + previewId = self.previewInitId + '-' + $h.INIT_FLAG + i; + caption = $h.ifSet('caption', config, $h.ifSet('filename', config)); + size = $h.ifSet('size', config); + self._setThumbAttr(previewId, caption, size); + } + }, + _slugDefault: function (text) { + // noinspection RegExpRedundantEscape + return $h.isEmpty(text, true) ? '' : String(text).replace(/[\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g, '_'); + }, + _updateFileDetails: function (numFiles, skipRaiseEvent) { + var self = this, $el = self.$element, label, n, log, nFiles, file, + name = ($h.isIE(9) && $h.findFileName($el.val())) || ($el[0].files[0] && $el[0].files[0].name); + if (!name && self.fileManager.count() > 0) { + file = self.fileManager.getFirstFile(); + label = file.nameFmt; + } else { + label = name ? self.slug(name) : '_'; + } + n = self.isAjaxUpload ? self.fileManager.count() : numFiles; + nFiles = self.previewCache.count(true) + n; + log = n === 1 ? label : self._getMsgSelected(nFiles); + if (self.isError) { + self.$previewContainer.removeClass('file-thumb-loading'); + self.$previewStatus.html(''); + self.$captionContainer.removeClass('icon-visible'); + } else { + self._showFileIcon(); + } + self._setCaption(log, self.isError); + self.$container.removeClass('file-input-new file-input-ajax-new'); + if (!skipRaiseEvent) { + self._raise('fileselect', [numFiles, label]); + } + if (self.previewCache.count(true)) { + self._initPreviewActions(); + } + }, + _setThumbStatus: function ($thumb, status) { + var self = this; + if (!self.showPreview) { + return; + } + var icon = 'indicator' + status, msg = icon + 'Title', + css = 'file-preview-' + status.toLowerCase(), + $indicator = $thumb.find('.file-upload-indicator'), + config = self.fileActionSettings; + $thumb.removeClass('file-preview-success file-preview-error file-preview-paused file-preview-loading'); + if (status === 'Success') { + $thumb.find('.file-drag-handle').remove(); + } + $h.setHtml($indicator, config[icon]); + $indicator.attr('title', config[msg]); + $thumb.addClass(css); + if (status === 'Error' && !self.retryErrorUploads) { + $thumb.find('.kv-file-upload').attr('disabled', true); + } + }, + _setProgressCancelled: function () { + var self = this; + self._setProgress(101, self.$progress, self.msgCancelled); + }, + _setProgress: function (p, $el, error, stats) { + var self = this; + $el = $el || self.$progress; + if (!$el.length) { + return; + } + var pct = Math.min(p, 100), out, pctLimit = self.progressUploadThreshold, + t = p <= 100 ? self.progressTemplate : self.progressCompleteTemplate, + template = pct < 100 ? self.progressTemplate : + (error ? (self.paused ? self.progressPauseTemplate : self.progressErrorTemplate) : t); + if (p >= 100) { + stats = ''; + } + if (!$h.isEmpty(template)) { + if (pctLimit && pct > pctLimit && p <= 100) { + out = template.setTokens({'percent': pctLimit, 'status': self.msgUploadThreshold}); + } else { + out = template.setTokens({'percent': pct, 'status': (p > 100 ? self.msgUploadEnd : pct + '%')}); + } + stats = stats || ''; + out = out.setTokens({stats: stats}); + $h.setHtml($el, out); + if (error) { + $h.setHtml($el.find('[role="progressbar"]'), error); + } + } + }, + _hasFiles: function () { + var el = this.$element[0]; + return !!(el && el.files && el.files.length); + }, + _setFileDropZoneTitle: function () { + var self = this, $zone = self.$container.find('.file-drop-zone'), title = self.dropZoneTitle, strFiles; + if (self.isClickable) { + strFiles = $h.isEmpty(self.$element.attr('multiple')) ? self.fileSingle : self.filePlural; + title += self.dropZoneClickTitle.replace('{files}', strFiles); + } + $zone.find('.' + self.dropZoneTitleClass).remove(); + if (!self.showPreview || $zone.length === 0 || self.fileManager.count() > 0 || !self.dropZoneEnabled || + self.previewCache.count() > 0 || (!self.isAjaxUpload && self._hasFiles())) { + return; + } + if ($zone.find($h.FRAMES).length === 0 && $h.isEmpty(self.defaultPreviewContent)) { + $zone.prepend('
    ' + title + '
    '); + } + self.$container.removeClass('file-input-new'); + $h.addCss(self.$container, 'file-input-ajax-new'); + }, + _getStats: function (stats) { + var self = this, pendingTime, t; + if (!self.showUploadStats || !stats || !stats.bitrate) { + return ''; + } + t = self._getLayoutTemplate('stats'); + pendingTime = (!stats.elapsed || !stats.bps) ? self.msgCalculatingTime : + self.msgPendingTime.setTokens({time: $h.getElapsed(Math.ceil(stats.pendingBytes / stats.bps))}); + + return t.setTokens({ + uploadSpeed: stats.bitrate, + pendingTime: pendingTime + }); + }, + _setResumableProgress: function (pct, stats, $thumb) { + var self = this, rm = self.resumableManager, obj = $thumb ? rm : self, + $prog = $thumb ? $thumb.find('.file-thumb-progress') : null; + if (obj.lastProgress === 0) { + obj.lastProgress = pct; + } + if (pct < obj.lastProgress) { + pct = obj.lastProgress; + } + self._setProgress(pct, $prog, null, self._getStats(stats)); + obj.lastProgress = pct; + }, + _toggleResumableProgress: function (template, message) { + var self = this, $progress = self.$progress; + if ($progress && $progress.length) { + $h.setHtml($progress, template.setTokens({ + percent: 101, + status: message, + stats: '' + })); + } + }, + _setFileUploadStats: function (id, pct, total, stats) { + var self = this, $prog = self.$progress; + if (!self.showPreview && (!$prog || !$prog.length)) { + return; + } + var fm = self.fileManager, $thumb = fm.getThumb(id), pctTot, rm = self.resumableManager, + totUpSize = 0, totSize = fm.getTotalSize(), totStats = $.extend(true, {}, stats); + if (self.enableResumableUpload) { + var loaded = stats.loaded, currUplSize = rm.getUploadedSize(), currTotSize = rm.file.size, totLoaded; + loaded += currUplSize; + totLoaded = fm.uploadedSize + loaded; + pct = $h.round(100 * loaded / currTotSize); + stats.pendingBytes = currTotSize - currUplSize; + self._setResumableProgress(pct, stats, $thumb); + pctTot = Math.floor(100 * totLoaded / totSize); + totStats.pendingBytes = totSize - totLoaded; + self._setResumableProgress(pctTot, totStats); + } else { + fm.setProgress(id, pct); + $prog = $thumb && $thumb.length ? $thumb.find('.file-thumb-progress') : null; + self._setProgress(pct, $prog, null, self._getStats(stats)); + $.each(fm.stats, function (id, cfg) { + totUpSize += cfg.loaded; + }); + totStats.pendingBytes = totSize - totUpSize; + pctTot = $h.round(totUpSize / totSize * 100); + self._setProgress(pctTot, null, null, self._getStats(totStats)); + } + }, + _validateMinCount: function () { + var self = this, len = self.isAjaxUpload ? self.fileManager.count() : self._inputFileCount(); + if (self.validateInitialCount && self.minFileCount > 0 && self._getFileCount(len - 1) < self.minFileCount) { + self._noFilesError({}); + return false; + } + return true; + }, + _getFileCount: function (fileCount, includeInitial) { + var self = this, addCount = 0; + if (includeInitial === undefined) { + includeInitial = self.validateInitialCount && !self.overwriteInitial; + } + if (includeInitial) { + addCount = self.previewCache.count(true); + fileCount += addCount; + } + return fileCount; + }, + _getFileId: function (file) { + return $h.getFileId(file, this.generateFileId); + }, + _getFileName: function (file, defaultValue) { + var self = this, fileName = $h.getFileName(file); + return fileName ? self.slug(fileName) : defaultValue; + }, + _getFileNames: function (skipNull) { + var self = this; + return self.filenames.filter(function (n) { + return (skipNull ? n !== undefined : n !== undefined && n !== null); + }); + }, + _setPreviewError: function ($thumb, keepFile) { + var self = this, removeFrame = self.removeFromPreviewOnError && !self.retryErrorUploads; + if (!keepFile || removeFrame) { + self.fileManager.remove($thumb); + } + if (!self.showPreview) { + return; + } + if (removeFrame) { + $thumb.remove(); + return; + } else { + self._setThumbStatus($thumb, 'Error'); + } + self._refreshUploadButton($thumb); + }, + _refreshUploadButton: function ($thumb) { + var self = this, $btn = $thumb.find('.kv-file-upload'), cfg = self.fileActionSettings, + icon = cfg.uploadIcon, title = cfg.uploadTitle; + if (!$btn.length) { + return; + } + if (self.retryErrorUploads) { + icon = cfg.uploadRetryIcon; + title = cfg.uploadRetryTitle; + } + $btn.attr('title', title); + $h.setHtml($btn, icon); + }, + _checkDimensions: function (i, chk, $img, $thumb, fname, type, params) { + var self = this, msg, dim, tag = chk === 'Small' ? 'min' : 'max', limit = self[tag + 'Image' + type], + $imgEl, isValid; + if ($h.isEmpty(limit) || !$img.length) { + return; + } + $imgEl = $img[0]; + dim = (type === 'Width') ? $imgEl.naturalWidth || $imgEl.width : $imgEl.naturalHeight || $imgEl.height; + isValid = chk === 'Small' ? dim >= limit : dim <= limit; + if (isValid) { + return; + } + msg = self['msgImage' + type + chk].setTokens({'name': fname, 'size': limit}); + self._showFileError(msg, params); + self._setPreviewError($thumb); + }, + _getExifObj: function (data) { + var self = this, exifObj, error = $h.logMessages.exifWarning; + if (data.slice(0, 23) !== 'data:image/jpeg;base64,' && data.slice(0, 22) !== 'data:image/jpg;base64,') { + exifObj = null; + return; + } + try { + exifObj = window.piexif ? window.piexif.load(data) : null; + } catch (err) { + exifObj = null; + error = err && err.message || ''; + } + if (!exifObj) { + self._log($h.logMessages.badExifParser, {details: error}); + } + return exifObj; + }, + setImageOrientation: function ($img, $zoomImg, value, $thumb) { + var self = this, invalidImg = !$img || !$img.length, invalidZoomImg = !$zoomImg || !$zoomImg.length, $mark, + isHidden = false, $div, zoomOnly = invalidImg && $thumb && $thumb.attr('data-template') === 'image', ev; + if (invalidImg && invalidZoomImg) { + return; + } + ev = 'load.fileinputimageorient'; + if (zoomOnly) { + $img = $zoomImg; + $zoomImg = null; + $img.css(self.previewSettings.image); + $div = $(document.createElement('div')).appendTo($thumb.find('.kv-file-content')); + $mark = $(document.createElement('span')).insertBefore($img); + $img.css('visibility', 'hidden').removeClass('file-zoom-detail').appendTo($div); + } else { + isHidden = !$img.is(':visible'); + } + $img.off(ev).on(ev, function () { + if (isHidden) { + self.$preview.removeClass('hide-content'); + $thumb.find('.kv-file-content').css('visibility', 'hidden'); + } + var img = $img[0], zoomImg = $zoomImg && $zoomImg.length ? $zoomImg[0] : null, + h = img.offsetHeight, w = img.offsetWidth, r = $h.getRotation(value); + if (isHidden) { + $thumb.find('.kv-file-content').css('visibility', 'visible'); + self.$preview.addClass('hide-content'); + } + $img.data('orientation', value); + if (zoomImg) { + $zoomImg.data('orientation', value); + } + if (value < 5) { + $h.setTransform(img, r); + $h.setTransform(zoomImg, r); + return; + } + var offsetAngle = Math.atan(w / h), origFactor = Math.sqrt(Math.pow(h, 2) + Math.pow(w, 2)), + scale = !origFactor ? 1 : (h / Math.cos(Math.PI / 2 + offsetAngle)) / origFactor, + s = ' scale(' + Math.abs(scale) + ')'; + $h.setTransform(img, r + s); + $h.setTransform(zoomImg, r + s); + if (zoomOnly) { + $img.css('visibility', 'visible').insertAfter($mark).addClass('file-zoom-detail'); + $mark.remove(); + $div.remove(); + } + }); + }, + _validateImageOrientation: function ($img, file, previewId, fileId, caption, ftype, fsize, iData) { + var self = this, exifObj, value, autoOrientImage = self.autoOrientImage, selector; + if (self.canOrientImage) { + $img.css('image-orientation', (autoOrientImage ? 'from-image' : 'none')); + return; + } + selector = $h.getZoomSelector(previewId, ' img'); + exifObj = autoOrientImage ? self._getExifObj(iData) : null; + value = exifObj ? exifObj['0th'][piexif.ImageIFD.Orientation] : null; // jshint ignore:line + if (!value) { + self._validateImage(previewId, fileId, caption, ftype, fsize, iData, exifObj); + return; + } + self.setImageOrientation($img, $(selector), value, self._getFrame(previewId)); + self._raise('fileimageoriented', {'$img': $img, 'file': file}); + self._validateImage(previewId, fileId, caption, ftype, fsize, iData, exifObj); + }, + _validateImage: function (previewId, fileId, fname, ftype, fsize, iData, exifObj) { + var self = this, $preview = self.$preview, params, w1, w2, $thumb = self._getFrame(previewId), + i = $thumb.attr('data-fileindex'), $img = $thumb.find('img'); + fname = fname || 'Untitled'; + $img.one('load', function () { + w1 = $thumb.width(); + w2 = $preview.width(); + if (w1 > w2) { + $img.css('width', '100%'); + } + params = {ind: i, id: previewId, fileId: fileId}; + self._checkDimensions(i, 'Small', $img, $thumb, fname, 'Width', params); + self._checkDimensions(i, 'Small', $img, $thumb, fname, 'Height', params); + if (!self.resizeImage) { + self._checkDimensions(i, 'Large', $img, $thumb, fname, 'Width', params); + self._checkDimensions(i, 'Large', $img, $thumb, fname, 'Height', params); + } + self._raise('fileimageloaded', [previewId]); + self.fileManager.addImage(fileId, { + ind: i, + img: $img, + thumb: $thumb, + pid: previewId, + typ: ftype, + siz: fsize, + validated: false, + imgData: iData, + exifObj: exifObj + }); + $thumb.data('exif', exifObj); + self._validateAllImages(); + }).one('error', function () { + self._raise('fileimageloaderror', [previewId]); + }).each(function () { + if (this.complete) { + $(this).trigger('load'); + } else { + if (this.error) { + $(this).trigger('error'); + } + } + }); + }, + _validateAllImages: function () { + var self = this, counter = {val: 0}, numImgs = self.fileManager.getImageCount(), fsize, + minSize = self.resizeIfSizeMoreThan; + if (numImgs !== self.fileManager.totalImages) { + return; + } + self._raise('fileimagesloaded'); + if (!self.resizeImage) { + return; + } + $.each(self.fileManager.loadedImages, function (id, config) { + if (!config.validated) { + fsize = config.siz; + if (fsize && fsize > minSize * 1000) { + self._getResizedImage(id, config, counter, numImgs); + } + config.validated = true; + } + }); + }, + _getResizedImage: function (id, config, counter, numImgs) { + var self = this, img = $(config.img)[0], width = img.naturalWidth, height = img.naturalHeight, blob, + ratio = 1, maxWidth = self.maxImageWidth || width, maxHeight = self.maxImageHeight || height, + isValidImage = !!(width && height), chkWidth, chkHeight, canvas = self.imageCanvas, dataURI, + context = self.imageCanvasContext, type = config.typ, pid = config.pid, ind = config.ind, + $thumb = config.thumb, throwError, msg, exifObj = config.exifObj, exifStr, file, params, evParams; + throwError = function (msg, params, ev) { + if (self.isAjaxUpload) { + self._showFileError(msg, params, ev); + } else { + self._showError(msg, params, ev); + } + self._setPreviewError($thumb); + }; + file = self.fileManager.getFile(id); + params = {id: pid, 'index': ind, fileId: id}; + evParams = [id, pid, ind]; + if (!file || !isValidImage || (width <= maxWidth && height <= maxHeight)) { + if (isValidImage && file) { + self._raise('fileimageresized', evParams); + } + counter.val++; + if (counter.val === numImgs) { + self._raise('fileimagesresized'); + } + if (!isValidImage) { + throwError(self.msgImageResizeError, params, 'fileimageresizeerror'); + return; + } + } + type = type || self.resizeDefaultImageType; + chkWidth = width > maxWidth; + chkHeight = height > maxHeight; + if (self.resizePreference === 'width') { + ratio = chkWidth ? maxWidth / width : (chkHeight ? maxHeight / height : 1); + } else { + ratio = chkHeight ? maxHeight / height : (chkWidth ? maxWidth / width : 1); + } + self._resetCanvas(); + width *= ratio; + height *= ratio; + canvas.width = width; + canvas.height = height; + try { + context.drawImage(img, 0, 0, width, height); + dataURI = canvas.toDataURL(type, self.resizeQuality); + if (exifObj) { + exifStr = window.piexif.dump(exifObj); + dataURI = window.piexif.insert(exifStr, dataURI); + } + blob = $h.dataURI2Blob(dataURI); + self.fileManager.setFile(id, blob); + self._raise('fileimageresized', evParams); + counter.val++; + if (counter.val === numImgs) { + self._raise('fileimagesresized', [undefined, undefined]); + } + if (!(blob instanceof Blob)) { + throwError(self.msgImageResizeError, params, 'fileimageresizeerror'); + } + } catch (err) { + counter.val++; + if (counter.val === numImgs) { + self._raise('fileimagesresized', [undefined, undefined]); + } + msg = self.msgImageResizeException.replace('{errors}', err.message); + throwError(msg, params, 'fileimageresizeexception'); + } + }, + _showProgress: function () { + var self = this; + if (self.$progress && self.$progress.length) { + self.$progress.show(); + } + }, + _hideProgress: function () { + var self = this; + if (self.$progress && self.$progress.length) { + self.$progress.hide(); + } + }, + _initBrowse: function ($container) { + var self = this, $el = self.$element; + if (self.showBrowse) { + self.$btnFile = $container.find('.btn-file').append($el); + } else { + $el.appendTo($container).attr('tabindex', -1); + $h.addCss($el, 'file-no-browse'); + } + }, + _initClickable: function () { + var self = this, $zone, $tmpZone; + if (!self.isClickable) { + return; + } + $zone = self.$dropZone; + if (!self.isAjaxUpload) { + $tmpZone = self.$preview.find('.file-default-preview'); + if ($tmpZone.length) { + $zone = $tmpZone; + } + } + + $h.addCss($zone, 'clickable'); + $zone.attr('tabindex', -1); + self._handler($zone, 'click', function (e) { + var $tar = $(e.target); + if (!$(self.elErrorContainer + ':visible').length && + (!$tar.parents('.file-preview-thumbnails').length || $tar.parents( + '.file-default-preview').length)) { + self.$element.data('zoneClicked', true).trigger('click'); + $zone.blur(); + } + }); + }, + _initCaption: function () { + var self = this, cap = self.initialCaption || ''; + if (self.overwriteInitial || $h.isEmpty(cap)) { + self.$caption.val(''); + return false; + } + self._setCaption(cap); + return true; + }, + _setCaption: function (content, isError) { + var self = this, title, out, icon, n, cap, file; + if (!self.$caption.length) { + return; + } + self.$captionContainer.removeClass('icon-visible'); + if (isError) { + title = $('
    ' + self.msgValidationError + '
    ').text(); + n = self.fileManager.count(); + if (n) { + file = self.fileManager.getFirstFile(); + cap = n === 1 && file ? file.nameFmt : self._getMsgSelected(n); + } else { + cap = self._getMsgSelected(self.msgNo); + } + out = $h.isEmpty(content) ? cap : content; + icon = '' + self.msgValidationErrorIcon + ''; + } else { + if ($h.isEmpty(content)) { + return; + } + title = $('
    ' + content + '
    ').text(); + out = title; + icon = self._getLayoutTemplate('fileIcon'); + } + self.$captionContainer.addClass('icon-visible'); + self.$caption.attr('title', title).val(out); + $h.setHtml(self.$captionIcon, icon); + }, + _createContainer: function () { + var self = this, attribs = {'class': 'file-input file-input-new' + (self.rtl ? ' kv-rtl' : '')}, + $container = $h.createElement($h.cspBuffer.stash(self._renderMain())); + $h.cspBuffer.apply($container); + $container.insertBefore(self.$element).attr(attribs); + self._initBrowse($container); + if (self.theme) { + $container.addClass('theme-' + self.theme); + } + return $container; + }, + _refreshContainer: function () { + var self = this, $container = self.$container, $el = self.$element; + $el.insertAfter($container); + $h.setHtml($container, self._renderMain()); + self._initBrowse($container); + self._validateDisabled(); + }, + _validateDisabled: function () { + var self = this; + self.$caption.attr({readonly: self.isDisabled}); + }, + _renderMain: function () { + var self = this, + dropCss = self.dropZoneEnabled ? ' file-drop-zone' : 'file-drop-disabled', + close = !self.showClose ? '' : self._getLayoutTemplate('close'), + preview = !self.showPreview ? '' : self._getLayoutTemplate('preview') + .setTokens({'class': self.previewClass, 'dropClass': dropCss}), + css = self.isDisabled ? self.captionClass + ' file-caption-disabled' : self.captionClass, + caption = self.captionTemplate.setTokens({'class': css + ' kv-fileinput-caption'}); + return self.mainTemplate.setTokens({ + 'class': self.mainClass + (!self.showBrowse && self.showCaption ? ' no-browse' : ''), + 'preview': preview, + 'close': close, + 'caption': caption, + 'upload': self._renderButton('upload'), + 'remove': self._renderButton('remove'), + 'cancel': self._renderButton('cancel'), + 'pause': self._renderButton('pause'), + 'browse': self._renderButton('browse') + }); + + }, + _renderButton: function (type) { + var self = this, tmplt = self._getLayoutTemplate('btnDefault'), css = self[type + 'Class'], + title = self[type + 'Title'], icon = self[type + 'Icon'], label = self[type + 'Label'], + status = self.isDisabled ? ' disabled' : '', btnType = 'button'; + switch (type) { + case 'remove': + if (!self.showRemove) { + return ''; + } + break; + case 'cancel': + if (!self.showCancel) { + return ''; + } + css += ' kv-hidden'; + break; + case 'pause': + if (!self.showPause) { + return ''; + } + css += ' kv-hidden'; + break; + case 'upload': + if (!self.showUpload) { + return ''; + } + if (self.isAjaxUpload && !self.isDisabled) { + tmplt = self._getLayoutTemplate('btnLink').replace('{href}', self.uploadUrl); + } else { + btnType = 'submit'; + } + break; + case 'browse': + if (!self.showBrowse) { + return ''; + } + tmplt = self._getLayoutTemplate('btnBrowse'); + break; + default: + return ''; + } + + css += type === 'browse' ? ' btn-file' : ' fileinput-' + type + ' fileinput-' + type + '-button'; + if (!$h.isEmpty(label)) { + label = ' ' + label + ''; + } + return tmplt.setTokens({ + 'type': btnType, 'css': css, 'title': title, 'status': status, 'icon': icon, 'label': label + }); + }, + _renderThumbProgress: function () { + var self = this; + return '
    ' + + self.progressInfoTemplate.setTokens({percent: 101, status: self.msgUploadBegin, stats: ''}) + + '
    '; + }, + _renderFileFooter: function (cat, caption, size, width, isError) { + var self = this, config = self.fileActionSettings, rem = config.showRemove, drg = config.showDrag, + upl = config.showUpload, zoom = config.showZoom, out, params, + template = self._getLayoutTemplate('footer'), tInd = self._getLayoutTemplate('indicator'), + ind = isError ? config.indicatorError : config.indicatorNew, + title = isError ? config.indicatorErrorTitle : config.indicatorNewTitle, + indicator = tInd.setTokens({'indicator': ind, 'indicatorTitle': title}); + size = self._getSize(size); + params = {type: cat, caption: caption, size: size, width: width, progress: '', indicator: indicator}; + if (self.isAjaxUpload) { + params.progress = self._renderThumbProgress(); + params.actions = self._renderFileActions(params, upl, false, rem, zoom, drg, false, false, false); + } else { + params.actions = self._renderFileActions(params, false, false, false, zoom, drg, false, false, false); + } + out = template.setTokens(params); + out = $h.replaceTags(out, self.previewThumbTags); + return out; + }, + _renderFileActions: function ( + cfg, + showUpl, + showDwn, + showDel, + showZoom, + showDrag, + disabled, + url, + key, + isInit, + dUrl, + dFile + ) { + var self = this; + if (!cfg.type && isInit) { + cfg.type = 'image'; + } + if (self.enableResumableUpload) { + showUpl = false; + } else { + if (typeof showUpl === 'function') { + showUpl = showUpl(cfg); + } + } + if (typeof showDwn === 'function') { + showDwn = showDwn(cfg); + } + if (typeof showDel === 'function') { + showDel = showDel(cfg); + } + if (typeof showZoom === 'function') { + showZoom = showZoom(cfg); + } + if (typeof showDrag === 'function') { + showDrag = showDrag(cfg); + } + if (!showUpl && !showDwn && !showDel && !showZoom && !showDrag) { + return ''; + } + var vUrl = url === false ? '' : ' data-url="' + url + '"', btnZoom = '', btnDrag = '', css, + vKey = key === false ? '' : ' data-key="' + key + '"', btnDelete = '', btnUpload = '', btnDownload = '', + template = self._getLayoutTemplate('actions'), config = self.fileActionSettings, + otherButtons = self.otherActionButtons.setTokens({'dataKey': vKey, 'key': key}), + removeClass = disabled ? config.removeClass + ' disabled' : config.removeClass; + if (showDel) { + btnDelete = self._getLayoutTemplate('actionDelete').setTokens({ + 'removeClass': removeClass, + 'removeIcon': config.removeIcon, + 'removeTitle': config.removeTitle, + 'dataUrl': vUrl, + 'dataKey': vKey, + 'key': key + }); + } + if (showUpl) { + btnUpload = self._getLayoutTemplate('actionUpload').setTokens({ + 'uploadClass': config.uploadClass, + 'uploadIcon': config.uploadIcon, + 'uploadTitle': config.uploadTitle + }); + } + if (showDwn) { + btnDownload = self._getLayoutTemplate('actionDownload').setTokens({ + 'downloadClass': config.downloadClass, + 'downloadIcon': config.downloadIcon, + 'downloadTitle': config.downloadTitle, + 'downloadUrl': dUrl || self.initialPreviewDownloadUrl + }); + btnDownload = btnDownload.setTokens({'filename': dFile, 'key': key}); + } + if (showZoom) { + btnZoom = self._getLayoutTemplate('actionZoom').setTokens({ + 'zoomClass': config.zoomClass, + 'zoomIcon': config.zoomIcon, + 'zoomTitle': config.zoomTitle + }); + } + if (showDrag && isInit) { + css = 'drag-handle-init ' + config.dragClass; + btnDrag = self._getLayoutTemplate('actionDrag').setTokens({ + 'dragClass': css, + 'dragTitle': config.dragTitle, + 'dragIcon': config.dragIcon + }); + } + return template.setTokens({ + 'delete': btnDelete, + 'upload': btnUpload, + 'download': btnDownload, + 'zoom': btnZoom, + 'drag': btnDrag, + 'other': otherButtons + }); + }, + _browse: function (e) { + var self = this; + if (e && e.isDefaultPrevented() || !self._raise('filebrowse')) { + return; + } + if (self.isError && !self.isAjaxUpload) { + self.clear(); + } + if (self.focusCaptionOnBrowse) { + self.$captionContainer.focus(); + } + }, + _change: function (e) { + var self = this; + if (self.changeTriggered) { + return; + } + var $el = self.$element, isDragDrop = arguments.length > 1, isAjaxUpload = self.isAjaxUpload, + tfiles, files = isDragDrop ? arguments[1] : $el[0].files, ctr = self.fileManager.count(), + total, initCount, len, isSingleUpl = $h.isEmpty($el.attr('multiple')), + maxCount = !isAjaxUpload && isSingleUpl ? 1 : self.maxFileCount, maxTotCount = self.maxTotalFileCount, + inclAll = maxTotCount > 0 && maxTotCount > maxCount, flagSingle = (isSingleUpl && ctr > 0), + throwError = function (mesg, file, previewId, index) { + var p1 = $.extend(true, {}, self._getOutData(null, {}, {}, files), {id: previewId, index: index}), + p2 = {id: previewId, index: index, file: file, files: files}; + self.isPersistentError = true; + return isAjaxUpload ? self._showFileError(mesg, p1) : self._showError(mesg, p2); + }, + maxCountCheck = function (n, m, all) { + var msg = all ? self.msgTotalFilesTooMany : self.msgFilesTooMany; + msg = msg.replace('{m}', m).replace('{n}', n); + self.isError = throwError(msg, null, null, null); + self.$captionContainer.removeClass('icon-visible'); + self._setCaption('', true); + self.$container.removeClass('file-input-new file-input-ajax-new'); + }; + self.reader = null; + self._resetUpload(); + self._hideFileIcon(); + if (self.dropZoneEnabled) { + self.$container.find('.file-drop-zone .' + self.dropZoneTitleClass).remove(); + } + if (!isAjaxUpload) { + if (e.target && e.target.files === undefined) { + files = e.target.value ? [{name: e.target.value.replace(/^.+\\/, '')}] : []; + } else { + files = e.target.files || {}; + } + } + tfiles = files; + if ($h.isEmpty(tfiles) || tfiles.length === 0) { + if (!isAjaxUpload) { + self.clear(); + } + self._raise('fileselectnone'); + return; + } + self._resetErrors(); + len = tfiles.length; + initCount = isAjaxUpload ? (self.fileManager.count() + len) : len; + total = self._getFileCount(initCount, inclAll ? false : undefined); + if (maxCount > 0 && total > maxCount) { + if (!self.autoReplace || len > maxCount) { + maxCountCheck((self.autoReplace && len > maxCount ? len : total), maxCount); + return; + } + if (total > maxCount) { + self._resetPreviewThumbs(isAjaxUpload); + } + } else { + if (inclAll) { + total = self._getFileCount(initCount, true); + if (maxTotCount > 0 && total > maxTotCount) { + if (!self.autoReplace || len > maxCount) { + maxCountCheck((self.autoReplace && len > maxTotCount ? len : total), maxTotCount, true); + return; + } + if (total > maxCount) { + self._resetPreviewThumbs(isAjaxUpload); + } + } + } + if (!isAjaxUpload || flagSingle) { + self._resetPreviewThumbs(false); + if (flagSingle) { + self.clearFileStack(); + } + } else { + if (isAjaxUpload && ctr === 0 && (!self.previewCache.count(true) || self.overwriteInitial)) { + self._resetPreviewThumbs(true); + } + } + } + self.readFiles(tfiles); + }, + _abort: function (params) { + var self = this, data; + if (self.ajaxAborted && typeof self.ajaxAborted === 'object' && self.ajaxAborted.message !== undefined) { + data = $.extend(true, {}, self._getOutData(null), params); + data.abortData = self.ajaxAborted.data || {}; + data.abortMessage = self.ajaxAborted.message; + self._setProgress(101, self.$progress, self.msgCancelled); + self._showFileError(self.ajaxAborted.message, data, 'filecustomerror'); + self.cancel(); + return true; + } + return !!self.ajaxAborted; + }, + _resetFileStack: function () { + var self = this, i = 0; + self._getThumbs().each(function () { + var $thumb = $(this), ind = $thumb.attr('data-fileindex'), pid = $thumb.attr('id'); + if (ind === '-1' || ind === -1) { + return; + } + if (!self.fileManager.getFile($thumb.attr('data-fileid'))) { + $thumb.attr({'data-fileindex': i}); + i++; + } else { + $thumb.attr({'data-fileindex': '-1'}); + } + self._getZoom(pid).attr({ + 'data-fileindex': $thumb.attr('data-fileindex') + }); + }); + }, + _isFileSelectionValid: function (cnt) { + var self = this; + cnt = cnt || 0; + if (self.required && !self.getFilesCount()) { + self.$errorContainer.html(''); + self._showFileError(self.msgFileRequired); + return false; + } + if (self.minFileCount > 0 && self._getFileCount(cnt) < self.minFileCount) { + self._noFilesError({}); + return false; + } + return true; + }, + _canPreview: function (file) { + var self = this; + if (!file || !self.showPreview || !self.$preview || !self.$preview.length) { + return false; + } + var name = file.name || '', type = file.type || '', size = (file.size || 0) / 1000, + cat = self._parseFileType(type, name), allowedTypes, allowedMimes, allowedExts, skipPreview, + types = self.allowedPreviewTypes, mimes = self.allowedPreviewMimeTypes, + exts = self.allowedPreviewExtensions || [], dTypes = self.disabledPreviewTypes, + dMimes = self.disabledPreviewMimeTypes, dExts = self.disabledPreviewExtensions || [], + maxSize = self.maxFilePreviewSize && parseFloat(self.maxFilePreviewSize) || 0, + expAllExt = new RegExp('\\.(' + exts.join('|') + ')$', 'i'), + expDisExt = new RegExp('\\.(' + dExts.join('|') + ')$', 'i'); + allowedTypes = !types || types.indexOf(cat) !== -1; + allowedMimes = !mimes || mimes.indexOf(type) !== -1; + allowedExts = !exts.length || $h.compare(name, expAllExt); + skipPreview = (dTypes && dTypes.indexOf(cat) !== -1) || (dMimes && dMimes.indexOf(type) !== -1) || + (dExts.length && $h.compare(name, expDisExt)) || (maxSize && !isNaN(maxSize) && size > maxSize); + return !skipPreview && (allowedTypes || allowedMimes || allowedExts); + }, + addToStack: function (file, id) { + this.fileManager.add(file, id); + }, + clearFileStack: function () { + var self = this; + self.fileManager.clear(); + self._initResumableUpload(); + if (self.enableResumableUpload) { + if (self.showPause === null) { + self.showPause = true; + } + if (self.showCancel === null) { + self.showCancel = false; + } + } else { + self.showPause = false; + if (self.showCancel === null) { + self.showCancel = true; + } + } + return self.$element; + }, + getFileStack: function () { + return this.fileManager.stack; + }, + getFileList: function () { + return this.fileManager.list(); + }, + getFilesCount: function (includeInitial) { + var self = this, len = self.isAjaxUpload ? self.fileManager.count() : self._inputFileCount(); + if (includeInitial) { + len += self.previewCache.count(true); + } + return self._getFileCount(len); + }, + readFiles: function (files) { + this.reader = new FileReader(); + var self = this, reader = self.reader, $container = self.$previewContainer, + $status = self.$previewStatus, msgLoading = self.msgLoading, msgProgress = self.msgProgress, + previewInitId = self.previewInitId, numFiles = files.length, settings = self.fileTypeSettings, + readFile, fileTypes = self.allowedFileTypes, typLen = fileTypes ? fileTypes.length : 0, + fileExt = self.allowedFileExtensions, strExt = $h.isEmpty(fileExt) ? '' : fileExt.join(', '), + throwError = function (msg, file, previewId, index, fileId) { + var $thumb, p1 = $.extend(true, {}, self._getOutData(null, {}, {}, files), + {id: previewId, index: index, fileId: fileId}), + p2 = {id: previewId, index: index, fileId: fileId, file: file, files: files}; + if (!removeThumb) { + self._previewDefault(file, true); + } + $thumb = self._getFrame(previewId, true); + if (self.isAjaxUpload) { + setTimeout(function () { + readFile(index + 1); + }, self.processDelay); + } else { + self.unlock(); + numFiles = 0; + } + if (self.removeFromPreviewOnError && $thumb.length) { + $thumb.remove(); + } else { + self._initFileActions(); + $thumb.find('.kv-file-upload').remove(); + } + self.isPersistentError = true; + self.isError = self.isAjaxUpload ? self._showFileError(msg, p1) : self._showError(msg, p2); + self._updateFileDetails(numFiles); + }; + self.fileManager.clearImages(); + $.each(files, function (key, file) { + var func = self.fileTypeSettings.image; + if (func && func(file.type)) { + self.fileManager.totalImages++; + } + }); + readFile = function (i) { + var $error = self.$errorContainer, errors, fm = self.fileManager; + if (i >= numFiles) { + self.unlock(); + if (self.duplicateErrors.length) { + errors = '
  • ' + self.duplicateErrors.join('
  • ') + '
  • '; + if ($error.find('ul').length === 0) { + $h.setHtml($error, self.errorCloseButton + '
      ' + errors + '
    '); + } else { + $error.find('ul').append(errors); + } + $error.fadeIn(self.fadeDelay); + self._handler($error.find('.kv-error-close'), 'click', function () { + $error.fadeOut(self.fadeDelay); + }); + self.duplicateErrors = []; + } + if (self.isAjaxUpload) { + self._raise('filebatchselected', [fm.stack]); + if (fm.count() === 0 && !self.isError) { + self.reset(); + } + } else { + self._raise('filebatchselected', [files]); + } + $container.removeClass('file-thumb-loading'); + $status.html(''); + return; + } + self.lock(true); + var file = files[i], previewId = previewInitId + '-' + self._getFileId(file), fSizeKB, j, msg, + fnText = settings.text, fnImage = settings.image, fnHtml = settings.html, typ, chk, typ1, typ2, + caption = self._getFileName(file, ''), fileSize = (file && file.size || 0) / 1000, + fileExtExpr = '', previewData = $h.createObjectURL(file), fileCount = 0, + strTypes = '', fileId, canLoad, fileReaderAborted = false, + func, knownTypes = 0, isText, isHtml, isImage, txtFlag, processFileLoaded = function () { + var msg = msgProgress.setTokens({ + 'index': i + 1, + 'files': numFiles, + 'percent': 50, + 'name': caption + }); + setTimeout(function () { + $status.html(msg); + self._updateFileDetails(numFiles); + readFile(i + 1); + }, self.processDelay); + if (self._raise('fileloaded', [file, previewId, i, reader]) && self.isAjaxUpload) { + fm.add(file); + } + }; + if (!file) { + return; + } + fileId = fm.getId(file); + if (typLen > 0) { + for (j = 0; j < typLen; j++) { + typ1 = fileTypes[j]; + typ2 = self.msgFileTypes[typ1] || typ1; + strTypes += j === 0 ? typ2 : ', ' + typ2; + } + } + if (caption === false) { + readFile(i + 1); + return; + } + if (caption.length === 0) { + msg = self.msgInvalidFileName.replace('{name}', $h.htmlEncode($h.getFileName(file), '[unknown]')); + throwError(msg, file, previewId, i, fileId); + return; + } + if (!$h.isEmpty(fileExt)) { + fileExtExpr = new RegExp('\\.(' + fileExt.join('|') + ')$', 'i'); + } + fSizeKB = fileSize.toFixed(2); + if (self.isAjaxUpload && fm.exists(fileId) || self._getFrame(previewId, true).length) { + var p2 = {id: previewId, index: i, fileId: fileId, file: file, files: files}; + msg = self.msgDuplicateFile.setTokens({name: caption, size: fSizeKB}); + if (self.isAjaxUpload) { + self.duplicateErrors.push(msg); + self.isDuplicateError = true; + self._raise('fileduplicateerror', [file, fileId, caption, fSizeKB, previewId, i]); + readFile(i + 1); + self._updateFileDetails(numFiles); + } else { + self._showError(msg, p2); + self.unlock(); + numFiles = 0; + self._clearFileInput(); + self.reset(); + self._updateFileDetails(numFiles); + } + return; + } + if (self.maxFileSize > 0 && fileSize > self.maxFileSize) { + msg = self.msgSizeTooLarge.setTokens({ + 'name': caption, + 'size': fSizeKB, + 'maxSize': self.maxFileSize + }); + throwError(msg, file, previewId, i, fileId); + return; + } + if (self.minFileSize !== null && fileSize <= $h.getNum(self.minFileSize)) { + msg = self.msgSizeTooSmall.setTokens({ + 'name': caption, + 'size': fSizeKB, + 'minSize': self.minFileSize + }); + throwError(msg, file, previewId, i, fileId); + return; + } + if (!$h.isEmpty(fileTypes) && $h.isArray(fileTypes)) { + for (j = 0; j < fileTypes.length; j += 1) { + typ = fileTypes[j]; + func = settings[typ]; + fileCount += !func || (typeof func !== 'function') ? 0 : (func(file.type, + $h.getFileName(file)) ? 1 : 0); + } + if (fileCount === 0) { + msg = self.msgInvalidFileType.setTokens({name: caption, types: strTypes}); + throwError(msg, file, previewId, i, fileId); + return; + } + } + if (fileCount === 0 && !$h.isEmpty(fileExt) && $h.isArray(fileExt) && !$h.isEmpty(fileExtExpr)) { + chk = $h.compare(caption, fileExtExpr); + fileCount += $h.isEmpty(chk) ? 0 : chk.length; + if (fileCount === 0) { + msg = self.msgInvalidFileExtension.setTokens({name: caption, extensions: strExt}); + throwError(msg, file, previewId, i, fileId); + return; + } + } + if (!self._canPreview(file)) { + canLoad = self.isAjaxUpload && self._raise('filebeforeload', [file, i, reader]); + if (self.isAjaxUpload && canLoad) { + fm.add(file); + } + if (self.showPreview && canLoad) { + $container.addClass('file-thumb-loading'); + self._previewDefault(file); + self._initFileActions(); + } + setTimeout(function () { + if (canLoad) { + self._updateFileDetails(numFiles); + } + readFile(i + 1); + self._raise('fileloaded', [file, previewId, i]); + }, 10); + return; + } + isText = fnText(file.type, caption); + isHtml = fnHtml(file.type, caption); + isImage = fnImage(file.type, caption); + $status.html(msgLoading.replace('{index}', i + 1).replace('{files}', numFiles)); + $container.addClass('file-thumb-loading'); + reader.onerror = function (evt) { + self._errorHandler(evt, caption); + }; + reader.onload = function (theFile) { + var hex, fileInfo, uint, byte, bytes = [], contents, mime, readTextImage = function (textFlag) { + var newReader = new FileReader(); + newReader.onerror = function (theFileNew) { + self._errorHandler(theFileNew, caption); + }; + newReader.onload = function (theFileNew) { + if (self.isAjaxUpload && !self._raise('filebeforeload', [file, i, reader])) { + fileReaderAborted = true; + self._resetCaption(); + reader.abort(); + $status.html(''); + $container.removeClass('file-thumb-loading'); + self.enable(); + return; + } + self._previewFile(i, file, theFileNew, previewData, fileInfo); + self._initFileActions(); + processFileLoaded(); + }; + if (textFlag) { + newReader.readAsText(file, self.textEncoding); + } else { + newReader.readAsDataURL(file); + } + }; + fileInfo = {'name': caption, 'type': file.type}; + $.each(settings, function (k, f) { + if (k !== 'object' && k !== 'other' && typeof f === 'function' && f(file.type, caption)) { + knownTypes++; + } + }); + if (knownTypes === 0) { // auto detect mime types from content if no known file types detected + uint = new Uint8Array(theFile.target.result); + for (j = 0; j < uint.length; j++) { + byte = uint[j].toString(16); + bytes.push(byte); + } + hex = bytes.join('').toLowerCase().substring(0, 8); + mime = $h.getMimeType(hex, '', ''); + if ($h.isEmpty(mime)) { // look for ascii text content + contents = $h.arrayBuffer2String(reader.result); + mime = $h.isSvg(contents) ? 'image/svg+xml' : $h.getMimeType(hex, contents, file.type); + } + fileInfo = {'name': caption, 'type': mime}; + isText = fnText(mime, ''); + isHtml = fnHtml(mime, ''); + isImage = fnImage(mime, ''); + txtFlag = isText || isHtml; + if (txtFlag || isImage) { + readTextImage(txtFlag); + return; + } + } + if (self.isAjaxUpload && !self._raise('filebeforeload', [file, i, reader])) { + fileReaderAborted = true; + self._resetCaption(); + reader.abort(); + $status.html(''); + $container.removeClass('file-thumb-loading'); + self.enable(); + return; + } + self._previewFile(i, file, theFile, previewData, fileInfo); + self._initFileActions(); + processFileLoaded(); + }; + reader.onprogress = function (data) { + if (data.lengthComputable) { + var fact = (data.loaded / data.total) * 100, progress = Math.ceil(fact); + msg = msgProgress.setTokens({ + 'index': i + 1, + 'files': numFiles, + 'percent': progress, + 'name': caption + }); + setTimeout(function () { + if (!fileReaderAborted) { + $status.html(msg); + } + }, self.processDelay); + } + }; + if (isText || isHtml) { + reader.readAsText(file, self.textEncoding); + } else { + if (isImage) { + reader.readAsDataURL(file); + } else { + reader.readAsArrayBuffer(file); + } + } + }; + + readFile(0); + self._updateFileDetails(numFiles, true); + }, + lock: function (selectMode) { + var self = this, $container = self.$container; + self._resetErrors(); + self.disable(); + if (!selectMode && self.showCancel) { + $container.find('.fileinput-cancel').show(); + } + if (!selectMode && self.showPause) { + $container.find('.fileinput-pause').show(); + } + self._raise('filelock', [self.fileManager.stack, self._getExtraData()]); + return self.$element; + }, + unlock: function (reset) { + var self = this, $container = self.$container; + if (reset === undefined) { + reset = true; + } + self.enable(); + $container.removeClass('is-locked'); + if (self.showCancel) { + $container.find('.fileinput-cancel').hide(); + } + if (self.showPause) { + $container.find('.fileinput-pause').hide(); + } + if (reset) { + self._resetFileStack(); + } + self._raise('fileunlock', [self.fileManager.stack, self._getExtraData()]); + return self.$element; + }, + resume: function () { + var self = this, flag = false, rm = self.resumableManager; + if (!self.enableResumableUpload) { + return self.$element; + } + if (self.paused) { + self._toggleResumableProgress(self.progressPauseTemplate, self.msgUploadResume); + } else { + flag = true; + } + self.paused = false; + if (flag) { + self._toggleResumableProgress(self.progressInfoTemplate, self.msgUploadBegin); + } + setTimeout(function () { + rm.upload(); + }, self.processDelay); + return self.$element; + }, + pause: function () { + var self = this, rm = self.resumableManager, xhr = self.ajaxRequests, len = xhr.length, i, + pct = rm.getProgress(), actions = self.fileActionSettings, tm = self.taskManager, + pool = tm.getPool(rm.id); + if (!self.enableResumableUpload) { + return self.$element; + } else { + if (pool) { + pool.cancel(); + } + } + self._raise('fileuploadpaused', [self.fileManager, rm]); + if (len > 0) { + for (i = 0; i < len; i += 1) { + self.paused = true; + xhr[i].abort(); + } + } + if (self.showPreview) { + self._getThumbs().each(function () { + var $thumb = $(this), fileId = $thumb.attr('data-fileid'), t = self._getLayoutTemplate('stats'), + stats, $indicator = $thumb.find('.file-upload-indicator'); + $thumb.removeClass('file-uploading'); + if ($indicator.attr('title') === actions.indicatorLoadingTitle) { + self._setThumbStatus($thumb, 'Paused'); + stats = t.setTokens({pendingTime: self.msgPaused, uploadSpeed: ''}); + self.paused = true; + self._setProgress(pct, $thumb.find('.file-thumb-progress'), pct + '%', stats); + } + if (!self.fileManager.getFile(fileId)) { + $thumb.find('.kv-file-remove').removeClass('disabled').removeAttr('disabled'); + } + }); + } + self._setProgress(101, self.$progress, self.msgPaused); + return self.$element; + }, + cancel: function () { + var self = this, xhr = self.ajaxRequests, + rm = self.resumableManager, tm = self.taskManager, + pool = rm ? tm.getPool(rm.id) : undefined, len = xhr.length, i; + + if (self.enableResumableUpload && pool) { + pool.cancel().done(function () { + self._setProgressCancelled(); + }); + rm.reset(); + self._raise('fileuploadcancelled', [self.fileManager, rm]); + } else { + self._raise('fileuploadcancelled', [self.fileManager]); + } + self._initAjax(); + if (len > 0) { + for (i = 0; i < len; i += 1) { + self.cancelling = true; + xhr[i].abort(); + } + } + self._getThumbs().each(function () { + var $thumb = $(this), fileId = $thumb.attr('data-fileid'), $prog = $thumb.find('.file-thumb-progress'); + $thumb.removeClass('file-uploading'); + self._setProgress(0, $prog); + $prog.hide(); + if (!self.fileManager.getFile(fileId)) { + $thumb.find('.kv-file-upload').removeClass('disabled').removeAttr('disabled'); + $thumb.find('.kv-file-remove').removeClass('disabled').removeAttr('disabled'); + } + self.unlock(); + }); + setTimeout(function () { + self._setProgressCancelled(); + }, self.processDelay); + return self.$element; + }, + clear: function () { + var self = this, cap; + if (!self._raise('fileclear')) { + return; + } + self.$btnUpload.removeAttr('disabled'); + self._getThumbs().find('video,audio,img').each(function () { + $h.cleanMemory($(this)); + }); + self._clearFileInput(); + self._resetUpload(); + self.clearFileStack(); + self.isDuplicateError = false; + self.isPersistentError = false; + self._resetErrors(true); + if (self._hasInitialPreview()) { + self._showFileIcon(); + self._resetPreview(); + self._initPreviewActions(); + self.$container.removeClass('file-input-new'); + } else { + self._getThumbs().each(function () { + self._clearObjects($(this)); + }); + if (self.isAjaxUpload) { + self.previewCache.data = {}; + } + self.$preview.html(''); + cap = (!self.overwriteInitial && self.initialCaption.length > 0) ? self.initialCaption : ''; + self.$caption.attr('title', '').val(cap); + $h.addCss(self.$container, 'file-input-new'); + self._validateDefaultPreview(); + } + if (self.$container.find($h.FRAMES).length === 0) { + if (!self._initCaption()) { + self.$captionContainer.removeClass('icon-visible'); + } + } + self._hideFileIcon(); + if (self.focusCaptionOnClear) { + self.$captionContainer.focus(); + } + self._setFileDropZoneTitle(); + self._raise('filecleared'); + return self.$element; + }, + reset: function () { + var self = this; + if (!self._raise('filereset')) { + return; + } + self.lastProgress = 0; + self._resetPreview(); + self.$container.find('.fileinput-filename').text(''); + $h.addCss(self.$container, 'file-input-new'); + if (self.getFrames().length) { + self.$container.removeClass('file-input-new'); + } + self.clearFileStack(); + self._setFileDropZoneTitle(); + return self.$element; + }, + disable: function () { + var self = this, $container = self.$container; + self.isDisabled = true; + self._raise('filedisabled'); + self.$element.attr('disabled', 'disabled'); + $container.addClass('is-locked'); + $h.addCss($container.find('.btn-file'), 'disabled'); + $container.find('.kv-fileinput-caption').addClass('file-caption-disabled'); + $container.find('.fileinput-remove, .fileinput-upload, .file-preview-frame button') + .attr('disabled', true); + self._initDragDrop(); + return self.$element; + }, + enable: function () { + var self = this, $container = self.$container; + self.isDisabled = false; + self._raise('fileenabled'); + self.$element.removeAttr('disabled'); + $container.removeClass('is-locked'); + $container.find('.kv-fileinput-caption').removeClass('file-caption-disabled'); + $container.find('.fileinput-remove, .fileinput-upload, .file-preview-frame button') + .removeAttr('disabled'); + $container.find('.btn-file').removeClass('disabled'); + self._initDragDrop(); + return self.$element; + }, + upload: function () { + var self = this, fm = self.fileManager, totLen = fm.count(), i, outData, + hasExtraData = !$.isEmptyObject(self._getExtraData()); + if (!self.isAjaxUpload || self.isDisabled || !self._isFileSelectionValid(totLen)) { + return; + } + self.lastProgress = 0; + self._resetUpload(); + if (totLen === 0 && !hasExtraData) { + self._showFileError(self.msgUploadEmpty); + return; + } + self.cancelling = false; + self._showProgress(); + self.lock(); + if (totLen === 0 && hasExtraData) { + self._setProgress(2); + self._uploadExtraOnly(); + return; + } + if (self.enableResumableUpload) { + return self.resume(); + } + if (self.uploadAsync || self.enableResumableUpload) { + outData = self._getOutData(null); + self._raise('filebatchpreupload', [outData]); + self.fileBatchCompleted = false; + self.uploadCache = []; + $.each(self.getFileStack(), function (id) { + var previewId = self._getThumbId(id); + self.uploadCache.push({id: previewId, content: null, config: null, tags: null, append: true}); + }); + self.$preview.find('.file-preview-initial').removeClass($h.SORT_CSS); + self._initSortable(); + } + self._setProgress(2); + self.hasInitData = false; + if (self.uploadAsync) { + i = 0; + $.each(fm.stack, function (id) { + self._uploadSingle(i, id, true); + i++; + }); + return; + } + self._uploadBatch(); + return self.$element; + }, + destroy: function () { + var self = this, $form = self.$form, $cont = self.$container, $el = self.$element, ns = self.namespace; + $(document).off(ns); + $(window).off(ns); + if ($form && $form.length) { + $form.off(ns); + } + if (self.isAjaxUpload) { + self._clearFileInput(); + } + self._cleanup(); + self._initPreviewCache(); + $el.insertBefore($cont).off(ns).removeData(); + $cont.off().remove(); + return $el; + }, + refresh: function (options) { + var self = this, $el = self.$element; + if (typeof options !== 'object' || $h.isEmpty(options)) { + options = self.options; + } else { + options = $.extend(true, {}, self.options, options); + } + self._init(options, true); + self._listen(); + return $el; + }, + zoom: function (frameId) { + var self = this, $frame = self._getFrame(frameId); + self._showModal($frame); + }, + getExif: function (frameId) { + var self = this, $frame = self._getFrame(frameId); + return $frame && $frame.data('exif') || null; + }, + getFrames: function (cssFilter) { + var self = this, $frames; + cssFilter = cssFilter || ''; + $frames = self.$preview.find($h.FRAMES + cssFilter); + if (self.reversePreviewOrder) { + $frames = $($frames.get().reverse()); + } + return $frames; + }, + getPreview: function () { + var self = this; + return { + content: self.initialPreview, + config: self.initialPreviewConfig, + tags: self.initialPreviewThumbTags + }; + } + }; + + $.fn.fileinput = function (option) { + if (!$h.hasFileAPISupport() && !$h.isIE(9)) { + return; + } + var args = Array.apply(null, arguments), retvals = []; + args.shift(); + this.each(function () { + var self = $(this), data = self.data('fileinput'), options = typeof option === 'object' && option, + theme = options.theme || self.data('theme'), l = {}, t = {}, + lang = options.language || self.data('language') || $.fn.fileinput.defaults.language || 'en', opt; + if (!data) { + if (theme) { + t = $.fn.fileinputThemes[theme] || {}; + } + if (lang !== 'en' && !$h.isEmpty($.fn.fileinputLocales[lang])) { + l = $.fn.fileinputLocales[lang] || {}; + } + opt = $.extend(true, {}, $.fn.fileinput.defaults, t, $.fn.fileinputLocales.en, l, options, self.data()); + data = new FileInput(this, opt); + self.data('fileinput', data); + } + + if (typeof option === 'string') { + retvals.push(data[option].apply(data, args)); + } + }); + switch (retvals.length) { + case 0: + return this; + case 1: + return retvals[0]; + default: + return retvals; + } + }; + + var IFRAME_ATTRIBS = 'class="kv-preview-data file-preview-pdf" src="{renderer}?file={data}" {style}'; + + $.fn.fileinput.defaults = { + language: 'en', + showCaption: true, + showBrowse: true, + showPreview: true, + showRemove: true, + showUpload: true, + showUploadStats: true, + showCancel: null, + showPause: null, + showClose: true, + showUploadedThumbs: true, + showConsoleLogs: false, + browseOnZoneClick: false, + autoReplace: false, + autoOrientImage: function () { // applicable for JPEG images only and non ios safari + var ua = window.navigator.userAgent, webkit = !!ua.match(/WebKit/i), + iOS = !!ua.match(/iP(od|ad|hone)/i), iOSSafari = iOS && webkit && !ua.match(/CriOS/i); + return !iOSSafari; + }, + autoOrientImageInitial: true, + required: false, + rtl: false, + hideThumbnailContent: false, + encodeUrl: true, + focusCaptionOnBrowse: true, + focusCaptionOnClear: true, + generateFileId: null, + previewClass: '', + captionClass: '', + frameClass: 'krajee-default', + mainClass: 'file-caption-main', + mainTemplate: null, + purifyHtml: true, + fileSizeGetter: null, + initialCaption: '', + initialPreview: [], + initialPreviewDelimiter: '*$$*', + initialPreviewAsData: false, + initialPreviewFileType: 'image', + initialPreviewConfig: [], + initialPreviewThumbTags: [], + previewThumbTags: {}, + initialPreviewShowDelete: true, + initialPreviewDownloadUrl: '', + removeFromPreviewOnError: false, + deleteUrl: '', + deleteExtraData: {}, + overwriteInitial: true, + sanitizeZoomCache: function (content) { + var $container = $h.createElement(content); + $container.find('input,select,.file-thumbnail-footer').remove(); + return $container.html(); + }, + previewZoomButtonIcons: { + prev: '', + next: '', + toggleheader: '', + fullscreen: '', + borderless: '', + close: '' + }, + previewZoomButtonClasses: { + prev: 'btn btn-navigate', + next: 'btn btn-navigate', + toggleheader: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + fullscreen: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + borderless: 'btn btn-sm btn-kv btn-default btn-outline-secondary', + close: 'btn btn-sm btn-kv btn-default btn-outline-secondary' + }, + previewTemplates: {}, + previewContentTemplates: {}, + preferIconicPreview: false, + preferIconicZoomPreview: false, + allowedFileTypes: null, + allowedFileExtensions: null, + allowedPreviewTypes: undefined, + allowedPreviewMimeTypes: null, + allowedPreviewExtensions: null, + disabledPreviewTypes: undefined, + disabledPreviewExtensions: ['msi', 'exe', 'com', 'zip', 'rar', 'app', 'vb', 'scr'], + disabledPreviewMimeTypes: null, + defaultPreviewContent: null, + customLayoutTags: {}, + customPreviewTags: {}, + previewFileIcon: '', + previewFileIconClass: 'file-other-icon', + previewFileIconSettings: {}, + previewFileExtSettings: {}, + buttonLabelClass: 'hidden-xs', + browseIcon: ' ', + browseClass: 'btn btn-primary', + removeIcon: '', + removeClass: 'btn btn-default btn-secondary', + cancelIcon: '', + cancelClass: 'btn btn-default btn-secondary', + pauseIcon: '', + pauseClass: 'btn btn-default btn-secondary', + uploadIcon: '', + uploadClass: 'btn btn-default btn-secondary', + uploadUrl: null, + uploadUrlThumb: null, + uploadAsync: true, + uploadParamNames: { + chunkCount: 'chunkCount', + chunkIndex: 'chunkIndex', + chunkSize: 'chunkSize', + chunkSizeStart: 'chunkSizeStart', + chunksUploaded: 'chunksUploaded', + fileBlob: 'fileBlob', + fileId: 'fileId', + fileName: 'fileName', + fileRelativePath: 'fileRelativePath', + fileSize: 'fileSize', + retryCount: 'retryCount' + }, + maxAjaxThreads: 5, + fadeDelay: 800, + processDelay: 100, + queueDelay: 10, // must be lesser than process delay + progressDelay: 0, // must be lesser than process delay + enableResumableUpload: false, + resumableUploadOptions: { + fallback: null, + testUrl: null, // used for checking status of chunks/ files previously / partially uploaded + chunkSize: 2 * 1024, // in KB + maxThreads: 4, + maxRetries: 3, + showErrorLog: true + }, + uploadExtraData: {}, + zoomModalHeight: 480, + minImageWidth: null, + minImageHeight: null, + maxImageWidth: null, + maxImageHeight: null, + resizeImage: false, + resizePreference: 'width', + resizeQuality: 0.92, + resizeDefaultImageType: 'image/jpeg', + resizeIfSizeMoreThan: 0, // in KB + minFileSize: 0, + maxFileSize: 0, + maxFilePreviewSize: 25600, // 25 MB + minFileCount: 0, + maxFileCount: 0, + maxTotalFileCount: 0, + validateInitialCount: false, + msgValidationErrorClass: 'text-danger', + msgValidationErrorIcon: ' ', + msgErrorClass: 'file-error-message', + progressThumbClass: 'progress-bar progress-bar-striped active', + progressClass: 'progress-bar bg-success progress-bar-success progress-bar-striped active', + progressInfoClass: 'progress-bar bg-info progress-bar-info progress-bar-striped active', + progressCompleteClass: 'progress-bar bg-success progress-bar-success', + progressPauseClass: 'progress-bar bg-primary progress-bar-primary progress-bar-striped active', + progressErrorClass: 'progress-bar bg-danger progress-bar-danger', + progressUploadThreshold: 99, + previewFileType: 'image', + elCaptionContainer: null, + elCaptionText: null, + elPreviewContainer: null, + elPreviewImage: null, + elPreviewStatus: null, + elErrorContainer: null, + errorCloseButton: $h.closeButton('kv-error-close'), + slugCallback: null, + dropZoneEnabled: true, + dropZoneTitleClass: 'file-drop-zone-title', + fileActionSettings: {}, + otherActionButtons: '', + textEncoding: 'UTF-8', + ajaxSettings: {}, + ajaxDeleteSettings: {}, + showAjaxErrorDetails: true, + mergeAjaxCallbacks: false, + mergeAjaxDeleteCallbacks: false, + retryErrorUploads: true, + reversePreviewOrder: false, + usePdfRenderer: function () { + //noinspection JSUnresolvedVariable + var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; + return !!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/i) || isIE11; + }, + pdfRendererUrl: '', + pdfRendererTemplate: '' + }; + + // noinspection HtmlUnknownAttribute + $.fn.fileinputLocales.en = { + fileSingle: 'file', + filePlural: 'files', + browseLabel: 'Browse …', + removeLabel: 'Remove', + removeTitle: 'Clear all unprocessed files', + cancelLabel: 'Cancel', + cancelTitle: 'Abort ongoing upload', + pauseLabel: 'Pause', + pauseTitle: 'Pause ongoing upload', + uploadLabel: 'Upload', + uploadTitle: 'Upload selected files', + msgNo: 'No', + msgNoFilesSelected: 'No files selected', + msgCancelled: 'Cancelled', + msgPaused: 'Paused', + msgPlaceholder: 'Select {files} ...', + msgZoomModalHeading: 'Detailed Preview', + msgFileRequired: 'You must select a file to upload.', + msgSizeTooSmall: 'File "{name}" ({size} KB) is too small and must be larger than {minSize} KB.', + msgSizeTooLarge: 'File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB.', + msgFilesTooLess: 'You must select at least {n} {files} to upload.', + msgFilesTooMany: 'Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.', + msgTotalFilesTooMany: 'You can upload a maximum of {m} files ({n} files detected).', + msgFileNotFound: 'File "{name}" not found!', + msgFileSecured: 'Security restrictions prevent reading the file "{name}".', + msgFileNotReadable: 'File "{name}" is not readable.', + msgFilePreviewAborted: 'File preview aborted for "{name}".', + msgFilePreviewError: 'An error occurred while reading the file "{name}".', + msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".', + msgInvalidFileType: 'Invalid type for file "{name}". Only "{types}" files are supported.', + msgInvalidFileExtension: 'Invalid extension for file "{name}". Only "{extensions}" files are supported.', + msgFileTypes: { + 'image': 'image', + 'html': 'HTML', + 'text': 'text', + 'video': 'video', + 'audio': 'audio', + 'flash': 'flash', + 'pdf': 'PDF', + 'object': 'object' + }, + msgUploadAborted: 'The file upload was aborted', + msgUploadThreshold: 'Processing …', + msgUploadBegin: 'Initializing …', + msgUploadEnd: 'Done', + msgUploadResume: 'Resuming upload …', + msgUploadEmpty: 'No valid data available for upload.', + msgUploadError: 'Upload Error', + msgDeleteError: 'Delete Error', + msgProgressError: 'Error', + msgValidationError: 'Validation Error', + msgLoading: 'Loading file {index} of {files} …', + msgProgress: 'Loading file {index} of {files} - {name} - {percent}% completed.', + msgSelected: '{n} {files} selected', + msgFoldersNotAllowed: 'Drag & drop files only! {n} folder(s) dropped were skipped.', + msgImageWidthSmall: 'Width of image file "{name}" must be at least {size} px.', + msgImageHeightSmall: 'Height of image file "{name}" must be at least {size} px.', + msgImageWidthLarge: 'Width of image file "{name}" cannot exceed {size} px.', + msgImageHeightLarge: 'Height of image file "{name}" cannot exceed {size} px.', + msgImageResizeError: 'Could not get the image dimensions to resize.', + msgImageResizeException: 'Error while resizing the image.
    {errors}
    ', + msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!', + msgAjaxProgressError: '{operation} failed', + msgDuplicateFile: 'File "{name}" of same size "{size} KB" has already been selected earlier. Skipping duplicate selection.', + msgResumableUploadRetriesExceeded: 'Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ', + msgPendingTime: '{time} remaining', + msgCalculatingTime: 'calculating time remaining', + ajaxOperations: { + deleteThumb: 'file delete', + uploadThumb: 'file upload', + uploadBatch: 'batch file upload', + uploadExtra: 'form data upload' + }, + dropZoneTitle: 'Drag & drop files here …', + dropZoneClickTitle: '
    (or click to select {files})', + previewZoomButtonTitles: { + prev: 'View previous file', + next: 'View next file', + toggleheader: 'Toggle header', + fullscreen: 'Toggle full screen', + borderless: 'Toggle borderless mode', + close: 'Close detailed preview' + } + }; + + $.fn.fileinput.Constructor = FileInput; + + /** + * Convert automatically file inputs with class 'file' into a bootstrap fileinput control. + */ + $(document).ready(function () { + var $input = $('input.file[type=file]'); + if ($input.length) { + $input.fileinput(); + } + }); +})); \ No newline at end of file diff --git a/static/js/plugins/fileinput/fileinput.min.js b/static/js/plugins/fileinput/fileinput.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f68b5479ee76f1664584fa54640c5d4c0cc9e412 --- /dev/null +++ b/static/js/plugins/fileinput/fileinput.min.js @@ -0,0 +1,2588 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */ +!function (e) { + "use strict"; + "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof module && module.exports ? module.exports = e(require("jquery")) : e(window.jQuery) +}(function (e) { + "use strict"; + e.fn.fileinputLocales = {}, e.fn.fileinputThemes = {}, String.prototype.setTokens = function (e) { + var t, i, a = this.toString(); + for (t in e) e.hasOwnProperty(t) && (i = new RegExp("{" + t + "}", "g"), a = a.replace(i, e[t])); + return a + }, Array.prototype.flatMap || (Array.prototype.flatMap = function (e) { + return [].concat(this.map(e)) + }); + var t, i; + t = { + FRAMES: ".kv-preview-thumb", + SORT_CSS: "file-sortable", + INIT_FLAG: "init-", + OBJECT_PARAMS: '\n\n\n\n\n\n', + DEFAULT_PREVIEW: '
    \n{previewFileIcon}\n
    ', + MODAL_ID: "kvFileinputModal", + MODAL_EVENTS: ["show", "shown", "hide", "hidden", "loaded"], + logMessages: { + ajaxError: "{status}: {error}. Error Details: {text}.", + badDroppedFiles: "Error scanning dropped files!", + badExifParser: "Error loading the piexif.js library. {details}", + badInputType: 'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.', + exifWarning: 'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded the "piexif.js" library correctly on your page before the "fileinput.js" script.', + invalidChunkSize: 'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.', + invalidThumb: 'Invalid thumb frame with id: "{id}".', + noResumableSupport: "The browser does not support resumable or chunk uploads.", + noUploadUrl: 'The "uploadUrl" is not set. Ajax uploads and resumable uploads have been disabled.', + retryStatus: "Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.", + chunkQueueError: "Could not push task to ajax pool for chunk index # {index}." + }, + objUrl: window.URL || window.webkitURL, + now: function () { + return new Date + }, + round: function (e) { + return e = parseFloat(e), isNaN(e) ? 0 : Math.floor(Math.round(e)) + }, + getFileRelativePath: function (e) { + return String(e.newPath || e.relativePath || e.webkitRelativePath || t.getFileName(e) || null) + }, + getFileId: function (e, i) { + var a = t.getFileRelativePath(e); + return "function" == typeof i ? i(e) : e && a ? e.size + "_" + a.replace(/\s/gim, "_") : null + }, + getFrameSelector: function (e, t) { + return t = t || "", '[id="' + e + '"]' + t + }, + getZoomSelector: function (e, t) { + return t = t || "", '[id="zoom-' + e + '"]' + t + }, + getFrameElement: function (e, i, a) { + return e.find(t.getFrameSelector(i, a)) + }, + getZoomElement: function (e, i, a) { + return e.find(t.getZoomSelector(i, a)) + }, + getElapsed: function (i) { + var a = i, r = "", n = {}, + o = {year: 31536e3, month: 2592e3, week: 604800, day: 86400, hour: 3600, minute: 60, second: 1}; + return t.getObjectKeys(o).forEach(function (e) { + n[e] = Math.floor(a / o[e]), a -= n[e] * o[e] + }), e.each(n, function (e, t) { + t > 0 && (r += (r ? " " : "") + t + e.substring(0, 1)) + }), r + }, + debounce: function (e, t) { + var i; + return function () { + var a = arguments, r = this; + clearTimeout(i), i = setTimeout(function () { + e.apply(r, a) + }, t) + } + }, + stopEvent: function (e) { + e.stopPropagation(), e.preventDefault() + }, + getFileName: function (e) { + return e ? e.fileName || e.name || "" : "" + }, + createObjectURL: function (e) { + return t.objUrl && t.objUrl.createObjectURL && e ? t.objUrl.createObjectURL(e) : "" + }, + revokeObjectURL: function (e) { + t.objUrl && t.objUrl.revokeObjectURL && e && t.objUrl.revokeObjectURL(e) + }, + compare: function (e, t, i) { + return void 0 !== e && (i ? e === t : e.match(t)) + }, + isIE: function (e) { + var t, i; + return "Microsoft Internet Explorer" !== navigator.appName ? !1 : 10 === e ? new RegExp("msie\\s" + e, "i").test(navigator.userAgent) : (t = document.createElement("div"), t.innerHTML = "", i = t.getElementsByTagName("i").length, document.body.appendChild(t), t.parentNode.removeChild(t), i) + }, + canOrientImage: function (t) { + var i = e(document.createElement("img")).css({width: "1px", height: "1px"}).insertAfter(t), + a = i.css("image-orientation"); + return i.remove(), !!a + }, + canAssignFilesToInput: function () { + var e = document.createElement("input"); + try { + return e.type = "file", e.files = null, !0 + } catch (t) { + return !1 + } + }, + getDragDropFolders: function (e) { + var t, i, a = e ? e.length : 0, r = 0; + if (a > 0 && e[0].webkitGetAsEntry()) for (t = 0; a > t; t++) i = e[t].webkitGetAsEntry(), i && i.isDirectory && r++; + return r + }, + initModal: function (t) { + var i = e("body"); + i.length && t.appendTo(i) + }, + isFunction: function (e) { + return "function" == typeof e + }, + isEmpty: function (i, a) { + return void 0 === i || null === i || !t.isFunction(i) && (0 === i.length || a && "" === e.trim(i)) + }, + isArray: function (e) { + return Array.isArray(e) || "[object Array]" === Object.prototype.toString.call(e) + }, + ifSet: function (e, t, i) { + return i = i || "", t && "object" == typeof t && e in t ? t[e] : i + }, + cleanArray: function (e) { + return e instanceof Array || (e = []), e.filter(function (e) { + return void 0 !== e && null !== e + }) + }, + spliceArray: function (t, i, a) { + var r, n, o = 0, l = []; + if (!(t instanceof Array)) return []; + for (n = e.extend(!0, [], t), a && n.reverse(), r = 0; r < n.length; r++) r !== i && (l[o] = n[r], o++); + return a && l.reverse(), l + }, + getNum: function (e, t) { + return t = t || 0, "number" == typeof e ? e : ("string" == typeof e && (e = parseFloat(e)), isNaN(e) ? t : e) + }, + hasFileAPISupport: function () { + return !(!window.File || !window.FileReader) + }, + hasDragDropSupport: function () { + var e = document.createElement("div"); + return !t.isIE(9) && (void 0 !== e.draggable || void 0 !== e.ondragstart && void 0 !== e.ondrop) + }, + hasFileUploadSupport: function () { + return t.hasFileAPISupport() && window.FormData + }, + hasBlobSupport: function () { + try { + return !!window.Blob && Boolean(new Blob) + } catch (e) { + return !1 + } + }, + hasArrayBufferViewSupport: function () { + try { + return 100 === new Blob([new Uint8Array(100)]).size + } catch (e) { + return !1 + } + }, + hasResumableUploadSupport: function () { + return t.hasFileUploadSupport() && t.hasBlobSupport() && t.hasArrayBufferViewSupport() && (!!Blob.prototype.webkitSlice || !!Blob.prototype.mozSlice || !!Blob.prototype.slice || !1) + }, + dataURI2Blob: function (e) { + var i, a, r, n, o, l, + s = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, + d = t.hasBlobSupport(), c = (d || s) && window.atob && window.ArrayBuffer && window.Uint8Array; + if (!c) return null; + for (i = e.split(",")[0].indexOf("base64") >= 0 ? atob(e.split(",")[1]) : decodeURIComponent(e.split(",")[1]), a = new ArrayBuffer(i.length), r = new Uint8Array(a), n = 0; n < i.length; n += 1) r[n] = i.charCodeAt(n); + return o = e.split(",")[0].split(":")[1].split(";")[0], d ? new Blob([t.hasArrayBufferViewSupport() ? r : a], {type: o}) : (l = new s, l.append(a), l.getBlob(o)) + }, + arrayBuffer2String: function (e) { + if (window.TextDecoder) return new TextDecoder("utf-8").decode(e); + var t, i, a, r, n = Array.prototype.slice.apply(new Uint8Array(e)), o = "", l = 0; + for (t = n.length; t > l;) switch (i = n[l++], i >> 4) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + o += String.fromCharCode(i); + break; + case 12: + case 13: + a = n[l++], o += String.fromCharCode((31 & i) << 6 | 63 & a); + break; + case 14: + a = n[l++], r = n[l++], o += String.fromCharCode((15 & i) << 12 | (63 & a) << 6 | (63 & r) << 0) + } + return o + }, + isHtml: function (e) { + var t = document.createElement("div"); + t.innerHTML = e; + for (var i = t.childNodes, a = i.length; a--;) if (1 === i[a].nodeType) return !0; + return !1 + }, + isSvg: function (e) { + return e.match(/^\s*<\?xml/i) && (e.match(/" + t + "")) + }, + uniqId: function () { + return ((new Date).getTime() + Math.floor(Math.random() * Math.pow(10, 15))).toString(36) + }, + parseEventCallback: function (e) { + return Function("'use strict'; return (function() { " + e + " });")() + }, + cspBuffer: { + CSP_ATTRIB: "data-csp-01928735", + domEventsList: ["mousedown", "mouseup", "click", "dblclick", "mousemove", "mouseover", "mousewheel", "mouseout", "contextmenu", "touchstart", "touchmove", "touchend", "touchcancel", "keydown", "keypress", "keyup", "focus", "blur", "change", "submit", "scroll", "resize", "hashchange", "load", "unload", "cut", "copy", "paste"], + domElementEvents: {}, + domElementsStyles: {}, + stash: function (i) { + var a = this, r = e.parseHTML("
    " + i + "
    "), n = e(r); + n.find("[style]").each(function (i, r) { + var n = e(r), o = n.attr("style"), l = t.uniqId(), s = {}; + o && o.length && (-1 === o.indexOf(";") && (o += ";"), o.slice(0, o.length - 1).split(";").map(function (e) { + e = e.split(":"), e[0] && (s[e[0]] = e[1] ? e[1] : "") + }), a.domElementsStyles[l] = s, n.removeAttr("style").attr(a.CSP_ATTRIB, l)) + }), n.filter("*").removeAttr("style"), e.each(a.domEventsList, function (e, i) { + var r, o, l = "on" + i, s = n.find("[" + l + "]"); + s.length && (o = t.parseEventCallback(s.attr(l)), s.attr(a.CSP_ATTRIB) ? r = s.attr(a.CSP_ATTRIB) : (r = t.uniqId(), a.domElementEvents[r] = []), a.domElementEvents[r].push({ + name: i + ".csp", + handler: o + }), s.removeAttr(l).attr(a.CSP_ATTRIB, r)) + }); + var o = Object.values ? Object.values(r) : Object.keys(r).map(function (e) { + return r[e] + }); + return o.flatMap(function (e) { + return e.innerHTML + }).join("") + }, + apply: function (t) { + var i = this, a = e(t); + a.find("[" + i.CSP_ATTRIB + "]").each(function (t, a) { + var r = e(a), n = r.attr(i.CSP_ATTRIB), o = i.domElementsStyles[n], l = i.domElementEvents[n]; + o && r.css(o), l && e.each(l, function (e, t) { + t && t.name && r.off(t.name).on(t.name, t.handler) + }), r.removeAttr(i.CSP_ATTRIB) + }), i.domElementsStyles = {}, i.domElementEvents = {} + } + }, + setHtml: function (e, i) { + var a = t.cspBuffer; + return e.html(a.stash(i)), a.apply(e), e + }, + htmlEncode: function (e, t) { + return void 0 === e ? t || null : e.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'") + }, + replaceTags: function (t, i) { + var a = t; + return i ? (e.each(i, function (e, t) { + "function" == typeof t && (t = t()), a = a.split(e).join(t) + }), a) : a + }, + cleanMemory: function (e) { + var i = e.is("img") ? e.attr("src") : e.find("source").attr("src"); + t.revokeObjectURL(i) + }, + findFileName: function (e) { + var t = e.lastIndexOf("/"); + return -1 === t && (t = e.lastIndexOf("\\")), e.split(e.substring(t, t + 1)).pop() + }, + checkFullScreen: function () { + return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement + }, + toggleFullScreen: function (e) { + var i = document, a = i.documentElement, r = t.checkFullScreen(); + a && e && !r ? a.requestFullscreen ? a.requestFullscreen() : a.msRequestFullscreen ? a.msRequestFullscreen() : a.mozRequestFullScreen ? a.mozRequestFullScreen() : a.webkitRequestFullscreen && a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : r && (i.exitFullscreen ? i.exitFullscreen() : i.msExitFullscreen ? i.msExitFullscreen() : i.mozCancelFullScreen ? i.mozCancelFullScreen() : i.webkitExitFullscreen && i.webkitExitFullscreen()) + }, + moveArray: function (t, i, a, r) { + var n = e.extend(!0, [], t); + if (r && n.reverse(), a >= n.length) for (var o = a - n.length; o-- + 1;) n.push(void 0); + return n.splice(a, 0, n.splice(i, 1)[0]), r && n.reverse(), n + }, + closeButton: function (e) { + return e = e ? "close " + e : "close", '' + }, + getRotation: function (e) { + switch (e) { + case 2: + return "rotateY(180deg)"; + case 3: + return "rotate(180deg)"; + case 4: + return "rotate(180deg) rotateY(180deg)"; + case 5: + return "rotate(270deg) rotateY(180deg)"; + case 6: + return "rotate(90deg)"; + case 7: + return "rotate(90deg) rotateY(180deg)"; + case 8: + return "rotate(270deg)"; + default: + return "" + } + }, + setTransform: function (e, t) { + e && (e.style.transform = t, e.style.webkitTransform = t, e.style["-moz-transform"] = t, e.style["-ms-transform"] = t, e.style["-o-transform"] = t) + }, + getObjectKeys: function (t) { + var i = []; + return t && e.each(t, function (e) { + i.push(e) + }), i + }, + getObjectSize: function (e) { + return t.getObjectKeys(e).length + }, + whenAll: function (i) { + var a, r, n, o, l, s, d = [].slice, c = 1 === arguments.length && t.isArray(i) ? i : d.call(arguments), + u = e.Deferred(), p = 0, f = c.length, g = f; + for (n = o = l = Array(f), s = function (e, t, i) { + return function () { + i !== c && p++, u.notifyWith(t[e] = this, i[e] = d.call(arguments)), --g || u[(p ? "reject" : "resolve") + "With"](t, i) + } + }, a = 0; f > a; a++) (r = c[a]) && e.isFunction(r.promise) ? r.promise().done(s(a, l, c)).fail(s(a, n, o)) : (u.notifyWith(this, r), --g); + return g || u.resolveWith(l, c), u.promise() + } + }, i = function (i, a) { + var r = this; + r.$element = e(i), r.$parent = r.$element.parent(), r._validate() && (r.isPreviewable = t.hasFileAPISupport(), r.isIE9 = t.isIE(9), r.isIE10 = t.isIE(10), (r.isPreviewable || r.isIE9) && (r._init(a), r._listen()), r.$element.removeClass("file-loading")) + }, i.prototype = { + constructor: i, _cleanup: function () { + var e = this; + e.reader = null, e.clearFileStack(), e.fileBatchCompleted = !0, e.isError = !1, e.isDuplicateError = !1, e.isPersistentError = !1, e.cancelling = !1, e.paused = !1, e.lastProgress = 0, e._initAjax() + }, _isAborted: function () { + var e = this; + return e.cancelling || e.paused + }, _initAjax: function () { + var i = this, a = i.taskManager = { + pool: {}, addPool: function (e) { + return a.pool[e] = new a.TasksPool(e) + }, getPool: function (e) { + return a.pool[e] + }, addTask: function (e, t) { + return new a.Task(e, t) + }, TasksPool: function (i) { + var r = this; + r.id = i, r.cancelled = !1, r.cancelledDeferrer = e.Deferred(), r.tasks = {}, r.addTask = function (e, t) { + return r.tasks[e] = new a.Task(e, t) + }, r.size = function () { + return t.getObjectSize(r.tasks) + }, r.run = function (i) { + var a, n, o, l = 0, s = !1, d = t.getObjectKeys(r.tasks).map(function (e) { + return r.tasks[e] + }), c = [], u = e.Deferred(); + if (r.cancelled) return r.cancelledDeferrer.resolve(), u.reject(); + if (!i) { + var p = t.getObjectKeys(r.tasks).map(function (e) { + return r.tasks[e].deferred + }); + return t.whenAll(p).done(function () { + var e = Array.from(arguments); + r.cancelled ? (u.reject.apply(null, e), r.cancelledDeferrer.resolve()) : (u.resolve.apply(null, e), r.cancelledDeferrer.reject()) + }).fail(function () { + var e = Array.from(arguments); + u.reject.apply(null, e), r.cancelled ? r.cancelledDeferrer.resolve() : r.cancelledDeferrer.reject() + }), e.each(r.tasks, function (e) { + a = r.tasks[e], a.run() + }), u + } + for (n = function (t) { + e.when(t.deferred).fail(function () { + s = !0, o.apply(null, arguments) + }).always(o) + }, o = function () { + var e = Array.from(arguments); + return u.notify(e), c.push(e), r.cancelled ? (u.reject.apply(null, c), void r.cancelledDeferrer.resolve()) : (c.length === r.size() && (s ? u.reject.apply(null, c) : u.resolve.apply(null, c)), void (d.length && (a = d.shift(), n(a), a.run()))) + }; d.length && l++ < i;) a = d.shift(), n(a), a.run(); + return u + }, r.cancel = function () { + return r.cancelled = !0, r.cancelledDeferrer + } + }, Task: function (t, i) { + var a = this; + a.id = t, a.deferred = e.Deferred(), a.logic = i, a.context = null, a.run = function () { + var e, t = []; + for (e = 0; e < arguments.length; e++) t.push(arguments[e]); + return t.unshift(a.deferred), i.apply(a.context, t), a.deferred + }, a.runWithContext = function (e) { + return a.context = e, a.run() + } + } + }; + i.ajaxQueue = [], i.ajaxRequests = [], i.ajaxAborted = !1 + }, _init: function (i, a) { + var r, n, o, l, s = this, d = s.$element; + s.options = i, s.canOrientImage = t.canOrientImage(d), e.each(i, function (e, i) { + switch (e) { + case"minFileCount": + case"maxFileCount": + case"maxTotalFileCount": + case"minFileSize": + case"maxFileSize": + case"maxFilePreviewSize": + case"resizeImageQuality": + case"resizeIfSizeMoreThan": + case"progressUploadThreshold": + case"initialPreviewCount": + case"zoomModalHeight": + case"minImageHeight": + case"maxImageHeight": + case"minImageWidth": + case"maxImageWidth": + s[e] = t.getNum(i); + break; + default: + s[e] = i + } + }), s.maxTotalFileCount > 0 && s.maxTotalFileCount < s.maxFileCount && (s.maxTotalFileCount = s.maxFileCount), s.rtl && (l = s.previewZoomButtonIcons.prev, s.previewZoomButtonIcons.prev = s.previewZoomButtonIcons.next, s.previewZoomButtonIcons.next = l), !isNaN(s.maxAjaxThreads) && s.maxAjaxThreads < s.resumableUploadOptions.maxThreads && (s.resumableUploadOptions.maxThreads = s.maxAjaxThreads), s._initFileManager(), "function" == typeof s.autoOrientImage && (s.autoOrientImage = s.autoOrientImage()), "function" == typeof s.autoOrientImageInitial && (s.autoOrientImageInitial = s.autoOrientImageInitial()), a || s._cleanup(), s.duplicateErrors = [], s.$form = d.closest("form"), s._initTemplateDefaults(), s.uploadFileAttr = t.isEmpty(d.attr("name")) ? "file_data" : d.attr("name"), o = s._getLayoutTemplate("progress"), s.progressTemplate = o.replace("{class}", s.progressClass), s.progressInfoTemplate = o.replace("{class}", s.progressInfoClass), s.progressPauseTemplate = o.replace("{class}", s.progressPauseClass), s.progressCompleteTemplate = o.replace("{class}", s.progressCompleteClass), s.progressErrorTemplate = o.replace("{class}", s.progressErrorClass), s.isDisabled = d.attr("disabled") || d.attr("readonly"), s.isDisabled && d.attr("disabled", !0), s.isClickable = s.browseOnZoneClick && s.showPreview && (s.dropZoneEnabled || !t.isEmpty(s.defaultPreviewContent)), s.isAjaxUpload = t.hasFileUploadSupport() && !t.isEmpty(s.uploadUrl), s.dropZoneEnabled = t.hasDragDropSupport() && s.dropZoneEnabled, s.isAjaxUpload || (s.dropZoneEnabled = s.dropZoneEnabled && t.canAssignFilesToInput()), s.slug = "function" == typeof i.slugCallback ? i.slugCallback : s._slugDefault, s.mainTemplate = s.showCaption ? s._getLayoutTemplate("main1") : s._getLayoutTemplate("main2"), s.captionTemplate = s._getLayoutTemplate("caption"), s.previewGenericTemplate = s._getPreviewTemplate("generic"), !s.imageCanvas && s.resizeImage && (s.maxImageWidth || s.maxImageHeight) && (s.imageCanvas = document.createElement("canvas"), s.imageCanvasContext = s.imageCanvas.getContext("2d")), t.isEmpty(d.attr("id")) && d.attr("id", t.uniqId()), s.namespace = ".fileinput_" + d.attr("id").replace(/-/g, "_"), void 0 === s.$container ? s.$container = s._createContainer() : s._refreshContainer(), n = s.$container, s.$dropZone = n.find(".file-drop-zone"), s.$progress = n.find(".kv-upload-progress"), s.$btnUpload = n.find(".fileinput-upload"), s.$captionContainer = t.getElement(i, "elCaptionContainer", n.find(".file-caption")), s.$caption = t.getElement(i, "elCaptionText", n.find(".file-caption-name")), t.isEmpty(s.msgPlaceholder) || (r = d.attr("multiple") ? s.filePlural : s.fileSingle, s.$caption.attr("placeholder", s.msgPlaceholder.replace("{files}", r))), s.$captionIcon = s.$captionContainer.find(".file-caption-icon"), s.$previewContainer = t.getElement(i, "elPreviewContainer", n.find(".file-preview")), s.$preview = t.getElement(i, "elPreviewImage", n.find(".file-preview-thumbnails")), s.$previewStatus = t.getElement(i, "elPreviewStatus", n.find(".file-preview-status")), s.$errorContainer = t.getElement(i, "elErrorContainer", s.$previewContainer.find(".kv-fileinput-error")), s._validateDisabled(), t.isEmpty(s.msgErrorClass) || t.addCss(s.$errorContainer, s.msgErrorClass), a ? s._errorsExist() || s.$errorContainer.hide() : (s._resetErrors(), s.$errorContainer.hide(), s.previewInitId = "thumb-" + d.attr("id"), s._initPreviewCache(), s._initPreview(!0), s._initPreviewActions(), s.$parent.hasClass("file-loading") && (s.$container.insertBefore(s.$parent), s.$parent.remove())), s._setFileDropZoneTitle(), d.attr("disabled") && s.disable(), s._initZoom(), s.hideThumbnailContent && t.addCss(s.$preview, "hide-content") + }, _initFileManager: function () { + var i = this; + i.fileManager = { + stack: {}, + filesProcessed: [], + errors: [], + loadedImages: {}, + totalImages: 0, + totalFiles: null, + totalSize: null, + uploadedSize: 0, + stats: {}, + initStats: function (e) { + var a = {started: t.now().getTime()}; + e ? i.fileManager.stats[e] = a : i.fileManager.stats = a + }, + getUploadStats: function (e, a, r) { + var n = i.fileManager, o = e ? n.stats[e] && n.stats[e].started || null : null; + o || (o = t.now().getTime()); + var l = (t.now().getTime() - o) / 1e3, + s = ["B/s", "KB/s", "MB/s", "GB/s", "TB/s", "PB/s", "EB/s", "ZB/s", "YB/s"], d = l ? a / l : 0, + c = i._getSize(d, s), u = r - a, p = { + fileId: e, + started: o, + elapsed: l, + loaded: a, + total: r, + bps: d, + bitrate: c, + pendingBytes: u + }; + return e ? n.stats[e] = p : n.stats = p, p + }, + exists: function (t) { + return -1 !== e.inArray(t, i.fileManager.getIdList()) + }, + count: function () { + return i.fileManager.getIdList().length + }, + total: function () { + var e = i.fileManager; + return e.totalFiles || (e.totalFiles = e.count()), e.totalFiles + }, + getTotalSize: function () { + var t = i.fileManager; + return t.totalSize ? t.totalSize : (t.totalSize = 0, e.each(i.fileManager.stack, function (e, i) { + var a = parseFloat(i.size); + t.totalSize += isNaN(a) ? 0 : a + }), t.totalSize) + }, + add: function (e, a) { + a || (a = i.fileManager.getId(e)), a && (i.fileManager.stack[a] = { + file: e, + name: t.getFileName(e), + relativePath: t.getFileRelativePath(e), + size: e.size, + nameFmt: i._getFileName(e, ""), + sizeFmt: i._getSize(e.size) + }) + }, + remove: function (e) { + var t = e.attr("data-fileid"); + t && i.fileManager.removeFile(t) + }, + removeFile: function (e) { + delete i.fileManager.stack[e], delete i.fileManager.loadedImages[e] + }, + move: function (t, a) { + var r = {}, n = i.fileManager.stack; + (t || a) && t !== a && (e.each(n, function (e, i) { + e !== t && (r[e] = i), e === a && (r[t] = n[t]) + }), i.fileManager.stack = r) + }, + list: function () { + var t = []; + return e.each(i.fileManager.stack, function (e, i) { + i && i.file && t.push(i.file) + }), t + }, + isPending: function (t) { + return -1 === e.inArray(t, i.fileManager.filesProcessed) && i.fileManager.exists(t) + }, + isProcessed: function () { + var t = !0, a = i.fileManager; + return e.each(a.stack, function (e) { + a.isPending(e) && (t = !1) + }), t + }, + clear: function () { + var e = i.fileManager; + i.isDuplicateError = !1, i.isPersistentError = !1, e.totalFiles = null, e.totalSize = null, e.uploadedSize = 0, e.stack = {}, e.errors = [], e.filesProcessed = [], e.stats = {}, e.clearImages() + }, + clearImages: function () { + i.fileManager.loadedImages = {}, i.fileManager.totalImages = 0 + }, + addImage: function (e, t) { + i.fileManager.loadedImages[e] = t + }, + removeImage: function (e) { + delete i.fileManager.loadedImages[e] + }, + getImageIdList: function () { + return t.getObjectKeys(i.fileManager.loadedImages) + }, + getImageCount: function () { + return i.fileManager.getImageIdList().length + }, + getId: function (e) { + return i._getFileId(e) + }, + getIndex: function (e) { + return i.fileManager.getIdList().indexOf(e) + }, + getThumb: function (t) { + var a = null; + return i._getThumbs().each(function () { + var i = e(this); + i.attr("data-fileid") === t && (a = i) + }), a + }, + getThumbIndex: function (e) { + var t = e.attr("data-fileid"); + return i.fileManager.getIndex(t) + }, + getIdList: function () { + return t.getObjectKeys(i.fileManager.stack) + }, + getFile: function (e) { + return i.fileManager.stack[e] || null + }, + getFileName: function (e, t) { + var a = i.fileManager.getFile(e); + return a ? t ? a.nameFmt || "" : a.name || "" : "" + }, + getFirstFile: function () { + var e = i.fileManager.getIdList(), t = e && e.length ? e[0] : null; + return i.fileManager.getFile(t) + }, + setFile: function (e, t) { + i.fileManager.getFile(e) ? i.fileManager.stack[e].file = t : i.fileManager.add(t, e) + }, + setProcessed: function (e) { + i.fileManager.filesProcessed.push(e) + }, + getProgress: function () { + var e = i.fileManager.total(), t = i.fileManager.filesProcessed.length; + return e ? Math.ceil(t / e * 100) : 0 + }, + setProgress: function (e, t) { + var a = i.fileManager.getFile(e); + !isNaN(t) && a && (a.progress = t) + } + } + }, _setUploadData: function (i, a) { + var r = this; + e.each(a, function (e, a) { + var n = r.uploadParamNames[e] || e; + t.isArray(a) ? i.append(n, a[0], a[1]) : i.append(n, a) + }) + }, _initResumableUpload: function () { + var i = this, a = i.resumableUploadOptions, r = t.logMessages; + if (i.enableResumableUpload) { + if (a.fallback !== !1 && "function" != typeof a.fallback && (a.fallback = function (e) { + e._log(r.noResumableSupport), e.enableResumableUpload = !1 + }), !t.hasResumableUploadSupport() && a.fallback !== !1) return void a.fallback(i); + if (!i.uploadUrl && i.enableResumableUpload) return i._log(r.noUploadUrl), void (i.enableResumableUpload = !1); + if (a.chunkSize = parseFloat(a.chunkSize), a.chunkSize <= 0 || isNaN(a.chunkSize)) return i._log(r.invalidChunkSize, {chunkSize: a.chunkSize}), void (i.enableResumableUpload = !1); + i.resumableManager = { + init: function (e, t, a) { + var r = i.resumableManager, n = i.fileManager; + r.logs = [], r.stack = [], r.error = "", r.id = e, r.file = t.file, r.fileName = t.name, r.fileIndex = a, r.completed = !1, r.testing = !1, r.lastProgress = 0, i.showPreview && (r.$thumb = n.getThumb(e) || null, r.$progress = r.$btnDelete = null, r.$thumb && r.$thumb.length && (r.$progress = r.$thumb.find(".file-thumb-progress"), r.$btnDelete = r.$thumb.find(".kv-file-remove"))), r.chunkSize = 1024 * i.resumableUploadOptions.chunkSize, r.chunkCount = r.getTotalChunks() + }, setAjaxError: function (e, t, a, n) { + e.responseJSON && e.responseJSON.error && (a = e.responseJSON.error.toString()), n || (rm.error = a), i.resumableUploadOptions.showErrorLog && i._log(r.ajaxError, { + status: e.status, + error: a, + text: e.responseText || "" + }) + }, reset: function () { + var e = i.resumableManager; + e.stack = [], e.chunksProcessed = {} + }, setProcessed: function (e) { + var t, a = i.resumableManager, r = i.fileManager, n = a.id, o = a.$thumb, l = a.$progress, + s = o && o.length, d = {id: s ? o.attr("id") : "", index: r.getIndex(n), fileId: n}; + a.completed = !0, a.lastProgress = 0, s && o.removeClass("file-uploading"), "success" === e ? (r.uploadedSize += a.file.size, i.showPreview && (i._setProgress(101, l), i._setThumbStatus(o, "Success"), i._initUploadSuccess(a.chunksProcessed[n].data, o)), i.fileManager.removeFile(n), delete a.chunksProcessed[n], i._raise("fileuploaded", [d.id, d.index, d.fileId]), r.isProcessed() && i._setProgress(101)) : "cancel" !== e && (i.showPreview && (i._setThumbStatus(o, "Error"), i._setPreviewError(o, !0), i._setProgress(101, l, i.msgProgressError), i._setProgress(101, i.$progress, i.msgProgressError), i.cancelling = !0), i.$errorContainer.find('li[data-file-id="' + d.fileId + '"]').length || (t = i.msgResumableUploadRetriesExceeded.setTokens({ + file: a.fileName, + max: i.resumableUploadOptions.maxRetries, + error: a.error + }), i._showFileError(t, d))), r.isProcessed() && a.reset() + }, check: function () { + var t = i.resumableManager, a = !0; + e.each(t.logs, function (e, t) { + return t ? void 0 : (a = !1, !1) + }) + }, processedResumables: function () { + var e, t = i.resumableManager.logs, a = 0; + if (!t || !t.length) return 0; + for (e = 0; e < t.length; e++) t[e] === !0 && a++; + return a + }, getUploadedSize: function () { + var e = i.resumableManager, t = e.processedResumables() * e.chunkSize; + return t > e.file.size ? e.file.size : t + }, getTotalChunks: function () { + var e = i.resumableManager, t = parseFloat(e.chunkSize); + return !isNaN(t) && t > 0 ? Math.ceil(e.file.size / t) : 0 + }, getProgress: function () { + var e = i.resumableManager, t = e.processedResumables(), a = e.chunkCount; + return 0 === a ? 0 : Math.ceil(t / a * 100) + }, checkAborted: function (e) { + i._isAborted() && (clearInterval(e), i.unlock()) + }, upload: function () { + var e, a = i.resumableManager, r = i.fileManager, n = r.getIdList(), o = "new"; + e = setInterval(function () { + var l; + if (a.checkAborted(e), "new" === o && (i.lock(), o = "processing", l = n.shift(), r.initStats(l), r.stack[l] && (a.init(l, r.stack[l], r.getIndex(l)), a.testUpload(), a.uploadResumable())), !r.isPending(l) && a.completed && (o = "new"), r.isProcessed()) { + var s = i.$preview.find(".file-preview-initial"); + s.length && (t.addCss(s, t.SORT_CSS), i._initSortable()), clearInterval(e), i._clearFileInput(), i.unlock(), setTimeout(function () { + var e = i.previewCache.data; + e && (i.initialPreview = e.content, i.initialPreviewConfig = e.config, i.initialPreviewThumbTags = e.tags), i._raise("filebatchuploadcomplete", [i.initialPreview, i.initialPreviewConfig, i.initialPreviewThumbTags, i._getExtraData()]) + }, i.processDelay) + } + }, i.processDelay) + }, uploadResumable: function () { + var e, t, a = i.taskManager, r = i.resumableManager, n = r.chunkCount; + for (t = a.addPool(r.id), e = 0; n > e; e++) r.logs[e] = !(!r.chunksProcessed[r.id] || !r.chunksProcessed[r.id][e]), r.logs[e] || r.pushAjax(e, 0); + r.testing || t.run(i.resumableUploadOptions.maxThreads).done(function () { + r.setProcessed("success") + }).fail(function () { + t.cancelled ? r.setProcessed("cancel") : r.setProcessed("error") + }) + }, testUpload: function () { + var a, r, n, o, l, s, d, c = i.resumableManager, u = i.resumableUploadOptions, + p = i.fileManager, f = c.id; + return u.testUrl ? (c.testing = !0, a = new FormData, r = p.stack[f], i._setUploadData(a, { + fileId: f, + fileName: r.fileName, + fileSize: r.size, + fileRelativePath: r.relativePath, + chunkSize: c.chunkSize, + chunkCount: c.chunkCount + }), n = function (e) { + d = i._getOutData(a, e), i._raise("filetestbeforesend", [f, p, c, d]) + }, o = function (r, n, o) { + d = i._getOutData(a, o, r); + var l = i.uploadParamNames, s = l.chunksUploaded || "chunksUploaded", u = [f, p, c, d]; + r[s] && t.isArray(r[s]) ? (c.chunksProcessed[f] || (c.chunksProcessed[f] = {}), e.each(r[s], function (e, t) { + c.logs[t] = !0, c.chunksProcessed[f][t] = !0 + }), c.chunksProcessed[f].data = r, i._raise("filetestsuccess", u)) : i._raise("filetesterror", u), c.testing = !1 + }, l = function (e, t, r) { + d = i._getOutData(a, e), i._raise("filetestajaxerror", [f, p, c, d]), c.setAjaxError(e, t, r, !0), c.testing = !1 + }, s = function () { + i._raise("filetestcomplete", [f, p, c, i._getOutData(a)]), c.testing = !1 + }, void i._ajaxSubmit(n, o, s, l, a, f, c.fileIndex, u.testUrl)) : void (c.testing = !1) + }, pushAjax: function (e, t) { + var a = i.taskManager, n = i.resumableManager, o = a.getPool(n.id); + o.addTask(o.size() + 1, function (e) { + var t, a = n.stack.shift(); + t = a[0], n.chunksProcessed[n.id] && n.chunksProcessed[n.id][t] ? i._log(r.chunkQueueError, {index: t}) : n.sendAjax(t, a[1], e) + }), n.stack.push([e, t]) + }, sendAjax: function (e, a, n) { + var o, l = i.fileManager, s = i.resumableManager, d = i.resumableUploadOptions, c = s.chunkSize, + u = s.id, p = s.file, f = s.$thumb, g = s.$btnDelete; + if (!s.chunksProcessed[u] || !s.chunksProcessed[u][e]) { + if (a > d.maxRetries) return n.reject("max try reached"), void s.setProcessed("error"); + var m, h, v, w, b, _, + C = p.slice ? "slice" : p.mozSlice ? "mozSlice" : p.webkitSlice ? "webkitSlice" : "slice", + y = p[C](c * e, c * (e + 1)); + m = new FormData, o = l.stack[u], i._setUploadData(m, { + chunkCount: s.chunkCount, + chunkIndex: e, + chunkSize: c, + chunkSizeStart: c * e, + fileBlob: [y, s.fileName], + fileId: u, + fileName: s.fileName, + fileRelativePath: o.relativePath, + fileSize: p.size, + retryCount: a + }), s.$progress && s.$progress.length && s.$progress.show(), v = function (r) { + h = i._getOutData(m, r), i.showPreview && (f.hasClass("file-preview-success") || (i._setThumbStatus(f, "Loading"), t.addCss(f, "file-uploading")), g.attr("disabled", !0)), i._raise("filechunkbeforesend", [u, e, a, l, s, h]) + }, w = function (t, o, d) { + if (i._isAborted()) return void n.reject("cancelling"); + h = i._getOutData(m, d, t); + var c = i.uploadParamNames, p = c.chunkIndex || "chunkIndex", + f = i.resumableUploadOptions, g = [u, e, a, l, s, h]; + t.error ? (f.showErrorLog && i._log(r.retryStatus, { + retry: a + 1, + filename: s.fileName, + chunk: e + }), s.pushAjax(e, a + 1), s.error = t.error, i._raise("filechunkerror", g)) : (s.logs[t[p]] = !0, s.chunksProcessed[u] || (s.chunksProcessed[u] = {}), s.chunksProcessed[u][t[p]] = !0, s.chunksProcessed[u].data = t, n.resolve.call(null, t), i._raise("filechunksuccess", g), s.check()) + }, b = function (t, r, o) { + return i._isAborted() ? void n.reject("cancelling") : (h = i._getOutData(m, t), s.setAjaxError(t, r, o), i._raise("filechunkajaxerror", [u, e, a, l, s, h]), s.pushAjax(e, a + 1), void n.reject("try failed")) + }, _ = function () { + i._isAborted() || i._raise("filechunkcomplete", [u, e, a, l, s, i._getOutData(m)]) + }, i._ajaxSubmit(v, w, _, b, m, u, s.fileIndex) + } + } + }, i.resumableManager.reset() + } + }, _initTemplateDefaults: function () { + var i, a, r, n, o, l, s, d, c, u, p, f, g, m, h, v, w, b, _, C, y, x, T, P, k, E, F, S, I, A, D, z, M, j, U, + $, R, O, B, L, N, Z = this; + i = '{preview}\n
    \n
    \n {caption}\n
    \n {remove}\n {cancel}\n {pause}\n {upload}\n {browse}\n
    \n
    ', a = '{preview}\n
    \n
    \n{remove}\n{cancel}\n{upload}\n{browse}\n', r = '
    \n {close}
    \n
    \n
    \n
    \n
    \n
    \n
    ', o = t.closeButton("fileinput-remove"), n = '', l = '
    \n \n \n
    ', s = '', d = '{icon} {label}', c = '
    {icon} {label}
    ', u = '', p = '\n', + f = '
    \n
    \n {status}\n
    \n
    {stats}', N = '
    {pendingTime} {uploadSpeed}
    ', g = " ({sizeText})", m = '', h = '
    \n \n
    \n{drag}\n
    ', v = '\n', w = '', b = '{downloadIcon}', _ = '', C = '{dragIcon}', y = '
    {indicator}
    ', x = '
    \n', P = x + ' title="{caption}">
    \n', k = "
    {footer}\n{zoomCache}
    \n", E = "{content}\n", O = " {style}", F = '
    {data}
    \n", S = '{alt}\n", I = '\n", A = '", D = '", z = '\n", M = '\n", j = '\n", $ = '\n", U = '\n\n' + t.OBJECT_PARAMS + " " + t.DEFAULT_PREVIEW + "\n\n", R = '
    \n" + t.DEFAULT_PREVIEW + "\n
    \n", B = '', L = { + width: "100%", + height: "100%", + "min-height": "480px" + }, Z._isPdfRendered() && ($ = Z.pdfRendererTemplate.replace("{renderer}", Z._encodeURI(Z.pdfRendererUrl))), Z.defaults = { + layoutTemplates: { + main1: i, + main2: a, + preview: r, + close: o, + fileIcon: n, + caption: l, + modalMain: u, + modal: p, + progress: f, + stats: N, + size: g, + footer: m, + indicator: y, + actions: h, + actionDelete: v, + actionUpload: w, + actionDownload: b, + actionZoom: _, + actionDrag: C, + btnDefault: s, + btnLink: d, + btnBrowse: c, + zoomCache: B + }, + previewMarkupTags: {tagBefore1: T, tagBefore2: P, tagAfter: k}, + previewContentTemplates: { + generic: E, + html: F, + image: S, + text: I, + office: A, + gdocs: D, + video: z, + audio: M, + flash: j, + object: U, + pdf: $, + other: R + }, + allowedPreviewTypes: ["image", "html", "text", "video", "audio", "flash", "pdf", "object"], + previewTemplates: {}, + previewSettings: { + image: {width: "auto", height: "auto", "max-width": "100%", "max-height": "100%"}, + html: {width: "213px", height: "160px"}, + text: {width: "213px", height: "160px"}, + office: {width: "213px", height: "160px"}, + gdocs: {width: "213px", height: "160px"}, + video: {width: "213px", height: "160px"}, + audio: {width: "100%", height: "30px"}, + flash: {width: "213px", height: "160px"}, + object: {width: "213px", height: "160px"}, + pdf: {width: "100%", height: "160px", position: "relative"}, + other: {width: "213px", height: "160px"} + }, + previewSettingsSmall: { + image: { + width: "auto", + height: "auto", + "max-width": "100%", + "max-height": "100%" + }, + html: {width: "100%", height: "160px"}, + text: {width: "100%", height: "160px"}, + office: {width: "100%", height: "160px"}, + gdocs: {width: "100%", height: "160px"}, + video: {width: "100%", height: "auto"}, + audio: {width: "100%", height: "30px"}, + flash: {width: "100%", height: "auto"}, + object: {width: "100%", height: "auto"}, + pdf: {width: "100%", height: "160px"}, + other: {width: "100%", height: "160px"} + }, + previewZoomSettings: { + image: {width: "auto", height: "auto", "max-width": "100%", "max-height": "100%"}, + html: L, + text: L, + office: {width: "100%", height: "100%", "max-width": "100%", "min-height": "480px"}, + gdocs: {width: "100%", height: "100%", "max-width": "100%", "min-height": "480px"}, + video: {width: "auto", height: "100%", "max-width": "100%"}, + audio: {width: "100%", height: "30px"}, + flash: {width: "auto", height: "480px"}, + object: {width: "auto", height: "100%", "max-width": "100%", "min-height": "480px"}, + pdf: L, + other: {width: "auto", height: "100%", "min-height": "480px"} + }, + mimeTypeAliases: {"video/quicktime": "video/mp4"}, + fileTypeSettings: { + image: function (e, i) { + return t.compare(e, "image.*") && !t.compare(e, /(tiff?|wmf)$/i) || t.compare(i, /\.(gif|png|jpe?g)$/i) + }, html: function (e, i) { + return t.compare(e, "text/html") || t.compare(i, /\.(htm|html)$/i) + }, office: function (e, i) { + return t.compare(e, /(word|excel|powerpoint|office)$/i) || t.compare(i, /\.(docx?|xlsx?|pptx?|pps|potx?)$/i) + }, gdocs: function (e, i) { + return t.compare(e, /(word|excel|powerpoint|office|iwork-pages|tiff?)$/i) || t.compare(i, /\.(docx?|xlsx?|pptx?|pps|potx?|rtf|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i) + }, text: function (e, i) { + return t.compare(e, "text.*") || t.compare(i, /\.(xml|javascript)$/i) || t.compare(i, /\.(txt|md|csv|nfo|ini|json|php|js|css)$/i) + }, video: function (e, i) { + return t.compare(e, "video.*") && (t.compare(e, /(ogg|mp4|mp?g|mov|webm|3gp)$/i) || t.compare(i, /\.(og?|mp4|webm|mp?g|mov|3gp)$/i)) + }, audio: function (e, i) { + return t.compare(e, "audio.*") && (t.compare(i, /(ogg|mp3|mp?g|wav)$/i) || t.compare(i, /\.(og?|mp3|mp?g|wav)$/i)) + }, flash: function (e, i) { + return t.compare(e, "application/x-shockwave-flash", !0) || t.compare(i, /\.(swf)$/i) + }, pdf: function (e, i) { + return t.compare(e, "application/pdf", !0) || t.compare(i, /\.(pdf)$/i) + }, object: function () { + return !0 + }, other: function () { + return !0 + } + }, + fileActionSettings: { + showRemove: !0, + showUpload: !0, + showDownload: !0, + showZoom: !0, + showDrag: !0, + removeIcon: '', + removeClass: "btn btn-sm btn-kv btn-default btn-outline-secondary", + removeErrorClass: "btn btn-sm btn-kv btn-danger", + removeTitle: "Remove file", + uploadIcon: '', + uploadClass: "btn btn-sm btn-kv btn-default btn-outline-secondary", + uploadTitle: "Upload file", + uploadRetryIcon: '', + uploadRetryTitle: "Retry upload", + downloadIcon: '', + downloadClass: "btn btn-sm btn-kv btn-default btn-outline-secondary", + downloadTitle: "Download file", + zoomIcon: '', + zoomClass: "btn btn-sm btn-kv btn-default btn-outline-secondary", + zoomTitle: "View Details", + dragIcon: '', + dragClass: "text-info", + dragTitle: "Move / Rearrange", + dragSettings: {}, + indicatorNew: '', + indicatorSuccess: '', + indicatorError: '', + indicatorLoading: '', + indicatorPaused: '', + indicatorNewTitle: "Not uploaded yet", + indicatorSuccessTitle: "Uploaded", + indicatorErrorTitle: "Upload Error", + indicatorLoadingTitle: "Uploading …", + indicatorPausedTitle: "Upload Paused" + } + }, e.each(Z.defaults, function (t, i) { + return "allowedPreviewTypes" === t ? void (void 0 === Z.allowedPreviewTypes && (Z.allowedPreviewTypes = i)) : void (Z[t] = e.extend(!0, {}, i, Z[t])) + }), Z._initPreviewTemplates() + }, _initPreviewTemplates: function () { + var i, a = this, r = a.previewMarkupTags, n = r.tagAfter; + e.each(a.previewContentTemplates, function (e, o) { + t.isEmpty(a.previewTemplates[e]) && (i = r.tagBefore2, "generic" !== e && "image" !== e && "html" !== e && "text" !== e || (i = r.tagBefore1), a._isPdfRendered() && "pdf" === e && (i = i.replace("kv-file-content", "kv-file-content kv-pdf-rendered")), a.previewTemplates[e] = i + o + n) + }) + }, _initPreviewCache: function () { + var i = this; + i.previewCache = { + data: {}, init: function () { + var e = i.initialPreview; + e.length > 0 && !t.isArray(e) && (e = e.split(i.initialPreviewDelimiter)), i.previewCache.data = { + content: e, + config: i.initialPreviewConfig, + tags: i.initialPreviewThumbTags + } + }, count: function (e) { + if (!i.previewCache.data || !i.previewCache.data.content) return 0; + if (e) { + var t = i.previewCache.data.content.filter(function (e) { + return null !== e + }); + return t.length + } + return i.previewCache.data.content.length + }, get: function (e, a) { + var r, n, o, l, s, d, c, u = t.INIT_FLAG + e, p = i.previewCache.data, f = p.config[e], + g = p.content[e], m = t.ifSet("previewAsData", f, i.initialPreviewAsData), + h = f ? {title: f.title || null, alt: f.alt || null} : {title: null, alt: null}, + v = function (e, a, r, n, o, l, s, d) { + var c = " file-preview-initial " + t.SORT_CSS + (s ? " " + s : ""), + u = i.previewInitId + "-" + l, p = f && f.fileId || u; + return i._generatePreviewTemplate(e, a, r, n, u, p, !1, null, c, o, l, d, h, f && f.zoomData || a) + }; + return g && g.length ? (a = void 0 === a ? !0 : a, o = t.ifSet("type", f, i.initialPreviewFileType || "generic"), s = t.ifSet("filename", f, t.ifSet("caption", f)), d = t.ifSet("filetype", f, o), l = i.previewCache.footer(e, a, f && f.size || null), c = t.ifSet("frameClass", f), r = m ? v(o, g, s, d, l, u, c) : v("generic", g, s, d, l, u, c, o).setTokens({content: p.content[e]}), p.tags.length && p.tags[e] && (r = t.replaceTags(r, p.tags[e])), t.isEmpty(f) || t.isEmpty(f.frameAttr) || (n = t.createElement(r), n.find(".file-preview-initial").attr(f.frameAttr), r = n.html(), n.remove()), r) : "" + }, clean: function (e) { + e.content = t.cleanArray(e.content), e.config = t.cleanArray(e.config), e.tags = t.cleanArray(e.tags), i.previewCache.data = e + }, add: function (e, a, r, n) { + var o, l = i.previewCache.data; + return e && e.length ? (o = e.length - 1, t.isArray(e) || (e = e.split(i.initialPreviewDelimiter)), n && l.content ? (o = l.content.push(e[0]) - 1, l.config[o] = a, l.tags[o] = r) : (l.content = e, l.config = a, l.tags = r), i.previewCache.clean(l), o) : 0 + }, set: function (e, a, r, n) { + var o, l, s = i.previewCache.data; + if (e && e.length && (t.isArray(e) || (e = e.split(i.initialPreviewDelimiter)), l = e.filter(function (e) { + return null !== e + }), l.length)) { + if (void 0 === s.content && (s.content = []), void 0 === s.config && (s.config = []), void 0 === s.tags && (s.tags = []), n) { + for (o = 0; o < e.length; o++) e[o] && s.content.push(e[o]); + for (o = 0; o < a.length; o++) a[o] && s.config.push(a[o]); + for (o = 0; o < r.length; o++) r[o] && s.tags.push(r[o]) + } else s.content = e, s.config = a, s.tags = r; + i.previewCache.clean(s) + } + }, unset: function (a) { + var r = i.previewCache.count(), n = i.reversePreviewOrder; + if (r) { + if (1 === r) return i.previewCache.data.content = [], i.previewCache.data.config = [], i.previewCache.data.tags = [], i.initialPreview = [], i.initialPreviewConfig = [], void (i.initialPreviewThumbTags = []); + i.previewCache.data.content = t.spliceArray(i.previewCache.data.content, a, n), i.previewCache.data.config = t.spliceArray(i.previewCache.data.config, a, n), i.previewCache.data.tags = t.spliceArray(i.previewCache.data.tags, a, n); + var o = e.extend(!0, {}, i.previewCache.data); + i.previewCache.clean(o) + } + }, out: function () { + var e, t, a, r = "", n = i.previewCache.count(); + if (0 === n) return {content: "", caption: ""}; + for (t = 0; n > t; t++) a = i.previewCache.get(t), r = i.reversePreviewOrder ? a + r : r + a; + return e = i._getMsgSelected(n), {content: r, caption: e} + }, footer: function (e, a, r) { + var n = i.previewCache.data || {}; + if (t.isEmpty(n.content)) return ""; + (t.isEmpty(n.config) || t.isEmpty(n.config[e])) && (n.config[e] = {}), a = void 0 === a ? !0 : a; + var o, l = n.config[e], s = t.ifSet("caption", l), d = t.ifSet("width", l, "auto"), + c = t.ifSet("url", l, !1), u = t.ifSet("key", l, null), p = t.ifSet("fileId", l, null), + f = i.fileActionSettings, g = i.initialPreviewShowDelete || !1, + m = i.initialPreviewDownloadUrl ? i.initialPreviewDownloadUrl + "?key=" + u + (p ? "&fileId=" + p : "") : "", + h = l.downloadUrl || m, v = l.filename || l.caption || "", w = !!h, + b = t.ifSet("showRemove", l, g), _ = t.ifSet("showDownload", l, t.ifSet("showDownload", f, w)), + C = t.ifSet("showZoom", l, t.ifSet("showZoom", f, !0)), + y = t.ifSet("showDrag", l, t.ifSet("showDrag", f, !0)), x = c === !1 && a; + return _ = _ && l.downloadUrl !== !1 && !!h, o = i._renderFileActions(l, !1, _, b, C, y, x, c, u, !0, h, v), i._getLayoutTemplate("footer").setTokens({ + progress: i._renderThumbProgress(), + actions: o, + caption: s, + size: i._getSize(r), + width: d, + indicator: "" + }) + } + }, i.previewCache.init() + }, _isPdfRendered: function () { + var e = this, t = e.usePdfRenderer, i = "function" == typeof t ? t() : !!t; + return i && e.pdfRendererUrl + }, _handler: function (e, t, i) { + var a = this, r = a.namespace, n = t.split(" ").join(r + " ") + r; + e && e.length && e.off(n).on(n, i) + }, _encodeURI: function (e) { + var t = this; + return t.encodeUrl ? encodeURI(e) : e + }, _log: function (e, t) { + var i = this, a = i.$element.attr("id"); + i.showConsoleLogs && (a && (e = '"' + a + '": ' + e), e = "bootstrap-fileinput: " + e, "object" == typeof t && (e = e.setTokens(t)), window.console && "undefined" != typeof window.console.log ? window.console.log(e) : window.alert(e)) + }, _validate: function () { + var e = this, i = "file" === e.$element.attr("type"); + return i || e._log(t.logMessages.badInputType), i + }, _errorsExist: function () { + var i, a = this, r = a.$errorContainer.find("li"); + return r.length ? !0 : (i = t.createElement(a.$errorContainer.html()), i.find(".kv-error-close").remove(), i.find("ul").remove(), !!e.trim(i.text()).length) + }, _errorHandler: function (e, t) { + var i = this, a = e.target.error, r = function (e) { + i._showError(e.replace("{name}", t)) + }; + r(a.code === a.NOT_FOUND_ERR ? i.msgFileNotFound : a.code === a.SECURITY_ERR ? i.msgFileSecured : a.code === a.NOT_READABLE_ERR ? i.msgFileNotReadable : a.code === a.ABORT_ERR ? i.msgFilePreviewAborted : i.msgFilePreviewError) + }, _addError: function (e) { + var i = this, a = i.$errorContainer; + e && a.length && (t.setHtml(a, i.errorCloseButton + e), i._handler(a.find(".kv-error-close"), "click", function () { + setTimeout(function () { + i.showPreview && !i.getFrames().length && i.clear(), a.fadeOut("slow") + }, i.processDelay) + })) + }, _setValidationError: function (e) { + var i = this; + e = (e ? e + " " : "") + "has-error", i.$container.removeClass(e).addClass("has-error"), t.addCss(i.$captionContainer, "is-invalid") + }, _resetErrors: function (e) { + var t = this, i = t.$errorContainer; + t.isPersistentError || (t.isError = !1, t.$container.removeClass("has-error"), t.$captionContainer.removeClass("is-invalid"), i.html(""), e ? i.fadeOut("slow") : i.hide()) + }, _showFolderError: function (e) { + var t, i = this, a = i.$errorContainer; + e && (i.isAjaxUpload || i._clearFileInput(), t = i.msgFoldersNotAllowed.replace("{n}", e), i._addError(t), i._setValidationError(), a.fadeIn(i.fadeDelay), i._raise("filefoldererror", [e, t])) + }, _showFileError: function (e, t, i) { + var a = this, r = a.$errorContainer, n = i || "fileuploaderror", o = t && t.fileId || "", + l = t && t.id ? '
  • ' + e + "
  • " : "
  • " + e + "
  • "; + return 0 === r.find("ul").length ? a._addError("
      " + l + "
    ") : r.find("ul").append(l), r.fadeIn(a.fadeDelay), a._raise(n, [t, e]), a._setValidationError("file-input-new"), !0 + }, _showError: function (e, t, i) { + var a = this, r = a.$errorContainer, n = i || "fileerror"; + return t = t || {}, t.reader = a.reader, a._addError(e), r.fadeIn(a.fadeDelay), a._raise(n, [t, e]), a.isAjaxUpload || a._clearFileInput(), a._setValidationError("file-input-new"), a.$btnUpload.attr("disabled", !0), !0 + }, _noFilesError: function (e) { + var t = this, i = t.minFileCount > 1 ? t.filePlural : t.fileSingle, + a = t.msgFilesTooLess.replace("{n}", t.minFileCount).replace("{files}", i), r = t.$errorContainer; + a = "
  • " + a + "
  • ", 0 === r.find("ul").length ? t._addError("
      " + a + "
    ") : r.find("ul").append(a), t.isError = !0, t._updateFileDetails(0), r.fadeIn(t.fadeDelay), t._raise("fileerror", [e, a]), t._clearFileInput(), t._setValidationError() + }, _parseError: function (t, i, a, r) { + var n, o, l, s = this, d = e.trim(a + ""); + return o = i.responseJSON && i.responseJSON.error ? i.responseJSON.error.toString() : "", l = o ? o : i.responseText, s.cancelling && s.msgUploadAborted && (d = s.msgUploadAborted), s.showAjaxErrorDetails && l && (o ? d = e.trim(o + "") : (l = e.trim(l.replace(/\n\s*\n/g, "\n")), n = l.length ? "
    " + l + "
    " : "", d += d ? n : l)), d || (d = s.msgAjaxError.replace("{operation}", t)), s.cancelling = !1, r ? "" + r + ": " + d : d + }, _parseFileType: function (e, i) { + var a, r, n, o, l = this, s = l.allowedPreviewTypes || []; + if ("application/text-plain" === e) return "text"; + for (o = 0; o < s.length; o++) if (n = s[o], a = l.fileTypeSettings[n], r = a(e, i) ? n : "", !t.isEmpty(r)) return r; + return "other" + }, _getPreviewIcon: function (t) { + var i, a = this, r = null; + return t && t.indexOf(".") > -1 && (i = t.split(".").pop(), a.previewFileIconSettings && (r = a.previewFileIconSettings[i] || a.previewFileIconSettings[i.toLowerCase()] || null), a.previewFileExtSettings && e.each(a.previewFileExtSettings, function (e, t) { + return a.previewFileIconSettings[e] && t(i) ? void (r = a.previewFileIconSettings[e]) : void 0 + })), r || a.previewFileIcon + }, _parseFilePreviewIcon: function (e, t) { + var i = this, a = i._getPreviewIcon(t), r = e; + return r.indexOf("{previewFileIcon}") > -1 && (r = r.setTokens({ + previewFileIconClass: i.previewFileIconClass, + previewFileIcon: a + })), r + }, _raise: function (t, i) { + var a = this, r = e.Event(t); + if (void 0 !== i ? a.$element.trigger(r, i) : a.$element.trigger(r), r.isDefaultPrevented() || r.result === !1) return !1; + switch (t) { + case"filebatchuploadcomplete": + case"filebatchuploadsuccess": + case"fileuploaded": + case"fileclear": + case"filecleared": + case"filereset": + case"fileerror": + case"filefoldererror": + case"fileuploaderror": + case"filebatchuploaderror": + case"filedeleteerror": + case"filecustomerror": + case"filesuccessremove": + break; + default: + a.ajaxAborted || (a.ajaxAborted = r.result) + } + return !0 + }, _listenFullScreen: function (e) { + var t, i, a = this, r = a.$modal; + r && r.length && (t = r && r.find(".btn-fullscreen"), i = r && r.find(".btn-borderless"), t.length && i.length && (t.removeClass("active").attr("aria-pressed", "false"), i.removeClass("active").attr("aria-pressed", "false"), e ? t.addClass("active").attr("aria-pressed", "true") : i.addClass("active").attr("aria-pressed", "true"), r.hasClass("file-zoom-fullscreen") ? a._maximizeZoomDialog() : e ? a._maximizeZoomDialog() : i.removeClass("active").attr("aria-pressed", "false"))) + }, _listen: function () { + var i, a = this, r = a.$element, n = a.$form, o = a.$container; + a._handler(r, "click", function (e) { + r.hasClass("file-no-browse") && (r.data("zoneClicked") ? r.data("zoneClicked", !1) : e.preventDefault()) + }), a._handler(r, "change", e.proxy(a._change, a)), a.showBrowse && a._handler(a.$btnFile, "click", e.proxy(a._browse, a)), a._handler(o.find(".fileinput-remove:not([disabled])"), "click", e.proxy(a.clear, a)), a._handler(o.find(".fileinput-cancel"), "click", e.proxy(a.cancel, a)), a._handler(o.find(".fileinput-pause"), "click", e.proxy(a.pause, a)), a._initDragDrop(), a._handler(n, "reset", e.proxy(a.clear, a)), a.isAjaxUpload || a._handler(n, "submit", e.proxy(a._submitForm, a)), a._handler(a.$container.find(".fileinput-upload"), "click", e.proxy(a._uploadClick, a)), a._handler(e(window), "resize", function () { + a._listenFullScreen(screen.width === window.innerWidth && screen.height === window.innerHeight) + }), i = "webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange", a._handler(e(document), i, function () { + a._listenFullScreen(t.checkFullScreen()) + }), a._autoFitContent(), a._initClickable(), a._refreshPreview() + }, _autoFitContent: function () { + var t, i = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, a = this, + r = 400 > i ? a.previewSettingsSmall || a.defaults.previewSettingsSmall : a.previewSettings || a.defaults.previewSettings; + e.each(r, function (e, i) { + t = ".file-preview-frame .file-preview-" + e, a.$preview.find(t + ".kv-preview-data," + t + " .kv-preview-data").css(i) + }) + }, _scanDroppedItems: function (e, i, a) { + a = a || ""; + var r, n, o, l = this, s = function (e) { + l._log(t.logMessages.badDroppedFiles), l._log(e) + }; + e.isFile ? e.file(function (e) { + a && (e.newPath = a + e.name), i.push(e) + }, s) : e.isDirectory && (n = e.createReader(), (o = function () { + n.readEntries(function (t) { + if (t && t.length > 0) { + for (r = 0; r < t.length; r++) l._scanDroppedItems(t[r], i, a + e.name + "/"); + o() + } + return null + }, s) + })()) + }, _initDragDrop: function () { + var t = this, i = t.$dropZone; + t.dropZoneEnabled && t.showPreview && (t._handler(i, "dragenter dragover", e.proxy(t._zoneDragEnter, t)), t._handler(i, "dragleave", e.proxy(t._zoneDragLeave, t)), t._handler(i, "drop", e.proxy(t._zoneDrop, t)), t._handler(e(document), "dragenter dragover drop", t._zoneDragDropInit)) + }, _zoneDragDropInit: function (e) { + e.stopPropagation(), e.preventDefault() + }, _zoneDragEnter: function (i) { + var a = this, r = i.originalEvent.dataTransfer, n = e.inArray("Files", r.types) > -1; + return a._zoneDragDropInit(i), a.isDisabled || !n ? (i.originalEvent.dataTransfer.effectAllowed = "none", void (i.originalEvent.dataTransfer.dropEffect = "none")) : void (a._raise("fileDragEnter", { + sourceEvent: i, + files: r.types.Files + }) && t.addCss(a.$dropZone, "file-highlighted")) + }, _zoneDragLeave: function (e) { + var t = this; + t._zoneDragDropInit(e), t.isDisabled || t._raise("fileDragLeave", {sourceEvent: e}) && t.$dropZone.removeClass("file-highlighted") + }, _zoneDrop: function (e) { + var i, a = this, r = a.$element, n = e.originalEvent.dataTransfer, o = n.files, l = n.items, + s = t.getDragDropFolders(l), d = function () { + a.isAjaxUpload ? a._change(e, o) : (a.changeTriggered = !0, r.get(0).files = o, setTimeout(function () { + a.changeTriggered = !1, r.trigger("change" + a.namespace) + }, a.processDelay)), a.$dropZone.removeClass("file-highlighted") + }; + if (e.preventDefault(), !a.isDisabled && !t.isEmpty(o) && a._raise("fileDragDrop", { + sourceEvent: e, + files: o + })) if (s > 0) { + if (!a.isAjaxUpload) return void a._showFolderError(s); + for (o = [], i = 0; i < l.length; i++) { + var c = l[i].webkitGetAsEntry(); + c && a._scanDroppedItems(c, o) + } + setTimeout(function () { + d() + }, 500) + } else d() + }, _uploadClick: function (e) { + var i, a = this, r = a.$container.find(".fileinput-upload"), + n = !r.hasClass("disabled") && t.isEmpty(r.attr("disabled")); + if (!e || !e.isDefaultPrevented()) { + if (!a.isAjaxUpload) return void (n && "submit" !== r.attr("type") && (i = r.closest("form"), i.length && i.trigger("submit"), e.preventDefault())); + e.preventDefault(), n && a.upload() + } + }, _submitForm: function () { + var e = this; + return e._isFileSelectionValid() && !e._abort({}) + }, _clearPreview: function () { + var t = this, i = t.showUploadedThumbs ? t.getFrames(":not(.file-preview-success)") : t.getFrames(); + i.each(function () { + var t = e(this); + t.remove() + }), t.getFrames().length && t.showPreview || t._resetUpload(), t._validateDefaultPreview() + }, _initSortable: function () { + var i, a, r, n, o = this, l = o.$preview, s = "." + t.SORT_CSS, d = e("body"), c = e("html"), + u = o.reversePreviewOrder, p = window.Sortable; + p && 0 !== l.find(s).length && (a = d.length ? d : c.length ? c : o.$container, r = function () { + a.addClass("file-grabbing") + }, n = function () { + a.removeClass("file-grabbing") + }, i = { + handle: ".drag-handle-init", + dataIdAttr: "data-fileid", + animation: 600, + draggable: s, + scroll: !1, + forceFallback: !0, + onChoose: r, + onStart: r, + onUnchoose: n, + onEnd: n, + onSort: function (i) { + var a, r = i.oldIndex, n = i.newIndex, l = 0, s = o.initialPreviewConfig.length, + d = s > 0 && n >= s, c = e(i.item); + d && (n = s - 1), o.initialPreview = t.moveArray(o.initialPreview, r, n, u), o.initialPreviewConfig = t.moveArray(o.initialPreviewConfig, r, n, u), o.previewCache.init(), o.getFrames(".file-preview-initial").each(function () { + e(this).attr("data-fileindex", t.INIT_FLAG + l), l++ + }), d && (a = o.getFrames(":not(.file-preview-initial):first"), a.length && c.slideUp(function () { + c.insertBefore(a).slideDown() + })), o._raise("filesorted", { + previewId: c.attr("id"), + oldIndex: r, + newIndex: n, + stack: o.initialPreviewConfig + }) + } + }, e.extend(!0, i, o.fileActionSettings.dragSettings), o.sortable && o.sortable.destroy(), o.sortable = p.create(l[0], i)) + }, _setPreviewContent: function (e) { + var i = this; + t.setHtml(i.$preview, e), i._autoFitContent() + }, _initPreviewImageOrientations: function () { + var t = this, i = 0, a = t.canOrientImage; + (t.autoOrientImageInitial || a) && t.getFrames(".file-preview-initial").each(function () { + var r, n, o, l = e(this), s = t.initialPreviewConfig[i]; + s && s.exif && s.exif.Orientation && (o = l.attr("id"), r = l.find(">.kv-file-content img"), n = t._getZoom(o, " >.kv-file-content img"), a ? r.css("image-orientation", t.autoOrientImageInitial ? "from-image" : "none") : t.setImageOrientation(r, n, s.exif.Orientation, l)), i++ + }) + }, _initPreview: function (e) { + var i, a = this, r = a.initialCaption || ""; + return a.previewCache.count(!0) ? (i = a.previewCache.out(), r = e && a.initialCaption ? a.initialCaption : i.caption, a._setPreviewContent(i.content), a._setInitThumbAttr(), a._setCaption(r), a._initSortable(), t.isEmpty(i.content) || a.$container.removeClass("file-input-new"), void a._initPreviewImageOrientations()) : (a._clearPreview(), void (e ? a._setCaption(r) : a._initCaption())) + }, _getZoomButton: function (e) { + var t = this, i = t.previewZoomButtonIcons[e], a = t.previewZoomButtonClasses[e], + r = ' title="' + (t.previewZoomButtonTitles[e] || "") + '" ', + n = r + ("close" === e ? ' data-dismiss="modal" aria-hidden="true"' : ""); + return "fullscreen" !== e && "borderless" !== e && "toggleheader" !== e || (n += ' data-toggle="button" aria-pressed="false" autocomplete="off"'), '" + }, _getModalContent: function () { + var e = this; + return e._getLayoutTemplate("modal").setTokens({ + rtl: e.rtl ? " kv-rtl" : "", + zoomFrameClass: e.frameClass, + heading: e.msgZoomModalHeading, + prev: e._getZoomButton("prev"), + next: e._getZoomButton("next"), + toggleheader: e._getZoomButton("toggleheader"), + fullscreen: e._getZoomButton("fullscreen"), + borderless: e._getZoomButton("borderless"), + close: e._getZoomButton("close") + }) + }, _listenModalEvent: function (e) { + var i = this, a = i.$modal, r = function (e) { + return {sourceEvent: e, previewId: a.data("previewId"), modal: a} + }; + a.on(e + ".bs.modal", function (n) { + var o = a.find(".btn-fullscreen"), l = a.find(".btn-borderless"); + a.data("fileinputPluginId") === i.$element.attr("id") && i._raise("filezoom" + e, r(n)), "shown" === e && (l.removeClass("active").attr("aria-pressed", "false"), o.removeClass("active").attr("aria-pressed", "false"), a.hasClass("file-zoom-fullscreen") && (i._maximizeZoomDialog(), t.checkFullScreen() ? o.addClass("active").attr("aria-pressed", "true") : l.addClass("active").attr("aria-pressed", "true"))) + }) + }, _initZoom: function () { + var i, a = this, r = a._getLayoutTemplate("modalMain"), n = "#" + t.MODAL_ID; + a.showPreview && (a.$modal = e(n), a.$modal && a.$modal.length || (i = t.createElement(t.cspBuffer.stash(r)).insertAfter(a.$container), a.$modal = e(n).insertBefore(i), t.cspBuffer.apply(a.$modal), i.remove()), t.initModal(a.$modal), a.$modal.html(t.cspBuffer.stash(a._getModalContent())), t.cspBuffer.apply(a.$modal), e.each(t.MODAL_EVENTS, function (e, t) { + a._listenModalEvent(t) + })) + }, _initZoomButtons: function () { + var t, i, a = this, r = a.$modal.data("previewId") || "", n = a.getFrames().toArray(), o = n.length, + l = a.$modal.find(".btn-prev"), s = a.$modal.find(".btn-next"); + return n.length < 2 ? (l.hide(), void s.hide()) : (l.show(), s.show(), void (o && (t = e(n[0]), i = e(n[o - 1]), l.removeAttr("disabled"), s.removeAttr("disabled"), t.length && t.attr("id") === r && l.attr("disabled", !0), i.length && i.attr("id") === r && s.attr("disabled", !0)))) + }, _maximizeZoomDialog: function () { + var t = this, i = t.$modal, a = i.find(".modal-header:visible"), r = i.find(".modal-footer:visible"), + n = i.find(".modal-body"), o = e(window).height(), l = 0; + i.addClass("file-zoom-fullscreen"), a && a.length && (o -= a.outerHeight(!0)), r && r.length && (o -= r.outerHeight(!0)), n && n.length && (l = n.outerHeight(!0) - n.height(), o -= l), i.find(".kv-zoom-body").height(o) + }, _resizeZoomDialog: function (e) { + var i = this, a = i.$modal, r = a.find(".btn-fullscreen"), n = a.find(".btn-borderless"); + if (a.hasClass("file-zoom-fullscreen")) t.toggleFullScreen(!1), e ? r.hasClass("active") || (a.removeClass("file-zoom-fullscreen"), i._resizeZoomDialog(!0), n.hasClass("active") && n.removeClass("active").attr("aria-pressed", "false")) : r.hasClass("active") ? r.removeClass("active").attr("aria-pressed", "false") : (a.removeClass("file-zoom-fullscreen"), i.$modal.find(".kv-zoom-body").css("height", i.zoomModalHeight)); else { + if (!e) return void i._maximizeZoomDialog(); + t.toggleFullScreen(!0) + } + a.focus() + }, _setZoomContent: function (i, a) { + var r, n, o, l, s, d, c, u, p, f, g = this, m = i.attr("id"), h = g._getZoom(m), v = g.$modal, + w = v.find(".btn-fullscreen"), b = v.find(".btn-borderless"), _ = v.find(".btn-toggleheader"); + n = h.attr("data-template") || "generic", r = h.find(".kv-file-content"), o = r.length ? r.html() : "", p = i.data("caption") || "", f = i.data("size") || "", l = p + " " + f, v.find(".kv-zoom-title").attr("title", e("
    ").html(l).text()).html(l), s = v.find(".kv-zoom-body"), v.removeClass("kv-single-content"), a ? (u = s.addClass("file-thumb-loading").clone().insertAfter(s), t.setHtml(s, o).hide(), u.fadeOut("fast", function () { + s.fadeIn("fast", function () { + s.removeClass("file-thumb-loading") + }), u.remove() + })) : t.setHtml(s, o), c = g.previewZoomSettings[n], c && (d = s.find(".kv-preview-data"), t.addCss(d, "file-zoom-detail"), e.each(c, function (e, t) { + d.css(e, t), (d.attr("width") && "width" === e || d.attr("height") && "height" === e) && d.removeAttr(e) + })), v.data("previewId", m), g._handler(v.find(".btn-prev"), "click", function () { + g._zoomSlideShow("prev", m) + }), g._handler(v.find(".btn-next"), "click", function () { + g._zoomSlideShow("next", m) + }), g._handler(w, "click", function () { + g._resizeZoomDialog(!0) + }), g._handler(b, "click", function () { + g._resizeZoomDialog(!1) + }), g._handler(_, "click", function () { + var e, t = v.find(".modal-header"), i = v.find(".modal-body .floating-buttons"), + a = t.find(".kv-zoom-actions"), r = function (e) { + var i = g.$modal.find(".kv-zoom-body"), a = g.zoomModalHeight; + v.hasClass("file-zoom-fullscreen") && (a = i.outerHeight(!0), e || (a -= t.outerHeight(!0))), i.css("height", e ? a + e : a) + }; + t.is(":visible") ? (e = t.outerHeight(!0), t.slideUp("slow", function () { + a.find(".btn").appendTo(i), r(e) + })) : (i.find(".btn").appendTo(a), t.slideDown("slow", function () { + r() + })), v.focus() + }), g._handler(v, "keydown", function (t) { + var i = t.which || t.keyCode, a = e(this).find(".btn-prev"), r = e(this).find(".btn-next"), + n = e(this).data("previewId"), o = g.rtl ? 39 : 37, l = g.rtl ? 37 : 39; + i === o && a.length && !a.attr("disabled") && g._zoomSlideShow("prev", n), i === l && r.length && !r.attr("disabled") && g._zoomSlideShow("next", n) + }) + }, _showModal: function (e) { + var i = this, a = i.$modal; + e && e.length && (t.initModal(a), t.setHtml(a, i._getModalContent()), i._setZoomContent(e), a.data("fileinputPluginId", i.$element.attr("id")), a.modal("show"), i._initZoomButtons()) + }, _zoomPreview: function (e) { + var i, a = this; + if (!e.length) throw"Cannot zoom to detailed preview!"; + i = e.closest(t.FRAMES), a._showModal(i) + }, _zoomSlideShow: function (t, i) { + var a, r, n, o, l = this, s = l.$modal.find(".kv-zoom-actions .btn-" + t), d = l.getFrames().toArray(), + c = [], u = d.length; + if (!s.attr("disabled")) { + for (r = 0; u > r; r++) n = e(d[r]), n && n.length && n.find(".kv-file-zoom:visible").length && c.push(d[r]); + for (u = c.length, r = 0; u > r; r++) if (e(c[r]).attr("id") === i) { + o = "prev" === t ? r - 1 : r + 1; + break + } + 0 > o || o >= u || !c[o] || (a = e(c[o]), a.length && l._setZoomContent(a, !0), l._initZoomButtons(), l._raise("filezoom" + t, { + previewId: i, + modal: l.$modal + })) + } + }, _initZoomButton: function () { + var t = this; + t.$preview.find(".kv-file-zoom").each(function () { + var i = e(this); + t._handler(i, "click", function () { + t._zoomPreview(i) + }) + }) + }, _inputFileCount: function () { + return this.$element[0].files.length + }, _refreshPreview: function () { + var t, i = this; + (i._inputFileCount() || i.isAjaxUpload) && i.showPreview && i.isPreviewable && (i.isAjaxUpload && i.fileManager.count() > 0 ? (t = e.extend(!0, {}, i.fileManager.stack), i.fileManager.clear(), i._clearFileInput()) : t = i.$element[0].files, t && t.length && (i.readFiles(t), i._setFileDropZoneTitle())) + }, _clearObjects: function (t) { + t.find("video audio").each(function () { + this.pause(), e(this).remove() + }), t.find("img object div").each(function () { + e(this).remove() + }) + }, _clearFileInput: function () { + var t, i, a, r = this, n = r.$element; + r._inputFileCount() && (t = n.closest("form"), i = e(document.createElement("form")), a = e(document.createElement("div")), n.before(a), t.length ? t.after(i) : a.after(i), i.append(n).trigger("reset"), a.before(n).remove(), i.remove()) + }, _resetUpload: function () { + var e = this; + e.uploadCache = [], e.$btnUpload.removeAttr("disabled"), e._setProgress(0), e._hideProgress(), e._resetErrors(!1), e._initAjax(), e.fileManager.clearImages(), e._resetCanvas(), e.overwriteInitial && (e.initialPreview = [], e.initialPreviewConfig = [], e.initialPreviewThumbTags = [], e.previewCache.data = { + content: [], + config: [], + tags: [] + }) + }, _resetCanvas: function () { + var e = this; + e.canvas && e.imageCanvasContext && e.imageCanvasContext.clearRect(0, 0, e.canvas.width, e.canvas.height) + }, _hasInitialPreview: function () { + var e = this; + return !e.overwriteInitial && e.previewCache.count(!0) + }, _resetPreview: function () { + var i, a, r, n = this, o = n.showUploadedThumbs, l = !n.removeFromPreviewOnError, + s = (o || l) && n.isDuplicateError; + n.previewCache.count(!0) ? (i = n.previewCache.out(), s && (r = t.createElement("").insertAfter(n.$container), n.getFrames().each(function () { + var t = e(this); + (o && t.hasClass("file-preview-success") || l && t.hasClass("file-preview-error")) && r.append(t) + })), n._setPreviewContent(i.content), n._setInitThumbAttr(), a = n.initialCaption ? n.initialCaption : i.caption, n._setCaption(a), s && (r.contents().appendTo(n.$preview), r.remove())) : (n._clearPreview(), n._initCaption()), n.showPreview && (n._initZoom(), n._initSortable()), n.isDuplicateError = !1 + }, _clearDefaultPreview: function () { + var e = this; + e.$preview.find(".file-default-preview").remove() + }, _validateDefaultPreview: function () { + var e = this; + e.showPreview && !t.isEmpty(e.defaultPreviewContent) && (e._setPreviewContent('
    ' + e.defaultPreviewContent + "
    "), e.$container.removeClass("file-input-new"), e._initClickable()) + }, _resetPreviewThumbs: function (e) { + var t, i = this; + return e ? (i._clearPreview(), void i.clearFileStack()) : void (i._hasInitialPreview() ? (t = i.previewCache.out(), i._setPreviewContent(t.content), i._setInitThumbAttr(), i._setCaption(t.caption), i._initPreviewActions()) : i._clearPreview()) + }, _getLayoutTemplate: function (e) { + var i = this, a = i.layoutTemplates[e]; + return t.isEmpty(i.customLayoutTags) ? a : t.replaceTags(a, i.customLayoutTags) + }, _getPreviewTemplate: function (e) { + var i = this, a = i.previewTemplates, r = a[e] || a.other; + return t.isEmpty(i.customPreviewTags) ? r : t.replaceTags(r, i.customPreviewTags) + }, _getOutData: function (e, t, i, a) { + var r = this; + return t = t || {}, i = i || {}, a = a || r.fileManager.list(), { + formdata: e, + files: a, + filenames: r.filenames, + filescount: r.getFilesCount(), + extra: r._getExtraData(), + response: i, + reader: r.reader, + jqXHR: t + } + }, _getMsgSelected: function (e) { + var t = this, i = 1 === e ? t.fileSingle : t.filePlural; + return e > 0 ? t.msgSelected.replace("{n}", e).replace("{files}", i) : t.msgNoFilesSelected + }, _getFrame: function (e, i) { + var a = this, r = t.getFrameElement(a.$preview, e); + return !a.showPreview || i || r.length || a._log(t.logMessages.invalidThumb, {id: e}), r + }, _getZoom: function (e, i) { + var a = this, r = t.getZoomElement(a.$preview, e, i); + return a.showPreview && !r.length && a._log(t.logMessages.invalidThumb, {id: e}), r + }, _getThumbs: function (e) { + return e = e || "", this.getFrames(":not(.file-preview-initial)" + e) + }, _getThumbId: function (e) { + var t = this; + return t.previewInitId + "-" + e + }, _getExtraData: function (e, t) { + var i = this, a = i.uploadExtraData; + return "function" == typeof i.uploadExtraData && (a = i.uploadExtraData(e, t)), a + }, _initXhr: function (e, i, a) { + var r = this, n = r.fileManager, o = function (e) { + var o = 0, l = e.total, s = e.loaded || e.position, d = n.getUploadStats(i, s, l); + e.lengthComputable && !r.enableResumableUpload && (o = t.round(s / l * 100)), i ? r._setFileUploadStats(i, o, a, d) : r._setProgress(o, null, null, r._getStats(d)), r._raise("fileajaxprogress", [d]) + }; + return e.upload && (r.progressDelay && (o = t.debounce(o, r.progressDelay)), e.upload.addEventListener("progress", o, !1)), e + }, _initAjaxSettings: function () { + var t = this; + t._ajaxSettings = e.extend(!0, {}, t.ajaxSettings), t._ajaxDeleteSettings = e.extend(!0, {}, t.ajaxDeleteSettings) + }, _mergeAjaxCallback: function (e, t, i) { + var a, r = this, n = r._ajaxSettings, o = r.mergeAjaxCallbacks; + "delete" === i && (n = r._ajaxDeleteSettings, o = r.mergeAjaxDeleteCallbacks), a = n[e], o && "function" == typeof a ? "before" === o ? n[e] = function () { + a.apply(this, arguments), t.apply(this, arguments) + } : n[e] = function () { + t.apply(this, arguments), a.apply(this, arguments) + } : n[e] = t + }, _ajaxSubmit: function (t, i, a, r, n, o, l, s) { + var d, c, u, p, f = this; + f._raise("filepreajax", [n, o, l]) && (n.append("initialPreview", JSON.stringify(f.initialPreview)), n.append("initialPreviewConfig", JSON.stringify(f.initialPreviewConfig)), n.append("initialPreviewThumbTags", JSON.stringify(f.initialPreviewThumbTags)), f._initAjaxSettings(), f._mergeAjaxCallback("beforeSend", t), f._mergeAjaxCallback("success", i), f._mergeAjaxCallback("complete", a), f._mergeAjaxCallback("error", r), s = s || f.uploadUrlThumb || f.uploadUrl, "function" == typeof s && (s = s()), u = f._getExtraData(o, l) || {}, "object" == typeof u && e.each(u, function (e, t) { + n.append(e, t) + }), c = { + xhr: function () { + var t = e.ajaxSettings.xhr(); + return f._initXhr(t, o, f.fileManager.count()) + }, + url: f._encodeURI(s), + type: "POST", + dataType: "json", + data: n, + cache: !1, + processData: !1, + contentType: !1 + }, d = e.extend(!0, {}, c, f._ajaxSettings), p = f.taskManager.addTask(o + "-" + l, function () { + var t, i, a = this.self; + t = a.ajaxQueue.shift(), i = e.ajax(t), a.ajaxRequests.push(i) + }), f.ajaxQueue.push(d), p.runWithContext({self: f})) + }, _mergeArray: function (e, i) { + var a = this, r = t.cleanArray(a[e]), n = t.cleanArray(i); + a[e] = r.concat(n) + }, _initUploadSuccess: function (i, a, r) { + var n, o, l, s, d, c, u, p, f, g, m = this; + return !m.showPreview || "object" != typeof i || e.isEmptyObject(i) ? void m._resetCaption() : (void 0 !== i.initialPreview && i.initialPreview.length > 0 && (m.hasInitData = !0, c = i.initialPreview || [], u = i.initialPreviewConfig || [], p = i.initialPreviewThumbTags || [], n = void 0 === i.append || i.append, c.length > 0 && !t.isArray(c) && (c = c.split(m.initialPreviewDelimiter)), c.length && (m._mergeArray("initialPreview", c), m._mergeArray("initialPreviewConfig", u), m._mergeArray("initialPreviewThumbTags", p)), void 0 !== a ? r ? (f = a.attr("id"), g = m._getUploadCacheIndex(f), null !== g && (m.uploadCache[g] = { + id: f, + content: c[0], + config: u[0] || [], + tags: p[0] || [], + append: n + })) : (l = m.previewCache.add(c[0], u[0], p[0], n), o = m.previewCache.get(l, !1), s = t.createElement(o).hide().appendTo(a), d = s.find(".kv-zoom-cache"), d && d.length && d.appendTo(a), a.fadeOut("slow", function () { + var e = s.find(".file-preview-frame"); + e && e.length && e.insertBefore(a).fadeIn("slow").css("display:inline-block"), m._initPreviewActions(), m._clearFileInput(), a.remove(), s.remove(), m._initSortable() + })) : (m.previewCache.set(c, u, p, n), m._initPreview(), m._initPreviewActions())), void m._resetCaption()) + }, _getUploadCacheIndex: function (e) { + var t, i, a = this, r = a.uploadCache.length; + for (t = 0; r > t; t++) if (i = a.uploadCache[t], i.id === e) return t; + return null + }, _initSuccessThumbs: function () { + var i = this; + i.showPreview && i._getThumbs(t.FRAMES + ".file-preview-success").each(function () { + var a = e(this), r = a.find(".kv-file-remove"); + r.removeAttr("disabled"), i._handler(r, "click", function () { + var e = a.attr("id"), r = i._raise("filesuccessremove", [e, a.attr("data-fileindex")]); + t.cleanMemory(a), r !== !1 && a.fadeOut("slow", function () { + a.remove(), i.getFrames().length || i.reset() + }) + }) + }) + }, _updateInitialPreview: function () { + var t = this, i = t.uploadCache; + t.showPreview && (e.each(i, function (e, i) { + t.previewCache.add(i.content, i.config, i.tags, i.append) + }), t.hasInitData && (t._initPreview(), t._initPreviewActions())) + }, _uploadSingle: function (i, a, r) { + var n, o, l, s, d, c, u, p, f, g, m, h, v, w = this, b = w.fileManager, _ = b.count(), C = new FormData, + y = w._getThumbId(a), x = _ > 0 || !e.isEmptyObject(w.uploadExtraData), + T = w.ajaxOperations.uploadThumb, P = b.getFile(a), k = {id: y, index: i, fileId: a}, + E = w.fileManager.getFileName(a, !0); + w.enableResumableUpload || (w.showPreview && (o = w.fileManager.getThumb(a), u = o.find(".file-thumb-progress"), s = o.find(".kv-file-upload"), d = o.find(".kv-file-remove"), u.show()), 0 === _ || !x || w.showPreview && s && s.hasClass("disabled") || w._abort(k) || (v = function () { + c ? b.errors.push(a) : b.removeFile(a), b.setProcessed(a), b.isProcessed() && (w.fileBatchCompleted = !0, l()) + }, l = function () { + var e; + w.fileBatchCompleted && setTimeout(function () { + var i = 0 === b.count(), a = b.errors.length; + w._updateInitialPreview(), w.unlock(i), i && w._clearFileInput(), e = w.$preview.find(".file-preview-initial"), w.uploadAsync && e.length && (t.addCss(e, t.SORT_CSS), w._initSortable()), w._raise("filebatchuploadcomplete", [b.stack, w._getExtraData()]), w.retryErrorUploads && 0 !== a || b.clear(), w._setProgress(101), w.ajaxAborted = !1 + }, w.processDelay) + }, p = function (l) { + n = w._getOutData(C, l), b.initStats(a), w.fileBatchCompleted = !1, r || (w.ajaxAborted = !1), w.showPreview && (o.hasClass("file-preview-success") || (w._setThumbStatus(o, "Loading"), t.addCss(o, "file-uploading")), s.attr("disabled", !0), d.attr("disabled", !0)), r || w.lock(), -1 !== b.errors.indexOf(a) && delete b.errors[a], w._raise("filepreupload", [n, y, i]), e.extend(!0, k, n), w._abort(k) && (l.abort(), r || (w._setThumbStatus(o, "New"), o.removeClass("file-uploading"), s.removeAttr("disabled"), d.removeAttr("disabled"), w.unlock()), w._setProgressCancelled()) + }, g = function (l, d, p) { + var g = w.showPreview && o.attr("id") ? o.attr("id") : y; + n = w._getOutData(C, p, l), e.extend(!0, k, n), setTimeout(function () { + t.isEmpty(l) || t.isEmpty(l.error) ? (w.showPreview && (w._setThumbStatus(o, "Success"), s.hide(), w._initUploadSuccess(l, o, r), w._setProgress(101, u)), w._raise("fileuploaded", [n, g, i]), r ? v() : w.fileManager.remove(o)) : (c = !0, f = w._parseError(T, p, w.msgUploadError, w.fileManager.getFileName(a)), w._showFileError(f, k), w._setPreviewError(o, !0), w.retryErrorUploads || s.hide(), r && v(), w._setProgress(101, w._getFrame(g).find(".file-thumb-progress"), w.msgUploadError)) + }, w.processDelay) + }, m = function () { + w.showPreview && (s.removeAttr("disabled"), d.removeAttr("disabled"), o.removeClass("file-uploading")), r ? l() : (w.unlock(!1), w._clearFileInput()), w._initSuccessThumbs() + }, h = function (t, i, n) { + f = w._parseError(T, t, n, w.fileManager.getFileName(a)), c = !0, setTimeout(function () { + var i; + r && v(), w.fileManager.setProgress(a, 100), w._setPreviewError(o, !0), w.retryErrorUploads || s.hide(), e.extend(!0, k, w._getOutData(C, t)), w._setProgress(101, w.$progress, w.msgAjaxProgressError.replace("{operation}", T)), i = w.showPreview && o ? o.find(".file-thumb-progress") : "", w._setProgress(101, i, w.msgUploadError), w._showFileError(f, k) + }, w.processDelay) + }, C.append(w.uploadFileAttr, P.file, E), w._setUploadData(C, {fileId: a}), w._ajaxSubmit(p, g, m, h, C, a, i))) + }, _uploadBatch: function () { + var i, a, r, n, o, l, s = this, d = s.fileManager, c = d.total(), u = {}, + p = c > 0 || !e.isEmptyObject(s.uploadExtraData), f = new FormData, g = s.ajaxOperations.uploadBatch; + if (0 !== c && p && !s._abort(u)) { + l = function () { + s.fileManager.clear(), s._clearFileInput() + }, i = function (i) { + s.lock(), d.initStats(); + var a = s._getOutData(f, i); + s.ajaxAborted = !1, s.showPreview && s._getThumbs().each(function () { + var i = e(this), a = i.find(".kv-file-upload"), r = i.find(".kv-file-remove"); + i.hasClass("file-preview-success") || (s._setThumbStatus(i, "Loading"), t.addCss(i, "file-uploading")), a.attr("disabled", !0), r.attr("disabled", !0) + }), s._raise("filebatchpreupload", [a]), s._abort(a) && (i.abort(), s._getThumbs().each(function () { + var t = e(this), i = t.find(".kv-file-upload"), a = t.find(".kv-file-remove"); + t.hasClass("file-preview-loading") && (s._setThumbStatus(t, "New"), t.removeClass("file-uploading")), i.removeAttr("disabled"), a.removeAttr("disabled") + }), s._setProgressCancelled()) + }, a = function (i, a, r) { + var n = s._getOutData(f, r, i), d = 0, c = s._getThumbs(":not(.file-preview-success)"), + u = t.isEmpty(i) || t.isEmpty(i.errorkeys) ? [] : i.errorkeys; + t.isEmpty(i) || t.isEmpty(i.error) ? (s._raise("filebatchuploadsuccess", [n]), l(), s.showPreview ? (c.each(function () { + var t = e(this); + s._setThumbStatus(t, "Success"), t.removeClass("file-uploading"), t.find(".kv-file-upload").hide().removeAttr("disabled") + }), s._initUploadSuccess(i)) : s.reset(), s._setProgress(101)) : (s.showPreview && (c.each(function () { + var t = e(this); + t.removeClass("file-uploading"), t.find(".kv-file-upload").removeAttr("disabled"), t.find(".kv-file-remove").removeAttr("disabled"), 0 === u.length || -1 !== e.inArray(d, u) ? (s._setPreviewError(t, !0), s.retryErrorUploads || (t.find(".kv-file-upload").hide(), s.fileManager.remove(t))) : (t.find(".kv-file-upload").hide(), s._setThumbStatus(t, "Success"), s.fileManager.remove(t)), t.hasClass("file-preview-error") && !s.retryErrorUploads || d++ + }), s._initUploadSuccess(i)), o = s._parseError(g, r, s.msgUploadError), s._showFileError(o, n, "filebatchuploaderror"), s._setProgress(101, s.$progress, s.msgUploadError)) + }, n = function () { + s.unlock(), s._initSuccessThumbs(), s._clearFileInput(), s._raise("filebatchuploadcomplete", [s.fileManager.stack, s._getExtraData()]) + }, r = function (t, i, a) { + var r = s._getOutData(f, t); + o = s._parseError(g, t, a), s._showFileError(o, r, "filebatchuploaderror"), s.uploadFileCount = c - 1, s.showPreview && (s._getThumbs().each(function () { + var t = e(this); + t.removeClass("file-uploading"), s.fileManager.getFile(t.attr("data-fileid")) && s._setPreviewError(t) + }), s._getThumbs().removeClass("file-uploading"), s._getThumbs(" .kv-file-upload").removeAttr("disabled"), s._getThumbs(" .kv-file-delete").removeAttr("disabled"), s._setProgress(101, s.$progress, s.msgAjaxProgressError.replace("{operation}", g))) + }; + var m = 0; + e.each(s.fileManager.stack, function (e, i) { + t.isEmpty(i.file) || f.append(s.uploadFileAttr, i.file, i.nameFmt || "untitled_" + m), m++ + }), s._ajaxSubmit(i, a, n, r, f) + } + }, _uploadExtraOnly: function () { + var e, i, a, r, n, o = this, l = {}, s = new FormData, d = o.ajaxOperations.uploadExtra; + o._abort(l) || (e = function (e) { + o.lock(); + var t = o._getOutData(s, e); + o._raise("filebatchpreupload", [t]), o._setProgress(50), l.data = t, l.xhr = e, o._abort(l) && (e.abort(), o._setProgressCancelled()) + }, i = function (e, i, a) { + var r = o._getOutData(s, a, e); + t.isEmpty(e) || t.isEmpty(e.error) ? (o._raise("filebatchuploadsuccess", [r]), o._clearFileInput(), o._initUploadSuccess(e), o._setProgress(101)) : (n = o._parseError(d, a, o.msgUploadError), o._showFileError(n, r, "filebatchuploaderror")) + }, a = function () { + o.unlock(), o._clearFileInput(), o._raise("filebatchuploadcomplete", [o.fileManager.stack, o._getExtraData()]) + }, r = function (e, t, i) { + var a = o._getOutData(s, e); + n = o._parseError(d, e, i), l.data = a, o._showFileError(n, a, "filebatchuploaderror"), o._setProgress(101, o.$progress, o.msgAjaxProgressError.replace("{operation}", d)) + }, o._ajaxSubmit(e, i, a, r, s)) + }, _deleteFileIndex: function (i) { + var a = this, r = i.attr("data-fileindex"), n = a.reversePreviewOrder; + r.substring(0, 5) === t.INIT_FLAG && (r = parseInt(r.replace(t.INIT_FLAG, "")), a.initialPreview = t.spliceArray(a.initialPreview, r, n), a.initialPreviewConfig = t.spliceArray(a.initialPreviewConfig, r, n), a.initialPreviewThumbTags = t.spliceArray(a.initialPreviewThumbTags, r, n), a.getFrames().each(function () { + var i = e(this), a = i.attr("data-fileindex"); + a.substring(0, 5) === t.INIT_FLAG && (a = parseInt(a.replace(t.INIT_FLAG, "")), a > r && (a--, i.attr("data-fileindex", t.INIT_FLAG + a))) + })) + }, _resetCaption: function () { + var e = this; + setTimeout(function () { + var t, i, a, r = e.previewCache.count(!0), n = e.fileManager.count(), + o = ":not(.file-preview-success):not(.file-preview-error)", + l = e.showPreview && e.getFrames(o).length; + 0 !== n || 0 !== r || l ? (i = r + n, i > 1 ? t = e._getMsgSelected(i) : (a = e.fileManager.getFirstFile(), t = a ? a.nameFmt : "_"), e._setCaption(t)) : e.reset() + }, e.processDelay) + }, _initFileActions: function () { + var i = this; + i.showPreview && (i._initZoomButton(), i.getFrames(" .kv-file-remove").each(function () { + var a, r, n = e(this), o = n.closest(t.FRAMES), l = o.attr("id"), s = o.attr("data-fileindex"); + i._handler(n, "click", function () { + return r = i._raise("filepreremove", [l, s]), r !== !1 && i._validateMinCount() ? (a = o.hasClass("file-preview-error"), t.cleanMemory(o), void o.fadeOut("slow", function () { + i.fileManager.remove(o), i._clearObjects(o), o.remove(), l && a && i.$errorContainer.find('li[data-thumb-id="' + l + '"]').fadeOut("fast", function () { + e(this).remove(), i._errorsExist() || i._resetErrors() + }), i._clearFileInput(), i._resetCaption(), i._raise("fileremoved", [l, s]) + })) : !1 + }) + }), i.getFrames(" .kv-file-upload").each(function () { + var a = e(this); + i._handler(a, "click", function () { + var e = a.closest(t.FRAMES), r = e.attr("data-fileid"); + i._hideProgress(), e.hasClass("file-preview-error") && !i.retryErrorUploads || i._uploadSingle(i.fileManager.getIndex(r), r, !1) + }) + })) + }, _initPreviewActions: function () { + var i = this, a = i.$preview, r = i.deleteExtraData || {}, n = t.FRAMES + " .kv-file-remove", + o = i.fileActionSettings, l = o.removeClass, s = o.removeErrorClass, d = function () { + var e = i.isAjaxUpload ? i.previewCache.count(!0) : i._inputFileCount(); + i.getFrames().length || e || (i._setCaption(""), i.reset(), i.initialCaption = "") + }; + i._initZoomButton(), a.find(n).each(function () { + var a, n, o, c, u = e(this), p = u.data("url") || i.deleteUrl, f = u.data("key"), + g = i.ajaxOperations.deleteThumb; + if (!t.isEmpty(p) && void 0 !== f) { + "function" == typeof p && (p = p()); + var m, h, v, w, b, _ = u.closest(t.FRAMES), C = i.previewCache.data, y = _.attr("data-fileindex"); + y = parseInt(y.replace(t.INIT_FLAG, "")), v = t.isEmpty(C.config) && t.isEmpty(C.config[y]) ? null : C.config[y], b = t.isEmpty(v) || t.isEmpty(v.extra) ? r : v.extra, w = v && (v.filename || v.caption) || "", "function" == typeof b && (b = b()), h = { + id: u.attr("id"), + key: f, + extra: b + }, n = function (e) { + i.ajaxAborted = !1, i._raise("filepredelete", [f, e, b]), i._abort() ? e.abort() : (u.removeClass(s), t.addCss(_, "file-uploading"), t.addCss(u, "disabled " + l)) + }, o = function (e, r, n) { + var o, c; + return t.isEmpty(e) || t.isEmpty(e.error) ? (_.removeClass("file-uploading").addClass("file-deleted"), void _.fadeOut("slow", function () { + y = parseInt(_.attr("data-fileindex").replace(t.INIT_FLAG, "")), i.previewCache.unset(y), i._deleteFileIndex(_), o = i.previewCache.count(!0), c = o > 0 ? i._getMsgSelected(o) : "", i._setCaption(c), i._raise("filedeleted", [f, n, b]), i._clearObjects(_), _.remove(), d() + })) : (h.jqXHR = n, h.response = e, a = i._parseError(g, n, i.msgDeleteError, w), i._showFileError(a, h, "filedeleteerror"), _.removeClass("file-uploading"), u.removeClass("disabled " + l).addClass(s), void d()) + }, c = function (e, t, a) { + var r = i._parseError(g, e, a, w); + h.jqXHR = e, h.response = {}, i._showFileError(r, h, "filedeleteerror"), _.removeClass("file-uploading"), u.removeClass("disabled " + l).addClass(s), d() + }, i._initAjaxSettings(), i._mergeAjaxCallback("beforeSend", n, "delete"), i._mergeAjaxCallback("success", o, "delete"), i._mergeAjaxCallback("error", c, "delete"), m = e.extend(!0, {}, { + url: i._encodeURI(p), + type: "POST", + dataType: "json", + data: e.extend(!0, {}, {key: f}, b) + }, i._ajaxDeleteSettings), i._handler(u, "click", function () { + return i._validateMinCount() ? (i.ajaxAborted = !1, i._raise("filebeforedelete", [f, b]), void (i.ajaxAborted instanceof Promise ? i.ajaxAborted.then(function (t) { + t || e.ajax(m) + }) : i.ajaxAborted || e.ajax(m))) : !1 + }) + } + }) + }, _hideFileIcon: function () { + var e = this; + e.overwriteInitial && e.$captionContainer.removeClass("icon-visible") + }, _showFileIcon: function () { + var e = this; + t.addCss(e.$captionContainer, "icon-visible") + }, _getSize: function (t, i) { + var a, r, n = this, o = parseFloat(t), l = n.fileSizeGetter; + return e.isNumeric(t) && e.isNumeric(o) ? ("function" == typeof l ? r = l(o) : 0 === o ? r = "0.00 B" : (a = Math.floor(Math.log(o) / Math.log(1024)), i || (i = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]), r = 1 * (o / Math.pow(1024, a)).toFixed(2) + " " + i[a]), n._getLayoutTemplate("size").replace("{sizeText}", r)) : "" + }, _getFileType: function (e) { + var t = this; + return t.mimeTypeAliases[e] || e + }, _generatePreviewTemplate: function (i, a, r, n, o, l, s, d, c, u, p, f, g, m) { + var h, v, w, b = this, _ = b.slug(r), C = "", y = "", + x = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, T = _, + P = _, k = "type-default", E = u || b._renderFileFooter(i, _, d, "auto", s), F = b.preferIconicPreview, + S = b.preferIconicZoomPreview, I = F ? "other" : i; + return v = 400 > x ? b.previewSettingsSmall[I] || b.defaults.previewSettingsSmall[I] : b.previewSettings[I] || b.defaults.previewSettings[I], v && e.each(v, function (e, t) { + y += e + ":" + t + ";" + }), w = function (a, s, d, u) { + var m = d ? "zoom-" + o : o, h = b._getPreviewTemplate(a), v = (c || "") + " " + u; + return b.frameClass && (v = b.frameClass + " " + v), d && (v = v.replace(" " + t.SORT_CSS, "")), h = b._parseFilePreviewIcon(h, r), "text" === a && (s = t.htmlEncode(s)), "object" !== i || n || e.each(b.defaults.fileTypeSettings, function (e, t) { + "object" !== e && "other" !== e && t(r, n) && (k = "type-" + e) + }), t.isEmpty(g) || (void 0 !== g.title && null !== g.title && (T = g.title), void 0 !== g.alt && null !== g.alt && (T = g.alt)), h.setTokens({ + previewId: m, + caption: _, + title: T, + alt: P, + frameClass: v, + type: b._getFileType(n), + fileindex: p, + fileid: l || "", + typeCss: k, + footer: E, + data: s, + template: f || i, + style: y ? 'style="' + y + '"' : "" + }) + }, p = p || o.slice(o.lastIndexOf("-") + 1), b.fileActionSettings.showZoom && (C = w(S ? "other" : i, m ? m : a, !0, "kv-zoom-thumb")), C = "\n" + b._getLayoutTemplate("zoomCache").replace("{zoomContent}", C), "function" == typeof b.sanitizeZoomCache && (C = b.sanitizeZoomCache(C)), h = w(F ? "other" : i, a, !1, "kv-preview-thumb"), h.setTokens({zoomCache: C}) + }, _addToPreview: function (e, i) { + var a, r = this; + return i = t.cspBuffer.stash(i), a = r.reversePreviewOrder ? e.prepend(i) : e.append(i), t.cspBuffer.apply(e), a + }, _previewDefault: function (e, i) { + var a = this, r = a.$preview; + if (a.showPreview) { + var n, o = t.getFileName(e), l = e ? e.type : "", s = e.size || 0, d = a._getFileName(e, ""), + c = i === !0 && !a.isAjaxUpload, u = t.createObjectURL(e), p = a.fileManager.getId(e), + f = a._getThumbId(p); + a._clearDefaultPreview(), n = a._generatePreviewTemplate("other", u, o, l, f, p, c, s), a._addToPreview(r, n), a._setThumbAttr(f, d, s), i === !0 && a.isAjaxUpload && a._setThumbStatus(a._getFrame(f), "Error") + } + }, _previewFile: function (e, i, a, r, n) { + if (this.showPreview) { + var o, l = this, s = t.getFileName(i), d = n.type, c = n.name, u = l._parseFileType(d, s), + p = l.$preview, f = i.size || 0, + g = "text" === u || "html" === u || "image" === u ? a.target.result : r, m = l.fileManager.getId(i), + h = l._getThumbId(m); + "html" === u && l.purifyHtml && window.DOMPurify && (g = window.DOMPurify.sanitize(g)), o = l._generatePreviewTemplate(u, g, s, d, h, m, !1, f), l._clearDefaultPreview(), l._addToPreview(p, o); + var v = l._getFrame(h); + l._validateImageOrientation(v.find("img"), i, h, m, c, d, f, g), l._setThumbAttr(h, c, f), l._initSortable() + } + }, _setThumbAttr: function (e, t, i) { + var a = this, r = a._getFrame(e); + r.length && (i = i && i > 0 ? a._getSize(i) : "", r.data({caption: t, size: i})) + }, _setInitThumbAttr: function () { + var e, i, a, r, n = this, o = n.previewCache.data, l = n.previewCache.count(!0); + if (0 !== l) for (var s = 0; l > s; s++) e = o.config[s], r = n.previewInitId + "-" + t.INIT_FLAG + s, i = t.ifSet("caption", e, t.ifSet("filename", e)), a = t.ifSet("size", e), n._setThumbAttr(r, i, a) + }, _slugDefault: function (e) { + return t.isEmpty(e, !0) ? "" : String(e).replace(/[\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g, "_") + }, _updateFileDetails: function (e, i) { + var a, r, n, o, l, s = this, d = s.$element, + c = t.isIE(9) && t.findFileName(d.val()) || d[0].files[0] && d[0].files[0].name; + !c && s.fileManager.count() > 0 ? (l = s.fileManager.getFirstFile(), a = l.nameFmt) : a = c ? s.slug(c) : "_", r = s.isAjaxUpload ? s.fileManager.count() : e, o = s.previewCache.count(!0) + r, n = 1 === r ? a : s._getMsgSelected(o), s.isError ? (s.$previewContainer.removeClass("file-thumb-loading"), s.$previewStatus.html(""), s.$captionContainer.removeClass("icon-visible")) : s._showFileIcon(), s._setCaption(n, s.isError), s.$container.removeClass("file-input-new file-input-ajax-new"), i || s._raise("fileselect", [e, a]), s.previewCache.count(!0) && s._initPreviewActions() + }, _setThumbStatus: function (e, i) { + var a = this; + if (a.showPreview) { + var r = "indicator" + i, n = r + "Title", o = "file-preview-" + i.toLowerCase(), + l = e.find(".file-upload-indicator"), s = a.fileActionSettings; + e.removeClass("file-preview-success file-preview-error file-preview-paused file-preview-loading"), "Success" === i && e.find(".file-drag-handle").remove(), t.setHtml(l, s[r]), l.attr("title", s[n]), e.addClass(o), "Error" !== i || a.retryErrorUploads || e.find(".kv-file-upload").attr("disabled", !0) + } + }, _setProgressCancelled: function () { + var e = this; + e._setProgress(101, e.$progress, e.msgCancelled) + }, _setProgress: function (e, i, a, r) { + var n = this; + if (i = i || n.$progress, i.length) { + var o, l = Math.min(e, 100), s = n.progressUploadThreshold, + d = 100 >= e ? n.progressTemplate : n.progressCompleteTemplate, + c = 100 > l ? n.progressTemplate : a ? n.paused ? n.progressPauseTemplate : n.progressErrorTemplate : d; + e >= 100 && (r = ""), t.isEmpty(c) || (o = s && l > s && 100 >= e ? c.setTokens({ + percent: s, + status: n.msgUploadThreshold + }) : c.setTokens({ + percent: l, + status: e > 100 ? n.msgUploadEnd : l + "%" + }), r = r || "", o = o.setTokens({stats: r}), t.setHtml(i, o), a && t.setHtml(i.find('[role="progressbar"]'), a)) + } + }, _hasFiles: function () { + var e = this.$element[0]; + return !!(e && e.files && e.files.length) + }, _setFileDropZoneTitle: function () { + var e, i = this, a = i.$container.find(".file-drop-zone"), r = i.dropZoneTitle; + i.isClickable && (e = t.isEmpty(i.$element.attr("multiple")) ? i.fileSingle : i.filePlural, r += i.dropZoneClickTitle.replace("{files}", e)), a.find("." + i.dropZoneTitleClass).remove(), !i.showPreview || 0 === a.length || i.fileManager.count() > 0 || !i.dropZoneEnabled || i.previewCache.count() > 0 || !i.isAjaxUpload && i._hasFiles() || (0 === a.find(t.FRAMES).length && t.isEmpty(i.defaultPreviewContent) && a.prepend('
    ' + r + "
    "), i.$container.removeClass("file-input-new"), t.addCss(i.$container, "file-input-ajax-new")) + }, _getStats: function (e) { + var i, a, r = this; + return r.showUploadStats && e && e.bitrate ? (a = r._getLayoutTemplate("stats"), i = e.elapsed && e.bps ? r.msgPendingTime.setTokens({time: t.getElapsed(Math.ceil(e.pendingBytes / e.bps))}) : r.msgCalculatingTime, a.setTokens({ + uploadSpeed: e.bitrate, + pendingTime: i + })) : "" + }, _setResumableProgress: function (e, t, i) { + var a = this, r = a.resumableManager, n = i ? r : a, o = i ? i.find(".file-thumb-progress") : null; + 0 === n.lastProgress && (n.lastProgress = e), e < n.lastProgress && (e = n.lastProgress), a._setProgress(e, o, null, a._getStats(t)), n.lastProgress = e + }, _toggleResumableProgress: function (e, i) { + var a = this, r = a.$progress; + r && r.length && t.setHtml(r, e.setTokens({percent: 101, status: i, stats: ""})) + }, _setFileUploadStats: function (i, a, r, n) { + var o = this, l = o.$progress; + if (o.showPreview || l && l.length) { + var s, d = o.fileManager, c = d.getThumb(i), u = o.resumableManager, p = 0, f = d.getTotalSize(), + g = e.extend(!0, {}, n); + if (o.enableResumableUpload) { + var m, h = n.loaded, v = u.getUploadedSize(), w = u.file.size; + h += v, m = d.uploadedSize + h, a = t.round(100 * h / w), n.pendingBytes = w - v, o._setResumableProgress(a, n, c), s = Math.floor(100 * m / f), g.pendingBytes = f - m, o._setResumableProgress(s, g) + } else d.setProgress(i, a), l = c && c.length ? c.find(".file-thumb-progress") : null, o._setProgress(a, l, null, o._getStats(n)), e.each(d.stats, function (e, t) { + p += t.loaded + }), g.pendingBytes = f - p, s = t.round(p / f * 100), o._setProgress(s, null, null, o._getStats(g)) + } + }, _validateMinCount: function () { + var e = this, t = e.isAjaxUpload ? e.fileManager.count() : e._inputFileCount(); + return e.validateInitialCount && e.minFileCount > 0 && e._getFileCount(t - 1) < e.minFileCount ? (e._noFilesError({}), !1) : !0 + }, _getFileCount: function (e, t) { + var i = this, a = 0; + return void 0 === t && (t = i.validateInitialCount && !i.overwriteInitial), t && (a = i.previewCache.count(!0), e += a), e + }, _getFileId: function (e) { + return t.getFileId(e, this.generateFileId) + }, _getFileName: function (e, i) { + var a = this, r = t.getFileName(e); + return r ? a.slug(r) : i + }, _getFileNames: function (e) { + var t = this; + return t.filenames.filter(function (t) { + return e ? void 0 !== t : void 0 !== t && null !== t + }) + }, _setPreviewError: function (e, t) { + var i = this, a = i.removeFromPreviewOnError && !i.retryErrorUploads; + if (t && !a || i.fileManager.remove(e), i.showPreview) { + if (a) return void e.remove(); + i._setThumbStatus(e, "Error"), i._refreshUploadButton(e) + } + }, _refreshUploadButton: function (e) { + var i = this, a = e.find(".kv-file-upload"), r = i.fileActionSettings, n = r.uploadIcon, o = r.uploadTitle; + a.length && (i.retryErrorUploads && (n = r.uploadRetryIcon, o = r.uploadRetryTitle), a.attr("title", o), t.setHtml(a, n)) + }, _checkDimensions: function (e, i, a, r, n, o, l) { + var s, d, c, u, p = this, f = "Small" === i ? "min" : "max", g = p[f + "Image" + o]; + !t.isEmpty(g) && a.length && (c = a[0], d = "Width" === o ? c.naturalWidth || c.width : c.naturalHeight || c.height, u = "Small" === i ? d >= g : g >= d, u || (s = p["msgImage" + o + i].setTokens({ + name: n, + size: g + }), p._showFileError(s, l), p._setPreviewError(r))) + }, _getExifObj: function (e) { + var i, a = this, r = t.logMessages.exifWarning; + if ("data:image/jpeg;base64," !== e.slice(0, 23) && "data:image/jpg;base64," !== e.slice(0, 22)) return void (i = null); + try { + i = window.piexif ? window.piexif.load(e) : null + } catch (n) { + i = null, r = n && n.message || "" + } + return i || a._log(t.logMessages.badExifParser, {details: r}), i + }, setImageOrientation: function (i, a, r, n) { + var o, l, s, d = this, c = !i || !i.length, u = !a || !a.length, p = !1, + f = c && n && "image" === n.attr("data-template"); + c && u || (s = "load.fileinputimageorient", f ? (i = a, a = null, i.css(d.previewSettings.image), l = e(document.createElement("div")).appendTo(n.find(".kv-file-content")), o = e(document.createElement("span")).insertBefore(i), i.css("visibility", "hidden").removeClass("file-zoom-detail").appendTo(l)) : p = !i.is(":visible"), i.off(s).on(s, function () { + p && (d.$preview.removeClass("hide-content"), n.find(".kv-file-content").css("visibility", "hidden")); + var e = i[0], s = a && a.length ? a[0] : null, c = e.offsetHeight, u = e.offsetWidth, + g = t.getRotation(r); + if (p && (n.find(".kv-file-content").css("visibility", "visible"), d.$preview.addClass("hide-content")), i.data("orientation", r), s && a.data("orientation", r), 5 > r) return t.setTransform(e, g), void t.setTransform(s, g); + var m = Math.atan(u / c), h = Math.sqrt(Math.pow(c, 2) + Math.pow(u, 2)), + v = h ? c / Math.cos(Math.PI / 2 + m) / h : 1, w = " scale(" + Math.abs(v) + ")"; + t.setTransform(e, g + w), t.setTransform(s, g + w), f && (i.css("visibility", "visible").insertAfter(o).addClass("file-zoom-detail"), o.remove(), l.remove()) + })) + }, _validateImageOrientation: function (i, a, r, n, o, l, s, d) { + var c, u, p, f = this, g = f.autoOrientImage; + return f.canOrientImage ? void i.css("image-orientation", g ? "from-image" : "none") : (p = t.getZoomSelector(r, " img"), c = g ? f._getExifObj(d) : null, (u = c ? c["0th"][piexif.ImageIFD.Orientation] : null) ? (f.setImageOrientation(i, e(p), u, f._getFrame(r)), f._raise("fileimageoriented", { + $img: i, + file: a + }), void f._validateImage(r, n, o, l, s, d, c)) : void f._validateImage(r, n, o, l, s, d, c)) + }, _validateImage: function (t, i, a, r, n, o, l) { + var s, d, c, u = this, p = u.$preview, f = u._getFrame(t), g = f.attr("data-fileindex"), m = f.find("img"); + a = a || "Untitled", m.one("load", function () { + d = f.width(), c = p.width(), d > c && m.css("width", "100%"), s = { + ind: g, + id: t, + fileId: i + }, u._checkDimensions(g, "Small", m, f, a, "Width", s), u._checkDimensions(g, "Small", m, f, a, "Height", s), u.resizeImage || (u._checkDimensions(g, "Large", m, f, a, "Width", s), u._checkDimensions(g, "Large", m, f, a, "Height", s)), u._raise("fileimageloaded", [t]), u.fileManager.addImage(i, { + ind: g, + img: m, + thumb: f, + pid: t, + typ: r, + siz: n, + validated: !1, + imgData: o, + exifObj: l + }), f.data("exif", l), u._validateAllImages() + }).one("error", function () { + u._raise("fileimageloaderror", [t]) + }).each(function () { + this.complete ? e(this).trigger("load") : this.error && e(this).trigger("error") + }) + }, _validateAllImages: function () { + var t, i = this, a = {val: 0}, r = i.fileManager.getImageCount(), n = i.resizeIfSizeMoreThan; + r === i.fileManager.totalImages && (i._raise("fileimagesloaded"), i.resizeImage && e.each(i.fileManager.loadedImages, function (e, o) { + o.validated || (t = o.siz, t && t > 1e3 * n && i._getResizedImage(e, o, a, r), o.validated = !0) + })) + }, _getResizedImage: function (i, a, r, n) { + var o, l, s, d, c, u, p, f, g, m, h = this, v = e(a.img)[0], w = v.naturalWidth, b = v.naturalHeight, _ = 1, + C = h.maxImageWidth || w, y = h.maxImageHeight || b, x = !(!w || !b), T = h.imageCanvas, + P = h.imageCanvasContext, k = a.typ, E = a.pid, F = a.ind, S = a.thumb, I = a.exifObj; + if (c = function (e, t, i) { + h.isAjaxUpload ? h._showFileError(e, t, i) : h._showError(e, t, i), h._setPreviewError(S) + }, f = h.fileManager.getFile(i), g = { + id: E, + index: F, + fileId: i + }, m = [i, E, F], (!f || !x || C >= w && y >= b) && (x && f && h._raise("fileimageresized", m), r.val++, r.val === n && h._raise("fileimagesresized"), !x)) return void c(h.msgImageResizeError, g, "fileimageresizeerror"); + k = k || h.resizeDefaultImageType, l = w > C, s = b > y, _ = "width" === h.resizePreference ? l ? C / w : s ? y / b : 1 : s ? y / b : l ? C / w : 1, h._resetCanvas(), w *= _, b *= _, T.width = w, T.height = b; + try { + P.drawImage(v, 0, 0, w, b), d = T.toDataURL(k, h.resizeQuality), I && (p = window.piexif.dump(I), d = window.piexif.insert(p, d)), o = t.dataURI2Blob(d), h.fileManager.setFile(i, o), h._raise("fileimageresized", m), r.val++, r.val === n && h._raise("fileimagesresized", [void 0, void 0]), o instanceof Blob || c(h.msgImageResizeError, g, "fileimageresizeerror") + } catch (A) { + r.val++, r.val === n && h._raise("fileimagesresized", [void 0, void 0]), u = h.msgImageResizeException.replace("{errors}", A.message), c(u, g, "fileimageresizeexception") + } + }, _showProgress: function () { + var e = this; + e.$progress && e.$progress.length && e.$progress.show() + }, _hideProgress: function () { + var e = this; + e.$progress && e.$progress.length && e.$progress.hide() + }, _initBrowse: function (e) { + var i = this, a = i.$element; + i.showBrowse ? i.$btnFile = e.find(".btn-file").append(a) : (a.appendTo(e).attr("tabindex", -1), t.addCss(a, "file-no-browse")) + }, _initClickable: function () { + var i, a, r = this; + r.isClickable && (i = r.$dropZone, r.isAjaxUpload || (a = r.$preview.find(".file-default-preview"), a.length && (i = a)), t.addCss(i, "clickable"), i.attr("tabindex", -1), r._handler(i, "click", function (t) { + var a = e(t.target); + e(r.elErrorContainer + ":visible").length || a.parents(".file-preview-thumbnails").length && !a.parents(".file-default-preview").length || (r.$element.data("zoneClicked", !0).trigger("click"), i.blur()) + })) + }, _initCaption: function () { + var e = this, i = e.initialCaption || ""; + return e.overwriteInitial || t.isEmpty(i) ? (e.$caption.val(""), !1) : (e._setCaption(i), !0) + }, _setCaption: function (i, a) { + var r, n, o, l, s, d, c = this; + if (c.$caption.length) { + if (c.$captionContainer.removeClass("icon-visible"), a) r = e("
    " + c.msgValidationError + "
    ").text(), l = c.fileManager.count(), l ? (d = c.fileManager.getFirstFile(), s = 1 === l && d ? d.nameFmt : c._getMsgSelected(l)) : s = c._getMsgSelected(c.msgNo), n = t.isEmpty(i) ? s : i, o = '' + c.msgValidationErrorIcon + ""; else { + if (t.isEmpty(i)) return; + r = e("
    " + i + "
    ").text(), n = r, o = c._getLayoutTemplate("fileIcon") + } + c.$captionContainer.addClass("icon-visible"), c.$caption.attr("title", r).val(n), t.setHtml(c.$captionIcon, o) + } + }, _createContainer: function () { + var e = this, i = {"class": "file-input file-input-new" + (e.rtl ? " kv-rtl" : "")}, + a = t.createElement(t.cspBuffer.stash(e._renderMain())); + return t.cspBuffer.apply(a), a.insertBefore(e.$element).attr(i), + e._initBrowse(a), e.theme && a.addClass("theme-" + e.theme), a + }, _refreshContainer: function () { + var e = this, i = e.$container, a = e.$element; + a.insertAfter(i), t.setHtml(i, e._renderMain()), e._initBrowse(i), e._validateDisabled() + }, _validateDisabled: function () { + var e = this; + e.$caption.attr({readonly: e.isDisabled}) + }, _renderMain: function () { + var e = this, t = e.dropZoneEnabled ? " file-drop-zone" : "file-drop-disabled", + i = e.showClose ? e._getLayoutTemplate("close") : "", + a = e.showPreview ? e._getLayoutTemplate("preview").setTokens({ + "class": e.previewClass, + dropClass: t + }) : "", r = e.isDisabled ? e.captionClass + " file-caption-disabled" : e.captionClass, + n = e.captionTemplate.setTokens({"class": r + " kv-fileinput-caption"}); + return e.mainTemplate.setTokens({ + "class": e.mainClass + (!e.showBrowse && e.showCaption ? " no-browse" : ""), + preview: a, + close: i, + caption: n, + upload: e._renderButton("upload"), + remove: e._renderButton("remove"), + cancel: e._renderButton("cancel"), + pause: e._renderButton("pause"), + browse: e._renderButton("browse") + }) + }, _renderButton: function (e) { + var i = this, a = i._getLayoutTemplate("btnDefault"), r = i[e + "Class"], n = i[e + "Title"], + o = i[e + "Icon"], l = i[e + "Label"], s = i.isDisabled ? " disabled" : "", d = "button"; + switch (e) { + case"remove": + if (!i.showRemove) return ""; + break; + case"cancel": + if (!i.showCancel) return ""; + r += " kv-hidden"; + break; + case"pause": + if (!i.showPause) return ""; + r += " kv-hidden"; + break; + case"upload": + if (!i.showUpload) return ""; + i.isAjaxUpload && !i.isDisabled ? a = i._getLayoutTemplate("btnLink").replace("{href}", i.uploadUrl) : d = "submit"; + break; + case"browse": + if (!i.showBrowse) return ""; + a = i._getLayoutTemplate("btnBrowse"); + break; + default: + return "" + } + return r += "browse" === e ? " btn-file" : " fileinput-" + e + " fileinput-" + e + "-button", t.isEmpty(l) || (l = ' ' + l + ""), a.setTokens({ + type: d, + css: r, + title: n, + status: s, + icon: o, + label: l + }) + }, _renderThumbProgress: function () { + var e = this; + return '
    ' + e.progressInfoTemplate.setTokens({ + percent: 101, + status: e.msgUploadBegin, + stats: "" + }) + "
    " + }, _renderFileFooter: function (e, i, a, r, n) { + var o, l, s = this, d = s.fileActionSettings, c = d.showRemove, u = d.showDrag, p = d.showUpload, + f = d.showZoom, g = s._getLayoutTemplate("footer"), m = s._getLayoutTemplate("indicator"), + h = n ? d.indicatorError : d.indicatorNew, v = n ? d.indicatorErrorTitle : d.indicatorNewTitle, + w = m.setTokens({indicator: h, indicatorTitle: v}); + return a = s._getSize(a), l = { + type: e, + caption: i, + size: a, + width: r, + progress: "", + indicator: w + }, s.isAjaxUpload ? (l.progress = s._renderThumbProgress(), l.actions = s._renderFileActions(l, p, !1, c, f, u, !1, !1, !1)) : l.actions = s._renderFileActions(l, !1, !1, !1, f, u, !1, !1, !1), o = g.setTokens(l), o = t.replaceTags(o, s.previewThumbTags) + }, _renderFileActions: function (e, t, i, a, r, n, o, l, s, d, c, u) { + var p = this; + if (!e.type && d && (e.type = "image"), p.enableResumableUpload ? t = !1 : "function" == typeof t && (t = t(e)), "function" == typeof i && (i = i(e)), "function" == typeof a && (a = a(e)), "function" == typeof r && (r = r(e)), "function" == typeof n && (n = n(e)), !(t || i || a || r || n)) return ""; + var f, g = l === !1 ? "" : ' data-url="' + l + '"', m = "", h = "", + v = s === !1 ? "" : ' data-key="' + s + '"', w = "", b = "", _ = "", + C = p._getLayoutTemplate("actions"), y = p.fileActionSettings, + x = p.otherActionButtons.setTokens({dataKey: v, key: s}), + T = o ? y.removeClass + " disabled" : y.removeClass; + return a && (w = p._getLayoutTemplate("actionDelete").setTokens({ + removeClass: T, + removeIcon: y.removeIcon, + removeTitle: y.removeTitle, + dataUrl: g, + dataKey: v, + key: s + })), t && (b = p._getLayoutTemplate("actionUpload").setTokens({ + uploadClass: y.uploadClass, + uploadIcon: y.uploadIcon, + uploadTitle: y.uploadTitle + })), i && (_ = p._getLayoutTemplate("actionDownload").setTokens({ + downloadClass: y.downloadClass, + downloadIcon: y.downloadIcon, + downloadTitle: y.downloadTitle, + downloadUrl: c || p.initialPreviewDownloadUrl + }), _ = _.setTokens({ + filename: u, + key: s + })), r && (m = p._getLayoutTemplate("actionZoom").setTokens({ + zoomClass: y.zoomClass, + zoomIcon: y.zoomIcon, + zoomTitle: y.zoomTitle + })), n && d && (f = "drag-handle-init " + y.dragClass, h = p._getLayoutTemplate("actionDrag").setTokens({ + dragClass: f, + dragTitle: y.dragTitle, + dragIcon: y.dragIcon + })), C.setTokens({"delete": w, upload: b, download: _, zoom: m, drag: h, other: x}) + }, _browse: function (e) { + var t = this; + e && e.isDefaultPrevented() || !t._raise("filebrowse") || (t.isError && !t.isAjaxUpload && t.clear(), t.focusCaptionOnBrowse && t.$captionContainer.focus()) + }, _change: function (i) { + var a = this; + if (!a.changeTriggered) { + var r, n, o, l, s = a.$element, d = arguments.length > 1, c = a.isAjaxUpload, + u = d ? arguments[1] : s[0].files, p = a.fileManager.count(), f = t.isEmpty(s.attr("multiple")), + g = !c && f ? 1 : a.maxFileCount, m = a.maxTotalFileCount, h = m > 0 && m > g, v = f && p > 0, + w = function (t, i, r, n) { + var o = e.extend(!0, {}, a._getOutData(null, {}, {}, u), {id: r, index: n}), + l = {id: r, index: n, file: i, files: u}; + return a.isPersistentError = !0, c ? a._showFileError(t, o) : a._showError(t, l) + }, b = function (e, t, i) { + var r = i ? a.msgTotalFilesTooMany : a.msgFilesTooMany; + r = r.replace("{m}", t).replace("{n}", e), a.isError = w(r, null, null, null), a.$captionContainer.removeClass("icon-visible"), a._setCaption("", !0), a.$container.removeClass("file-input-new file-input-ajax-new") + }; + if (a.reader = null, a._resetUpload(), a._hideFileIcon(), a.dropZoneEnabled && a.$container.find(".file-drop-zone ." + a.dropZoneTitleClass).remove(), c || (u = i.target && void 0 === i.target.files ? i.target.value ? [{name: i.target.value.replace(/^.+\\/, "")}] : [] : i.target.files || {}), r = u, t.isEmpty(r) || 0 === r.length) return c || a.clear(), void a._raise("fileselectnone"); + if (a._resetErrors(), l = r.length, o = c ? a.fileManager.count() + l : l, n = a._getFileCount(o, h ? !1 : void 0), g > 0 && n > g) { + if (!a.autoReplace || l > g) return void b(a.autoReplace && l > g ? l : n, g); + n > g && a._resetPreviewThumbs(c) + } else { + if (h && (n = a._getFileCount(o, !0), m > 0 && n > m)) { + if (!a.autoReplace || l > g) return void b(a.autoReplace && l > m ? l : n, m, !0); + n > g && a._resetPreviewThumbs(c) + } + !c || v ? (a._resetPreviewThumbs(!1), v && a.clearFileStack()) : !c || 0 !== p || a.previewCache.count(!0) && !a.overwriteInitial || a._resetPreviewThumbs(!0) + } + a.readFiles(r) + } + }, _abort: function (t) { + var i, a = this; + return a.ajaxAborted && "object" == typeof a.ajaxAborted && void 0 !== a.ajaxAborted.message ? (i = e.extend(!0, {}, a._getOutData(null), t), i.abortData = a.ajaxAborted.data || {}, i.abortMessage = a.ajaxAborted.message, a._setProgress(101, a.$progress, a.msgCancelled), a._showFileError(a.ajaxAborted.message, i, "filecustomerror"), a.cancel(), !0) : !!a.ajaxAborted + }, _resetFileStack: function () { + var t = this, i = 0; + t._getThumbs().each(function () { + var a = e(this), r = a.attr("data-fileindex"), n = a.attr("id"); + "-1" !== r && -1 !== r && (t.fileManager.getFile(a.attr("data-fileid")) ? a.attr({"data-fileindex": "-1"}) : (a.attr({"data-fileindex": i}), i++), t._getZoom(n).attr({"data-fileindex": a.attr("data-fileindex")})) + }) + }, _isFileSelectionValid: function (e) { + var t = this; + return e = e || 0, t.required && !t.getFilesCount() ? (t.$errorContainer.html(""), t._showFileError(t.msgFileRequired), !1) : t.minFileCount > 0 && t._getFileCount(e) < t.minFileCount ? (t._noFilesError({}), !1) : !0 + }, _canPreview: function (e) { + var i = this; + if (!(e && i.showPreview && i.$preview && i.$preview.length)) return !1; + var a, r, n, o, l = e.name || "", s = e.type || "", d = (e.size || 0) / 1e3, c = i._parseFileType(s, l), + u = i.allowedPreviewTypes, p = i.allowedPreviewMimeTypes, f = i.allowedPreviewExtensions || [], + g = i.disabledPreviewTypes, m = i.disabledPreviewMimeTypes, h = i.disabledPreviewExtensions || [], + v = i.maxFilePreviewSize && parseFloat(i.maxFilePreviewSize) || 0, + w = new RegExp("\\.(" + f.join("|") + ")$", "i"), b = new RegExp("\\.(" + h.join("|") + ")$", "i"); + return a = !u || -1 !== u.indexOf(c), r = !p || -1 !== p.indexOf(s), n = !f.length || t.compare(l, w), o = g && -1 !== g.indexOf(c) || m && -1 !== m.indexOf(s) || h.length && t.compare(l, b) || v && !isNaN(v) && d > v, !o && (a || r || n) + }, addToStack: function (e, t) { + this.fileManager.add(e, t) + }, clearFileStack: function () { + var e = this; + return e.fileManager.clear(), e._initResumableUpload(), e.enableResumableUpload ? (null === e.showPause && (e.showPause = !0), null === e.showCancel && (e.showCancel = !1)) : (e.showPause = !1, null === e.showCancel && (e.showCancel = !0)), e.$element + }, getFileStack: function () { + return this.fileManager.stack + }, getFileList: function () { + return this.fileManager.list() + }, getFilesCount: function (e) { + var t = this, i = t.isAjaxUpload ? t.fileManager.count() : t._inputFileCount(); + return e && (i += t.previewCache.count(!0)), t._getFileCount(i) + }, readFiles: function (i) { + this.reader = new FileReader; + var a, r = this, n = r.reader, o = r.$previewContainer, l = r.$previewStatus, s = r.msgLoading, + d = r.msgProgress, c = r.previewInitId, u = i.length, p = r.fileTypeSettings, f = r.allowedFileTypes, + g = f ? f.length : 0, m = r.allowedFileExtensions, h = t.isEmpty(m) ? "" : m.join(", "), + v = function (t, n, o, l, s) { + var d, c = e.extend(!0, {}, r._getOutData(null, {}, {}, i), {id: o, index: l, fileId: s}), + p = {id: o, index: l, fileId: s, file: n, files: i}; + removeThumb || r._previewDefault(n, !0), d = r._getFrame(o, !0), r.isAjaxUpload ? setTimeout(function () { + a(l + 1) + }, r.processDelay) : (r.unlock(), u = 0), r.removeFromPreviewOnError && d.length ? d.remove() : (r._initFileActions(), d.find(".kv-file-upload").remove()), r.isPersistentError = !0, r.isError = r.isAjaxUpload ? r._showFileError(t, c) : r._showError(t, p), r._updateFileDetails(u) + }; + r.fileManager.clearImages(), e.each(i, function (e, t) { + var i = r.fileTypeSettings.image; + i && i(t.type) && r.fileManager.totalImages++ + }), a = function (w) { + var b, _ = r.$errorContainer, C = r.fileManager; + if (w >= u) return r.unlock(), r.duplicateErrors.length && (b = "
  • " + r.duplicateErrors.join("
  • ") + "
  • ", 0 === _.find("ul").length ? t.setHtml(_, r.errorCloseButton + "
      " + b + "
    ") : _.find("ul").append(b), _.fadeIn(r.fadeDelay), r._handler(_.find(".kv-error-close"), "click", function () { + _.fadeOut(r.fadeDelay) + }), r.duplicateErrors = []), r.isAjaxUpload ? (r._raise("filebatchselected", [C.stack]), 0 !== C.count() || r.isError || r.reset()) : r._raise("filebatchselected", [i]), o.removeClass("file-thumb-loading"), void l.html(""); + r.lock(!0); + var y, x, T, P, k, E, F, S, I, A, D, z, M, j, U = i[w], $ = c + "-" + r._getFileId(U), R = p.text, + O = p.image, B = p.html, L = r._getFileName(U, ""), N = (U && U.size || 0) / 1e3, Z = "", + H = t.createObjectURL(U), W = 0, q = "", V = !1, K = 0, G = function () { + var e = d.setTokens({index: w + 1, files: u, percent: 50, name: L}); + setTimeout(function () { + l.html(e), r._updateFileDetails(u), a(w + 1) + }, r.processDelay), r._raise("fileloaded", [U, $, w, n]) && r.isAjaxUpload && C.add(U) + }; + if (U) { + if (S = C.getId(U), g > 0) for (x = 0; g > x; x++) E = f[x], F = r.msgFileTypes[E] || E, q += 0 === x ? F : ", " + F; + if (L === !1) return void a(w + 1); + if (0 === L.length) return T = r.msgInvalidFileName.replace("{name}", t.htmlEncode(t.getFileName(U), "[unknown]")), void v(T, U, $, w, S); + if (t.isEmpty(m) || (Z = new RegExp("\\.(" + m.join("|") + ")$", "i")), y = N.toFixed(2), r.isAjaxUpload && C.exists(S) || r._getFrame($, !0).length) { + var Y = {id: $, index: w, fileId: S, file: U, files: i}; + return T = r.msgDuplicateFile.setTokens({ + name: L, + size: y + }), void (r.isAjaxUpload ? (r.duplicateErrors.push(T), r.isDuplicateError = !0, r._raise("fileduplicateerror", [U, S, L, y, $, w]), a(w + 1), r._updateFileDetails(u)) : (r._showError(T, Y), r.unlock(), u = 0, r._clearFileInput(), r.reset(), r._updateFileDetails(u))) + } + if (r.maxFileSize > 0 && N > r.maxFileSize) return T = r.msgSizeTooLarge.setTokens({ + name: L, + size: y, + maxSize: r.maxFileSize + }), void v(T, U, $, w, S); + if (null !== r.minFileSize && N <= t.getNum(r.minFileSize)) return T = r.msgSizeTooSmall.setTokens({ + name: L, + size: y, + minSize: r.minFileSize + }), void v(T, U, $, w, S); + if (!t.isEmpty(f) && t.isArray(f)) { + for (x = 0; x < f.length; x += 1) P = f[x], A = p[P], W += A && "function" == typeof A && A(U.type, t.getFileName(U)) ? 1 : 0; + if (0 === W) return T = r.msgInvalidFileType.setTokens({ + name: L, + types: q + }), void v(T, U, $, w, S) + } + if (0 === W && !t.isEmpty(m) && t.isArray(m) && !t.isEmpty(Z) && (k = t.compare(L, Z), W += t.isEmpty(k) ? 0 : k.length, 0 === W)) return T = r.msgInvalidFileExtension.setTokens({ + name: L, + extensions: h + }), void v(T, U, $, w, S); + if (!r._canPreview(U)) return I = r.isAjaxUpload && r._raise("filebeforeload", [U, w, n]), r.isAjaxUpload && I && C.add(U), r.showPreview && I && (o.addClass("file-thumb-loading"), r._previewDefault(U), r._initFileActions()), void setTimeout(function () { + I && r._updateFileDetails(u), a(w + 1), r._raise("fileloaded", [U, $, w]) + }, 10); + D = R(U.type, L), z = B(U.type, L), M = O(U.type, L), l.html(s.replace("{index}", w + 1).replace("{files}", u)), o.addClass("file-thumb-loading"), n.onerror = function (e) { + r._errorHandler(e, L) + }, n.onload = function (i) { + var a, s, d, c, u, f, g = [], m = function (e) { + var t = new FileReader; + t.onerror = function (e) { + r._errorHandler(e, L) + }, t.onload = function (e) { + return r.isAjaxUpload && !r._raise("filebeforeload", [U, w, n]) ? (V = !0, r._resetCaption(), n.abort(), l.html(""), o.removeClass("file-thumb-loading"), void r.enable()) : (r._previewFile(w, U, e, H, s), r._initFileActions(), void G()) + }, e ? t.readAsText(U, r.textEncoding) : t.readAsDataURL(U) + }; + if (s = {name: L, type: U.type}, e.each(p, function (e, t) { + "object" !== e && "other" !== e && "function" == typeof t && t(U.type, L) && K++ + }), 0 === K) { + for (d = new Uint8Array(i.target.result), x = 0; x < d.length; x++) c = d[x].toString(16), g.push(c); + if (a = g.join("").toLowerCase().substring(0, 8), f = t.getMimeType(a, "", ""), t.isEmpty(f) && (u = t.arrayBuffer2String(n.result), f = t.isSvg(u) ? "image/svg+xml" : t.getMimeType(a, u, U.type)), s = { + name: L, + type: f + }, D = R(f, ""), z = B(f, ""), M = O(f, ""), j = D || z, j || M) return void m(j) + } + return r.isAjaxUpload && !r._raise("filebeforeload", [U, w, n]) ? (V = !0, r._resetCaption(), n.abort(), l.html(""), o.removeClass("file-thumb-loading"), void r.enable()) : (r._previewFile(w, U, i, H, s), r._initFileActions(), void G()) + }, n.onprogress = function (e) { + if (e.lengthComputable) { + var t = e.loaded / e.total * 100, i = Math.ceil(t); + T = d.setTokens({index: w + 1, files: u, percent: i, name: L}), setTimeout(function () { + V || l.html(T) + }, r.processDelay) + } + }, D || z ? n.readAsText(U, r.textEncoding) : M ? n.readAsDataURL(U) : n.readAsArrayBuffer(U) + } + }, a(0), r._updateFileDetails(u, !0) + }, lock: function (e) { + var t = this, i = t.$container; + return t._resetErrors(), t.disable(), !e && t.showCancel && i.find(".fileinput-cancel").show(), !e && t.showPause && i.find(".fileinput-pause").show(), t._raise("filelock", [t.fileManager.stack, t._getExtraData()]), t.$element + }, unlock: function (e) { + var t = this, i = t.$container; + return void 0 === e && (e = !0), t.enable(), i.removeClass("is-locked"), t.showCancel && i.find(".fileinput-cancel").hide(), t.showPause && i.find(".fileinput-pause").hide(), e && t._resetFileStack(), t._raise("fileunlock", [t.fileManager.stack, t._getExtraData()]), t.$element + }, resume: function () { + var e = this, t = !1, i = e.resumableManager; + return e.enableResumableUpload ? (e.paused ? e._toggleResumableProgress(e.progressPauseTemplate, e.msgUploadResume) : t = !0, e.paused = !1, t && e._toggleResumableProgress(e.progressInfoTemplate, e.msgUploadBegin), setTimeout(function () { + i.upload() + }, e.processDelay), e.$element) : e.$element + }, pause: function () { + var t, i = this, a = i.resumableManager, r = i.ajaxRequests, n = r.length, o = a.getProgress(), + l = i.fileActionSettings, s = i.taskManager, d = s.getPool(a.id); + if (!i.enableResumableUpload) return i.$element; + if (d && d.cancel(), i._raise("fileuploadpaused", [i.fileManager, a]), n > 0) for (t = 0; n > t; t += 1) i.paused = !0, r[t].abort(); + return i.showPreview && i._getThumbs().each(function () { + var t, a = e(this), r = a.attr("data-fileid"), n = i._getLayoutTemplate("stats"), + s = a.find(".file-upload-indicator"); + a.removeClass("file-uploading"), s.attr("title") === l.indicatorLoadingTitle && (i._setThumbStatus(a, "Paused"), t = n.setTokens({ + pendingTime: i.msgPaused, + uploadSpeed: "" + }), i.paused = !0, i._setProgress(o, a.find(".file-thumb-progress"), o + "%", t)), i.fileManager.getFile(r) || a.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled") + }), i._setProgress(101, i.$progress, i.msgPaused), i.$element + }, cancel: function () { + var t, i = this, a = i.ajaxRequests, r = i.resumableManager, n = i.taskManager, + o = r ? n.getPool(r.id) : void 0, l = a.length; + if (i.enableResumableUpload && o ? (o.cancel().done(function () { + i._setProgressCancelled() + }), r.reset(), i._raise("fileuploadcancelled", [i.fileManager, r])) : i._raise("fileuploadcancelled", [i.fileManager]), i._initAjax(), l > 0) for (t = 0; l > t; t += 1) i.cancelling = !0, a[t].abort(); + return i._getThumbs().each(function () { + var t = e(this), a = t.attr("data-fileid"), r = t.find(".file-thumb-progress"); + t.removeClass("file-uploading"), i._setProgress(0, r), r.hide(), i.fileManager.getFile(a) || (t.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"), t.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")), i.unlock() + }), setTimeout(function () { + i._setProgressCancelled() + }, i.processDelay), i.$element + }, clear: function () { + var i, a = this; + if (a._raise("fileclear")) return a.$btnUpload.removeAttr("disabled"), a._getThumbs().find("video,audio,img").each(function () { + t.cleanMemory(e(this)) + }), a._clearFileInput(), a._resetUpload(), a.clearFileStack(), a.isDuplicateError = !1, a.isPersistentError = !1, a._resetErrors(!0), a._hasInitialPreview() ? (a._showFileIcon(), a._resetPreview(), a._initPreviewActions(), a.$container.removeClass("file-input-new")) : (a._getThumbs().each(function () { + a._clearObjects(e(this)) + }), a.isAjaxUpload && (a.previewCache.data = {}), a.$preview.html(""), i = !a.overwriteInitial && a.initialCaption.length > 0 ? a.initialCaption : "", a.$caption.attr("title", "").val(i), t.addCss(a.$container, "file-input-new"), a._validateDefaultPreview()), 0 === a.$container.find(t.FRAMES).length && (a._initCaption() || a.$captionContainer.removeClass("icon-visible")), a._hideFileIcon(), a.focusCaptionOnClear && a.$captionContainer.focus(), a._setFileDropZoneTitle(), a._raise("filecleared"), a.$element + }, reset: function () { + var e = this; + if (e._raise("filereset")) return e.lastProgress = 0, e._resetPreview(), e.$container.find(".fileinput-filename").text(""), t.addCss(e.$container, "file-input-new"), e.getFrames().length && e.$container.removeClass("file-input-new"), e.clearFileStack(), e._setFileDropZoneTitle(), e.$element + }, disable: function () { + var e = this, i = e.$container; + return e.isDisabled = !0, e._raise("filedisabled"), e.$element.attr("disabled", "disabled"), i.addClass("is-locked"), t.addCss(i.find(".btn-file"), "disabled"), i.find(".kv-fileinput-caption").addClass("file-caption-disabled"), i.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled", !0), e._initDragDrop(), e.$element + }, enable: function () { + var e = this, t = e.$container; + return e.isDisabled = !1, e._raise("fileenabled"), e.$element.removeAttr("disabled"), t.removeClass("is-locked"), t.find(".kv-fileinput-caption").removeClass("file-caption-disabled"), t.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"), t.find(".btn-file").removeClass("disabled"), e._initDragDrop(), e.$element + }, upload: function () { + var i, a, r = this, n = r.fileManager, o = n.count(), l = !e.isEmptyObject(r._getExtraData()); + if (r.isAjaxUpload && !r.isDisabled && r._isFileSelectionValid(o)) return r.lastProgress = 0, r._resetUpload(), 0 !== o || l ? (r.cancelling = !1, r._showProgress(), r.lock(), 0 === o && l ? (r._setProgress(2), void r._uploadExtraOnly()) : r.enableResumableUpload ? r.resume() : ((r.uploadAsync || r.enableResumableUpload) && (a = r._getOutData(null), r._raise("filebatchpreupload", [a]), r.fileBatchCompleted = !1, r.uploadCache = [], e.each(r.getFileStack(), function (e) { + var t = r._getThumbId(e); + r.uploadCache.push({id: t, content: null, config: null, tags: null, append: !0}) + }), r.$preview.find(".file-preview-initial").removeClass(t.SORT_CSS), r._initSortable()), r._setProgress(2), r.hasInitData = !1, r.uploadAsync ? (i = 0, void e.each(n.stack, function (e) { + r._uploadSingle(i, e, !0), i++ + })) : (r._uploadBatch(), r.$element))) : void r._showFileError(r.msgUploadEmpty) + }, destroy: function () { + var t = this, i = t.$form, a = t.$container, r = t.$element, n = t.namespace; + return e(document).off(n), e(window).off(n), i && i.length && i.off(n), t.isAjaxUpload && t._clearFileInput(), t._cleanup(), t._initPreviewCache(), r.insertBefore(a).off(n).removeData(), a.off().remove(), r + }, refresh: function (i) { + var a = this, r = a.$element; + return i = "object" != typeof i || t.isEmpty(i) ? a.options : e.extend(!0, {}, a.options, i), a._init(i, !0), a._listen(), r + }, zoom: function (e) { + var t = this, i = t._getFrame(e); + t._showModal(i) + }, getExif: function (e) { + var t = this, i = t._getFrame(e); + return i && i.data("exif") || null + }, getFrames: function (i) { + var a, r = this; + return i = i || "", a = r.$preview.find(t.FRAMES + i), r.reversePreviewOrder && (a = e(a.get().reverse())), a + }, getPreview: function () { + var e = this; + return {content: e.initialPreview, config: e.initialPreviewConfig, tags: e.initialPreviewThumbTags} + } + }, e.fn.fileinput = function (a) { + if (t.hasFileAPISupport() || t.isIE(9)) { + var r = Array.apply(null, arguments), n = []; + switch (r.shift(), this.each(function () { + var o, l = e(this), s = l.data("fileinput"), d = "object" == typeof a && a, + c = d.theme || l.data("theme"), u = {}, p = {}, + f = d.language || l.data("language") || e.fn.fileinput.defaults.language || "en"; + s || (c && (p = e.fn.fileinputThemes[c] || {}), "en" === f || t.isEmpty(e.fn.fileinputLocales[f]) || (u = e.fn.fileinputLocales[f] || {}), o = e.extend(!0, {}, e.fn.fileinput.defaults, p, e.fn.fileinputLocales.en, u, d, l.data()), s = new i(this, o), l.data("fileinput", s)), "string" == typeof a && n.push(s[a].apply(s, r)) + }), n.length) { + case 0: + return this; + case 1: + return n[0]; + default: + return n + } + } + }; + var a = 'class="kv-preview-data file-preview-pdf" src="{renderer}?file={data}" {style}'; + e.fn.fileinput.defaults = { + language: "en", + showCaption: !0, + showBrowse: !0, + showPreview: !0, + showRemove: !0, + showUpload: !0, + showUploadStats: !0, + showCancel: null, + showPause: null, + showClose: !0, + showUploadedThumbs: !0, + showConsoleLogs: !1, + browseOnZoneClick: !1, + autoReplace: !1, + autoOrientImage: function () { + var e = window.navigator.userAgent, t = !!e.match(/WebKit/i), i = !!e.match(/iP(od|ad|hone)/i), + a = i && t && !e.match(/CriOS/i); + return !a + }, + autoOrientImageInitial: !0, + required: !1, + rtl: !1, + hideThumbnailContent: !1, + encodeUrl: !0, + focusCaptionOnBrowse: !0, + focusCaptionOnClear: !0, + generateFileId: null, + previewClass: "", + captionClass: "", + frameClass: "krajee-default", + mainClass: "file-caption-main", + mainTemplate: null, + purifyHtml: !0, + fileSizeGetter: null, + initialCaption: "", + initialPreview: [], + initialPreviewDelimiter: "*$$*", + initialPreviewAsData: !1, + initialPreviewFileType: "image", + initialPreviewConfig: [], + initialPreviewThumbTags: [], + previewThumbTags: {}, + initialPreviewShowDelete: !0, + initialPreviewDownloadUrl: "", + removeFromPreviewOnError: !1, + deleteUrl: "", + deleteExtraData: {}, + overwriteInitial: !0, + sanitizeZoomCache: function (e) { + var i = t.createElement(e); + return i.find("input,select,.file-thumbnail-footer").remove(), i.html() + }, + previewZoomButtonIcons: { + prev: '', + next: '', + toggleheader: '', + fullscreen: '', + borderless: '', + close: '' + }, + previewZoomButtonClasses: { + prev: "btn btn-navigate", + next: "btn btn-navigate", + toggleheader: "btn btn-sm btn-kv btn-default btn-outline-secondary", + fullscreen: "btn btn-sm btn-kv btn-default btn-outline-secondary", + borderless: "btn btn-sm btn-kv btn-default btn-outline-secondary", + close: "btn btn-sm btn-kv btn-default btn-outline-secondary" + }, + previewTemplates: {}, + previewContentTemplates: {}, + preferIconicPreview: !1, + preferIconicZoomPreview: !1, + allowedFileTypes: null, + allowedFileExtensions: null, + allowedPreviewTypes: void 0, + allowedPreviewMimeTypes: null, + allowedPreviewExtensions: null, + disabledPreviewTypes: void 0, + disabledPreviewExtensions: ["msi", "exe", "com", "zip", "rar", "app", "vb", "scr"], + disabledPreviewMimeTypes: null, + defaultPreviewContent: null, + customLayoutTags: {}, + customPreviewTags: {}, + previewFileIcon: '', + previewFileIconClass: "file-other-icon", + previewFileIconSettings: {}, + previewFileExtSettings: {}, + buttonLabelClass: "hidden-xs", + browseIcon: ' ', + browseClass: "btn btn-primary", + removeIcon: '', + removeClass: "btn btn-default btn-secondary", + cancelIcon: '', + cancelClass: "btn btn-default btn-secondary", + pauseIcon: '', + pauseClass: "btn btn-default btn-secondary", + uploadIcon: '', + uploadClass: "btn btn-default btn-secondary", + uploadUrl: null, + uploadUrlThumb: null, + uploadAsync: !0, + uploadParamNames: { + chunkCount: "chunkCount", + chunkIndex: "chunkIndex", + chunkSize: "chunkSize", + chunkSizeStart: "chunkSizeStart", + chunksUploaded: "chunksUploaded", + fileBlob: "fileBlob", + fileId: "fileId", + fileName: "fileName", + fileRelativePath: "fileRelativePath", + fileSize: "fileSize", + retryCount: "retryCount" + }, + maxAjaxThreads: 5, + fadeDelay: 800, + processDelay: 100, + queueDelay: 10, + progressDelay: 0, + enableResumableUpload: !1, + resumableUploadOptions: { + fallback: null, + testUrl: null, + chunkSize: 2048, + maxThreads: 4, + maxRetries: 3, + showErrorLog: !0 + }, + uploadExtraData: {}, + zoomModalHeight: 480, + minImageWidth: null, + minImageHeight: null, + maxImageWidth: null, + maxImageHeight: null, + resizeImage: !1, + resizePreference: "width", + resizeQuality: .92, + resizeDefaultImageType: "image/jpeg", + resizeIfSizeMoreThan: 0, + minFileSize: 0, + maxFileSize: 0, + maxFilePreviewSize: 25600, + minFileCount: 0, + maxFileCount: 0, + maxTotalFileCount: 0, + validateInitialCount: !1, + msgValidationErrorClass: "text-danger", + msgValidationErrorIcon: ' ', + msgErrorClass: "file-error-message", + progressThumbClass: "progress-bar progress-bar-striped active", + progressClass: "progress-bar bg-success progress-bar-success progress-bar-striped active", + progressInfoClass: "progress-bar bg-info progress-bar-info progress-bar-striped active", + progressCompleteClass: "progress-bar bg-success progress-bar-success", + progressPauseClass: "progress-bar bg-primary progress-bar-primary progress-bar-striped active", + progressErrorClass: "progress-bar bg-danger progress-bar-danger", + progressUploadThreshold: 99, + previewFileType: "image", + elCaptionContainer: null, + elCaptionText: null, + elPreviewContainer: null, + elPreviewImage: null, + elPreviewStatus: null, + elErrorContainer: null, + errorCloseButton: t.closeButton("kv-error-close"), + slugCallback: null, + dropZoneEnabled: !0, + dropZoneTitleClass: "file-drop-zone-title", + fileActionSettings: {}, + otherActionButtons: "", + textEncoding: "UTF-8", + ajaxSettings: {}, + ajaxDeleteSettings: {}, + showAjaxErrorDetails: !0, + mergeAjaxCallbacks: !1, + mergeAjaxDeleteCallbacks: !1, + retryErrorUploads: !0, + reversePreviewOrder: !1, + usePdfRenderer: function () { + var e = !!window.MSInputMethodContext && !!document.documentMode; + return !!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/i) || e + }, + pdfRendererUrl: "", + pdfRendererTemplate: "" + }, e.fn.fileinputLocales.en = { + fileSingle: "file", + filePlural: "files", + browseLabel: "Browse …", + removeLabel: "Remove", + removeTitle: "Clear all unprocessed files", + cancelLabel: "Cancel", + cancelTitle: "Abort ongoing upload", + pauseLabel: "Pause", + pauseTitle: "Pause ongoing upload", + uploadLabel: "Upload", + uploadTitle: "Upload selected files", + msgNo: "No", + msgNoFilesSelected: "No files selected", + msgCancelled: "Cancelled", + msgPaused: "Paused", + msgPlaceholder: "Select {files} ...", + msgZoomModalHeading: "Detailed Preview", + msgFileRequired: "You must select a file to upload.", + msgSizeTooSmall: 'File "{name}" ({size} KB) is too small and must be larger than {minSize} KB.', + msgSizeTooLarge: 'File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB.', + msgFilesTooLess: "You must select at least {n} {files} to upload.", + msgFilesTooMany: "Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.", + msgTotalFilesTooMany: "You can upload a maximum of {m} files ({n} files detected).", + msgFileNotFound: 'File "{name}" not found!', + msgFileSecured: 'Security restrictions prevent reading the file "{name}".', + msgFileNotReadable: 'File "{name}" is not readable.', + msgFilePreviewAborted: 'File preview aborted for "{name}".', + msgFilePreviewError: 'An error occurred while reading the file "{name}".', + msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".', + msgInvalidFileType: 'Invalid type for file "{name}". Only "{types}" files are supported.', + msgInvalidFileExtension: 'Invalid extension for file "{name}". Only "{extensions}" files are supported.', + msgFileTypes: { + image: "image", + html: "HTML", + text: "text", + video: "video", + audio: "audio", + flash: "flash", + pdf: "PDF", + object: "object" + }, + msgUploadAborted: "The file upload was aborted", + msgUploadThreshold: "Processing …", + msgUploadBegin: "Initializing …", + msgUploadEnd: "Done", + msgUploadResume: "Resuming upload …", + msgUploadEmpty: "No valid data available for upload.", + msgUploadError: "Upload Error", + msgDeleteError: "Delete Error", + msgProgressError: "Error", + msgValidationError: "Validation Error", + msgLoading: "Loading file {index} of {files} …", + msgProgress: "Loading file {index} of {files} - {name} - {percent}% completed.", + msgSelected: "{n} {files} selected", + msgFoldersNotAllowed: "Drag & drop files only! {n} folder(s) dropped were skipped.", + msgImageWidthSmall: 'Width of image file "{name}" must be at least {size} px.', + msgImageHeightSmall: 'Height of image file "{name}" must be at least {size} px.', + msgImageWidthLarge: 'Width of image file "{name}" cannot exceed {size} px.', + msgImageHeightLarge: 'Height of image file "{name}" cannot exceed {size} px.', + msgImageResizeError: "Could not get the image dimensions to resize.", + msgImageResizeException: "Error while resizing the image.
    {errors}
    ", + msgAjaxError: "Something went wrong with the {operation} operation. Please try again later!", + msgAjaxProgressError: "{operation} failed", + msgDuplicateFile: 'File "{name}" of same size "{size} KB" has already been selected earlier. Skipping duplicate selection.', + msgResumableUploadRetriesExceeded: "Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ", + msgPendingTime: "{time} remaining", + msgCalculatingTime: "calculating time remaining", + ajaxOperations: { + deleteThumb: "file delete", + uploadThumb: "file upload", + uploadBatch: "batch file upload", + uploadExtra: "form data upload" + }, + dropZoneTitle: "Drag & drop files here …", + dropZoneClickTitle: "
    (or click to select {files})", + previewZoomButtonTitles: { + prev: "View previous file", + next: "View next file", + toggleheader: "Toggle header", + fullscreen: "Toggle full screen", + borderless: "Toggle borderless mode", + close: "Close detailed preview" + } + }, e.fn.fileinput.Constructor = i, e(document).ready(function () { + var t = e("input.file[type=file]"); + t.length && t.fileinput() + }) +}); \ No newline at end of file diff --git a/static/js/plugins/fileinput/theme.js b/static/js/plugins/fileinput/theme.js new file mode 100644 index 0000000000000000000000000000000000000000..2510dbf4e3fb9b14b45629e1683cfdeb5a312fe6 --- /dev/null +++ b/static/js/plugins/fileinput/theme.js @@ -0,0 +1,40 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Krajee Explorer theme configuration for bootstrap-fileinput. Load this theme file after loading `fileinput.js`. + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */ +(function ($) { + "use strict"; + $.fn.fileinputThemes.explorer = { + layoutTemplates: { + footer: '
    ' + + '
    {caption}
    ' + '{size}{progress}' + + '
    ' + + '
    {indicator} {actions}
    ', + actions: '{drag}\n' + + '
    \n' + + ' \n' + + '
    ', + }, + previewSettings: { + html: {width: "100px", height: "60px"}, + text: {width: "100px", height: "60px"}, + video: {width: "auto", height: "60px"}, + audio: {width: "auto", height: "60px"}, + flash: {width: "100%", height: "60px"}, + object: {width: "100%", height: "60px"}, + pdf: {width: "100px", height: "60px"}, + other: {width: "100%", height: "60px"} + }, + frameClass: 'explorer-frame' + }; +})(window.jQuery); diff --git a/static/js/plugins/fileinput/theme.min.js b/static/js/plugins/fileinput/theme.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f7aeb71796f623ae29b6228badc3967f01052c72 --- /dev/null +++ b/static/js/plugins/fileinput/theme.min.js @@ -0,0 +1,12 @@ +/*! + * bootstrap-fileinput v5.1.2 + * http://plugins.krajee.com/file-input + * + * Krajee Explorer theme configuration for bootstrap-fileinput. Load this theme file after loading `fileinput.js`. + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD-3-Clause + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md + */!function(i){"use strict";i.fn.fileinputThemes.explorer={layoutTemplates:{footer:'
    {caption}
    {size}{progress}
    {indicator} {actions}
    ',actions:'{drag}\n
    \n \n
    '},previewSettings:{html:{width:"100px",height:"60px"},text:{width:"100px",height:"60px"},video:{width:"auto",height:"60px"},audio:{width:"auto",height:"60px"},flash:{width:"100%",height:"60px"},object:{width:"100%",height:"60px"},pdf:{width:"100px",height:"60px"},other:{width:"100%",height:"60px"}},frameClass:"explorer-frame"}}(window.jQuery); diff --git a/static/js/plugins/fileinput/zh.js b/static/js/plugins/fileinput/zh.js new file mode 100644 index 0000000000000000000000000000000000000000..e930478fba59d23a50f18ab23f3583a1ce3b1d6f --- /dev/null +++ b/static/js/plugins/fileinput/zh.js @@ -0,0 +1,113 @@ +/*! + * FileInput Chinese Translations + * + * This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * @see http://github.com/kartik-v/bootstrap-fileinput + * @author kangqf + * + * NOTE: this file must be saved in UTF-8 encoding. + */ +(function ($) { + "use strict"; + + $.fn.fileinputLocales['zh'] = { + fileSingle: '文件', + filePlural: '个文件', + browseLabel: '选择 …', + removeLabel: '移除', + removeTitle: '清除选中文件', + cancelLabel: '取消', + cancelTitle: '取消进行中的上传', + pauseLabel: 'Pause', + pauseTitle: 'Pause ongoing upload', + uploadLabel: '上传', + uploadTitle: '上传选中文件', + msgNo: '没有', + msgNoFilesSelected: '未选择文件', + msgPaused: 'Paused', + msgCancelled: '取消', + msgPlaceholder: '选择 {files} ...', + msgZoomModalHeading: '详细预览', + msgFileRequired: '必须选择一个文件上传.', + msgSizeTooSmall: '文件 "{name}" ({size} KB) 必须大于限定大小 {minSize} KB.', + msgSizeTooLarge: '文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB.', + msgFilesTooLess: '你必须选择最少 {n} {files} 来上传. ', + msgFilesTooMany: '选择的上传文件个数 ({n}) 超出最大文件的限制个数 {m}.', + msgTotalFilesTooMany: 'You can upload a maximum of {m} files ({n} files detected).', + msgFileNotFound: '文件 "{name}" 未找到!', + msgFileSecured: '安全限制,为了防止读取文件 "{name}".', + msgFileNotReadable: '文件 "{name}" 不可读.', + msgFilePreviewAborted: '取消 "{name}" 的预览.', + msgFilePreviewError: '读取 "{name}" 时出现了一个错误.', + msgInvalidFileName: '文件名 "{name}" 包含非法字符.', + msgInvalidFileType: '不正确的类型 "{name}". 只支持 "{types}" 类型的文件.', + msgInvalidFileExtension: '不正确的文件扩展名 "{name}". 只支持 "{extensions}" 的文件扩展名.', + msgFileTypes: { + 'image': 'image', + 'html': 'HTML', + 'text': 'text', + 'video': 'video', + 'audio': 'audio', + 'flash': 'flash', + 'pdf': 'PDF', + 'object': 'object' + }, + msgUploadAborted: '该文件上传被中止', + msgUploadThreshold: '处理中 …', + msgUploadBegin: '正在初始化 …', + msgUploadEnd: '完成', + msgUploadResume: 'Resuming upload …', + msgUploadEmpty: '无效的文件上传.', + msgUploadError: 'Upload Error', + msgDeleteError: 'Delete Error', + msgProgressError: '上传出错', + msgValidationError: '验证错误', + msgLoading: '加载第 {index} 文件 共 {files} …', + msgProgress: '加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.', + msgSelected: '{n} {files} 选中', + msgFoldersNotAllowed: '只支持拖拽文件! 跳过 {n} 拖拽的文件夹.', + msgImageWidthSmall: '图像文件的"{name}"的宽度必须是至少{size}像素.', + msgImageHeightSmall: '图像文件的"{name}"的高度必须至少为{size}像素.', + msgImageWidthLarge: '图像文件"{name}"的宽度不能超过{size}像素.', + msgImageHeightLarge: '图像文件"{name}"的高度不能超过{size}像素.', + msgImageResizeError: '无法获取的图像尺寸调整。', + msgImageResizeException: '调整图像大小时发生错误。
    {errors}
    ', + msgAjaxError: '{operation} 发生错误. 请重试!', + msgAjaxProgressError: '{operation} 失败', + msgDuplicateFile: 'File "{name}" of same size "{size} KB" has already been selected earlier. Skipping duplicate selection.', + msgResumableUploadRetriesExceeded: 'Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ', + msgPendingTime: '{time} remaining', + msgCalculatingTime: 'calculating time remaining', + ajaxOperations: { + deleteThumb: '删除文件', + uploadThumb: '上传文件', + uploadBatch: '批量上传', + uploadExtra: '表单数据上传' + }, + dropZoneTitle: '拖拽文件到这里 …
    支持多文件同时上传', + dropZoneClickTitle: '
    (或点击{files}按钮选择文件)', + fileActionSettings: { + removeTitle: '删除文件', + uploadTitle: '上传文件', + downloadTitle: '下载文件', + uploadRetryTitle: '重试', + zoomTitle: '查看详情', + dragTitle: '移动 / 重置', + indicatorNewTitle: '没有上传', + indicatorSuccessTitle: '上传', + indicatorErrorTitle: '上传错误', + indicatorPausedTitle: 'Upload Paused', + indicatorLoadingTitle: '上传 …' + }, + previewZoomButtonTitles: { + prev: '预览上一个文件', + next: '预览下一个文件', + toggleheader: '缩放', + fullscreen: '全屏', + borderless: '无边界模式', + close: '关闭当前预览' + } + }; +})(window.jQuery); diff --git a/static/js/plugins/rickshaw/vendor/d3.v3.js b/static/js/plugins/rickshaw/vendor/d3.v3.js index 0ac05ba9e62270977eae2313031ccca32beea9d6..b9221bf53266189dc725202f48295c7a97725c1f 100644 --- a/static/js/plugins/rickshaw/vendor/d3.v3.js +++ b/static/js/plugins/rickshaw/vendor/d3.v3.js @@ -1,5 +1,5974 @@ -d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(){}function o(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function a(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=Do.length;r>e;++e){var u=Do[e]+t;if(u in n)return u}}function c(){}function l(){}function s(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function T(n){return Lo(n,Io),n}function q(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t0&&(n=n.substring(0,a));var s=Zo.get(n);return s&&(n=s,l=j),a?t?u:r:t?c:i}function D(n,t){return function(e){var r=mo.event;mo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{mo.event=r}}}function j(n,t){var e=D(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function L(){var n=".dragsuppress-"+ ++Xo,t="touchmove"+n,e="selectstart"+n,r="dragstart"+n,u="click"+n,i=mo.select(_o).on(t,f).on(e,f).on(r,f),o=bo.style,a=o[Vo];return o[Vo]="none",function(t){function e(){i.on(u,null)}i.on(n,null),o[Vo]=a,t&&(i.on(u,function(){f(),e()},!0),setTimeout(e,0))}}function H(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>$o&&(_o.scrollX||_o.scrollY)){e=mo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();$o=!(u.f||u.e),e.remove()}return $o?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function F(n){return n>0?1:0>n?-1:0}function P(n){return n>1?0:-1>n?Bo:Math.acos(n)}function O(n){return n>1?Jo:-1>n?-Jo:Math.asin(n)}function R(n){return((n=Math.exp(n))-1/n)/2}function Y(n){return((n=Math.exp(n))+1/n)/2}function I(n){return((n=Math.exp(2*n))-1)/(n+1)}function U(n){return(n=Math.sin(n/2))*n}function Z(){}function V(n,t,e){return new X(n,t,e)}function X(n,t,e){this.h=n,this.s=t,this.l=e}function $(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,ot(u(n+120),u(n),u(n-120))}function B(n,t,e){return new W(n,t,e)}function W(n,t,e){this.h=n,this.c=t,this.l=e}function J(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),G(e,Math.cos(n*=Qo)*t,Math.sin(n)*t)}function G(n,t,e){return new K(n,t,e)}function K(n,t,e){this.l=n,this.a=t,this.b=e}function Q(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=tt(u)*sa,r=tt(r)*fa,i=tt(i)*ha,ot(rt(3.2404542*u-1.5371385*r-.4985314*i),rt(-.969266*u+1.8760108*r+.041556*i),rt(.0556434*u-.2040259*r+1.0572252*i))}function nt(n,t,e){return n>0?B(Math.atan2(e,t)*na,Math.sqrt(t*t+e*e),n):B(0/0,0/0,n)}function tt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function et(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function rt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n){return ot(n>>16,255&n>>8,255&n)}function it(n){return ut(n)+""}function ot(n,t,e){return new at(n,t,e)}function at(n,t,e){this.r=n,this.g=t,this.b=e}function ct(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function lt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(gt(u[0]),gt(u[1]),gt(u[2]))}return(i=da.get(n))?t(i.r,i.g,i.b):(null!=n&&"#"===n.charAt(0)&&(4===n.length?(o=n.charAt(1),o+=o,a=n.charAt(2),a+=a,c=n.charAt(3),c+=c):7===n.length&&(o=n.substring(1,3),a=n.substring(3,5),c=n.substring(5,7)),o=parseInt(o,16),a=parseInt(a,16),c=parseInt(c,16)),t(o,a,c))}function st(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),V(r,u,c)}function ft(n,t,e){n=ht(n),t=ht(t),e=ht(e);var r=et((.4124564*n+.3575761*t+.1804375*e)/sa),u=et((.2126729*n+.7151522*t+.072175*e)/fa),i=et((.0193339*n+.119192*t+.9503041*e)/ha);return G(116*u-16,500*(r-u),200*(u-i))}function ht(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function pt(n){return"function"==typeof n?n:function(){return n}}function dt(n){return n}function vt(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),mt(t,e,n,r)}}function mt(n,t,e,r){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=mo.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!_o.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=mo.event;mo.event=n;try{o.progress.call(i,c)}finally{mo.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Mo(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},mo.rebind(i,o,"on"),null==r?i:i.get(yt(r))}function yt(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Mt(){var n=bt(),t=_t()-n;t>24?(isFinite(t)&&(clearTimeout(Ma),Ma=setTimeout(Mt,t)),ya=0):(ya=1,ba(Mt))}function xt(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now()),xa.callback=n,xa.time=e+t}function bt(){var n=Date.now();for(xa=va;xa;)n>=xa.time&&(xa.flush=xa.callback(n-xa.time)),xa=xa.next;return n}function _t(){for(var n,t=va,e=1/0;t;)t.flush?t=n?n.next=t.next:va=t.next:(t.time8?function(n){return n/e}:function(n){return n*e},symbol:n}}function St(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Et(n){return n+""}function kt(){}function At(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function Nt(n,t){n&&Da.hasOwnProperty(n.type)&&Da[n.type](n,t)}function Tt(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++ua;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c={point:e,points:n,other:null,visited:!1,entry:!0,subject:!0},l={point:e,points:[e],other:c,visited:!1,entry:!1,subject:!1};c.other=l,i.push(c),o.push(l),c={point:r,points:[r],other:null,visited:!1,entry:!1,subject:!0},l={point:r,points:[r],other:c,visited:!1,entry:!0,subject:!1},c.other=l,i.push(c),o.push(l)}}),o.sort(t),$t(i),$t(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].entry=c=!c;for(var s,f,h,g=i[0];;){for(s=g;s.visited;)if((s=s.next)===g)return;f=s.points,u.lineStart();do{if(s.visited=s.other.visited=!0,s.entry){if(s.subject)for(var a=0;a=0;)u.point((h=f[a])[0],h[1])}else r(s.point,s.prev.point,-1,u);s=s.prev}s=s.other,f=s.points}while(!s.visited);u.lineEnd()}}}function $t(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Wt))}}var g,p,d,v=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[],i.polygonStart()},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=mo.merge(g);var n=Kt(m,p);g.length?Xt(g,Gt,n,e,i):n&&(i.lineStart(),e(null,null,1,i),i.lineEnd()),i.polygonEnd(),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Jt(),x=t(M);return y}}function Wt(n){return n.length>1}function Jt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:c,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Gt(n,t){return((n=n.point)[0]<0?n[1]-Jo-Go:Jo-n[1])-((t=t.point)[0]<0?t[1]-Jo-Go:Jo-t[1])}function Kt(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;La.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+Bo/4,p=Math.sin(g),d=Math.cos(g),v=1;;){v===s&&(v=0),n=l[v];var m=n[0],y=n[1]/2+Bo/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=Math.abs(b)>Bo,w=p*M;if(La.add(Math.atan2(w*Math.sin(b),d*x+w*Math.cos(b))),i+=_?b+(b>=0?2:-2)*Bo:b,_^h>=e^m>=e){var S=jt(Ct(f),Ct(n));Ft(S);var E=jt(u,S);Ft(E);var k=(_^b>=0?-1:1)*O(E[2]);(r>k||r===k&&(S[0]||S[1]))&&(o+=_^b>=0?1:-1)}if(!v++)break;h=m,p=M,d=x,f=n}}return(-Go>i||Go>i&&0>La)^1&o}function Qt(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?Bo:-Bo,c=Math.abs(i-e);Math.abs(c-Bo)0?Jo:-Jo),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=Bo&&(Math.abs(e-u)Go?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function te(n,t,e,r){var u;if(null==n)u=e*Jo,r.point(-Bo,u),r.point(0,u),r.point(Bo,u),r.point(Bo,0),r.point(Bo,-u),r.point(0,-u),r.point(-Bo,-u),r.point(-Bo,0),r.point(-Bo,u);else if(Math.abs(n[0]-t[0])>Go){var i=(n[0]i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],d=t(f,h),v=o?d?0:u(f,h):d?u(f+(0>f?Bo:-Bo),h):0;if(!e&&(l=c=d)&&n.lineStart(),d!==c&&(g=r(e,p),(Ot(e,g)||Ot(p,g))&&(p[0]+=Go,p[1]+=Go,d=t(p[0],p[1]))),d!==c)s=0,d?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^d){var m;v&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!d||e&&Ot(e,p)||n.point(p[0],p[1]),e=p,c=d,i=v},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=Ct(n),u=Ct(t),o=[1,0,0],a=jt(r,u),c=Dt(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=jt(o,a),p=Ht(o,f),d=Ht(a,h);Lt(p,d);var v=g,m=Dt(p,v),y=Dt(v,v),M=m*m-y*(Dt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=Ht(v,(-m-x)/y);if(Lt(b,p),b=Pt(b),!e)return b;var _,w=n[0],S=t[0],E=n[1],k=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=Math.abs(A-Bo)A;if(!N&&E>k&&(_=E,E=k,k=_),T?N?E+k>0^b[1]<(Math.abs(b[0]-w)Bo^(w<=b[0]&&b[0]<=S)){var q=Ht(v,(-m+x)/y);return Lt(q,p),[b,Pt(q)]}}}function u(t,e){var r=o?n:Bo-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=Math.abs(i)>Go,c=Te(n,6*Qo);return Bt(t,e,c,o?[0,-n]:[-Bo,n-Bo])}function re(n,t,e,r){function u(r,u){return Math.abs(r[0]-n)0?0:3:Math.abs(r[0]-e)0?2:1:Math.abs(r[1]-t)0?1:0:u>0?3:2}function i(n,t){return o(n.point,t.point)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}function a(u,i){var o=i[0]-u[0],a=i[1]-u[1],c=[0,1];return Math.abs(o)0&&(u[0]+=c[0]*o,u[1]+=c[0]*a),!0):!1}return function(c){function l(n){for(var t=0,e=y.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=y[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&s(l,i,n)>0&&++t:i[1]<=r&&s(l,i,n)<0&&--t,l=i;return 0!==t}function s(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(e[0]-n[0])*(t[1]-n[1])}function f(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function h(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function g(n,t){h(n,t)&&c.point(n,t)}function p(){q.point=v,y&&y.push(M=[]),k=!0,E=!1,w=S=0/0}function d(){m&&(v(x,b),_&&E&&T.rejoin(),m.push(T.buffer())),q.point=g,E&&c.lineEnd()}function v(n,t){n=Math.max(-Ja,Math.min(Ja,n)),t=Math.max(-Ja,Math.min(Ja,t));var e=h(n,t);if(y&&M.push([n,t]),k)x=n,b=t,_=e,k=!1,e&&(c.lineStart(),c.point(n,t));else if(e&&E)c.point(n,t);else{var r=[w,S],u=[n,t];a(r,u)?(E||(c.lineStart(),c.point(r[0],r[1])),c.point(u[0],u[1]),e||c.lineEnd(),A=!1):e&&(c.lineStart(),c.point(n,t),A=!1)}w=n,S=t,E=e}var m,y,M,x,b,_,w,S,E,k,A,N=c,T=Jt(),q={point:g,lineStart:p,lineEnd:d,polygonStart:function(){c=T,m=[],y=[],A=!0},polygonEnd:function(){c=N,m=mo.merge(m);var t=l([n,r]),e=A&&t,u=m.length;(e||u)&&(c.polygonStart(),e&&(c.lineStart(),f(null,null,1,c),c.lineEnd()),u&&Xt(m,i,t,f,c),c.polygonEnd()),m=y=M=null}};return q}}function ue(n,t,e){if(Math.abs(t)=n;var r=n/t;if(t>0){if(r>e[1])return!1;r>e[0]&&(e[0]=r)}else{if(rn&&(Qa=n),n>tc&&(tc=n),nc>t&&(nc=t),t>ec&&(ec=t)}function se(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=fe(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=fe(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function fe(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function he(n,t){Oa+=n,Ra+=t,++Ya}function ge(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);Ia+=o*(t+n)/2,Ua+=o*(e+r)/2,Za+=o,he(t=n,e=r)}var t,e;ic.point=function(r,u){ic.point=n,he(t=r,e=u)}}function pe(){ic.point=he}function de(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);Ia+=o*(r+n)/2,Ua+=o*(u+t)/2,Za+=o,o=u*n-r*t,Va+=o*(r+n),Xa+=o*(u+t),$a+=3*o,he(r=n,u=t)}var t,e,r,u;ic.point=function(i,o){ic.point=n,he(t=r=i,e=u=o)},ic.lineEnd=function(){n(t,e)}}function ve(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,Wo)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:c};return a}function me(n){function t(t){function r(e,r){e=n(e,r),t.point(e[0],e[1])}function u(){M=0/0,S.point=o,t.lineStart()}function o(r,u){var o=Ct([r,u]),a=n(r,u);e(M,x,y,b,_,w,M=a[0],x=a[1],y=r,b=o[0],_=o[1],w=o[2],i,t),t.point(M,x)}function a(){S.point=r,t.lineEnd()}function c(){u(),S.point=l,S.lineEnd=s}function l(n,t){o(f=n,h=t),g=M,p=x,d=b,v=_,m=w,S.point=o}function s(){e(M,x,y,b,_,w,g,p,f,d,v,m,i,t),S.lineEnd=a,a()}var f,h,g,p,d,v,m,y,M,x,b,_,w,S={point:r,lineStart:u,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=u}};return S}function e(t,i,o,a,c,l,s,f,h,g,p,d,v,m){var y=s-t,M=f-i,x=y*y+M*M;if(x>4*r&&v--){var b=a+g,_=c+p,w=l+d,S=Math.sqrt(b*b+_*_+w*w),E=Math.asin(w/=S),k=Math.abs(Math.abs(w)-1)r||Math.abs((y*q+M*z)/x-.5)>.3||u>a*g+c*p+l*d)&&(e(t,i,o,a,c,l,N,T,k,b/=S,_/=S,w,v,m),m.point(N,T),e(N,T,k,b,_,w,s,f,h,g,p,d,v,m))}}var r=.5,u=Math.cos(30*Qo),i=16;return t.precision=function(n){return arguments.length?(i=(r=n*n)>0&&16,t):Math.sqrt(r)},t}function ye(n){this.stream=n}function Me(n){var t=me(function(t,e){return n([t*na,e*na])});return function(n){var e=new ye(n=t(n));return e.point=function(t,e){n.point(t*Qo,e*Qo)},e}}function xe(n){return be(function(){return n})()}function be(n){function t(n){return n=a(n[0]*Qo,n[1]*Qo),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*na,n[1]*na]}function r(){a=ie(o=Ee(m,y,M),i);var n=i(d,v);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=me(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,d=0,v=0,m=0,y=0,M=0,x=Wa,b=dt,_=null,w=null;return t.stream=function(n){return s&&(s.valid=!1),s=_e(x(o,f(b(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(x=null==n?(_=n,Wa):ee((_=+n)*Qo),u()):_},t.clipExtent=function(n){return arguments.length?(w=n,b=n?re(n[0][0],n[0][1],n[1][0],n[1][1]):dt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(d=n[0]%360*Qo,v=n[1]%360*Qo,r()):[d*na,v*na]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Qo,y=n[1]%360*Qo,M=n.length>2?n[2]%360*Qo:0,r()):[m*na,y*na,M*na]},mo.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function _e(n){var t=new ye(n);return t.point=function(t,e){n.point(t*Qo,e*Qo)},t}function we(n,t){return[n,t]}function Se(n,t){return[n>Bo?n-Wo:-Bo>n?n+Wo:n,t]}function Ee(n,t,e){return n?t||e?ie(Ae(n),Ne(t,e)):Ae(n):t||e?Ne(t,e):Se}function ke(n){return function(t,e){return t+=n,[t>Bo?t-Wo:-Bo>t?t+Wo:t,e]}}function Ae(n){var t=ke(n);return t.invert=ke(-n),t}function Ne(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),O(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),O(s*r-a*u)]},e}function Te(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=qe(e,u),i=qe(e,i),(o>0?i>u:u>i)&&(u+=o*Wo)):(u=n+o*Wo,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=Pt([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function qe(n,t){var e=Ct(t);e[0]-=n,Ft(e);var r=P(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Go)%(2*Math.PI)}function ze(n,t,e){var r=mo.range(n,t-Go,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function Ce(n,t,e){var r=mo.range(n,t-Go,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function De(n){return n.source}function je(n){return n.target}function Le(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(U(r-t)+u*o*U(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*na,Math.atan2(o,Math.sqrt(r*r+u*u))*na]}:function(){return[n*na,t*na]};return p.distance=h,p}function He(){function n(n,u){var i=Math.sin(u*=Qo),o=Math.cos(u),a=Math.abs((n*=Qo)-t),c=Math.cos(a);oc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;ac.point=function(u,i){t=u*Qo,e=Math.sin(i*=Qo),r=Math.cos(i),ac.point=n},ac.lineEnd=function(){ac.point=ac.lineEnd=c}}function Fe(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function Pe(n,t){function e(n,t){var e=Math.abs(Math.abs(t)-Jo)1&&u.push("H",r[0]),u.join("")}function We(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function fr(n){return n.length<3?Xe(n):n[0]+nr(n,sr(n))}function hr(n,t,e,r){var u,i,o,a,c,l,s;return u=r[n],i=u[0],o=u[1],u=r[t],a=u[0],c=u[1],u=r[e],l=u[0],s=u[1],(s-o)*(a-i)-(c-o)*(l-i)>0}function gr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function pr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function dr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function vr(n,t){var e={list:n.map(function(n,t){return{index:t,x:n[0],y:n[1]}}).sort(function(n,t){return n.yt.y?1:n.xt.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(n,t){return{edge:n,side:t,vertex:null,l:null,r:null}},insert:function(n,t){t.l=n,t.r=n.r,n.r.l=t,n.r=t},leftBound:function(n){var t=r.leftEnd;do t=t.r;while(t!=r.rightEnd&&u.rightOf(t,n));return t=t.l},del:function(n){n.l.r=n.r,n.r.l=n.l,n.edge=null},right:function(n){return n.r},left:function(n){return n.l},leftRegion:function(n){return null==n.edge?e.bottomSite:n.edge.region[n.side]},rightRegion:function(n){return null==n.edge?e.bottomSite:n.edge.region[yc[n.side]]}},u={bisect:function(n,t){var e={region:{l:n,r:t},ep:{l:null,r:null}},r=t.x-n.x,u=t.y-n.y,i=r>0?r:-r,o=u>0?u:-u;return e.c=n.x*r+n.y*u+.5*(r*r+u*u),i>o?(e.a=1,e.b=u/r,e.c/=r):(e.b=1,e.a=r/u,e.c/=u),e},intersect:function(n,t){var e=n.edge,r=t.edge;if(!e||!r||e.region.r==r.region.r)return null;var u=e.a*r.b-e.b*r.a;if(Math.abs(u)<1e-10)return null;var i,o,a=(e.c*r.b-r.c*e.b)/u,c=(r.c*e.a-e.c*r.a)/u,l=e.region.r,s=r.region.r;l.y=o.region.r.x;return f&&"l"===i.side||!f&&"r"===i.side?null:{x:a,y:c}},rightOf:function(n,t){var e=n.edge,r=e.region.r,u=t.x>r.x;if(u&&"l"===n.side)return 1;if(!u&&"r"===n.side)return 0;if(1===e.a){var i=t.y-r.y,o=t.x-r.x,a=0,c=0;if(!u&&e.b<0||u&&e.b>=0?c=a=i>=e.b*o:(c=t.x+t.y*e.b>e.c,e.b<0&&(c=!c),c||(a=1)),!a){var l=r.x-e.region.l.x;c=e.b*(o*o-i*i)h*h+g*g}return"l"===n.side?c:!c},endPoint:function(n,e,r){n.ep[e]=r,n.ep[yc[e]]&&t(n)},distance:function(n,t){var e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}},i={list:[],insert:function(n,t,e){n.vertex=t,n.ystar=t.y+e;for(var r=0,u=i.list,o=u.length;o>r;r++){var a=u[r];if(!(n.ystar>a.ystar||n.ystar==a.ystar&&t.x>a.vertex.x))break}u.splice(r,0,n)},del:function(n){for(var t=0,e=i.list,r=e.length;r>t&&e[t]!=n;++t);e.splice(t,1)},empty:function(){return 0===i.list.length},nextEvent:function(n){for(var t=0,e=i.list,r=e.length;r>t;++t)if(e[t]==n)return e[t+1];return null},min:function(){var n=i.list[0];return{x:n.vertex.x,y:n.ystar}},extractMin:function(){return i.list.shift()}};r.init(),e.bottomSite=e.list.shift();for(var o,a,c,l,s,f,h,g,p,d,v,m,y,M=e.list.shift();;)if(i.empty()||(o=i.min()),M&&(i.empty()||M.yg.y&&(p=h,h=g,g=p,y="r"),m=u.bisect(h,g),f=r.createHalfEdge(m,y),r.insert(l,f),u.endPoint(m,yc[y],v),d=u.intersect(l,f),d&&(i.del(l),i.insert(l,d,u.distance(d,h))),d=u.intersect(f,s),d&&i.insert(f,d,u.distance(d,h))}for(a=r.right(r.leftEnd);a!=r.rightEnd;a=r.right(a))t(a.edge)}function mr(n){return n.x}function yr(n){return n.y}function Mr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function xr(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&xr(n,c[0],e,r,o,a),c[1]&&xr(n,c[1],o,r,u,a),c[2]&&xr(n,c[2],e,a,o,i),c[3]&&xr(n,c[3],o,a,u,i)}}function br(n,t){n=mo.rgb(n),t=mo.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+ct(Math.round(e+i*n))+ct(Math.round(r+o*n))+ct(Math.round(u+a*n))}}function _r(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Er(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function wr(n,t){return t-=n=+n,function(e){return n+t*e}}function Sr(n,t){var e,r,u,i,o,a=0,c=0,l=[],s=[];for(n+="",t+="",Mc.lastIndex=0,r=0;e=Mc.exec(t);++r)e.index&&l.push(t.substring(a,c=e.index)),s.push({i:l.length,x:e[0]}),l.push(null),a=Mc.lastIndex;for(ar;++r)if(o=s[r],o.x==e[0]){if(o.i)if(null==l[o.i+1])for(l[o.i-1]+=o.x,l.splice(o.i,1),u=r+1;i>u;++u)s[u].i--;else for(l[o.i-1]+=o.x+l[o.i+1],l.splice(o.i,2),u=r+1;i>u;++u)s[u].i-=2;else if(null==l[o.i+1])l[o.i]=o.x;else for(l[o.i]=o.x+l[o.i+1],l.splice(o.i+1,1),u=r+1;i>u;++u)s[u].i--;s.splice(r,1),i--,r--}else o.x=wr(parseFloat(e[0]),parseFloat(o.x));for(;i>r;)o=s.pop(),null==l[o.i+1]?l[o.i]=o.x:(l[o.i]=o.x+l[o.i+1],l.splice(o.i+1,1)),i--;return 1===l.length?null==l[0]?(o=s[0].x,function(n){return o(n)+""}):function(){return t}:function(n){for(r=0;i>r;++r)l[(o=s[r]).i]=o.x(n);return l.join("")}}function Er(n,t){for(var e,r=mo.interpolators.length;--r>=0&&!(e=mo.interpolators[r](n,t)););return e}function kr(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Er(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Ar(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function Nr(n){return function(t){return 1-n(1-t)}}function Tr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function qr(n){return n*n}function zr(n){return n*n*n}function Cr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Dr(n){return function(t){return Math.pow(t,n)}}function jr(n){return 1-Math.cos(n*Jo)}function Lr(n){return Math.pow(2,10*(n-1))}function Hr(n){return 1-Math.sqrt(1-n*n)}function Fr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Wo*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Wo/t)}}function Pr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Or(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=mo.hcl(n),t=mo.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return J(e+i*n,r+o*n,u+a*n)+""}}function Yr(n,t){n=mo.hsl(n),t=mo.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return $(e+i*n,r+o*n,u+a*n)+""}}function Ir(n,t){n=mo.lab(n),t=mo.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return Q(e+i*n,r+o*n,u+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Zr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Xr(t),u=Vr(t,e),i=Xr($r(e,t,-u))||0;t[0]*e[1]180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:wr(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:wr(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:wr(g[0],p[0])},{i:e-2,x:wr(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++ie;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function vu(n){return n.reduce(mu,0)}function mu(n,t){return n+t[1]}function yu(n,t){return Mu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Mu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function xu(n){return[mo.min(n),mo.max(n)]}function bu(n,t){return n.parent==t.parent?1:2}function _u(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}function wu(n){var t,e=n.children;return e&&(t=e.length)?e[t-1]:n._tree.thread}function Su(n,t){var e=n.children;if(e&&(u=e.length))for(var r,u,i=-1;++i0&&(n=r);return n}function Eu(n,t){return n.x-t.x}function ku(n,t){return t.x-n.x}function Au(n,t){return n.depth-t.depth}function Nu(n,t){function e(n,r){var u=n.children;if(u&&(o=u.length))for(var i,o,a=null,c=-1;++c=0;)t=u[i]._tree,t.prelim+=e,t.mod+=e,e+=t.shift+(r+=t.change)}function qu(n,t,e){n=n._tree,t=t._tree;var r=e/(t.number-n.number);n.change+=r,t.change-=r,t.shift+=e,t.prelim+=e,t.mod+=e}function zu(n,t,e){return n._tree.ancestor.parent==t.parent?n._tree.ancestor:e}function Cu(n,t){return n.value-t.value}function Du(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function ju(n,t){n._pack_next=t,t._pack_prev=n}function Lu(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Hu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(Fu),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],Ru(r,u,i),t(i),Du(r,i),r._pack_prev=i,Du(i,u),u=r._pack_next,o=3;l>o;o++){Ru(r,u,i=e[o]);var p=0,d=1,v=1;for(a=u._pack_next;a!==u;a=a._pack_next,d++)if(Lu(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!Lu(c,i);c=c._pack_prev,v++);p?(v>d||d==v&&u.ro;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Pu)}}function Fu(n){n._pack_next=n._pack_prev=n}function Pu(n){delete n._pack_next,delete n._pack_prev}function Ou(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++iu&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function $u(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Bu(n){return n.rangeExtent?n.rangeExtent():$u(n.range())}function Wu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Ju(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Gu(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Tc}function Ku(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Ku:Wu,c=r?Jr:Wr;return o=u(n,t,c,e),a=u(t,n,c,Er),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Ur)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return ri(n,t)},i.tickFormat=function(t,e){return ui(n,t,e)},i.nice=function(t){return ti(n,t),u()},i.copy=function(){return Qu(n,t,e,r)},u()}function ni(n,t){return mo.rebind(n,t,"range","rangeRound","interpolate","clamp")}function ti(n,t){return Ju(n,Gu(ei(n,t)[2]))}function ei(n,t){null==t&&(t=10);var e=$u(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function ri(n,t){return mo.range.apply(mo,ei(n,t))}function ui(n,t,e){var r=-Math.floor(Math.log(ei(n,t)[2])/Math.LN10+.01);return mo.format(e?e.replace(Aa,function(n,t,e,u,i,o,a,c,l,s){return[t,e,u,i,o,a,c,l||"."+(r-2*("%"===s)),s].join("")}):",."+r+"f")}function ii(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Ju(r.map(u),e?Math:zc);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=$u(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++0;h--)o.push(i(l)*h);for(l=0;o[l]c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return qc;arguments.length<2?t=qc:"function"!=typeof t&&(t=mo.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return ii(n.copy(),t,e,r)},ni(o,n)}function oi(n,t,e){function r(t){return n(u(t))}var u=ai(t),i=ai(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return ri(e,n)},r.tickFormat=function(n,t){return ui(e,n,t)},r.nice=function(n){return r.domain(ti(e,n))},r.exponent=function(o){return arguments.length?(u=ai(t=o),i=ai(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return oi(n.copy(),t,e)},ni(r,n)}function ai(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ci(n,t){function e(e){return o[((i.get(e)||"range"===t.t&&i.set(e,n.push(e)))-1)%o.length]}function r(t,e){return mo.range(n.length).map(function(n){return t+e*n})}var i,o,a;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new u;for(var o,a=-1,c=r.length;++ae?[0/0,0/0]:[e>0?u[e-1]:n[0],et?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return si(n,t,e)},u()}function fi(n,t){function e(e){return e>=e?t[mo.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return fi(n,t)},e}function hi(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return ri(n,t)},t.tickFormat=function(t,e){return ui(n,t,e)},t.copy=function(){return hi(n)},t}function gi(n){return n.innerRadius}function pi(n){return n.outerRadius}function di(n){return n.startAngle}function vi(n){return n.endAngle}function mi(n){for(var t,e,r,u=-1,i=n.length;++ue?l():(i.active=e,o.event&&o.event.start.call(n,s,t),o.tween.forEach(function(e,r){(r=r.call(n,s,t))&&p.push(r)}),c(r||1)?1:(xt(c,h,a),void 0))}function c(r){if(i.active!==e)return l();for(var u=r/g,a=f(u),c=p.length;c>0;)p[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,s,t),l()):void 0}function l(){return--i.count?delete i[e]:delete n.__transition__,1}var s=n.__data__,f=o.ease,h=o.delay,g=o.duration,p=[];return r>=h?u(r-h):(xt(u,h,a),void 0)},0,a)}}function Ti(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function qi(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function zi(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ci(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new Jc(e-1)),1),e}function i(n,e){return t(n=new Jc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{Jc=zi;var r=new zi;return r._=n,o(r,t,e)}finally{Jc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Di(n);return c.floor=c,c.round=Di(r),c.ceil=Di(u),c.offset=Di(i),c.range=a,n}function Di(n){return function(t,e){try{Jc=zi;var r=new zi;return r._=t,n(r,e)._}finally{Jc=Date}}}function ji(n){function t(t){for(var r,u,i,o=[],a=-1,c=0;++aa;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=ml[o in dl?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function Hi(n){return new RegExp("^(?:"+n.map(mo.requote).join("|")+")","i")}function Fi(n){for(var t=new u,e=-1,r=n.length;++en?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Oi(n,t,e){cl.lastIndex=0;var r=cl.exec(t.substring(e));return r?(n.w=ll.get(r[0].toLowerCase()),e+r[0].length):-1}function Ri(n,t,e){ol.lastIndex=0;var r=ol.exec(t.substring(e));return r?(n.w=al.get(r[0].toLowerCase()),e+r[0].length):-1}function Yi(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Ii(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e));return r?(n.U=+r[0],e+r[0].length):-1}function Ui(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e));return r?(n.W=+r[0],e+r[0].length):-1}function Zi(n,t,e){hl.lastIndex=0;var r=hl.exec(t.substring(e));return r?(n.m=gl.get(r[0].toLowerCase()),e+r[0].length):-1}function Vi(n,t,e){sl.lastIndex=0;var r=sl.exec(t.substring(e));return r?(n.m=fl.get(r[0].toLowerCase()),e+r[0].length):-1}function Xi(n,t,e){return Li(n,vl.c.toString(),t,e)}function $i(n,t,e){return Li(n,vl.x.toString(),t,e)}function Bi(n,t,e){return Li(n,vl.X.toString(),t,e)}function Wi(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Ji(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+2));return r?(n.y=Ki(+r[0]),e+r[0].length):-1}function Gi(n,t,e){return/^[+-]\d{4}$/.test(t=t.substring(e,e+5))?(n.Z=+t,e+5):-1}function Ki(n){return n+(n>68?1900:2e3)}function Qi(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function no(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function to(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function eo(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ro(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function uo(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function io(n,t,e){yl.lastIndex=0;var r=yl.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function oo(n,t,e){var r=Ml.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}function ao(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(Math.abs(t)/60),u=Math.abs(t)%60;return e+Pi(r,"0",2)+Pi(u,"0",2)}function co(n,t,e){pl.lastIndex=0;var r=pl.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function lo(n){function t(n){try{Jc=zi;var t=new Jc;return t._=n,e(t)}finally{Jc=Date}}var e=ji(n);return t.parse=function(n){try{Jc=zi;var t=e.parse(n);return t&&t._}finally{Jc=Date}},t.toString=e.toString,t}function so(n){return n.toISOString()}function fo(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=mo.bisect(bl,u);return i==bl.length?[t.year,ei(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/bl[i-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=ho(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ho(+t+1);return t}}:n))},r.ticks=function(n,t){var e=$u(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ho(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return fo(n.copy(),t,e)},ni(r,n)}function ho(n){return new Date(n)}function go(n){return function(t){for(var e=n.length-1,r=n[e];!r[1](t);)r=n[--e];return r[0](t)}}function po(n){return JSON.parse(n.responseText)}function vo(n){var t=xo.createRange();return t.selectNode(xo.body),t.createContextualFragment(n.responseText)}var mo={version:"3.3.6"};Date.now||(Date.now=function(){return+new Date});var yo=[].slice,Mo=function(n){return yo.call(n)},xo=document,bo=xo.documentElement,_o=window;try{Mo(bo.childNodes)[0].nodeType}catch(wo){Mo=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{xo.createElement("div").style.setProperty("opacity",0,"")}catch(So){var Eo=_o.Element.prototype,ko=Eo.setAttribute,Ao=Eo.setAttributeNS,No=_o.CSSStyleDeclaration.prototype,To=No.setProperty;Eo.setAttribute=function(n,t){ko.call(this,n,t+"")},Eo.setAttributeNS=function(n,t,e){Ao.call(this,n,t,e+"")},No.setProperty=function(n,t,e){To.call(this,n,t+"",e)}}mo.ascending=function(n,t){return t>n?-1:n>t?1:n>=t?0:0/0},mo.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},mo.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=e);)e=void 0;for(;++ur&&(e=r)}else{for(;++u=e);)e=void 0;for(;++ur&&(e=r)}return e},mo.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=e);)e=void 0;for(;++ue&&(e=r)}else{for(;++u=e);)e=void 0;for(;++ue&&(e=r)}return e},mo.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i=e);)e=u=void 0;for(;++ir&&(e=r),r>u&&(u=r))}else{for(;++i=e);)e=void 0;for(;++ir&&(e=r),r>u&&(u=r))}return[e,u]},mo.sum=function(n,t){var e,r=0,u=n.length,i=-1;if(1===arguments.length)for(;++i1&&(t=t.map(e)),t=t.filter(n),t.length?mo.quantile(t.sort(mo.ascending),.5):void 0},mo.bisector=function(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n.call(t,t[i],i)r;){var i=r+u>>>1;er?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},mo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,e=mo.min(arguments,t),r=new Array(e);++nr)for(;(u=n+r*++a)>t;)i.push(u/o);else for(;(u=n+r*++a)=o.length)return r?r.call(i,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,d=o[c++],v=new u;++g=o.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,i={},o=[],a=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(mo.map,e,0),0)},i.key=function(n){return o.push(n),i},i.sortKeys=function(n){return a[o.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},mo.set=function(n){var t=new i;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},r(i,{has:function(n){return zo+n in this},add:function(n){return this[zo+n]=!0,n},remove:function(n){return n=zo+n,n in this&&delete this[n]},values:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===Co&&n.call(this,t.substring(1))}}),mo.behavior={},mo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},mo.event=null,mo.requote=function(n){return n.replace(jo,"\\$&")};var jo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Lo={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ho=function(n,t){return t.querySelector(n)},Fo=function(n,t){return t.querySelectorAll(n)},Po=bo[a(bo,"matchesSelector")],Oo=function(n,t){return Po.call(n,t)};"function"==typeof Sizzle&&(Ho=function(n,t){return Sizzle(n,t)[0]||null},Fo=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},Oo=Sizzle.matchesSelector),mo.selection=function(){return Uo};var Ro=mo.selection.prototype=[];Ro.select=function(n){var t,e,r,u,i=[];n=d(n);for(var o=-1,a=this.length;++o=0&&(e=n.substring(0,t),n=n.substring(t+1)),Yo.hasOwnProperty(e)?{space:Yo[e],local:n}:n}},Ro.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=mo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(m(t,n[t]));return this}return this.each(m(n,t))},Ro.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=n.trim().split(/^|\s+/g)).length,u=-1;if(t=e.classList){for(;++ur){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(_(e,n[e],t));return this}if(2>r)return _o.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(_(n,t,e))},Ro.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(w(t,n[t]));return this}return this.each(w(n,t))},Ro.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Ro.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Ro.append=function(n){return n=S(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Ro.insert=function(n,t){return n=S(n),t=d(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments))})},Ro.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},Ro.data=function(n,t){function e(n,e){var r,i,o,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),d=new Array(a);if(t){var v,m=new u,y=new u,M=[];for(r=-1;++rr;++r)p[r]=E(e[r]);for(;a>r;++r)d[r]=n[r]}p.update=g,p.parentNode=g.parentNode=d.parentNode=n.parentNode,c.push(p),l.push(g),s.push(d)}var r,i,o=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++oi;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a)&&t.push(r)}return p(u)},Ro.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Ro.sort=function(n){n=A.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Ro.size=function(){var n=0;return this.each(function(){++n}),n};var Io=[];mo.selection.enter=T,mo.selection.enter.prototype=Io,Io.append=Ro.append,Io.empty=Ro.empty,Io.node=Ro.node,Io.call=Ro.call,Io.size=Ro.size,Io.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(C(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(C(n,t,e))};var Zo=mo.map({mouseenter:"mouseover",mouseleave:"mouseout"});Zo.forEach(function(n){"on"+n in xo&&Zo.remove(n)});var Vo=a(bo.style,"userSelect"),Xo=0;mo.mouse=function(n){return H(n,h())};var $o=/WebKit/.test(_o.navigator.userAgent)?-1:0;mo.touches=function(n,t){return arguments.length<2&&(t=h().touches),t?Mo(t).map(function(t){var e=H(n,t);return e.identifier=t.identifier,e}):[]},mo.behavior.drag=function(){function n(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function t(){return mo.event.changedTouches[0].identifier}function e(n,t){return mo.touches(n).filter(function(n){return n.identifier===t})[0]}function r(n,t,e,r){return function(){function o(){var n=t(s,g),e=n[0]-d[0],r=n[1]-d[1];v|=e|r,d=n,f({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:e,dy:r})}function a(){m.on(e+"."+p,null).on(r+"."+p,null),y(v&&mo.event.target===h),f({type:"dragend"})}var c,l=this,s=l.parentNode,f=u.of(l,arguments),h=mo.event.target,g=n(),p=null==g?"drag":"drag-"+g,d=t(s,g),v=0,m=mo.select(_o).on(e+"."+p,o).on(r+"."+p,a),y=L();i?(c=i.apply(l,arguments),c=[c.x-d[0],c.y-d[1]]):c=[0,0],f({type:"dragstart"})}}var u=g(n,"drag","dragstart","dragend"),i=null,o=r(c,mo.mouse,"mousemove","mouseup"),a=r(t,e,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},mo.rebind(n,u,"on")};var Bo=Math.PI,Wo=2*Bo,Jo=Bo/2,Go=1e-6,Ko=Go*Go,Qo=Bo/180,na=180/Bo,ta=Math.SQRT2,ea=2,ra=4;mo.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=Y(d),o=i/(ea*h)*(e*I(ta*t+d)-R(d));return[r+o*l,u+o*s,i*e/Y(ta*t+d)]}return[r+n*l,u+n*s,i*Math.exp(ta*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+ra*f)/(2*i*ea*h),p=(c*c-i*i-ra*f)/(2*c*ea*h),d=Math.log(Math.sqrt(g*g+1)-g),v=Math.log(Math.sqrt(p*p+1)-p),m=v-d,y=(m||Math.log(c/i))/ta;return e.duration=1e3*y,e},mo.behavior.zoom=function(){function n(n){n.on(A,l).on(oa+".zoom",h).on(N,p).on("dblclick.zoom",d).on(q,s)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(k[0],Math.min(k[1],n))}function u(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){b&&b.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-S.y)/S.k}).map(_.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function l(){function n(){s=1,u(mo.mouse(r),h),a(i)}function e(){f.on(N,_o===r?p:null).on(T,null),g(s&&mo.event.target===l),c(i)}var r=this,i=C.of(r,arguments),l=mo.event.target,s=0,f=mo.select(_o).on(N,n).on(T,e),h=t(mo.mouse(r)),g=L();z.call(r),o(i)}function s(){function n(){var n=mo.touches(p);return g=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){for(var t=mo.event.changedTouches,e=0,i=t.length;i>e;++e)v[t[e].identifier]=null;var o=n(),c=Date.now();if(1===o.length){if(500>c-M){var l=o[0],s=v[l.identifier];r(2*S.k),u(l,s),f(),a(d)}M=c}else if(o.length>1){var l=o[0],h=o[1],g=l[0]-h[0],p=l[1]-h[1];m=g*g+p*p}}function i(){for(var n,t,e,i,o=mo.touches(p),c=0,l=o.length;l>c;++c,i=null)if(e=o[c],i=v[e.identifier]){if(t)break;n=e,t=i}if(i){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*g)}M=null,u(n,t),a(d)}function h(){if(mo.event.touches.length){for(var t=mo.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var u in v)return void n()}_.on(x,null).on(b,null),w.on(A,l).on(q,s),E(),c(d)}var g,p=this,d=C.of(p,arguments),v={},m=0,y=mo.event.changedTouches[0].identifier,x="touchmove.zoom-"+y,b="touchend.zoom-"+y,_=mo.select(_o).on(x,i).on(b,h),w=mo.select(p).on(A,null).on(q,e),E=L();z.call(p),e(),o(d)}function h(){var n=C.of(this,arguments);y?clearTimeout(y):(z.call(this),o(n)),y=setTimeout(function(){y=null,c(n)},50),f();var e=m||mo.mouse(this);v||(v=t(e)),r(Math.pow(2,.002*ua())*S.k),u(e,v),a(n)}function p(){v=null}function d(){var n=C.of(this,arguments),e=mo.mouse(this),i=t(e),l=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,mo.event.shiftKey?Math.ceil(l)-1:Math.floor(l)+1)),u(e,i),a(n),c(n)}var v,m,y,M,x,b,_,w,S={x:0,y:0,k:1},E=[960,500],k=ia,A="mousedown.zoom",N="mousemove.zoom",T="mouseup.zoom",q="touchstart.zoom",C=g(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=C.of(this,arguments),t=S;Oc?mo.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=e/2,i=r/2,o=mo.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,e/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:u-r[0]*c,y:i-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(k=null==t?ia:[+t[0],+t[1]],n):k},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.x=function(t){return arguments.length?(b=t,x=t.copy(),S={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),S={x:0,y:0,k:1},n):w},mo.rebind(n,C,"on")};var ua,ia=[0,1/0],oa="onwheel"in xo?(ua=function(){return-mo.event.deltaY*(mo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in xo?(ua=function(){return mo.event.wheelDelta},"mousewheel"):(ua=function(){return-mo.event.detail},"MozMousePixelScroll");Z.prototype.toString=function(){return this.rgb()+""},mo.hsl=function(n,t,e){return 1===arguments.length?n instanceof X?V(n.h,n.s,n.l):lt(""+n,st,V):V(+n,+t,+e)};var aa=X.prototype=new Z;aa.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),V(this.h,this.s,this.l/n)},aa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),V(this.h,this.s,n*this.l)},aa.rgb=function(){return $(this.h,this.s,this.l)},mo.hcl=function(n,t,e){return 1===arguments.length?n instanceof W?B(n.h,n.c,n.l):n instanceof K?nt(n.l,n.a,n.b):nt((n=ft((n=mo.rgb(n)).r,n.g,n.b)).l,n.a,n.b):B(+n,+t,+e)};var ca=W.prototype=new Z;ca.brighter=function(n){return B(this.h,this.c,Math.min(100,this.l+la*(arguments.length?n:1)))},ca.darker=function(n){return B(this.h,this.c,Math.max(0,this.l-la*(arguments.length?n:1)))},ca.rgb=function(){return J(this.h,this.c,this.l).rgb()},mo.lab=function(n,t,e){return 1===arguments.length?n instanceof K?G(n.l,n.a,n.b):n instanceof W?J(n.l,n.c,n.h):ft((n=mo.rgb(n)).r,n.g,n.b):G(+n,+t,+e)};var la=18,sa=.95047,fa=1,ha=1.08883,ga=K.prototype=new Z;ga.brighter=function(n){return G(Math.min(100,this.l+la*(arguments.length?n:1)),this.a,this.b)},ga.darker=function(n){return G(Math.max(0,this.l-la*(arguments.length?n:1)),this.a,this.b)},ga.rgb=function(){return Q(this.l,this.a,this.b)},mo.rgb=function(n,t,e){return 1===arguments.length?n instanceof at?ot(n.r,n.g,n.b):lt(""+n,ot,$):ot(~~n,~~t,~~e)};var pa=at.prototype=new Z;pa.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),ot(Math.min(255,~~(t/n)),Math.min(255,~~(e/n)),Math.min(255,~~(r/n)))):ot(u,u,u)},pa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),ot(~~(n*this.r),~~(n*this.g),~~(n*this.b))},pa.hsl=function(){return st(this.r,this.g,this.b)},pa.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var da=mo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});da.forEach(function(n,t){da.set(n,ut(t))}),mo.functor=pt,mo.xhr=vt(dt),mo.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=mo.xhr(n,t,i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o.row(e)}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function o(t){return t.map(a).join(n)}function a(n){return c.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var c=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==l)continue;return n.substring(t,s-a)}return n.substring(t)}for(var r,u,i={},o={},a=[],c=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new i,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(o).join("\n")},e},mo.csv=mo.dsv(",","text/csv"),mo.tsv=mo.dsv(" ","text/tab-separated-values");var va,ma,ya,Ma,xa,ba=_o[a(_o,"requestAnimationFrame")]||function(n){setTimeout(n,17)};mo.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={callback:n,time:u,next:null};ma?ma.next=i:va=i,ma=i,ya||(Ma=clearTimeout(Ma),ya=1,ba(Mt))},mo.timer.flush=function(){bt(),_t()};var _a=".",wa=",",Sa=[3,3],Ea="$",ka=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(wt);mo.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=mo.round(n,St(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((0>=e?e+1:e-1)/3)))),ka[8+e/3]},mo.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)},mo.format=function(n){var t=Aa.exec(n),e=t[1]||" ",r=t[2]||">",u=t[3]||"",i=t[4]||"",o=t[5],a=+t[6],c=t[7],l=t[8],s=t[9],f=1,h="",g=!1;switch(l&&(l=+l.substring(1)),(o||"0"===e&&"="===r)&&(o=e="0",r="=",c&&(a-=Math.floor((a-1)/4))),s){case"n":c=!0,s="g";break;case"%":f=100,h="%",s="f";break;case"p":f=100,h="%",s="r";break;case"b":case"o":case"x":case"X":"#"===i&&(i="0"+s.toLowerCase());case"c":case"d":g=!0,l=0;break;case"s":f=-1,s="r"}"#"===i?i="":"$"===i&&(i=Ea),"r"!=s||l||(s="g"),null!=l&&("g"==s?l=Math.max(1,Math.min(21,l)):("e"==s||"f"==s)&&(l=Math.max(0,Math.min(20,l)))),s=Na.get(s)||Et;var p=o&&c;return function(n){if(g&&n%1)return"";var t=0>n||0===n&&0>1/n?(n=-n,"-"):u;if(0>f){var d=mo.formatPrefix(n,l);n=d.scale(n),h=d.symbol}else n*=f;n=s(n,l);var v=n.lastIndexOf("."),m=0>v?n:n.substring(0,v),y=0>v?"":_a+n.substring(v+1);!o&&c&&(m=Ta(m));var M=i.length+m.length+y.length+(p?0:t.length),x=a>M?new Array(M=a-M+1).join(e):"";return p&&(m=Ta(x+m)),t+=i,n=m+y,("<"===r?t+n+x:">"===r?x+t+n:"^"===r?x.substring(0,M>>=1)+t+n+x.substring(M):t+(p?n:x+n))+h}};var Aa=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Na=mo.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=mo.round(n,St(n,t))).toFixed(Math.max(0,Math.min(20,St(n*(1+1e-15),t))))}}),Ta=dt;if(Sa){var qa=Sa.length;Ta=function(n){for(var t=n.length,e=[],r=0,u=Sa[0];t>0&&u>0;)e.push(n.substring(t-=u,t+u)),u=Sa[r=(r+1)%qa];return e.reverse().join(wa)}}mo.geo={},kt.prototype={s:0,t:0,add:function(n){At(n,this.t,za),At(za.s,this.s,this),this.s?this.t+=za.t:this.s=za.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var za=new kt;mo.geo.stream=function(n,t){n&&Ca.hasOwnProperty(n.type)?Ca[n.type](n,t):Nt(n,t)};var Ca={Feature:function(n,t){Nt(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++rn?4*Bo+n:n,Ha.lineStart=Ha.lineEnd=Ha.point=c}};mo.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=Ct([t*Qo,e*Qo]);if(m){var u=jt(m,r),i=[u[1],-u[0],0],o=jt(i,u);Ft(o),o=Pt(o);var c=t-p,l=c>0?1:-1,d=o[0]*na*l,v=Math.abs(c)>180;if(v^(d>l*p&&l*t>d)){var y=o[1]*na;y>g&&(g=y)}else if(d=(d+360)%360-180,v^(d>l*p&&l*t>d)){var y=-o[1]*na;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);v?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Math.abs(r)>180?r+(r>0?360:-360):r}else d=n,v=e;Ha.point(n,e),t(n,e)}function i(){Ha.lineStart()}function o(){u(d,v),Ha.lineEnd(),Math.abs(y)>Go&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nLa?(s=-(h=180),f=-(g=90)):y>Go?g=90:-Go>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],mo.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),mo.geo.centroid=function(n){Fa=Pa=Oa=Ra=Ya=Ia=Ua=Za=Va=Xa=$a=0,mo.geo.stream(n,Ba);var t=Va,e=Xa,r=$a,u=t*t+e*e+r*r;return Ko>u&&(t=Ia,e=Ua,r=Za,Go>Pa&&(t=Oa,e=Ra,r=Ya),u=t*t+e*e+r*r,Ko>u)?[0/0,0/0]:[Math.atan2(e,t)*na,O(r/Math.sqrt(u))*na]};var Fa,Pa,Oa,Ra,Ya,Ia,Ua,Za,Va,Xa,$a,Ba={sphere:c,point:Rt,lineStart:It,lineEnd:Ut,polygonStart:function(){Ba.lineStart=Zt},polygonEnd:function(){Ba.lineStart=It}},Wa=Bt(Vt,Qt,te,[-Bo,-Bo/2]),Ja=1e9;mo.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=re(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(mo.geo.conicEqualArea=function(){return oe(ae)}).raw=ae,mo.geo.albers=function(){return mo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},mo.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=mo.geo.albers(),o=mo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=mo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Go,f+.12*l+Go],[s-.214*l-Go,f+.234*l-Go]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Go,f+.166*l+Go],[s-.115*l-Go,f+.234*l-Go]]).stream(c).point,n},n.scale(1070)};var Ga,Ka,Qa,nc,tc,ec,rc={point:c,lineStart:c,lineEnd:c,polygonStart:function(){Ka=0,rc.lineStart=ce},polygonEnd:function(){rc.lineStart=rc.lineEnd=rc.point=c,Ga+=Math.abs(Ka/2)}},uc={point:le,lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c},ic={point:he,lineStart:ge,lineEnd:pe,polygonStart:function(){ic.lineStart=de},polygonEnd:function(){ic.point=he,ic.lineStart=ge,ic.lineEnd=pe}};mo.geo.transform=function(n){return{stream:function(t){var e=new ye(t);for(var r in n)e[r]=n[r];return e}}},ye.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},mo.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),mo.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Ga=0,mo.geo.stream(n,u(rc)),Ga},n.centroid=function(n){return Oa=Ra=Ya=Ia=Ua=Za=Va=Xa=$a=0,mo.geo.stream(n,u(ic)),$a?[Va/$a,Xa/$a]:Za?[Ia/Za,Ua/Za]:Ya?[Oa/Ya,Ra/Ya]:[0/0,0/0]},n.bounds=function(n){return tc=ec=-(Qa=nc=1/0),mo.geo.stream(n,u(uc)),[[Qa,nc],[tc,ec]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||Me(n):dt,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new se:new ve(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(mo.geo.albersUsa()).context(null)},mo.geo.projection=xe,mo.geo.projectionMutator=be,(mo.geo.equirectangular=function(){return xe(we)}).raw=we.invert=we,mo.geo.rotation=function(n){function t(t){return t=n(t[0]*Qo,t[1]*Qo),t[0]*=na,t[1]*=na,t}return n=Ee(n[0]%360*Qo,n[1]*Qo,n.length>2?n[2]*Qo:0),t.invert=function(t){return t=n.invert(t[0]*Qo,t[1]*Qo),t[0]*=na,t[1]*=na,t},t},Se.invert=we,mo.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=Ee(-n[0]*Qo,-n[1]*Qo,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=na,n[1]*=na}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=Te((t=+r)*Qo,u*Qo),n):t},n.precision=function(r){return arguments.length?(e=Te(t*Qo,(u=+r)*Qo),n):u},n.angle(90)},mo.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Qo,u=n[1]*Qo,i=t[1]*Qo,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},mo.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return mo.range(Math.ceil(i/v)*v,u,v).map(h).concat(mo.range(Math.ceil(l/m)*m,c,m).map(g)).concat(mo.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Math.abs(n%v)>Go -}).map(s)).concat(mo.range(Math.ceil(a/d)*d,o,d).filter(function(n){return Math.abs(n%m)>Go}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,d=p,v=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(v=+t[0],m=+t[1],n):[v,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],n):[p,d]},n.precision=function(t){return arguments.length?(y=+t,s=ze(a,o,90),f=Ce(r,e,y),h=ze(l,c,90),g=Ce(i,u,y),n):y},n.majorExtent([[-180,-90+Go],[180,90-Go]]).minorExtent([[-180,-80-Go],[180,80+Go]])},mo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=De,u=je;return n.distance=function(){return mo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},mo.geo.interpolate=function(n,t){return Le(n[0]*Qo,n[1]*Qo,t[0]*Qo,t[1]*Qo)},mo.geo.length=function(n){return oc=0,mo.geo.stream(n,ac),oc};var oc,ac={sphere:c,point:c,lineStart:He,lineEnd:c,polygonStart:c,polygonEnd:c},cc=Fe(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(mo.geo.azimuthalEqualArea=function(){return xe(cc)}).raw=cc;var lc=Fe(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},dt);(mo.geo.azimuthalEquidistant=function(){return xe(lc)}).raw=lc,(mo.geo.conicConformal=function(){return oe(Pe)}).raw=Pe,(mo.geo.conicEquidistant=function(){return oe(Oe)}).raw=Oe;var sc=Fe(function(n){return 1/n},Math.atan);(mo.geo.gnomonic=function(){return xe(sc)}).raw=sc,Re.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Jo]},(mo.geo.mercator=function(){return Ye(Re)}).raw=Re;var fc=Fe(function(){return 1},Math.asin);(mo.geo.orthographic=function(){return xe(fc)}).raw=fc;var hc=Fe(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(mo.geo.stereographic=function(){return xe(hc)}).raw=hc,Ie.invert=function(n,t){return[Math.atan2(R(n),Math.cos(t)),O(Math.sin(t)/Y(n))]},(mo.geo.transverseMercator=function(){return Ye(Ie)}).raw=Ie,mo.geom={},mo.svg={},mo.svg.line=function(){return Ue(dt)};var gc=mo.map({linear:Xe,"linear-closed":$e,step:Be,"step-before":We,"step-after":Je,basis:er,"basis-open":rr,"basis-closed":ur,bundle:ir,cardinal:Qe,"cardinal-open":Ge,"cardinal-closed":Ke,monotone:fr});gc.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var pc=[0,2/3,1/3,0],dc=[0,1/3,2/3,0],vc=[0,1/6,2/3,1/6];mo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u,i,o,a,c,l,s,f,h,g,p,d=pt(e),v=pt(r),m=n.length,y=m-1,M=[],x=[],b=0;if(d===Ze&&r===Ve)t=n;else for(i=0,t=[];m>i;++i)t.push([+d.call(this,u=n[i],i),+v.call(this,u,i)]);for(i=1;m>i;++i)(t[i][1]i;++i)i!==b&&(c=t[i][1]-t[b][1],a=t[i][0]-t[b][0],M.push({angle:Math.atan2(c,a),index:i}));for(M.sort(function(n,t){return n.angle-t.angle}),g=M[0].angle,h=M[0].index,f=0,i=1;y>i;++i){if(o=M[i].index,g==M[i].angle){if(a=t[h][0]-t[b][0],c=t[h][1]-t[b][1],l=t[o][0]-t[b][0],s=t[o][1]-t[b][1],a*a+c*c>=l*l+s*s){M[i].index=-1;continue}M[f].index=-1}g=M[i].angle,f=i,h=o}for(x.push(b),i=0,o=0;2>i;++o)M[o].index>-1&&(x.push(M[o].index),i++);for(p=x.length;y>o;++o)if(!(M[o].index<0)){for(;!hr(x[p-2],x[p-1],M[o].index,t);)--p;x[p++]=M[o].index}var _=[];for(i=p-1;i>=0;--i)_.push(n[x[i]]);return _}var e=Ze,r=Ve;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},mo.geom.polygon=function(n){return Lo(n,mc),n};var mc=mo.geom.polygon.prototype=[];mc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++ta;a++)e.push([u,t[a],t[a+1]])}),e},mo.geom.voronoi=function(n){function t(n){var t,i,o,a=n.map(function(){return[]}),c=pt(e),l=pt(r),s=n.length,f=1e6;if(c===Ze&&l===Ve)t=n;else for(t=new Array(s),o=0;s>o;++o)t[o]=[+c.call(this,i=n[o],o),+l.call(this,i,o)];if(vr(t,function(n){var t,e,r,u,i,o;1===n.a&&n.b>=0?(t=n.ep.r,e=n.ep.l):(t=n.ep.l,e=n.ep.r),1===n.a?(i=t?t.y:-f,r=n.c-n.b*i,o=e?e.y:f,u=n.c-n.b*o):(r=t?t.x:-f,i=n.c-n.a*r,u=e?e.x:f,o=n.c-n.a*u);var c=[r,i],l=[u,o];a[n.region.l.index].push(c,l),a[n.region.r.index].push(c,l)}),a=a.map(function(n,e){var r=t[e][0],u=t[e][1],i=n.map(function(n){return Math.atan2(n[0]-r,n[1]-u)}),o=mo.range(n.length).sort(function(n,t){return i[n]-i[t]});return o.filter(function(n,t){return!t||i[n]-i[o[t-1]]>Go}).map(function(t){return n[t]})}),a.forEach(function(n,e){var r=n.length;if(!r)return n.push([-f,-f],[-f,f],[f,f],[f,-f]);if(!(r>2)){var u=t[e],i=n[0],o=n[1],a=u[0],c=u[1],l=i[0],s=i[1],h=o[0],g=o[1],p=Math.abs(h-l),d=g-s;if(Math.abs(d)c?-f:f;n.push([-f,v],[f,v])}else if(Go>p){var m=l>a?-f:f;n.push([m,-f],[m,f])}else{var v=(l-a)*(g-s)>(h-l)*(s-c)?f:-f,y=Math.abs(d)-p;Math.abs(y)d?v:-v,v]):(y>0&&(v*=-1),n.push([-f,v],[f,v]))}}}),u)for(o=0;s>o;++o)u.clip(a[o]);for(o=0;s>o;++o)a[o].point=n[o];return a}var e=Ze,r=Ve,u=null;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.clipExtent=function(n){if(!arguments.length)return u&&[u[0],u[2]];if(null==n)u=null;else{var e=+n[0][0],r=+n[0][1],i=+n[1][0],o=+n[1][1];u=mo.geom.polygon([[e,r],[e,o],[i,o],[i,r]])}return t},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):u&&u[2]},t.links=function(n){var t,u,i,o=n.map(function(){return[]}),a=[],c=pt(e),l=pt(r),s=n.length;if(c===Ze&&l===Ve)t=n;else for(t=new Array(s),i=0;s>i;++i)t[i]=[+c.call(this,u=n[i],i),+l.call(this,u,i)];return vr(t,function(t){var e=t.region.l.index,r=t.region.r.index;o[e][r]||(o[e][r]=o[r][e]=!0,a.push({source:n[e],target:n[r]}))}),a},t.triangles=function(n){if(e===Ze&&r===Ve)return mo.geom.delaunay(n);for(var t,u=new Array(c),i=pt(e),o=pt(r),a=-1,c=n.length;++a=l,h=r>=s,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=Mr()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,d,v,m,y,M=pt(a),x=pt(c);if(null!=t)d=t,v=e,m=r,y=u;else if(m=y=-(d=v=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.xm&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);d>b&&(d=b),v>_&&(v=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-d,S=y-v;w>S?y=v+w:m=d+S;var E=Mr();if(E.add=function(n){i(E,n,+M(n,++g),+x(n,g),d,v,m,y)},E.visit=function(n){xr(n,E,d,v,m,y)},g=-1,null==t){for(;++g=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=bc.get(e)||xc,r=_c.get(r)||dt,Ar(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},mo.interpolateHcl=Rr,mo.interpolateHsl=Yr,mo.interpolateLab=Ir,mo.interpolateRound=Ur,mo.transform=function(n){var t=xo.createElementNS(mo.ns.prefix.svg,"g");return(mo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Zr(e?e.matrix:wc)})(n)},Zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var wc={a:1,b:0,c:0,d:1,e:0,f:0};mo.interpolateTransform=Br,mo.layout={},mo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e(u-e)*a){var c=t.charge*a*a;return n.px-=i*c,n.py-=o*c,!0}if(t.point&&isFinite(a)){var c=t.pointCharge*a*a;n.px-=i*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=mo.event.x,n.py=mo.event.y,a.resume()}var e,r,u,i,o,a={},c=mo.dispatch("start","tick","end"),l=[1,1],s=.9,f=Sc,h=Ec,g=-30,p=.1,d=.8,v=[],m=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,d,y,M,x,b=v.length,_=m.length;for(e=0;_>e;++e)a=m[e],f=a.source,h=a.target,M=h.x-f.x,x=h.y-f.y,(d=M*M+x*x)&&(d=r*i[e]*((d=Math.sqrt(d))-u[e])/d,M*=d,x*=d,h.x-=M*(y=f.weight/(h.weight+f.weight)),h.y-=x*y,f.x+=M*(y=1-y),f.y+=x*y);if((y=r*p)&&(M=l[0]/2,x=l[1]/2,e=-1,y))for(;++e0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),mo.timer(a.tick)),a):r},a.start=function(){function n(n,r){for(var u,i=t(e),o=-1,a=i.length;++or;++r)c[r]=[];for(r=0;d>r;++r){var n=m[r];c[n.source.index].push(n.target),c[n.target.index].push(n.source)}}return c[e]}var e,r,c,s,p=v.length,d=m.length,y=l[0],M=l[1];for(e=0;p>e;++e)(s=v[e]).index=e,s.weight=0;for(e=0;d>e;++e)s=m[e],"number"==typeof s.source&&(s.source=v[s.source]),"number"==typeof s.target&&(s.target=v[s.target]),++s.source.weight,++s.target.weight;for(e=0;p>e;++e)s=v[e],isNaN(s.x)&&(s.x=n("x",y)),isNaN(s.y)&&(s.y=n("y",M)),isNaN(s.px)&&(s.px=s.x),isNaN(s.py)&&(s.py=s.y);if(u=[],"function"==typeof f)for(e=0;d>e;++e)u[e]=+f.call(this,m[e],e);else for(e=0;d>e;++e)u[e]=f;if(i=[],"function"==typeof h)for(e=0;d>e;++e)i[e]=+h.call(this,m[e],e);else for(e=0;d>e;++e)i[e]=h;if(o=[],"function"==typeof g)for(e=0;p>e;++e)o[e]=+g.call(this,v[e],e);else for(e=0;p>e;++e)o[e]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=mo.behavior.drag().origin(dt).on("dragstart.force",nu).on("drag.force",t).on("dragend.force",tu)),arguments.length?(this.on("mouseover.force",eu).on("mouseout.force",ru).call(e),void 0):e},mo.rebind(a,c,"on")};var Sc=20,Ec=1;mo.layout.hierarchy=function(){function n(t,o,a){var c=u.call(e,t,o);if(t.depth=o,a.push(t),c&&(l=c.length)){for(var l,s,f=-1,h=t.children=[],g=0,p=o+1;++fg;++g)for(u.call(n,l[0][g],p=d[g],s[0][g][1]),h=1;v>h;++h)u.call(n,l[h][g],p+=s[h-1][g][1],s[h][g][1]);return a}var t=dt,e=gu,r=pu,u=hu,i=su,o=fu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:Ac.get(t)||gu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:Nc.get(t)||pu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var Ac=mo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(vu),o=mo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return mo.range(n.length).reverse()},"default":gu}),Nc=mo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:pu});mo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i0)for(i=-1;++i=s[0]&&a<=s[1]&&(o=c[mo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=xu,u=yu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=pt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return Mu(n,t)}:pt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},mo.layout.tree=function(){function n(n,i){function o(n,t){var r=n.children,u=n._tree;if(r&&(i=r.length)){for(var i,a,l,s=r[0],f=s,h=-1;++h0&&(qu(zu(a,n,r),n,u),l+=u,s+=u),f+=a._tree.mod,l+=i._tree.mod,h+=c._tree.mod,s+=o._tree.mod;a&&!wu(o)&&(o._tree.thread=a,o._tree.mod+=f-s),i&&!_u(c)&&(c._tree.thread=i,c._tree.mod+=l-h,r=n)}return r}var l=t.call(this,n,i),s=l[0];Nu(s,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),o(s),a(s,-s._tree.prelim);var f=Su(s,ku),h=Su(s,Eu),g=Su(s,Au),p=f.x-e(f,h)/2,d=h.x+e(h,f)/2,v=g.depth||1;return Nu(s,u?function(n){n.x*=r[0],n.y=n.depth*r[1],delete n._tree}:function(n){n.x=(n.x-p)/(d-p)*r[0],n.y=n.depth/v*r[1],delete n._tree}),l}var t=mo.layout.hierarchy().sort(null).value(null),e=bu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},iu(n,t)},mo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Nu(a,function(n){n.r=+s(n.value)}),Nu(a,Hu),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Nu(a,function(n){n.r+=f}),Nu(a,Hu),Nu(a,function(n){n.r-=f})}return Ou(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=mo.layout.hierarchy().sort(Cu),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},iu(n,e)},mo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Nu(c,function(n){var t=n.children;t&&t.length?(n.x=Iu(t),n.y=Yu(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Uu(c),f=Zu(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Nu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=mo.layout.hierarchy().sort(null).value(null),e=bu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},iu(n,t)},mo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++ut?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,d="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,d))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,d,l,!1),d=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,d,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++oe&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++ie.dx)&&(s=e.dx);++ie&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=mo.random.normal.apply(mo,arguments);return function(){return Math.exp(n())}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t/n}}},mo.scale={};var Tc={floor:dt,ceil:dt};mo.scale.linear=function(){return Qu([0,1],[0,1],Er,!1)},mo.scale.log=function(){return ii(mo.scale.linear().domain([0,1]),10,!0,[1,10])};var qc=mo.format(".0e"),zc={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};mo.scale.pow=function(){return oi(mo.scale.linear(),1,[0,1])},mo.scale.sqrt=function(){return mo.scale.pow().exponent(.5)},mo.scale.ordinal=function(){return ci([],{t:"range",a:[[]]})},mo.scale.category10=function(){return mo.scale.ordinal().range(Cc)},mo.scale.category20=function(){return mo.scale.ordinal().range(Dc)},mo.scale.category20b=function(){return mo.scale.ordinal().range(jc)},mo.scale.category20c=function(){return mo.scale.ordinal().range(Lc)};var Cc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(it),Dc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(it),jc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(it),Lc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(it);mo.scale.quantile=function(){return li([],[])},mo.scale.quantize=function(){return si(0,1,[0,1])},mo.scale.threshold=function(){return fi([.5],[0,1])},mo.scale.identity=function(){return hi([0,1])},mo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+Hc,a=u.apply(this,arguments)+Hc,c=(o>a&&(c=o,o=a,a=c),a-o),l=Bo>c?"0":"1",s=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=Fc?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+l+",0 "+n*s+","+n*f+"Z":"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=gi,e=pi,r=di,u=vi;return n.innerRadius=function(e){return arguments.length?(t=pt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=pt(t),n):e},n.startAngle=function(t){return arguments.length?(r=pt(t),n):r},n.endAngle=function(t){return arguments.length?(u=pt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+Hc;return[Math.cos(i)*n,Math.sin(i)*n]},n};var Hc=-Jo,Fc=Wo-Go;mo.svg.line.radial=function(){var n=Ue(mi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},We.reverse=Je,Je.reverse=We,mo.svg.area=function(){return yi(dt)},mo.svg.area.radial=function(){var n=yi(mi);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},mo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+Hc,s=l.call(n,u,r)+Hc;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Bo)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=De,o=je,a=Mi,c=di,l=vi;return n.radius=function(t){return arguments.length?(a=pt(t),n):a},n.source=function(t){return arguments.length?(i=pt(t),n):i},n.target=function(t){return arguments.length?(o=pt(t),n):o},n.startAngle=function(t){return arguments.length?(c=pt(t),n):c},n.endAngle=function(t){return arguments.length?(l=pt(t),n):l},n},mo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=De,e=je,r=xi;return n.source=function(e){return arguments.length?(t=pt(e),n):t},n.target=function(t){return arguments.length?(e=pt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},mo.svg.diagonal.radial=function(){var n=mo.svg.diagonal(),t=xi,e=n.projection;return n.projection=function(n){return arguments.length?e(bi(t=n)):t},n},mo.svg.symbol=function(){function n(n,r){return(Pc.get(t.call(this,n,r))||Si)(e.call(this,n,r))}var t=wi,e=_i;return n.type=function(e){return arguments.length?(t=pt(e),n):t},n.size=function(t){return arguments.length?(e=pt(t),n):e},n};var Pc=mo.map({circle:Si,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ic)),e=t*Ic;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Yc),e=t*Yc/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Yc),e=t*Yc/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});mo.svg.symbolTypes=Pc.keys();var Oc,Rc,Yc=Math.sqrt(3),Ic=Math.tan(30*Qo),Uc=[],Zc=0;Uc.call=Ro.call,Uc.empty=Ro.empty,Uc.node=Ro.node,Uc.size=Ro.size,mo.transition=function(n){return arguments.length?Oc?n.transition():n:Uo.transition()},mo.transition.prototype=Uc,Uc.select=function(n){var t,e,r,u=this.id,i=[];n=d(n);for(var o=-1,a=this.length;++oi;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a)&&t.push(r)}return Ei(u,this.id)},Uc.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):N(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Uc.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n)) -})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Br:Er,a=mo.ns.qualify(n);return ki(this,"attr."+n,t,a.local?i:u)},Uc.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=mo.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Uc.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=_o.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=Er(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return ki(this,"style."+n,t,u)},Uc.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,_o.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Uc.text=function(n){return ki(this,"text",n,Ai)},Uc.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Uc.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=mo.ease.apply(mo,arguments)),N(this,function(e){e.__transition__[t].ease=n}))},Uc.delay=function(n){var t=this.id;return N(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Uc.duration=function(n){var t=this.id;return N(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Uc.each=function(n,t){var e=this.id;if(arguments.length<2){var r=Rc,u=Oc;Oc=e,N(this,function(t,r,u){Rc=t.__transition__[e],n.call(t,t.__data__,r,u)}),Rc=r,Oc=u}else N(this,function(r){var u=r.__transition__[e];(u.event||(u.event=mo.dispatch("start","end"))).on(n,t)});return this},Uc.transition=function(){for(var n,t,e,r,u=this.id,i=++Zc,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],l=0,s=t.length;s>l;l++)(e=t[l])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Ni(e,l,i,r)),n.push(e)}return Ei(o,i)},mo.svg.axis=function(){function n(n){n.each(function(){var n,l=mo.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):dt:t,p=l.selectAll(".tick").data(h,f),d=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Go),v=mo.transition(p.exit()).style("opacity",Go).remove(),m=mo.transition(p).style("opacity",1),y=Bu(f),M=l.selectAll(".domain").data([0]),x=(M.enter().append("path").attr("class","domain"),mo.transition(M));d.append("line"),d.append("text");var b=d.select("line"),_=m.select("line"),w=p.select("text").text(g),S=d.select("text"),E=m.select("text");switch(r){case"bottom":n=Ti,b.attr("y2",u),S.attr("y",Math.max(u,0)+o),_.attr("x2",0).attr("y2",u),E.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),x.attr("d","M"+y[0]+","+i+"V0H"+y[1]+"V"+i);break;case"top":n=Ti,b.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),_.attr("x2",0).attr("y2",-u),E.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),x.attr("d","M"+y[0]+","+-i+"V0H"+y[1]+"V"+-i);break;case"left":n=qi,b.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),_.attr("x2",-u).attr("y2",0),E.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),x.attr("d","M"+-i+","+y[0]+"H0V"+y[1]+"H"+-i);break;case"right":n=qi,b.attr("x2",u),S.attr("x",Math.max(u,0)+o),_.attr("x2",u).attr("y2",0),E.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),x.attr("d","M"+i+","+y[0]+"H0V"+y[1]+"H"+i)}if(f.rangeBand){var k=f.rangeBand()/2,A=function(n){return f(n)+k};d.call(n,A),m.call(n,A)}else d.call(n,s),m.call(n,f),v.call(n,f)})}var t,e=mo.scale.linear(),r=Vc,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xc?t+"":Vc,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vc="bottom",Xc={top:1,right:1,bottom:1,left:1};mo.svg.brush=function(){function n(i){i.each(function(){var i=mo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(v,dt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $c[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var s,f=mo.transition(i),h=mo.transition(o);c&&(s=Bu(c),h.attr("x",s[0]).attr("width",s[1]-s[0]),e(f)),l&&(s=Bu(l),h.attr("y",s[0]).attr("height",s[1]-s[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function r(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==mo.event.keyCode&&(N||(M=null,q[0]-=s[1],q[1]-=h[1],N=2),f())}function g(){32==mo.event.keyCode&&2==N&&(q[0]+=s[1],q[1]+=h[1],N=0,f())}function v(){var n=mo.mouse(b),u=!1;x&&(n[0]+=x[0],n[1]+=x[1]),N||(mo.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),q[0]=s[+(n[0]f?(u=r,r=f):u=f),g[0]!=r||g[1]!=u?(e?o=null:i=null,g[0]=r,g[1]=u,!0):void 0}function y(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),mo.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),w({type:"brushend"})}var M,x,b=this,_=mo.select(mo.event.target),w=a.of(b,arguments),S=mo.select(b),E=_.datum(),k=!/^(n|s)$/.test(E)&&c,A=!/^(e|w)$/.test(E)&&l,N=_.classed("extent"),T=L(),q=mo.mouse(b),z=mo.select(_o).on("keydown.brush",u).on("keyup.brush",g);if(mo.event.changedTouches?z.on("touchmove.brush",v).on("touchend.brush",y):z.on("mousemove.brush",v).on("mouseup.brush",y),S.interrupt().selectAll("*").interrupt(),N)q[0]=s[0]-q[0],q[1]=h[0]-q[1];else if(E){var C=+/w$/.test(E),D=+/^n/.test(E);x=[s[1-C]-q[0],h[1-D]-q[1]],q[0]=s[C],q[1]=h[D]}else mo.event.altKey&&(M=q.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),mo.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=g(n,"brushstart","brush","brushend"),c=null,l=null,s=[0,0],h=[0,0],p=!0,d=!0,v=Bc[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:s,y:h,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Oc?mo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=kr(s,t.x),r=kr(h,t.y);return i=o=null,function(u){s=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bc[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,v=Bc[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(p=!!t[0],d=!!t[1]):c?p=!!t:l&&(d=!!t),n):c&&l?[p,d]:c?p:l?d:null},n.extent=function(t){var e,r,u,a,f;return arguments.length?(c&&(e=t[0],r=t[1],l&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(f=e,e=r,r=f),(e!=s[0]||r!=s[1])&&(s=[e,r])),l&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],l.invert&&(u=l(u),a=l(a)),u>a&&(f=u,u=a,a=f),(u!=h[0]||a!=h[1])&&(h=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(f=e,e=r,r=f))),l&&(o?(u=o[0],a=o[1]):(u=h[0],a=h[1],l.invert&&(u=l.invert(u),a=l.invert(a)),u>a&&(f=u,u=a,a=f))),c&&l?[[e,u],[r,a]]:c?[e,r]:l&&[u,a])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],i=o=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!l&&h[0]==h[1]},mo.rebind(n,a,"on")};var $c={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wc=mo.time={},Jc=Date,Gc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];zi.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Kc.setUTCDate.apply(this._,arguments)},setDay:function(){Kc.setUTCDay.apply(this._,arguments)},setFullYear:function(){Kc.setUTCFullYear.apply(this._,arguments)},setHours:function(){Kc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Kc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Kc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Kc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Kc.setUTCSeconds.apply(this._,arguments)},setTime:function(){Kc.setTime.apply(this._,arguments)}};var Kc=Date.prototype,Qc="%a %b %e %X %Y",nl="%m/%d/%Y",tl="%H:%M:%S",el=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],rl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ul=["January","February","March","April","May","June","July","August","September","October","November","December"],il=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Wc.year=Ci(function(n){return n=Wc.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Wc.years=Wc.year.range,Wc.years.utc=Wc.year.utc.range,Wc.day=Ci(function(n){var t=new Jc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Wc.days=Wc.day.range,Wc.days.utc=Wc.day.utc.range,Wc.dayOfYear=function(n){var t=Wc.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},Gc.forEach(function(n,t){n=n.toLowerCase(),t=7-t;var e=Wc[n]=Ci(function(n){return(n=Wc.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Wc.year(n).getDay();return Math.floor((Wc.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Wc[n+"s"]=e.range,Wc[n+"s"].utc=e.utc.range,Wc[n+"OfYear"]=function(n){var e=Wc.year(n).getDay();return Math.floor((Wc.dayOfYear(n)+(e+t)%7)/7)}}),Wc.week=Wc.sunday,Wc.weeks=Wc.sunday.range,Wc.weeks.utc=Wc.sunday.utc.range,Wc.weekOfYear=Wc.sundayOfYear,Wc.format=ji;var ol=Hi(el),al=Fi(el),cl=Hi(rl),ll=Fi(rl),sl=Hi(ul),fl=Fi(ul),hl=Hi(il),gl=Fi(il),pl=/^%/,dl={"-":"",_:" ",0:"0"},vl={a:function(n){return rl[n.getDay()]},A:function(n){return el[n.getDay()]},b:function(n){return il[n.getMonth()]},B:function(n){return ul[n.getMonth()]},c:ji(Qc),d:function(n,t){return Pi(n.getDate(),t,2)},e:function(n,t){return Pi(n.getDate(),t,2)},H:function(n,t){return Pi(n.getHours(),t,2)},I:function(n,t){return Pi(n.getHours()%12||12,t,2)},j:function(n,t){return Pi(1+Wc.dayOfYear(n),t,3)},L:function(n,t){return Pi(n.getMilliseconds(),t,3)},m:function(n,t){return Pi(n.getMonth()+1,t,2)},M:function(n,t){return Pi(n.getMinutes(),t,2)},p:function(n){return n.getHours()>=12?"PM":"AM"},S:function(n,t){return Pi(n.getSeconds(),t,2)},U:function(n,t){return Pi(Wc.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Pi(Wc.mondayOfYear(n),t,2)},x:ji(nl),X:ji(tl),y:function(n,t){return Pi(n.getFullYear()%100,t,2)},Y:function(n,t){return Pi(n.getFullYear()%1e4,t,4)},Z:ao,"%":function(){return"%"}},ml={a:Oi,A:Ri,b:Zi,B:Vi,c:Xi,d:no,e:no,H:eo,I:eo,j:to,L:io,m:Qi,M:ro,p:oo,S:uo,U:Ii,w:Yi,W:Ui,x:$i,X:Bi,y:Ji,Y:Wi,Z:Gi,"%":co},yl=/^\s*\d+/,Ml=mo.map({am:0,pm:1});ji.utc=lo;var xl=lo("%Y-%m-%dT%H:%M:%S.%LZ");ji.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?so:xl,so.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},so.toString=xl.toString,Wc.second=Ci(function(n){return new Jc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Wc.seconds=Wc.second.range,Wc.seconds.utc=Wc.second.utc.range,Wc.minute=Ci(function(n){return new Jc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Wc.minutes=Wc.minute.range,Wc.minutes.utc=Wc.minute.utc.range,Wc.hour=Ci(function(n){var t=n.getTimezoneOffset()/60;return new Jc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Wc.hours=Wc.hour.range,Wc.hours.utc=Wc.hour.utc.range,Wc.month=Ci(function(n){return n=Wc.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Wc.months=Wc.month.range,Wc.months.utc=Wc.month.utc.range;var bl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],_l=[[Wc.second,1],[Wc.second,5],[Wc.second,15],[Wc.second,30],[Wc.minute,1],[Wc.minute,5],[Wc.minute,15],[Wc.minute,30],[Wc.hour,1],[Wc.hour,3],[Wc.hour,6],[Wc.hour,12],[Wc.day,1],[Wc.day,2],[Wc.week,1],[Wc.month,1],[Wc.month,3],[Wc.year,1]],wl=[[ji("%Y"),Vt],[ji("%B"),function(n){return n.getMonth()}],[ji("%b %d"),function(n){return 1!=n.getDate()}],[ji("%a %d"),function(n){return n.getDay()&&1!=n.getDate()}],[ji("%I %p"),function(n){return n.getHours()}],[ji("%I:%M"),function(n){return n.getMinutes()}],[ji(":%S"),function(n){return n.getSeconds()}],[ji(".%L"),function(n){return n.getMilliseconds()}]],Sl=go(wl);_l.year=Wc.year,Wc.scale=function(){return fo(mo.scale.linear(),_l,Sl)};var El={range:function(n,t,e){return mo.range(+n,+t,e).map(ho)}},kl=_l.map(function(n){return[n[0].utc,n[1]]}),Al=[[lo("%Y"),Vt],[lo("%B"),function(n){return n.getUTCMonth()}],[lo("%b %d"),function(n){return 1!=n.getUTCDate()}],[lo("%a %d"),function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],[lo("%I %p"),function(n){return n.getUTCHours()}],[lo("%I:%M"),function(n){return n.getUTCMinutes()}],[lo(":%S"),function(n){return n.getUTCSeconds()}],[lo(".%L"),function(n){return n.getUTCMilliseconds()}]],Nl=go(Al);return kl.year=Wc.year.utc,Wc.scale.utc=function(){return fo(mo.scale.linear(),kl,Nl)},mo.text=vt(function(n){return n.responseText}),mo.json=function(n,t){return mt(n,"application/json",po,t)},mo.html=function(n,t){return mt(n,"text/html",vo,t)},mo.xml=vt(function(n){return n.responseXML}),mo}(); +d3 = function () { + function n(n) { + return null != n && !isNaN(n) + } + + function t(n) { + return n.length + } + + function e(n) { + for (var t = 1; n * t % 1;) t *= 10; + return t + } + + function r(n, t) { + try { + for (var e in t) Object.defineProperty(n.prototype, e, {value: t[e], enumerable: !1}) + } catch (r) { + n.prototype = t + } + } + + function u() { + } + + function i() { + } + + function o(n, t, e) { + return function () { + var r = e.apply(t, arguments); + return r === t ? n : r + } + } + + function a(n, t) { + if (t in n) return t; + t = t.charAt(0).toUpperCase() + t.substring(1); + for (var e = 0, r = Do.length; r > e; ++e) { + var u = Do[e] + t; + if (u in n) return u + } + } + + function c() { + } + + function l() { + } + + function s(n) { + function t() { + for (var t, r = e, u = -1, i = r.length; ++u < i;) (t = r[u].on) && t.apply(this, arguments); + return n + } + + var e = [], r = new u; + return t.on = function (t, u) { + var i, o = r.get(t); + return arguments.length < 2 ? o && o.on : (o && (o.on = null, e = e.slice(0, i = e.indexOf(o)).concat(e.slice(i + 1)), r.remove(t)), u && e.push(r.set(t, {on: u})), n) + }, t + } + + function f() { + mo.event.preventDefault() + } + + function h() { + for (var n, t = mo.event; n = t.sourceEvent;) t = n; + return t + } + + function g(n) { + for (var t = new l, e = 0, r = arguments.length; ++e < r;) t[arguments[e]] = s(t); + return t.of = function (e, r) { + return function (u) { + try { + var i = u.sourceEvent = mo.event; + u.target = n, mo.event = u, t[u.type].apply(e, r) + } finally { + mo.event = i + } + } + }, t + } + + function p(n) { + return Lo(n, Ro), n + } + + function d(n) { + return "function" == typeof n ? n : function () { + return Ho(n, this) + } + } + + function v(n) { + return "function" == typeof n ? n : function () { + return Fo(n, this) + } + } + + function m(n, t) { + function e() { + this.removeAttribute(n) + } + + function r() { + this.removeAttributeNS(n.space, n.local) + } + + function u() { + this.setAttribute(n, t) + } + + function i() { + this.setAttributeNS(n.space, n.local, t) + } + + function o() { + var e = t.apply(this, arguments); + null == e ? this.removeAttribute(n) : this.setAttribute(n, e) + } + + function a() { + var e = t.apply(this, arguments); + null == e ? this.removeAttributeNS(n.space, n.local) : this.setAttributeNS(n.space, n.local, e) + } + + return n = mo.ns.qualify(n), null == t ? n.local ? r : e : "function" == typeof t ? n.local ? a : o : n.local ? i : u + } + + function y(n) { + return n.trim().replace(/\s+/g, " ") + } + + function M(n) { + return new RegExp("(?:^|\\s+)" + mo.requote(n) + "(?:\\s+|$)", "g") + } + + function x(n, t) { + function e() { + for (var e = -1; ++e < u;) n[e](this, t) + } + + function r() { + for (var e = -1, r = t.apply(this, arguments); ++e < u;) n[e](this, r) + } + + n = n.trim().split(/\s+/).map(b); + var u = n.length; + return "function" == typeof t ? r : e + } + + function b(n) { + var t = M(n); + return function (e, r) { + if (u = e.classList) return r ? u.add(n) : u.remove(n); + var u = e.getAttribute("class") || ""; + r ? (t.lastIndex = 0, t.test(u) || e.setAttribute("class", y(u + " " + n))) : e.setAttribute("class", y(u.replace(t, " "))) + } + } + + function _(n, t, e) { + function r() { + this.style.removeProperty(n) + } + + function u() { + this.style.setProperty(n, t, e) + } + + function i() { + var r = t.apply(this, arguments); + null == r ? this.style.removeProperty(n) : this.style.setProperty(n, r, e) + } + + return null == t ? r : "function" == typeof t ? i : u + } + + function w(n, t) { + function e() { + delete this[n] + } + + function r() { + this[n] = t + } + + function u() { + var e = t.apply(this, arguments); + null == e ? delete this[n] : this[n] = e + } + + return null == t ? e : "function" == typeof t ? u : r + } + + function S(n) { + return "function" == typeof n ? n : (n = mo.ns.qualify(n)).local ? function () { + return xo.createElementNS(n.space, n.local) + } : function () { + return xo.createElementNS(this.namespaceURI, n) + } + } + + function E(n) { + return {__data__: n} + } + + function k(n) { + return function () { + return Oo(this, n) + } + } + + function A(n) { + return arguments.length || (n = mo.ascending), function (t, e) { + return t && e ? n(t.__data__, e.__data__) : !t - !e + } + } + + function N(n, t) { + for (var e = 0, r = n.length; r > e; e++) for (var u, i = n[e], o = 0, a = i.length; a > o; o++) (u = i[o]) && t(u, o, e); + return n + } + + function T(n) { + return Lo(n, Io), n + } + + function q(n) { + var t, e; + return function (r, u, i) { + var o, a = n[i].update, c = a.length; + for (i != e && (e = i, t = 0), u >= t && (t = u + 1); !(o = a[t]) && ++t < c;) ; + return o + } + } + + function z() { + var n = this.__transition__; + n && ++n.active + } + + function C(n, t, e) { + function r() { + var t = this[o]; + t && (this.removeEventListener(n, t, t.$), delete this[o]) + } + + function u() { + var u = l(t, Mo(arguments)); + r.call(this), this.addEventListener(n, this[o] = u, u.$ = e), u._ = t + } + + function i() { + var t, e = new RegExp("^__on([^.]+)" + mo.requote(n) + "$"); + for (var r in this) if (t = r.match(e)) { + var u = this[r]; + this.removeEventListener(t[1], u, u.$), delete this[r] + } + } + + var o = "__on" + n, a = n.indexOf("."), l = D; + a > 0 && (n = n.substring(0, a)); + var s = Zo.get(n); + return s && (n = s, l = j), a ? t ? u : r : t ? c : i + } + + function D(n, t) { + return function (e) { + var r = mo.event; + mo.event = e, t[0] = this.__data__; + try { + n.apply(this, t) + } finally { + mo.event = r + } + } + } + + function j(n, t) { + var e = D(n, t); + return function (n) { + var t = this, r = n.relatedTarget; + r && (r === t || 8 & r.compareDocumentPosition(t)) || e.call(t, n) + } + } + + function L() { + var n = ".dragsuppress-" + ++Xo, t = "touchmove" + n, e = "selectstart" + n, r = "dragstart" + n, + u = "click" + n, i = mo.select(_o).on(t, f).on(e, f).on(r, f), o = bo.style, a = o[Vo]; + return o[Vo] = "none", function (t) { + function e() { + i.on(u, null) + } + + i.on(n, null), o[Vo] = a, t && (i.on(u, function () { + f(), e() + }, !0), setTimeout(e, 0)) + } + } + + function H(n, t) { + t.changedTouches && (t = t.changedTouches[0]); + var e = n.ownerSVGElement || n; + if (e.createSVGPoint) { + var r = e.createSVGPoint(); + if (0 > $o && (_o.scrollX || _o.scrollY)) { + e = mo.select("body").append("svg").style({ + position: "absolute", + top: 0, + left: 0, + margin: 0, + padding: 0, + border: "none" + }, "important"); + var u = e[0][0].getScreenCTM(); + $o = !(u.f || u.e), e.remove() + } + return $o ? (r.x = t.pageX, r.y = t.pageY) : (r.x = t.clientX, r.y = t.clientY), r = r.matrixTransform(n.getScreenCTM().inverse()), [r.x, r.y] + } + var i = n.getBoundingClientRect(); + return [t.clientX - i.left - n.clientLeft, t.clientY - i.top - n.clientTop] + } + + function F(n) { + return n > 0 ? 1 : 0 > n ? -1 : 0 + } + + function P(n) { + return n > 1 ? 0 : -1 > n ? Bo : Math.acos(n) + } + + function O(n) { + return n > 1 ? Jo : -1 > n ? -Jo : Math.asin(n) + } + + function R(n) { + return ((n = Math.exp(n)) - 1 / n) / 2 + } + + function Y(n) { + return ((n = Math.exp(n)) + 1 / n) / 2 + } + + function I(n) { + return ((n = Math.exp(2 * n)) - 1) / (n + 1) + } + + function U(n) { + return (n = Math.sin(n / 2)) * n + } + + function Z() { + } + + function V(n, t, e) { + return new X(n, t, e) + } + + function X(n, t, e) { + this.h = n, this.s = t, this.l = e + } + + function $(n, t, e) { + function r(n) { + return n > 360 ? n -= 360 : 0 > n && (n += 360), 60 > n ? i + (o - i) * n / 60 : 180 > n ? o : 240 > n ? i + (o - i) * (240 - n) / 60 : i + } + + function u(n) { + return Math.round(255 * r(n)) + } + + var i, o; + return n = isNaN(n) ? 0 : (n %= 360) < 0 ? n + 360 : n, t = isNaN(t) ? 0 : 0 > t ? 0 : t > 1 ? 1 : t, e = 0 > e ? 0 : e > 1 ? 1 : e, o = .5 >= e ? e * (1 + t) : e + t - e * t, i = 2 * e - o, ot(u(n + 120), u(n), u(n - 120)) + } + + function B(n, t, e) { + return new W(n, t, e) + } + + function W(n, t, e) { + this.h = n, this.c = t, this.l = e + } + + function J(n, t, e) { + return isNaN(n) && (n = 0), isNaN(t) && (t = 0), G(e, Math.cos(n *= Qo) * t, Math.sin(n) * t) + } + + function G(n, t, e) { + return new K(n, t, e) + } + + function K(n, t, e) { + this.l = n, this.a = t, this.b = e + } + + function Q(n, t, e) { + var r = (n + 16) / 116, u = r + t / 500, i = r - e / 200; + return u = tt(u) * sa, r = tt(r) * fa, i = tt(i) * ha, ot(rt(3.2404542 * u - 1.5371385 * r - .4985314 * i), rt(-.969266 * u + 1.8760108 * r + .041556 * i), rt(.0556434 * u - .2040259 * r + 1.0572252 * i)) + } + + function nt(n, t, e) { + return n > 0 ? B(Math.atan2(e, t) * na, Math.sqrt(t * t + e * e), n) : B(0 / 0, 0 / 0, n) + } + + function tt(n) { + return n > .206893034 ? n * n * n : (n - 4 / 29) / 7.787037 + } + + function et(n) { + return n > .008856 ? Math.pow(n, 1 / 3) : 7.787037 * n + 4 / 29 + } + + function rt(n) { + return Math.round(255 * (.00304 >= n ? 12.92 * n : 1.055 * Math.pow(n, 1 / 2.4) - .055)) + } + + function ut(n) { + return ot(n >> 16, 255 & n >> 8, 255 & n) + } + + function it(n) { + return ut(n) + "" + } + + function ot(n, t, e) { + return new at(n, t, e) + } + + function at(n, t, e) { + this.r = n, this.g = t, this.b = e + } + + function ct(n) { + return 16 > n ? "0" + Math.max(0, n).toString(16) : Math.min(255, n).toString(16) + } + + function lt(n, t, e) { + var r, u, i, o = 0, a = 0, c = 0; + if (r = /([a-z]+)\((.*)\)/i.exec(n)) switch (u = r[2].split(","), r[1]) { + case"hsl": + return e(parseFloat(u[0]), parseFloat(u[1]) / 100, parseFloat(u[2]) / 100); + case"rgb": + return t(gt(u[0]), gt(u[1]), gt(u[2])) + } + return (i = da.get(n)) ? t(i.r, i.g, i.b) : (null != n && "#" === n.charAt(0) && (4 === n.length ? (o = n.charAt(1), o += o, a = n.charAt(2), a += a, c = n.charAt(3), c += c) : 7 === n.length && (o = n.substring(1, 3), a = n.substring(3, 5), c = n.substring(5, 7)), o = parseInt(o, 16), a = parseInt(a, 16), c = parseInt(c, 16)), t(o, a, c)) + } + + function st(n, t, e) { + var r, u, i = Math.min(n /= 255, t /= 255, e /= 255), o = Math.max(n, t, e), a = o - i, c = (o + i) / 2; + return a ? (u = .5 > c ? a / (o + i) : a / (2 - o - i), r = n == o ? (t - e) / a + (e > t ? 6 : 0) : t == o ? (e - n) / a + 2 : (n - t) / a + 4, r *= 60) : (r = 0 / 0, u = c > 0 && 1 > c ? 0 : r), V(r, u, c) + } + + function ft(n, t, e) { + n = ht(n), t = ht(t), e = ht(e); + var r = et((.4124564 * n + .3575761 * t + .1804375 * e) / sa), + u = et((.2126729 * n + .7151522 * t + .072175 * e) / fa), + i = et((.0193339 * n + .119192 * t + .9503041 * e) / ha); + return G(116 * u - 16, 500 * (r - u), 200 * (u - i)) + } + + function ht(n) { + return (n /= 255) <= .04045 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4) + } + + function gt(n) { + var t = parseFloat(n); + return "%" === n.charAt(n.length - 1) ? Math.round(2.55 * t) : t + } + + function pt(n) { + return "function" == typeof n ? n : function () { + return n + } + } + + function dt(n) { + return n + } + + function vt(n) { + return function (t, e, r) { + return 2 === arguments.length && "function" == typeof e && (r = e, e = null), mt(t, e, n, r) + } + } + + function mt(n, t, e, r) { + function u() { + var n, t = c.status; + if (!t && c.responseText || t >= 200 && 300 > t || 304 === t) { + try { + n = e.call(i, c) + } catch (r) { + return o.error.call(i, r), void 0 + } + o.load.call(i, n) + } else o.error.call(i, c) + } + + var i = {}, o = mo.dispatch("beforesend", "progress", "load", "error"), a = {}, c = new XMLHttpRequest, + l = null; + return !_o.XDomainRequest || "withCredentials" in c || !/^(http(s)?:)?\/\//.test(n) || (c = new XDomainRequest), "onload" in c ? c.onload = c.onerror = u : c.onreadystatechange = function () { + c.readyState > 3 && u() + }, c.onprogress = function (n) { + var t = mo.event; + mo.event = n; + try { + o.progress.call(i, c) + } finally { + mo.event = t + } + }, i.header = function (n, t) { + return n = (n + "").toLowerCase(), arguments.length < 2 ? a[n] : (null == t ? delete a[n] : a[n] = t + "", i) + }, i.mimeType = function (n) { + return arguments.length ? (t = null == n ? null : n + "", i) : t + }, i.responseType = function (n) { + return arguments.length ? (l = n, i) : l + }, i.response = function (n) { + return e = n, i + }, ["get", "post"].forEach(function (n) { + i[n] = function () { + return i.send.apply(i, [n].concat(Mo(arguments))) + } + }), i.send = function (e, r, u) { + if (2 === arguments.length && "function" == typeof r && (u = r, r = null), c.open(e, n, !0), null == t || "accept" in a || (a.accept = t + ",*/*"), c.setRequestHeader) for (var s in a) c.setRequestHeader(s, a[s]); + return null != t && c.overrideMimeType && c.overrideMimeType(t), null != l && (c.responseType = l), null != u && i.on("error", u).on("load", function (n) { + u(null, n) + }), o.beforesend.call(i, c), c.send(null == r ? null : r), i + }, i.abort = function () { + return c.abort(), i + }, mo.rebind(i, o, "on"), null == r ? i : i.get(yt(r)) + } + + function yt(n) { + return 1 === n.length ? function (t, e) { + n(null == t ? e : null) + } : n + } + + function Mt() { + var n = bt(), t = _t() - n; + t > 24 ? (isFinite(t) && (clearTimeout(Ma), Ma = setTimeout(Mt, t)), ya = 0) : (ya = 1, ba(Mt)) + } + + function xt(n, t, e) { + var r = arguments.length; + 2 > r && (t = 0), 3 > r && (e = Date.now()), xa.callback = n, xa.time = e + t + } + + function bt() { + var n = Date.now(); + for (xa = va; xa;) n >= xa.time && (xa.flush = xa.callback(n - xa.time)), xa = xa.next; + return n + } + + function _t() { + for (var n, t = va, e = 1 / 0; t;) t.flush ? t = n ? n.next = t.next : va = t.next : (t.time < e && (e = t.time), t = (n = t).next); + return ma = n, e + } + + function wt(n, t) { + var e = Math.pow(10, 3 * Math.abs(8 - t)); + return { + scale: t > 8 ? function (n) { + return n / e + } : function (n) { + return n * e + }, symbol: n + } + } + + function St(n, t) { + return t - (n ? Math.ceil(Math.log(n) / Math.LN10) : 1) + } + + function Et(n) { + return n + "" + } + + function kt() { + } + + function At(n, t, e) { + var r = e.s = n + t, u = r - n, i = r - u; + e.t = n - i + (t - u) + } + + function Nt(n, t) { + n && Da.hasOwnProperty(n.type) && Da[n.type](n, t) + } + + function Tt(n, t, e) { + var r, u = -1, i = n.length - e; + for (t.lineStart(); ++u < i;) r = n[u], t.point(r[0], r[1], r[2]); + t.lineEnd() + } + + function qt(n, t) { + var e = -1, r = n.length; + for (t.polygonStart(); ++e < r;) Tt(n[e], t, 1); + t.polygonEnd() + } + + function zt() { + function n(n, t) { + n *= Qo, t = t * Qo / 2 + Bo / 4; + var e = n - r, o = Math.cos(t), a = Math.sin(t), c = i * a, l = u * o + c * Math.cos(e), + s = c * Math.sin(e); + La.add(Math.atan2(s, l)), r = n, u = o, i = a + } + + var t, e, r, u, i; + Ha.point = function (o, a) { + Ha.point = n, r = (t = o) * Qo, u = Math.cos(a = (e = a) * Qo / 2 + Bo / 4), i = Math.sin(a) + }, Ha.lineEnd = function () { + n(t, e) + } + } + + function Ct(n) { + var t = n[0], e = n[1], r = Math.cos(e); + return [r * Math.cos(t), r * Math.sin(t), Math.sin(e)] + } + + function Dt(n, t) { + return n[0] * t[0] + n[1] * t[1] + n[2] * t[2] + } + + function jt(n, t) { + return [n[1] * t[2] - n[2] * t[1], n[2] * t[0] - n[0] * t[2], n[0] * t[1] - n[1] * t[0]] + } + + function Lt(n, t) { + n[0] += t[0], n[1] += t[1], n[2] += t[2] + } + + function Ht(n, t) { + return [n[0] * t, n[1] * t, n[2] * t] + } + + function Ft(n) { + var t = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); + n[0] /= t, n[1] /= t, n[2] /= t + } + + function Pt(n) { + return [Math.atan2(n[1], n[0]), O(n[2])] + } + + function Ot(n, t) { + return Math.abs(n[0] - t[0]) < Go && Math.abs(n[1] - t[1]) < Go + } + + function Rt(n, t) { + n *= Qo; + var e = Math.cos(t *= Qo); + Yt(e * Math.cos(n), e * Math.sin(n), Math.sin(t)) + } + + function Yt(n, t, e) { + ++Fa, Oa += (n - Oa) / Fa, Ra += (t - Ra) / Fa, Ya += (e - Ya) / Fa + } + + function It() { + function n(n, u) { + n *= Qo; + var i = Math.cos(u *= Qo), o = i * Math.cos(n), a = i * Math.sin(n), c = Math.sin(u), + l = Math.atan2(Math.sqrt((l = e * c - r * a) * l + (l = r * o - t * c) * l + (l = t * a - e * o) * l), t * o + e * a + r * c); + Pa += l, Ia += l * (t + (t = o)), Ua += l * (e + (e = a)), Za += l * (r + (r = c)), Yt(t, e, r) + } + + var t, e, r; + Ba.point = function (u, i) { + u *= Qo; + var o = Math.cos(i *= Qo); + t = o * Math.cos(u), e = o * Math.sin(u), r = Math.sin(i), Ba.point = n, Yt(t, e, r) + } + } + + function Ut() { + Ba.point = Rt + } + + function Zt() { + function n(n, t) { + n *= Qo; + var e = Math.cos(t *= Qo), o = e * Math.cos(n), a = e * Math.sin(n), c = Math.sin(t), l = u * c - i * a, + s = i * o - r * c, f = r * a - u * o, h = Math.sqrt(l * l + s * s + f * f), g = r * o + u * a + i * c, + p = h && -P(g) / h, d = Math.atan2(h, g); + Va += p * l, Xa += p * s, $a += p * f, Pa += d, Ia += d * (r + (r = o)), Ua += d * (u + (u = a)), Za += d * (i + (i = c)), Yt(r, u, i) + } + + var t, e, r, u, i; + Ba.point = function (o, a) { + t = o, e = a, Ba.point = n, o *= Qo; + var c = Math.cos(a *= Qo); + r = c * Math.cos(o), u = c * Math.sin(o), i = Math.sin(a), Yt(r, u, i) + }, Ba.lineEnd = function () { + n(t, e), Ba.lineEnd = Ut, Ba.point = Rt + } + } + + function Vt() { + return !0 + } + + function Xt(n, t, e, r, u) { + var i = [], o = []; + if (n.forEach(function (n) { + if (!((t = n.length - 1) <= 0)) { + var t, e = n[0], r = n[t]; + if (Ot(e, r)) { + u.lineStart(); + for (var a = 0; t > a; ++a) u.point((e = n[a])[0], e[1]); + return u.lineEnd(), void 0 + } + var c = {point: e, points: n, other: null, visited: !1, entry: !0, subject: !0}, + l = {point: e, points: [e], other: c, visited: !1, entry: !1, subject: !1}; + c.other = l, i.push(c), o.push(l), c = { + point: r, + points: [r], + other: null, + visited: !1, + entry: !1, + subject: !0 + }, l = { + point: r, + points: [r], + other: c, + visited: !1, + entry: !0, + subject: !1 + }, c.other = l, i.push(c), o.push(l) + } + }), o.sort(t), $t(i), $t(o), i.length) { + for (var a = 0, c = e, l = o.length; l > a; ++a) o[a].entry = c = !c; + for (var s, f, h, g = i[0]; ;) { + for (s = g; s.visited;) if ((s = s.next) === g) return; + f = s.points, u.lineStart(); + do { + if (s.visited = s.other.visited = !0, s.entry) { + if (s.subject) for (var a = 0; a < f.length; a++) u.point((h = f[a])[0], h[1]); else r(s.point, s.next.point, 1, u); + s = s.next + } else { + if (s.subject) { + f = s.prev.points; + for (var a = f.length; --a >= 0;) u.point((h = f[a])[0], h[1]) + } else r(s.point, s.prev.point, -1, u); + s = s.prev + } + s = s.other, f = s.points + } while (!s.visited); + u.lineEnd() + } + } + } + + function $t(n) { + if (t = n.length) { + for (var t, e, r = 0, u = n[0]; ++r < t;) u.next = e = n[r], e.prev = u, u = e; + u.next = e = n[0], e.prev = u + } + } + + function Bt(n, t, e, r) { + return function (u, i) { + function o(t, e) { + var r = u(t, e); + n(t = r[0], e = r[1]) && i.point(t, e) + } + + function a(n, t) { + var e = u(n, t); + v.point(e[0], e[1]) + } + + function c() { + y.point = a, v.lineStart() + } + + function l() { + y.point = o, v.lineEnd() + } + + function s(n, t) { + d.push([n, t]); + var e = u(n, t); + x.point(e[0], e[1]) + } + + function f() { + x.lineStart(), d = [] + } + + function h() { + s(d[0][0], d[0][1]), x.lineEnd(); + var n, t = x.clean(), e = M.buffer(), r = e.length; + if (d.pop(), p.push(d), d = null, r) { + if (1 & t) { + n = e[0]; + var u, r = n.length - 1, o = -1; + for (i.lineStart(); ++o < r;) i.point((u = n[o])[0], u[1]); + return i.lineEnd(), void 0 + } + r > 1 && 2 & t && e.push(e.pop().concat(e.shift())), g.push(e.filter(Wt)) + } + } + + var g, p, d, v = t(i), m = u.invert(r[0], r[1]), y = { + point: o, lineStart: c, lineEnd: l, polygonStart: function () { + y.point = s, y.lineStart = f, y.lineEnd = h, g = [], p = [], i.polygonStart() + }, polygonEnd: function () { + y.point = o, y.lineStart = c, y.lineEnd = l, g = mo.merge(g); + var n = Kt(m, p); + g.length ? Xt(g, Gt, n, e, i) : n && (i.lineStart(), e(null, null, 1, i), i.lineEnd()), i.polygonEnd(), g = p = null + }, sphere: function () { + i.polygonStart(), i.lineStart(), e(null, null, 1, i), i.lineEnd(), i.polygonEnd() + } + }, M = Jt(), x = t(M); + return y + } + } + + function Wt(n) { + return n.length > 1 + } + + function Jt() { + var n, t = []; + return { + lineStart: function () { + t.push(n = []) + }, point: function (t, e) { + n.push([t, e]) + }, lineEnd: c, buffer: function () { + var e = t; + return t = [], n = null, e + }, rejoin: function () { + t.length > 1 && t.push(t.pop().concat(t.shift())) + } + } + } + + function Gt(n, t) { + return ((n = n.point)[0] < 0 ? n[1] - Jo - Go : Jo - n[1]) - ((t = t.point)[0] < 0 ? t[1] - Jo - Go : Jo - t[1]) + } + + function Kt(n, t) { + var e = n[0], r = n[1], u = [Math.sin(e), -Math.cos(e), 0], i = 0, o = 0; + La.reset(); + for (var a = 0, c = t.length; c > a; ++a) { + var l = t[a], s = l.length; + if (s) for (var f = l[0], h = f[0], g = f[1] / 2 + Bo / 4, p = Math.sin(g), d = Math.cos(g), v = 1; ;) { + v === s && (v = 0), n = l[v]; + var m = n[0], y = n[1] / 2 + Bo / 4, M = Math.sin(y), x = Math.cos(y), b = m - h, _ = Math.abs(b) > Bo, + w = p * M; + if (La.add(Math.atan2(w * Math.sin(b), d * x + w * Math.cos(b))), i += _ ? b + (b >= 0 ? 2 : -2) * Bo : b, _ ^ h >= e ^ m >= e) { + var S = jt(Ct(f), Ct(n)); + Ft(S); + var E = jt(u, S); + Ft(E); + var k = (_ ^ b >= 0 ? -1 : 1) * O(E[2]); + (r > k || r === k && (S[0] || S[1])) && (o += _ ^ b >= 0 ? 1 : -1) + } + if (!v++) break; + h = m, p = M, d = x, f = n + } + } + return (-Go > i || Go > i && 0 > La) ^ 1 & o + } + + function Qt(n) { + var t, e = 0 / 0, r = 0 / 0, u = 0 / 0; + return { + lineStart: function () { + n.lineStart(), t = 1 + }, point: function (i, o) { + var a = i > 0 ? Bo : -Bo, c = Math.abs(i - e); + Math.abs(c - Bo) < Go ? (n.point(e, r = (r + o) / 2 > 0 ? Jo : -Jo), n.point(u, r), n.lineEnd(), n.lineStart(), n.point(a, r), n.point(i, r), t = 0) : u !== a && c >= Bo && (Math.abs(e - u) < Go && (e -= u * Go), Math.abs(i - a) < Go && (i -= a * Go), r = ne(e, r, i, o), n.point(u, r), n.lineEnd(), n.lineStart(), n.point(a, r), t = 0), n.point(e = i, r = o), u = a + }, lineEnd: function () { + n.lineEnd(), e = r = 0 / 0 + }, clean: function () { + return 2 - t + } + } + } + + function ne(n, t, e, r) { + var u, i, o = Math.sin(n - e); + return Math.abs(o) > Go ? Math.atan((Math.sin(t) * (i = Math.cos(r)) * Math.sin(e) - Math.sin(r) * (u = Math.cos(t)) * Math.sin(n)) / (u * i * o)) : (t + r) / 2 + } + + function te(n, t, e, r) { + var u; + if (null == n) u = e * Jo, r.point(-Bo, u), r.point(0, u), r.point(Bo, u), r.point(Bo, 0), r.point(Bo, -u), r.point(0, -u), r.point(-Bo, -u), r.point(-Bo, 0), r.point(-Bo, u); else if (Math.abs(n[0] - t[0]) > Go) { + var i = (n[0] < t[0] ? 1 : -1) * Bo; + u = e * i / 2, r.point(-i, u), r.point(0, u), r.point(i, u) + } else r.point(t[0], t[1]) + } + + function ee(n) { + function t(n, t) { + return Math.cos(n) * Math.cos(t) > i + } + + function e(n) { + var e, i, c, l, s; + return { + lineStart: function () { + l = c = !1, s = 1 + }, point: function (f, h) { + var g, p = [f, h], d = t(f, h), v = o ? d ? 0 : u(f, h) : d ? u(f + (0 > f ? Bo : -Bo), h) : 0; + if (!e && (l = c = d) && n.lineStart(), d !== c && (g = r(e, p), (Ot(e, g) || Ot(p, g)) && (p[0] += Go, p[1] += Go, d = t(p[0], p[1]))), d !== c) s = 0, d ? (n.lineStart(), g = r(p, e), n.point(g[0], g[1])) : (g = r(e, p), n.point(g[0], g[1]), n.lineEnd()), e = g; else if (a && e && o ^ d) { + var m; + v & i || !(m = r(p, e, !0)) || (s = 0, o ? (n.lineStart(), n.point(m[0][0], m[0][1]), n.point(m[1][0], m[1][1]), n.lineEnd()) : (n.point(m[1][0], m[1][1]), n.lineEnd(), n.lineStart(), n.point(m[0][0], m[0][1]))) + } + !d || e && Ot(e, p) || n.point(p[0], p[1]), e = p, c = d, i = v + }, lineEnd: function () { + c && n.lineEnd(), e = null + }, clean: function () { + return s | (l && c) << 1 + } + } + } + + function r(n, t, e) { + var r = Ct(n), u = Ct(t), o = [1, 0, 0], a = jt(r, u), c = Dt(a, a), l = a[0], s = c - l * l; + if (!s) return !e && n; + var f = i * c / s, h = -i * l / s, g = jt(o, a), p = Ht(o, f), d = Ht(a, h); + Lt(p, d); + var v = g, m = Dt(p, v), y = Dt(v, v), M = m * m - y * (Dt(p, p) - 1); + if (!(0 > M)) { + var x = Math.sqrt(M), b = Ht(v, (-m - x) / y); + if (Lt(b, p), b = Pt(b), !e) return b; + var _, w = n[0], S = t[0], E = n[1], k = t[1]; + w > S && (_ = w, w = S, S = _); + var A = S - w, N = Math.abs(A - Bo) < Go, T = N || Go > A; + if (!N && E > k && (_ = E, E = k, k = _), T ? N ? E + k > 0 ^ b[1] < (Math.abs(b[0] - w) < Go ? E : k) : E <= b[1] && b[1] <= k : A > Bo ^ (w <= b[0] && b[0] <= S)) { + var q = Ht(v, (-m + x) / y); + return Lt(q, p), [b, Pt(q)] + } + } + } + + function u(t, e) { + var r = o ? n : Bo - n, u = 0; + return -r > t ? u |= 1 : t > r && (u |= 2), -r > e ? u |= 4 : e > r && (u |= 8), u + } + + var i = Math.cos(n), o = i > 0, a = Math.abs(i) > Go, c = Te(n, 6 * Qo); + return Bt(t, e, c, o ? [0, -n] : [-Bo, n - Bo]) + } + + function re(n, t, e, r) { + function u(r, u) { + return Math.abs(r[0] - n) < Go ? u > 0 ? 0 : 3 : Math.abs(r[0] - e) < Go ? u > 0 ? 2 : 1 : Math.abs(r[1] - t) < Go ? u > 0 ? 1 : 0 : u > 0 ? 3 : 2 + } + + function i(n, t) { + return o(n.point, t.point) + } + + function o(n, t) { + var e = u(n, 1), r = u(t, 1); + return e !== r ? e - r : 0 === e ? t[1] - n[1] : 1 === e ? n[0] - t[0] : 2 === e ? n[1] - t[1] : t[0] - n[0] + } + + function a(u, i) { + var o = i[0] - u[0], a = i[1] - u[1], c = [0, 1]; + return Math.abs(o) < Go && Math.abs(a) < Go ? n <= u[0] && u[0] <= e && t <= u[1] && u[1] <= r : ue(n - u[0], o, c) && ue(u[0] - e, -o, c) && ue(t - u[1], a, c) && ue(u[1] - r, -a, c) ? (c[1] < 1 && (i[0] = u[0] + c[1] * o, i[1] = u[1] + c[1] * a), c[0] > 0 && (u[0] += c[0] * o, u[1] += c[0] * a), !0) : !1 + } + + return function (c) { + function l(n) { + for (var t = 0, e = y.length, r = n[1], u = 0; e > u; ++u) for (var i, o = 1, a = y[u], c = a.length, l = a[0]; c > o; ++o) i = a[o], l[1] <= r ? i[1] > r && s(l, i, n) > 0 && ++t : i[1] <= r && s(l, i, n) < 0 && --t, l = i; + return 0 !== t + } + + function s(n, t, e) { + return (t[0] - n[0]) * (e[1] - n[1]) - (e[0] - n[0]) * (t[1] - n[1]) + } + + function f(i, a, c, l) { + var s = 0, f = 0; + if (null == i || (s = u(i, c)) !== (f = u(a, c)) || o(i, a) < 0 ^ c > 0) { + do l.point(0 === s || 3 === s ? n : e, s > 1 ? r : t); while ((s = (s + c + 4) % 4) !== f) + } else l.point(a[0], a[1]) + } + + function h(u, i) { + return u >= n && e >= u && i >= t && r >= i + } + + function g(n, t) { + h(n, t) && c.point(n, t) + } + + function p() { + q.point = v, y && y.push(M = []), k = !0, E = !1, w = S = 0 / 0 + } + + function d() { + m && (v(x, b), _ && E && T.rejoin(), m.push(T.buffer())), q.point = g, E && c.lineEnd() + } + + function v(n, t) { + n = Math.max(-Ja, Math.min(Ja, n)), t = Math.max(-Ja, Math.min(Ja, t)); + var e = h(n, t); + if (y && M.push([n, t]), k) x = n, b = t, _ = e, k = !1, e && (c.lineStart(), c.point(n, t)); else if (e && E) c.point(n, t); else { + var r = [w, S], u = [n, t]; + a(r, u) ? (E || (c.lineStart(), c.point(r[0], r[1])), c.point(u[0], u[1]), e || c.lineEnd(), A = !1) : e && (c.lineStart(), c.point(n, t), A = !1) + } + w = n, S = t, E = e + } + + var m, y, M, x, b, _, w, S, E, k, A, N = c, T = Jt(), q = { + point: g, lineStart: p, lineEnd: d, polygonStart: function () { + c = T, m = [], y = [], A = !0 + }, polygonEnd: function () { + c = N, m = mo.merge(m); + var t = l([n, r]), e = A && t, u = m.length; + (e || u) && (c.polygonStart(), e && (c.lineStart(), f(null, null, 1, c), c.lineEnd()), u && Xt(m, i, t, f, c), c.polygonEnd()), m = y = M = null + } + }; + return q + } + } + + function ue(n, t, e) { + if (Math.abs(t) < Go) return 0 >= n; + var r = n / t; + if (t > 0) { + if (r > e[1]) return !1; + r > e[0] && (e[0] = r) + } else { + if (r < e[0]) return !1; + r < e[1] && (e[1] = r) + } + return !0 + } + + function ie(n, t) { + function e(e, r) { + return e = n(e, r), t(e[0], e[1]) + } + + return n.invert && t.invert && (e.invert = function (e, r) { + return e = t.invert(e, r), e && n.invert(e[0], e[1]) + }), e + } + + function oe(n) { + var t = 0, e = Bo / 3, r = be(n), u = r(t, e); + return u.parallels = function (n) { + return arguments.length ? r(t = n[0] * Bo / 180, e = n[1] * Bo / 180) : [180 * (t / Bo), 180 * (e / Bo)] + }, u + } + + function ae(n, t) { + function e(n, t) { + var e = Math.sqrt(i - 2 * u * Math.sin(t)) / u; + return [e * Math.sin(n *= u), o - e * Math.cos(n)] + } + + var r = Math.sin(n), u = (r + Math.sin(t)) / 2, i = 1 + r * (2 * u - r), o = Math.sqrt(i) / u; + return e.invert = function (n, t) { + var e = o - t; + return [Math.atan2(n, e) / u, O((i - (n * n + e * e) * u * u) / (2 * u))] + }, e + } + + function ce() { + function n(n, t) { + Ka += u * n - r * t, r = n, u = t + } + + var t, e, r, u; + rc.point = function (i, o) { + rc.point = n, t = r = i, e = u = o + }, rc.lineEnd = function () { + n(t, e) + } + } + + function le(n, t) { + Qa > n && (Qa = n), n > tc && (tc = n), nc > t && (nc = t), t > ec && (ec = t) + } + + function se() { + function n(n, t) { + o.push("M", n, ",", t, i) + } + + function t(n, t) { + o.push("M", n, ",", t), a.point = e + } + + function e(n, t) { + o.push("L", n, ",", t) + } + + function r() { + a.point = n + } + + function u() { + o.push("Z") + } + + var i = fe(4.5), o = [], a = { + point: n, lineStart: function () { + a.point = t + }, lineEnd: r, polygonStart: function () { + a.lineEnd = u + }, polygonEnd: function () { + a.lineEnd = r, a.point = n + }, pointRadius: function (n) { + return i = fe(n), a + }, result: function () { + if (o.length) { + var n = o.join(""); + return o = [], n + } + } + }; + return a + } + + function fe(n) { + return "m0," + n + "a" + n + "," + n + " 0 1,1 0," + -2 * n + "a" + n + "," + n + " 0 1,1 0," + 2 * n + "z" + } + + function he(n, t) { + Oa += n, Ra += t, ++Ya + } + + function ge() { + function n(n, r) { + var u = n - t, i = r - e, o = Math.sqrt(u * u + i * i); + Ia += o * (t + n) / 2, Ua += o * (e + r) / 2, Za += o, he(t = n, e = r) + } + + var t, e; + ic.point = function (r, u) { + ic.point = n, he(t = r, e = u) + } + } + + function pe() { + ic.point = he + } + + function de() { + function n(n, t) { + var e = n - r, i = t - u, o = Math.sqrt(e * e + i * i); + Ia += o * (r + n) / 2, Ua += o * (u + t) / 2, Za += o, o = u * n - r * t, Va += o * (r + n), Xa += o * (u + t), $a += 3 * o, he(r = n, u = t) + } + + var t, e, r, u; + ic.point = function (i, o) { + ic.point = n, he(t = r = i, e = u = o) + }, ic.lineEnd = function () { + n(t, e) + } + } + + function ve(n) { + function t(t, e) { + n.moveTo(t, e), n.arc(t, e, o, 0, Wo) + } + + function e(t, e) { + n.moveTo(t, e), a.point = r + } + + function r(t, e) { + n.lineTo(t, e) + } + + function u() { + a.point = t + } + + function i() { + n.closePath() + } + + var o = 4.5, a = { + point: t, lineStart: function () { + a.point = e + }, lineEnd: u, polygonStart: function () { + a.lineEnd = i + }, polygonEnd: function () { + a.lineEnd = u, a.point = t + }, pointRadius: function (n) { + return o = n, a + }, result: c + }; + return a + } + + function me(n) { + function t(t) { + function r(e, r) { + e = n(e, r), t.point(e[0], e[1]) + } + + function u() { + M = 0 / 0, S.point = o, t.lineStart() + } + + function o(r, u) { + var o = Ct([r, u]), a = n(r, u); + e(M, x, y, b, _, w, M = a[0], x = a[1], y = r, b = o[0], _ = o[1], w = o[2], i, t), t.point(M, x) + } + + function a() { + S.point = r, t.lineEnd() + } + + function c() { + u(), S.point = l, S.lineEnd = s + } + + function l(n, t) { + o(f = n, h = t), g = M, p = x, d = b, v = _, m = w, S.point = o + } + + function s() { + e(M, x, y, b, _, w, g, p, f, d, v, m, i, t), S.lineEnd = a, a() + } + + var f, h, g, p, d, v, m, y, M, x, b, _, w, S = { + point: r, lineStart: u, lineEnd: a, polygonStart: function () { + t.polygonStart(), S.lineStart = c + }, polygonEnd: function () { + t.polygonEnd(), S.lineStart = u + } + }; + return S + } + + function e(t, i, o, a, c, l, s, f, h, g, p, d, v, m) { + var y = s - t, M = f - i, x = y * y + M * M; + if (x > 4 * r && v--) { + var b = a + g, _ = c + p, w = l + d, S = Math.sqrt(b * b + _ * _ + w * w), E = Math.asin(w /= S), + k = Math.abs(Math.abs(w) - 1) < Go ? (o + h) / 2 : Math.atan2(_, b), A = n(k, E), N = A[0], + T = A[1], q = N - t, z = T - i, C = M * q - y * z; + (C * C / x > r || Math.abs((y * q + M * z) / x - .5) > .3 || u > a * g + c * p + l * d) && (e(t, i, o, a, c, l, N, T, k, b /= S, _ /= S, w, v, m), m.point(N, T), e(N, T, k, b, _, w, s, f, h, g, p, d, v, m)) + } + } + + var r = .5, u = Math.cos(30 * Qo), i = 16; + return t.precision = function (n) { + return arguments.length ? (i = (r = n * n) > 0 && 16, t) : Math.sqrt(r) + }, t + } + + function ye(n) { + this.stream = n + } + + function Me(n) { + var t = me(function (t, e) { + return n([t * na, e * na]) + }); + return function (n) { + var e = new ye(n = t(n)); + return e.point = function (t, e) { + n.point(t * Qo, e * Qo) + }, e + } + } + + function xe(n) { + return be(function () { + return n + })() + } + + function be(n) { + function t(n) { + return n = a(n[0] * Qo, n[1] * Qo), [n[0] * h + c, l - n[1] * h] + } + + function e(n) { + return n = a.invert((n[0] - c) / h, (l - n[1]) / h), n && [n[0] * na, n[1] * na] + } + + function r() { + a = ie(o = Ee(m, y, M), i); + var n = i(d, v); + return c = g - n[0] * h, l = p + n[1] * h, u() + } + + function u() { + return s && (s.valid = !1, s = null), t + } + + var i, o, a, c, l, s, f = me(function (n, t) { + return n = i(n, t), [n[0] * h + c, l - n[1] * h] + }), h = 150, g = 480, p = 250, d = 0, v = 0, m = 0, y = 0, M = 0, x = Wa, b = dt, _ = null, w = null; + return t.stream = function (n) { + return s && (s.valid = !1), s = _e(x(o, f(b(n)))), s.valid = !0, s + }, t.clipAngle = function (n) { + return arguments.length ? (x = null == n ? (_ = n, Wa) : ee((_ = +n) * Qo), u()) : _ + }, t.clipExtent = function (n) { + return arguments.length ? (w = n, b = n ? re(n[0][0], n[0][1], n[1][0], n[1][1]) : dt, u()) : w + }, t.scale = function (n) { + return arguments.length ? (h = +n, r()) : h + }, t.translate = function (n) { + return arguments.length ? (g = +n[0], p = +n[1], r()) : [g, p] + }, t.center = function (n) { + return arguments.length ? (d = n[0] % 360 * Qo, v = n[1] % 360 * Qo, r()) : [d * na, v * na] + }, t.rotate = function (n) { + return arguments.length ? (m = n[0] % 360 * Qo, y = n[1] % 360 * Qo, M = n.length > 2 ? n[2] % 360 * Qo : 0, r()) : [m * na, y * na, M * na] + }, mo.rebind(t, f, "precision"), function () { + return i = n.apply(this, arguments), t.invert = i.invert && e, r() + } + } + + function _e(n) { + var t = new ye(n); + return t.point = function (t, e) { + n.point(t * Qo, e * Qo) + }, t + } + + function we(n, t) { + return [n, t] + } + + function Se(n, t) { + return [n > Bo ? n - Wo : -Bo > n ? n + Wo : n, t] + } + + function Ee(n, t, e) { + return n ? t || e ? ie(Ae(n), Ne(t, e)) : Ae(n) : t || e ? Ne(t, e) : Se + } + + function ke(n) { + return function (t, e) { + return t += n, [t > Bo ? t - Wo : -Bo > t ? t + Wo : t, e] + } + } + + function Ae(n) { + var t = ke(n); + return t.invert = ke(-n), t + } + + function Ne(n, t) { + function e(n, t) { + var e = Math.cos(t), a = Math.cos(n) * e, c = Math.sin(n) * e, l = Math.sin(t), s = l * r + a * u; + return [Math.atan2(c * i - s * o, a * r - l * u), O(s * i + c * o)] + } + + var r = Math.cos(n), u = Math.sin(n), i = Math.cos(t), o = Math.sin(t); + return e.invert = function (n, t) { + var e = Math.cos(t), a = Math.cos(n) * e, c = Math.sin(n) * e, l = Math.sin(t), s = l * i - c * o; + return [Math.atan2(c * i + l * o, a * r + s * u), O(s * r - a * u)] + }, e + } + + function Te(n, t) { + var e = Math.cos(n), r = Math.sin(n); + return function (u, i, o, a) { + var c = o * t; + null != u ? (u = qe(e, u), i = qe(e, i), (o > 0 ? i > u : u > i) && (u += o * Wo)) : (u = n + o * Wo, i = n - .5 * c); + for (var l, s = u; o > 0 ? s > i : i > s; s -= c) a.point((l = Pt([e, -r * Math.cos(s), -r * Math.sin(s)]))[0], l[1]) + } + } + + function qe(n, t) { + var e = Ct(t); + e[0] -= n, Ft(e); + var r = P(-e[1]); + return ((-e[2] < 0 ? -r : r) + 2 * Math.PI - Go) % (2 * Math.PI) + } + + function ze(n, t, e) { + var r = mo.range(n, t - Go, e).concat(t); + return function (n) { + return r.map(function (t) { + return [n, t] + }) + } + } + + function Ce(n, t, e) { + var r = mo.range(n, t - Go, e).concat(t); + return function (n) { + return r.map(function (t) { + return [t, n] + }) + } + } + + function De(n) { + return n.source + } + + function je(n) { + return n.target + } + + function Le(n, t, e, r) { + var u = Math.cos(t), i = Math.sin(t), o = Math.cos(r), a = Math.sin(r), c = u * Math.cos(n), + l = u * Math.sin(n), s = o * Math.cos(e), f = o * Math.sin(e), + h = 2 * Math.asin(Math.sqrt(U(r - t) + u * o * U(e - n))), g = 1 / Math.sin(h), p = h ? function (n) { + var t = Math.sin(n *= h) * g, e = Math.sin(h - n) * g, r = e * c + t * s, u = e * l + t * f, + o = e * i + t * a; + return [Math.atan2(u, r) * na, Math.atan2(o, Math.sqrt(r * r + u * u)) * na] + } : function () { + return [n * na, t * na] + }; + return p.distance = h, p + } + + function He() { + function n(n, u) { + var i = Math.sin(u *= Qo), o = Math.cos(u), a = Math.abs((n *= Qo) - t), c = Math.cos(a); + oc += Math.atan2(Math.sqrt((a = o * Math.sin(a)) * a + (a = r * i - e * o * c) * a), e * i + r * o * c), t = n, e = i, r = o + } + + var t, e, r; + ac.point = function (u, i) { + t = u * Qo, e = Math.sin(i *= Qo), r = Math.cos(i), ac.point = n + }, ac.lineEnd = function () { + ac.point = ac.lineEnd = c + } + } + + function Fe(n, t) { + function e(t, e) { + var r = Math.cos(t), u = Math.cos(e), i = n(r * u); + return [i * u * Math.sin(t), i * Math.sin(e)] + } + + return e.invert = function (n, e) { + var r = Math.sqrt(n * n + e * e), u = t(r), i = Math.sin(u), o = Math.cos(u); + return [Math.atan2(n * i, r * o), Math.asin(r && e * i / r)] + }, e + } + + function Pe(n, t) { + function e(n, t) { + var e = Math.abs(Math.abs(t) - Jo) < Go ? 0 : o / Math.pow(u(t), i); + return [e * Math.sin(i * n), o - e * Math.cos(i * n)] + } + + var r = Math.cos(n), u = function (n) { + return Math.tan(Bo / 4 + n / 2) + }, i = n === t ? Math.sin(n) : Math.log(r / Math.cos(t)) / Math.log(u(t) / u(n)), o = r * Math.pow(u(n), i) / i; + return i ? (e.invert = function (n, t) { + var e = o - t, r = F(i) * Math.sqrt(n * n + e * e); + return [Math.atan2(n, e) / i, 2 * Math.atan(Math.pow(o / r, 1 / i)) - Jo] + }, e) : Re + } + + function Oe(n, t) { + function e(n, t) { + var e = i - t; + return [e * Math.sin(u * n), i - e * Math.cos(u * n)] + } + + var r = Math.cos(n), u = n === t ? Math.sin(n) : (r - Math.cos(t)) / (t - n), i = r / u + n; + return Math.abs(u) < Go ? we : (e.invert = function (n, t) { + var e = i - t; + return [Math.atan2(n, e) / u, i - F(u) * Math.sqrt(n * n + e * e)] + }, e) + } + + function Re(n, t) { + return [n, Math.log(Math.tan(Bo / 4 + t / 2))] + } + + function Ye(n) { + var t, e = xe(n), r = e.scale, u = e.translate, i = e.clipExtent; + return e.scale = function () { + var n = r.apply(e, arguments); + return n === e ? t ? e.clipExtent(null) : e : n + }, e.translate = function () { + var n = u.apply(e, arguments); + return n === e ? t ? e.clipExtent(null) : e : n + }, e.clipExtent = function (n) { + var o = i.apply(e, arguments); + if (o === e) { + if (t = null == n) { + var a = Bo * r(), c = u(); + i([[c[0] - a, c[1] - a], [c[0] + a, c[1] + a]]) + } + } else t && (o = null); + return o + }, e.clipExtent(null) + } + + function Ie(n, t) { + var e = Math.cos(t) * Math.sin(n); + return [Math.log((1 + e) / (1 - e)) / 2, Math.atan2(Math.tan(t), Math.cos(n))] + } + + function Ue(n) { + function t(t) { + function o() { + l.push("M", i(n(s), a)) + } + + for (var c, l = [], s = [], f = -1, h = t.length, g = pt(e), p = pt(r); ++f < h;) u.call(this, c = t[f], f) ? s.push([+g.call(this, c, f), +p.call(this, c, f)]) : s.length && (o(), s = []); + return s.length && o(), l.length ? l.join("") : null + } + + var e = Ze, r = Ve, u = Vt, i = Xe, o = i.key, a = .7; + return t.x = function (n) { + return arguments.length ? (e = n, t) : e + }, t.y = function (n) { + return arguments.length ? (r = n, t) : r + }, t.defined = function (n) { + return arguments.length ? (u = n, t) : u + }, t.interpolate = function (n) { + return arguments.length ? (o = "function" == typeof n ? i = n : (i = gc.get(n) || Xe).key, t) : o + }, t.tension = function (n) { + return arguments.length ? (a = n, t) : a + }, t + } + + function Ze(n) { + return n[0] + } + + function Ve(n) { + return n[1] + } + + function Xe(n) { + return n.join("L") + } + + function $e(n) { + return Xe(n) + "Z" + } + + function Be(n) { + for (var t = 0, e = n.length, r = n[0], u = [r[0], ",", r[1]]; ++t < e;) u.push("H", (r[0] + (r = n[t])[0]) / 2, "V", r[1]); + return e > 1 && u.push("H", r[0]), u.join("") + } + + function We(n) { + for (var t = 0, e = n.length, r = n[0], u = [r[0], ",", r[1]]; ++t < e;) u.push("V", (r = n[t])[1], "H", r[0]); + return u.join("") + } + + function Je(n) { + for (var t = 0, e = n.length, r = n[0], u = [r[0], ",", r[1]]; ++t < e;) u.push("H", (r = n[t])[0], "V", r[1]); + return u.join("") + } + + function Ge(n, t) { + return n.length < 4 ? Xe(n) : n[1] + nr(n.slice(1, n.length - 1), tr(n, t)) + } + + function Ke(n, t) { + return n.length < 3 ? Xe(n) : n[0] + nr((n.push(n[0]), n), tr([n[n.length - 2]].concat(n, [n[1]]), t)) + } + + function Qe(n, t) { + return n.length < 3 ? Xe(n) : n[0] + nr(n, tr(n, t)) + } + + function nr(n, t) { + if (t.length < 1 || n.length != t.length && n.length != t.length + 2) return Xe(n); + var e = n.length != t.length, r = "", u = n[0], i = n[1], o = t[0], a = o, c = 1; + if (e && (r += "Q" + (i[0] - 2 * o[0] / 3) + "," + (i[1] - 2 * o[1] / 3) + "," + i[0] + "," + i[1], u = n[1], c = 2), t.length > 1) { + a = t[1], i = n[c], c++, r += "C" + (u[0] + o[0]) + "," + (u[1] + o[1]) + "," + (i[0] - a[0]) + "," + (i[1] - a[1]) + "," + i[0] + "," + i[1]; + for (var l = 2; l < t.length; l++, c++) i = n[c], a = t[l], r += "S" + (i[0] - a[0]) + "," + (i[1] - a[1]) + "," + i[0] + "," + i[1] + } + if (e) { + var s = n[c]; + r += "Q" + (i[0] + 2 * a[0] / 3) + "," + (i[1] + 2 * a[1] / 3) + "," + s[0] + "," + s[1] + } + return r + } + + function tr(n, t) { + for (var e, r = [], u = (1 - t) / 2, i = n[0], o = n[1], a = 1, c = n.length; ++a < c;) e = i, i = o, o = n[a], r.push([u * (o[0] - e[0]), u * (o[1] - e[1])]); + return r + } + + function er(n) { + if (n.length < 3) return Xe(n); + var t = 1, e = n.length, r = n[0], u = r[0], i = r[1], o = [u, u, u, (r = n[1])[0]], a = [i, i, i, r[1]], + c = [u, ",", i, "L", or(vc, o), ",", or(vc, a)]; + for (n.push(n[e - 1]); ++t <= e;) r = n[t], o.shift(), o.push(r[0]), a.shift(), a.push(r[1]), ar(c, o, a); + return n.pop(), c.push("L", r), c.join("") + } + + function rr(n) { + if (n.length < 4) return Xe(n); + for (var t, e = [], r = -1, u = n.length, i = [0], o = [0]; ++r < 3;) t = n[r], i.push(t[0]), o.push(t[1]); + for (e.push(or(vc, i) + "," + or(vc, o)), --r; ++r < u;) t = n[r], i.shift(), i.push(t[0]), o.shift(), o.push(t[1]), ar(e, i, o); + return e.join("") + } + + function ur(n) { + for (var t, e, r = -1, u = n.length, i = u + 4, o = [], a = []; ++r < 4;) e = n[r % u], o.push(e[0]), a.push(e[1]); + for (t = [or(vc, o), ",", or(vc, a)], --r; ++r < i;) e = n[r % u], o.shift(), o.push(e[0]), a.shift(), a.push(e[1]), ar(t, o, a); + return t.join("") + } + + function ir(n, t) { + var e = n.length - 1; + if (e) for (var r, u, i = n[0][0], o = n[0][1], a = n[e][0] - i, c = n[e][1] - o, l = -1; ++l <= e;) r = n[l], u = l / e, r[0] = t * r[0] + (1 - t) * (i + u * a), r[1] = t * r[1] + (1 - t) * (o + u * c); + return er(n) + } + + function or(n, t) { + return n[0] * t[0] + n[1] * t[1] + n[2] * t[2] + n[3] * t[3] + } + + function ar(n, t, e) { + n.push("C", or(pc, t), ",", or(pc, e), ",", or(dc, t), ",", or(dc, e), ",", or(vc, t), ",", or(vc, e)) + } + + function cr(n, t) { + return (t[1] - n[1]) / (t[0] - n[0]) + } + + function lr(n) { + for (var t = 0, e = n.length - 1, r = [], u = n[0], i = n[1], o = r[0] = cr(u, i); ++t < e;) r[t] = (o + (o = cr(u = i, i = n[t + 1]))) / 2; + return r[t] = o, r + } + + function sr(n) { + for (var t, e, r, u, i = [], o = lr(n), a = -1, c = n.length - 1; ++a < c;) t = cr(n[a], n[a + 1]), Math.abs(t) < Go ? o[a] = o[a + 1] = 0 : (e = o[a] / t, r = o[a + 1] / t, u = e * e + r * r, u > 9 && (u = 3 * t / Math.sqrt(u), o[a] = u * e, o[a + 1] = u * r)); + for (a = -1; ++a <= c;) u = (n[Math.min(c, a + 1)][0] - n[Math.max(0, a - 1)][0]) / (6 * (1 + o[a] * o[a])), i.push([u || 0, o[a] * u || 0]); + return i + } + + function fr(n) { + return n.length < 3 ? Xe(n) : n[0] + nr(n, sr(n)) + } + + function hr(n, t, e, r) { + var u, i, o, a, c, l, s; + return u = r[n], i = u[0], o = u[1], u = r[t], a = u[0], c = u[1], u = r[e], l = u[0], s = u[1], (s - o) * (a - i) - (c - o) * (l - i) > 0 + } + + function gr(n, t, e) { + return (e[0] - t[0]) * (n[1] - t[1]) < (e[1] - t[1]) * (n[0] - t[0]) + } + + function pr(n, t, e, r) { + var u = n[0], i = e[0], o = t[0] - u, a = r[0] - i, c = n[1], l = e[1], s = t[1] - c, f = r[1] - l, + h = (a * (c - l) - f * (u - i)) / (f * o - a * s); + return [u + h * o, c + h * s] + } + + function dr(n) { + var t = n[0], e = n[n.length - 1]; + return !(t[0] - e[0] || t[1] - e[1]) + } + + function vr(n, t) { + var e = { + list: n.map(function (n, t) { + return {index: t, x: n[0], y: n[1]} + }).sort(function (n, t) { + return n.y < t.y ? -1 : n.y > t.y ? 1 : n.x < t.x ? -1 : n.x > t.x ? 1 : 0 + }), bottomSite: null + }, r = { + list: [], leftEnd: null, rightEnd: null, init: function () { + r.leftEnd = r.createHalfEdge(null, "l"), r.rightEnd = r.createHalfEdge(null, "l"), r.leftEnd.r = r.rightEnd, r.rightEnd.l = r.leftEnd, r.list.unshift(r.leftEnd, r.rightEnd) + }, createHalfEdge: function (n, t) { + return {edge: n, side: t, vertex: null, l: null, r: null} + }, insert: function (n, t) { + t.l = n, t.r = n.r, n.r.l = t, n.r = t + }, leftBound: function (n) { + var t = r.leftEnd; + do t = t.r; while (t != r.rightEnd && u.rightOf(t, n)); + return t = t.l + }, del: function (n) { + n.l.r = n.r, n.r.l = n.l, n.edge = null + }, right: function (n) { + return n.r + }, left: function (n) { + return n.l + }, leftRegion: function (n) { + return null == n.edge ? e.bottomSite : n.edge.region[n.side] + }, rightRegion: function (n) { + return null == n.edge ? e.bottomSite : n.edge.region[yc[n.side]] + } + }, u = { + bisect: function (n, t) { + var e = {region: {l: n, r: t}, ep: {l: null, r: null}}, r = t.x - n.x, u = t.y - n.y, + i = r > 0 ? r : -r, o = u > 0 ? u : -u; + return e.c = n.x * r + n.y * u + .5 * (r * r + u * u), i > o ? (e.a = 1, e.b = u / r, e.c /= r) : (e.b = 1, e.a = r / u, e.c /= u), e + }, intersect: function (n, t) { + var e = n.edge, r = t.edge; + if (!e || !r || e.region.r == r.region.r) return null; + var u = e.a * r.b - e.b * r.a; + if (Math.abs(u) < 1e-10) return null; + var i, o, a = (e.c * r.b - r.c * e.b) / u, c = (r.c * e.a - e.c * r.a) / u, l = e.region.r, + s = r.region.r; + l.y < s.y || l.y == s.y && l.x < s.x ? (i = n, o = e) : (i = t, o = r); + var f = a >= o.region.r.x; + return f && "l" === i.side || !f && "r" === i.side ? null : {x: a, y: c} + }, rightOf: function (n, t) { + var e = n.edge, r = e.region.r, u = t.x > r.x; + if (u && "l" === n.side) return 1; + if (!u && "r" === n.side) return 0; + if (1 === e.a) { + var i = t.y - r.y, o = t.x - r.x, a = 0, c = 0; + if (!u && e.b < 0 || u && e.b >= 0 ? c = a = i >= e.b * o : (c = t.x + t.y * e.b > e.c, e.b < 0 && (c = !c), c || (a = 1)), !a) { + var l = r.x - e.region.l.x; + c = e.b * (o * o - i * i) < l * i * (1 + 2 * o / l + e.b * e.b), e.b < 0 && (c = !c) + } + } else { + var s = e.c - e.a * t.x, f = t.y - s, h = t.x - r.x, g = s - r.y; + c = f * f > h * h + g * g + } + return "l" === n.side ? c : !c + }, endPoint: function (n, e, r) { + n.ep[e] = r, n.ep[yc[e]] && t(n) + }, distance: function (n, t) { + var e = n.x - t.x, r = n.y - t.y; + return Math.sqrt(e * e + r * r) + } + }, i = { + list: [], insert: function (n, t, e) { + n.vertex = t, n.ystar = t.y + e; + for (var r = 0, u = i.list, o = u.length; o > r; r++) { + var a = u[r]; + if (!(n.ystar > a.ystar || n.ystar == a.ystar && t.x > a.vertex.x)) break + } + u.splice(r, 0, n) + }, del: function (n) { + for (var t = 0, e = i.list, r = e.length; r > t && e[t] != n; ++t) ; + e.splice(t, 1) + }, empty: function () { + return 0 === i.list.length + }, nextEvent: function (n) { + for (var t = 0, e = i.list, r = e.length; r > t; ++t) if (e[t] == n) return e[t + 1]; + return null + }, min: function () { + var n = i.list[0]; + return {x: n.vertex.x, y: n.ystar} + }, extractMin: function () { + return i.list.shift() + } + }; + r.init(), e.bottomSite = e.list.shift(); + for (var o, a, c, l, s, f, h, g, p, d, v, m, y, M = e.list.shift(); ;) if (i.empty() || (o = i.min()), M && (i.empty() || M.y < o.y || M.y == o.y && M.x < o.x)) a = r.leftBound(M), c = r.right(a), h = r.rightRegion(a), m = u.bisect(h, M), f = r.createHalfEdge(m, "l"), r.insert(a, f), d = u.intersect(a, f), d && (i.del(a), i.insert(a, d, u.distance(d, M))), a = f, f = r.createHalfEdge(m, "r"), r.insert(a, f), d = u.intersect(f, c), d && i.insert(f, d, u.distance(d, M)), M = e.list.shift(); else { + if (i.empty()) break; + a = i.extractMin(), l = r.left(a), c = r.right(a), s = r.right(c), h = r.leftRegion(a), g = r.rightRegion(c), v = a.vertex, u.endPoint(a.edge, a.side, v), u.endPoint(c.edge, c.side, v), r.del(a), i.del(c), r.del(c), y = "l", h.y > g.y && (p = h, h = g, g = p, y = "r"), m = u.bisect(h, g), f = r.createHalfEdge(m, y), r.insert(l, f), u.endPoint(m, yc[y], v), d = u.intersect(l, f), d && (i.del(l), i.insert(l, d, u.distance(d, h))), d = u.intersect(f, s), d && i.insert(f, d, u.distance(d, h)) + } + for (a = r.right(r.leftEnd); a != r.rightEnd; a = r.right(a)) t(a.edge) + } + + function mr(n) { + return n.x + } + + function yr(n) { + return n.y + } + + function Mr() { + return {leaf: !0, nodes: [], point: null, x: null, y: null} + } + + function xr(n, t, e, r, u, i) { + if (!n(t, e, r, u, i)) { + var o = .5 * (e + u), a = .5 * (r + i), c = t.nodes; + c[0] && xr(n, c[0], e, r, o, a), c[1] && xr(n, c[1], o, r, u, a), c[2] && xr(n, c[2], e, a, o, i), c[3] && xr(n, c[3], o, a, u, i) + } + } + + function br(n, t) { + n = mo.rgb(n), t = mo.rgb(t); + var e = n.r, r = n.g, u = n.b, i = t.r - e, o = t.g - r, a = t.b - u; + return function (n) { + return "#" + ct(Math.round(e + i * n)) + ct(Math.round(r + o * n)) + ct(Math.round(u + a * n)) + } + } + + function _r(n, t) { + var e, r = {}, u = {}; + for (e in n) e in t ? r[e] = Er(n[e], t[e]) : u[e] = n[e]; + for (e in t) e in n || (u[e] = t[e]); + return function (n) { + for (e in r) u[e] = r[e](n); + return u + } + } + + function wr(n, t) { + return t -= n = +n, function (e) { + return n + t * e + } + } + + function Sr(n, t) { + var e, r, u, i, o, a = 0, c = 0, l = [], s = []; + for (n += "", t += "", Mc.lastIndex = 0, r = 0; e = Mc.exec(t); ++r) e.index && l.push(t.substring(a, c = e.index)), s.push({ + i: l.length, + x: e[0] + }), l.push(null), a = Mc.lastIndex; + for (a < t.length && l.push(t.substring(a)), r = 0, i = s.length; (e = Mc.exec(n)) && i > r; ++r) if (o = s[r], o.x == e[0]) { + if (o.i) if (null == l[o.i + 1]) for (l[o.i - 1] += o.x, l.splice(o.i, 1), u = r + 1; i > u; ++u) s[u].i--; else for (l[o.i - 1] += o.x + l[o.i + 1], l.splice(o.i, 2), u = r + 1; i > u; ++u) s[u].i -= 2; else if (null == l[o.i + 1]) l[o.i] = o.x; else for (l[o.i] = o.x + l[o.i + 1], l.splice(o.i + 1, 1), u = r + 1; i > u; ++u) s[u].i--; + s.splice(r, 1), i--, r-- + } else o.x = wr(parseFloat(e[0]), parseFloat(o.x)); + for (; i > r;) o = s.pop(), null == l[o.i + 1] ? l[o.i] = o.x : (l[o.i] = o.x + l[o.i + 1], l.splice(o.i + 1, 1)), i--; + return 1 === l.length ? null == l[0] ? (o = s[0].x, function (n) { + return o(n) + "" + }) : function () { + return t + } : function (n) { + for (r = 0; i > r; ++r) l[(o = s[r]).i] = o.x(n); + return l.join("") + } + } + + function Er(n, t) { + for (var e, r = mo.interpolators.length; --r >= 0 && !(e = mo.interpolators[r](n, t));) ; + return e + } + + function kr(n, t) { + var e, r = [], u = [], i = n.length, o = t.length, a = Math.min(n.length, t.length); + for (e = 0; a > e; ++e) r.push(Er(n[e], t[e])); + for (; i > e; ++e) u[e] = n[e]; + for (; o > e; ++e) u[e] = t[e]; + return function (n) { + for (e = 0; a > e; ++e) u[e] = r[e](n); + return u + } + } + + function Ar(n) { + return function (t) { + return 0 >= t ? 0 : t >= 1 ? 1 : n(t) + } + } + + function Nr(n) { + return function (t) { + return 1 - n(1 - t) + } + } + + function Tr(n) { + return function (t) { + return .5 * (.5 > t ? n(2 * t) : 2 - n(2 - 2 * t)) + } + } + + function qr(n) { + return n * n + } + + function zr(n) { + return n * n * n + } + + function Cr(n) { + if (0 >= n) return 0; + if (n >= 1) return 1; + var t = n * n, e = t * n; + return 4 * (.5 > n ? e : 3 * (n - t) + e - .75) + } + + function Dr(n) { + return function (t) { + return Math.pow(t, n) + } + } + + function jr(n) { + return 1 - Math.cos(n * Jo) + } + + function Lr(n) { + return Math.pow(2, 10 * (n - 1)) + } + + function Hr(n) { + return 1 - Math.sqrt(1 - n * n) + } + + function Fr(n, t) { + var e; + return arguments.length < 2 && (t = .45), arguments.length ? e = t / Wo * Math.asin(1 / n) : (n = 1, e = t / 4), function (r) { + return 1 + n * Math.pow(2, -10 * r) * Math.sin((r - e) * Wo / t) + } + } + + function Pr(n) { + return n || (n = 1.70158), function (t) { + return t * t * ((n + 1) * t - n) + } + } + + function Or(n) { + return 1 / 2.75 > n ? 7.5625 * n * n : 2 / 2.75 > n ? 7.5625 * (n -= 1.5 / 2.75) * n + .75 : 2.5 / 2.75 > n ? 7.5625 * (n -= 2.25 / 2.75) * n + .9375 : 7.5625 * (n -= 2.625 / 2.75) * n + .984375 + } + + function Rr(n, t) { + n = mo.hcl(n), t = mo.hcl(t); + var e = n.h, r = n.c, u = n.l, i = t.h - e, o = t.c - r, a = t.l - u; + return isNaN(o) && (o = 0, r = isNaN(r) ? t.c : r), isNaN(i) ? (i = 0, e = isNaN(e) ? t.h : e) : i > 180 ? i -= 360 : -180 > i && (i += 360), function (n) { + return J(e + i * n, r + o * n, u + a * n) + "" + } + } + + function Yr(n, t) { + n = mo.hsl(n), t = mo.hsl(t); + var e = n.h, r = n.s, u = n.l, i = t.h - e, o = t.s - r, a = t.l - u; + return isNaN(o) && (o = 0, r = isNaN(r) ? t.s : r), isNaN(i) ? (i = 0, e = isNaN(e) ? t.h : e) : i > 180 ? i -= 360 : -180 > i && (i += 360), function (n) { + return $(e + i * n, r + o * n, u + a * n) + "" + } + } + + function Ir(n, t) { + n = mo.lab(n), t = mo.lab(t); + var e = n.l, r = n.a, u = n.b, i = t.l - e, o = t.a - r, a = t.b - u; + return function (n) { + return Q(e + i * n, r + o * n, u + a * n) + "" + } + } + + function Ur(n, t) { + return t -= n, function (e) { + return Math.round(n + t * e) + } + } + + function Zr(n) { + var t = [n.a, n.b], e = [n.c, n.d], r = Xr(t), u = Vr(t, e), i = Xr($r(e, t, -u)) || 0; + t[0] * e[1] < e[0] * t[1] && (t[0] *= -1, t[1] *= -1, r *= -1, u *= -1), this.rotate = (r ? Math.atan2(t[1], t[0]) : Math.atan2(-e[0], e[1])) * na, this.translate = [n.e, n.f], this.scale = [r, i], this.skew = i ? Math.atan2(u, i) * na : 0 + } + + function Vr(n, t) { + return n[0] * t[0] + n[1] * t[1] + } + + function Xr(n) { + var t = Math.sqrt(Vr(n, n)); + return t && (n[0] /= t, n[1] /= t), t + } + + function $r(n, t, e) { + return n[0] += e * t[0], n[1] += e * t[1], n + } + + function Br(n, t) { + var e, r = [], u = [], i = mo.transform(n), o = mo.transform(t), a = i.translate, c = o.translate, l = i.rotate, + s = o.rotate, f = i.skew, h = o.skew, g = i.scale, p = o.scale; + return a[0] != c[0] || a[1] != c[1] ? (r.push("translate(", null, ",", null, ")"), u.push({ + i: 1, + x: wr(a[0], c[0]) + }, { + i: 3, + x: wr(a[1], c[1]) + })) : c[0] || c[1] ? r.push("translate(" + c + ")") : r.push(""), l != s ? (l - s > 180 ? s += 360 : s - l > 180 && (l += 360), u.push({ + i: r.push(r.pop() + "rotate(", null, ")") - 2, + x: wr(l, s) + })) : s && r.push(r.pop() + "rotate(" + s + ")"), f != h ? u.push({ + i: r.push(r.pop() + "skewX(", null, ")") - 2, + x: wr(f, h) + }) : h && r.push(r.pop() + "skewX(" + h + ")"), g[0] != p[0] || g[1] != p[1] ? (e = r.push(r.pop() + "scale(", null, ",", null, ")"), u.push({ + i: e - 4, + x: wr(g[0], p[0]) + }, { + i: e - 2, + x: wr(g[1], p[1]) + })) : (1 != p[0] || 1 != p[1]) && r.push(r.pop() + "scale(" + p + ")"), e = u.length, function (n) { + for (var t, i = -1; ++i < e;) r[(t = u[i]).i] = t.x(n); + return r.join("") + } + } + + function Wr(n, t) { + return t = t - (n = +n) ? 1 / (t - n) : 0, function (e) { + return (e - n) * t + } + } + + function Jr(n, t) { + return t = t - (n = +n) ? 1 / (t - n) : 0, function (e) { + return Math.max(0, Math.min(1, (e - n) * t)) + } + } + + function Gr(n) { + for (var t = n.source, e = n.target, r = Qr(t, e), u = [t]; t !== r;) t = t.parent, u.push(t); + for (var i = u.length; e !== r;) u.splice(i, 0, e), e = e.parent; + return u + } + + function Kr(n) { + for (var t = [], e = n.parent; null != e;) t.push(n), n = e, e = e.parent; + return t.push(n), t + } + + function Qr(n, t) { + if (n === t) return n; + for (var e = Kr(n), r = Kr(t), u = e.pop(), i = r.pop(), o = null; u === i;) o = u, u = e.pop(), i = r.pop(); + return o + } + + function nu(n) { + n.fixed |= 2 + } + + function tu(n) { + n.fixed &= -7 + } + + function eu(n) { + n.fixed |= 4, n.px = n.x, n.py = n.y + } + + function ru(n) { + n.fixed &= -5 + } + + function uu(n, t, e) { + var r = 0, u = 0; + if (n.charge = 0, !n.leaf) for (var i, o = n.nodes, a = o.length, c = -1; ++c < a;) i = o[c], null != i && (uu(i, t, e), n.charge += i.charge, r += i.charge * i.cx, u += i.charge * i.cy); + if (n.point) { + n.leaf || (n.point.x += Math.random() - .5, n.point.y += Math.random() - .5); + var l = t * e[n.point.index]; + n.charge += n.pointCharge = l, r += l * n.point.x, u += l * n.point.y + } + n.cx = r / n.charge, n.cy = u / n.charge + } + + function iu(n, t) { + return mo.rebind(n, t, "sort", "children", "value"), n.nodes = n, n.links = lu, n + } + + function ou(n) { + return n.children + } + + function au(n) { + return n.value + } + + function cu(n, t) { + return t.value - n.value + } + + function lu(n) { + return mo.merge(n.map(function (n) { + return (n.children || []).map(function (t) { + return {source: n, target: t} + }) + })) + } + + function su(n) { + return n.x + } + + function fu(n) { + return n.y + } + + function hu(n, t, e) { + n.y0 = t, n.y = e + } + + function gu(n) { + return mo.range(n.length) + } + + function pu(n) { + for (var t = -1, e = n[0].length, r = []; ++t < e;) r[t] = 0; + return r + } + + function du(n) { + for (var t, e = 1, r = 0, u = n[0][1], i = n.length; i > e; ++e) (t = n[e][1]) > u && (r = e, u = t); + return r + } + + function vu(n) { + return n.reduce(mu, 0) + } + + function mu(n, t) { + return n + t[1] + } + + function yu(n, t) { + return Mu(n, Math.ceil(Math.log(t.length) / Math.LN2 + 1)) + } + + function Mu(n, t) { + for (var e = -1, r = +n[0], u = (n[1] - r) / t, i = []; ++e <= t;) i[e] = u * e + r; + return i + } + + function xu(n) { + return [mo.min(n), mo.max(n)] + } + + function bu(n, t) { + return n.parent == t.parent ? 1 : 2 + } + + function _u(n) { + var t = n.children; + return t && t.length ? t[0] : n._tree.thread + } + + function wu(n) { + var t, e = n.children; + return e && (t = e.length) ? e[t - 1] : n._tree.thread + } + + function Su(n, t) { + var e = n.children; + if (e && (u = e.length)) for (var r, u, i = -1; ++i < u;) t(r = Su(e[i], t), n) > 0 && (n = r); + return n + } + + function Eu(n, t) { + return n.x - t.x + } + + function ku(n, t) { + return t.x - n.x + } + + function Au(n, t) { + return n.depth - t.depth + } + + function Nu(n, t) { + function e(n, r) { + var u = n.children; + if (u && (o = u.length)) for (var i, o, a = null, c = -1; ++c < o;) i = u[c], e(i, a), a = i; + t(n, r) + } + + e(n, null) + } + + function Tu(n) { + for (var t, e = 0, r = 0, u = n.children, i = u.length; --i >= 0;) t = u[i]._tree, t.prelim += e, t.mod += e, e += t.shift + (r += t.change) + } + + function qu(n, t, e) { + n = n._tree, t = t._tree; + var r = e / (t.number - n.number); + n.change += r, t.change -= r, t.shift += e, t.prelim += e, t.mod += e + } + + function zu(n, t, e) { + return n._tree.ancestor.parent == t.parent ? n._tree.ancestor : e + } + + function Cu(n, t) { + return n.value - t.value + } + + function Du(n, t) { + var e = n._pack_next; + n._pack_next = t, t._pack_prev = n, t._pack_next = e, e._pack_prev = t + } + + function ju(n, t) { + n._pack_next = t, t._pack_prev = n + } + + function Lu(n, t) { + var e = t.x - n.x, r = t.y - n.y, u = n.r + t.r; + return .999 * u * u > e * e + r * r + } + + function Hu(n) { + function t(n) { + s = Math.min(n.x - n.r, s), f = Math.max(n.x + n.r, f), h = Math.min(n.y - n.r, h), g = Math.max(n.y + n.r, g) + } + + if ((e = n.children) && (l = e.length)) { + var e, r, u, i, o, a, c, l, s = 1 / 0, f = -1 / 0, h = 1 / 0, g = -1 / 0; + if (e.forEach(Fu), r = e[0], r.x = -r.r, r.y = 0, t(r), l > 1 && (u = e[1], u.x = u.r, u.y = 0, t(u), l > 2)) for (i = e[2], Ru(r, u, i), t(i), Du(r, i), r._pack_prev = i, Du(i, u), u = r._pack_next, o = 3; l > o; o++) { + Ru(r, u, i = e[o]); + var p = 0, d = 1, v = 1; + for (a = u._pack_next; a !== u; a = a._pack_next, d++) if (Lu(a, i)) { + p = 1; + break + } + if (1 == p) for (c = r._pack_prev; c !== a._pack_prev && !Lu(c, i); c = c._pack_prev, v++) ; + p ? (v > d || d == v && u.r < r.r ? ju(r, u = a) : ju(r = c, u), o--) : (Du(r, i), u = i, t(i)) + } + var m = (s + f) / 2, y = (h + g) / 2, M = 0; + for (o = 0; l > o; o++) i = e[o], i.x -= m, i.y -= y, M = Math.max(M, i.r + Math.sqrt(i.x * i.x + i.y * i.y)); + n.r = M, e.forEach(Pu) + } + } + + function Fu(n) { + n._pack_next = n._pack_prev = n + } + + function Pu(n) { + delete n._pack_next, delete n._pack_prev + } + + function Ou(n, t, e, r) { + var u = n.children; + if (n.x = t += r * n.x, n.y = e += r * n.y, n.r *= r, u) for (var i = -1, o = u.length; ++i < o;) Ou(u[i], t, e, r) + } + + function Ru(n, t, e) { + var r = n.r + e.r, u = t.x - n.x, i = t.y - n.y; + if (r && (u || i)) { + var o = t.r + e.r, a = u * u + i * i; + o *= o, r *= r; + var c = .5 + (r - o) / (2 * a), + l = Math.sqrt(Math.max(0, 2 * o * (r + a) - (r -= a) * r - o * o)) / (2 * a); + e.x = n.x + c * u + l * i, e.y = n.y + c * i - l * u + } else e.x = n.x + r, e.y = n.y + } + + function Yu(n) { + return 1 + mo.max(n, function (n) { + return n.y + }) + } + + function Iu(n) { + return n.reduce(function (n, t) { + return n + t.x + }, 0) / n.length + } + + function Uu(n) { + var t = n.children; + return t && t.length ? Uu(t[0]) : n + } + + function Zu(n) { + var t, e = n.children; + return e && (t = e.length) ? Zu(e[t - 1]) : n + } + + function Vu(n) { + return {x: n.x, y: n.y, dx: n.dx, dy: n.dy} + } + + function Xu(n, t) { + var e = n.x + t[3], r = n.y + t[0], u = n.dx - t[1] - t[3], i = n.dy - t[0] - t[2]; + return 0 > u && (e += u / 2, u = 0), 0 > i && (r += i / 2, i = 0), {x: e, y: r, dx: u, dy: i} + } + + function $u(n) { + var t = n[0], e = n[n.length - 1]; + return e > t ? [t, e] : [e, t] + } + + function Bu(n) { + return n.rangeExtent ? n.rangeExtent() : $u(n.range()) + } + + function Wu(n, t, e, r) { + var u = e(n[0], n[1]), i = r(t[0], t[1]); + return function (n) { + return i(u(n)) + } + } + + function Ju(n, t) { + var e, r = 0, u = n.length - 1, i = n[r], o = n[u]; + return i > o && (e = r, r = u, u = e, e = i, i = o, o = e), n[r] = t.floor(i), n[u] = t.ceil(o), n + } + + function Gu(n) { + return n ? { + floor: function (t) { + return Math.floor(t / n) * n + }, ceil: function (t) { + return Math.ceil(t / n) * n + } + } : Tc + } + + function Ku(n, t, e, r) { + var u = [], i = [], o = 0, a = Math.min(n.length, t.length) - 1; + for (n[a] < n[0] && (n = n.slice().reverse(), t = t.slice().reverse()); ++o <= a;) u.push(e(n[o - 1], n[o])), i.push(r(t[o - 1], t[o])); + return function (t) { + var e = mo.bisect(n, t, 1, a) - 1; + return i[e](u[e](t)) + } + } + + function Qu(n, t, e, r) { + function u() { + var u = Math.min(n.length, t.length) > 2 ? Ku : Wu, c = r ? Jr : Wr; + return o = u(n, t, c, e), a = u(t, n, c, Er), i + } + + function i(n) { + return o(n) + } + + var o, a; + return i.invert = function (n) { + return a(n) + }, i.domain = function (t) { + return arguments.length ? (n = t.map(Number), u()) : n + }, i.range = function (n) { + return arguments.length ? (t = n, u()) : t + }, i.rangeRound = function (n) { + return i.range(n).interpolate(Ur) + }, i.clamp = function (n) { + return arguments.length ? (r = n, u()) : r + }, i.interpolate = function (n) { + return arguments.length ? (e = n, u()) : e + }, i.ticks = function (t) { + return ri(n, t) + }, i.tickFormat = function (t, e) { + return ui(n, t, e) + }, i.nice = function (t) { + return ti(n, t), u() + }, i.copy = function () { + return Qu(n, t, e, r) + }, u() + } + + function ni(n, t) { + return mo.rebind(n, t, "range", "rangeRound", "interpolate", "clamp") + } + + function ti(n, t) { + return Ju(n, Gu(ei(n, t)[2])) + } + + function ei(n, t) { + null == t && (t = 10); + var e = $u(n), r = e[1] - e[0], u = Math.pow(10, Math.floor(Math.log(r / t) / Math.LN10)), i = t / r * u; + return .15 >= i ? u *= 10 : .35 >= i ? u *= 5 : .75 >= i && (u *= 2), e[0] = Math.ceil(e[0] / u) * u, e[1] = Math.floor(e[1] / u) * u + .5 * u, e[2] = u, e + } + + function ri(n, t) { + return mo.range.apply(mo, ei(n, t)) + } + + function ui(n, t, e) { + var r = -Math.floor(Math.log(ei(n, t)[2]) / Math.LN10 + .01); + return mo.format(e ? e.replace(Aa, function (n, t, e, u, i, o, a, c, l, s) { + return [t, e, u, i, o, a, c, l || "." + (r - 2 * ("%" === s)), s].join("") + }) : ",." + r + "f") + } + + function ii(n, t, e, r) { + function u(n) { + return (e ? Math.log(0 > n ? 0 : n) : -Math.log(n > 0 ? 0 : -n)) / Math.log(t) + } + + function i(n) { + return e ? Math.pow(t, n) : -Math.pow(t, -n) + } + + function o(t) { + return n(u(t)) + } + + return o.invert = function (t) { + return i(n.invert(t)) + }, o.domain = function (t) { + return arguments.length ? (e = t[0] >= 0, n.domain((r = t.map(Number)).map(u)), o) : r + }, o.base = function (e) { + return arguments.length ? (t = +e, n.domain(r.map(u)), o) : t + }, o.nice = function () { + var t = Ju(r.map(u), e ? Math : zc); + return n.domain(t), r = t.map(i), o + }, o.ticks = function () { + var n = $u(r), o = [], a = n[0], c = n[1], l = Math.floor(u(a)), s = Math.ceil(u(c)), f = t % 1 ? 2 : t; + if (isFinite(s - l)) { + if (e) { + for (; s > l; l++) for (var h = 1; f > h; h++) o.push(i(l) * h); + o.push(i(l)) + } else for (o.push(i(l)); l++ < s;) for (var h = f - 1; h > 0; h--) o.push(i(l) * h); + for (l = 0; o[l] < a; l++) ; + for (s = o.length; o[s - 1] > c; s--) ; + o = o.slice(l, s) + } + return o + }, o.tickFormat = function (n, t) { + if (!arguments.length) return qc; + arguments.length < 2 ? t = qc : "function" != typeof t && (t = mo.format(t)); + var r, a = Math.max(.1, n / o.ticks().length), c = e ? (r = 1e-12, Math.ceil) : (r = -1e-12, Math.floor); + return function (n) { + return n / i(c(u(n) + r)) <= a ? t(n) : "" + } + }, o.copy = function () { + return ii(n.copy(), t, e, r) + }, ni(o, n) + } + + function oi(n, t, e) { + function r(t) { + return n(u(t)) + } + + var u = ai(t), i = ai(1 / t); + return r.invert = function (t) { + return i(n.invert(t)) + }, r.domain = function (t) { + return arguments.length ? (n.domain((e = t.map(Number)).map(u)), r) : e + }, r.ticks = function (n) { + return ri(e, n) + }, r.tickFormat = function (n, t) { + return ui(e, n, t) + }, r.nice = function (n) { + return r.domain(ti(e, n)) + }, r.exponent = function (o) { + return arguments.length ? (u = ai(t = o), i = ai(1 / t), n.domain(e.map(u)), r) : t + }, r.copy = function () { + return oi(n.copy(), t, e) + }, ni(r, n) + } + + function ai(n) { + return function (t) { + return 0 > t ? -Math.pow(-t, n) : Math.pow(t, n) + } + } + + function ci(n, t) { + function e(e) { + return o[((i.get(e) || "range" === t.t && i.set(e, n.push(e))) - 1) % o.length] + } + + function r(t, e) { + return mo.range(n.length).map(function (n) { + return t + e * n + }) + } + + var i, o, a; + return e.domain = function (r) { + if (!arguments.length) return n; + n = [], i = new u; + for (var o, a = -1, c = r.length; ++a < c;) i.has(o = r[a]) || i.set(o, n.push(o)); + return e[t.t].apply(e, t.a) + }, e.range = function (n) { + return arguments.length ? (o = n, a = 0, t = {t: "range", a: arguments}, e) : o + }, e.rangePoints = function (u, i) { + arguments.length < 2 && (i = 0); + var c = u[0], l = u[1], s = (l - c) / (Math.max(1, n.length - 1) + i); + return o = r(n.length < 2 ? (c + l) / 2 : c + s * i / 2, s), a = 0, t = {t: "rangePoints", a: arguments}, e + }, e.rangeBands = function (u, i, c) { + arguments.length < 2 && (i = 0), arguments.length < 3 && (c = i); + var l = u[1] < u[0], s = u[l - 0], f = u[1 - l], h = (f - s) / (n.length - i + 2 * c); + return o = r(s + h * c, h), l && o.reverse(), a = h * (1 - i), t = {t: "rangeBands", a: arguments}, e + }, e.rangeRoundBands = function (u, i, c) { + arguments.length < 2 && (i = 0), arguments.length < 3 && (c = i); + var l = u[1] < u[0], s = u[l - 0], f = u[1 - l], h = Math.floor((f - s) / (n.length - i + 2 * c)), + g = f - s - (n.length - i) * h; + return o = r(s + Math.round(g / 2), h), l && o.reverse(), a = Math.round(h * (1 - i)), t = { + t: "rangeRoundBands", + a: arguments + }, e + }, e.rangeBand = function () { + return a + }, e.rangeExtent = function () { + return $u(t.a[0]) + }, e.copy = function () { + return ci(n, t) + }, e.domain(n) + } + + function li(n, t) { + function e() { + var e = 0, i = t.length; + for (u = []; ++e < i;) u[e - 1] = mo.quantile(n, e / i); + return r + } + + function r(n) { + return isNaN(n = +n) ? void 0 : t[mo.bisect(u, n)] + } + + var u; + return r.domain = function (t) { + return arguments.length ? (n = t.filter(function (n) { + return !isNaN(n) + }).sort(mo.ascending), e()) : n + }, r.range = function (n) { + return arguments.length ? (t = n, e()) : t + }, r.quantiles = function () { + return u + }, r.invertExtent = function (e) { + return e = t.indexOf(e), 0 > e ? [0 / 0, 0 / 0] : [e > 0 ? u[e - 1] : n[0], e < u.length ? u[e] : n[n.length - 1]] + }, r.copy = function () { + return li(n, t) + }, e() + } + + function si(n, t, e) { + function r(t) { + return e[Math.max(0, Math.min(o, Math.floor(i * (t - n))))] + } + + function u() { + return i = e.length / (t - n), o = e.length - 1, r + } + + var i, o; + return r.domain = function (e) { + return arguments.length ? (n = +e[0], t = +e[e.length - 1], u()) : [n, t] + }, r.range = function (n) { + return arguments.length ? (e = n, u()) : e + }, r.invertExtent = function (t) { + return t = e.indexOf(t), t = 0 > t ? 0 / 0 : t / i + n, [t, t + 1 / i] + }, r.copy = function () { + return si(n, t, e) + }, u() + } + + function fi(n, t) { + function e(e) { + return e >= e ? t[mo.bisect(n, e)] : void 0 + } + + return e.domain = function (t) { + return arguments.length ? (n = t, e) : n + }, e.range = function (n) { + return arguments.length ? (t = n, e) : t + }, e.invertExtent = function (e) { + return e = t.indexOf(e), [n[e - 1], n[e]] + }, e.copy = function () { + return fi(n, t) + }, e + } + + function hi(n) { + function t(n) { + return +n + } + + return t.invert = t, t.domain = t.range = function (e) { + return arguments.length ? (n = e.map(t), t) : n + }, t.ticks = function (t) { + return ri(n, t) + }, t.tickFormat = function (t, e) { + return ui(n, t, e) + }, t.copy = function () { + return hi(n) + }, t + } + + function gi(n) { + return n.innerRadius + } + + function pi(n) { + return n.outerRadius + } + + function di(n) { + return n.startAngle + } + + function vi(n) { + return n.endAngle + } + + function mi(n) { + for (var t, e, r, u = -1, i = n.length; ++u < i;) t = n[u], e = t[0], r = t[1] + Hc, t[0] = e * Math.cos(r), t[1] = e * Math.sin(r); + return n + } + + function yi(n) { + function t(t) { + function c() { + d.push("M", a(n(m), f), s, l(n(v.reverse()), f), "Z") + } + + for (var h, g, p, d = [], v = [], m = [], y = -1, M = t.length, x = pt(e), b = pt(u), _ = e === r ? function () { + return g + } : pt(r), w = u === i ? function () { + return p + } : pt(i); ++y < M;) o.call(this, h = t[y], y) ? (v.push([g = +x.call(this, h, y), p = +b.call(this, h, y)]), m.push([+_.call(this, h, y), +w.call(this, h, y)])) : v.length && (c(), v = [], m = []); + return v.length && c(), d.length ? d.join("") : null + } + + var e = Ze, r = Ze, u = 0, i = Ve, o = Vt, a = Xe, c = a.key, l = a, s = "L", f = .7; + return t.x = function (n) { + return arguments.length ? (e = r = n, t) : r + }, t.x0 = function (n) { + return arguments.length ? (e = n, t) : e + }, t.x1 = function (n) { + return arguments.length ? (r = n, t) : r + }, t.y = function (n) { + return arguments.length ? (u = i = n, t) : i + }, t.y0 = function (n) { + return arguments.length ? (u = n, t) : u + }, t.y1 = function (n) { + return arguments.length ? (i = n, t) : i + }, t.defined = function (n) { + return arguments.length ? (o = n, t) : o + }, t.interpolate = function (n) { + return arguments.length ? (c = "function" == typeof n ? a = n : (a = gc.get(n) || Xe).key, l = a.reverse || a, s = a.closed ? "M" : "L", t) : c + }, t.tension = function (n) { + return arguments.length ? (f = n, t) : f + }, t + } + + function Mi(n) { + return n.radius + } + + function xi(n) { + return [n.x, n.y] + } + + function bi(n) { + return function () { + var t = n.apply(this, arguments), e = t[0], r = t[1] + Hc; + return [e * Math.cos(r), e * Math.sin(r)] + } + } + + function _i() { + return 64 + } + + function wi() { + return "circle" + } + + function Si(n) { + var t = Math.sqrt(n / Bo); + return "M0," + t + "A" + t + "," + t + " 0 1,1 0," + -t + "A" + t + "," + t + " 0 1,1 0," + t + "Z" + } + + function Ei(n, t) { + return Lo(n, Uc), n.id = t, n + } + + function ki(n, t, e, r) { + var u = n.id; + return N(n, "function" == typeof e ? function (n, i, o) { + n.__transition__[u].tween.set(t, r(e.call(n, n.__data__, i, o))) + } : (e = r(e), function (n) { + n.__transition__[u].tween.set(t, e) + })) + } + + function Ai(n) { + return null == n && (n = ""), function () { + this.textContent = n + } + } + + function Ni(n, t, e, r) { + var i = n.__transition__ || (n.__transition__ = {active: 0, count: 0}), o = i[e]; + if (!o) { + var a = r.time; + o = i[e] = { + tween: new u, + time: a, + ease: r.ease, + delay: r.delay, + duration: r.duration + }, ++i.count, mo.timer(function (r) { + function u(r) { + return i.active > e ? l() : (i.active = e, o.event && o.event.start.call(n, s, t), o.tween.forEach(function (e, r) { + (r = r.call(n, s, t)) && p.push(r) + }), c(r || 1) ? 1 : (xt(c, h, a), void 0)) + } + + function c(r) { + if (i.active !== e) return l(); + for (var u = r / g, a = f(u), c = p.length; c > 0;) p[--c].call(n, a); + return u >= 1 ? (o.event && o.event.end.call(n, s, t), l()) : void 0 + } + + function l() { + return --i.count ? delete i[e] : delete n.__transition__, 1 + } + + var s = n.__data__, f = o.ease, h = o.delay, g = o.duration, p = []; + return r >= h ? u(r - h) : (xt(u, h, a), void 0) + }, 0, a) + } + } + + function Ti(n, t) { + n.attr("transform", function (n) { + return "translate(" + t(n) + ",0)" + }) + } + + function qi(n, t) { + n.attr("transform", function (n) { + return "translate(0," + t(n) + ")" + }) + } + + function zi() { + this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]) + } + + function Ci(n, t, e) { + function r(t) { + var e = n(t), r = i(e, 1); + return r - t > t - e ? e : r + } + + function u(e) { + return t(e = n(new Jc(e - 1)), 1), e + } + + function i(n, e) { + return t(n = new Jc(+n), e), n + } + + function o(n, r, i) { + var o = u(n), a = []; + if (i > 1) for (; r > o;) e(o) % i || a.push(new Date(+o)), t(o, 1); else for (; r > o;) a.push(new Date(+o)), t(o, 1); + return a + } + + function a(n, t, e) { + try { + Jc = zi; + var r = new zi; + return r._ = n, o(r, t, e) + } finally { + Jc = Date + } + } + + n.floor = n, n.round = r, n.ceil = u, n.offset = i, n.range = o; + var c = n.utc = Di(n); + return c.floor = c, c.round = Di(r), c.ceil = Di(u), c.offset = Di(i), c.range = a, n + } + + function Di(n) { + return function (t, e) { + try { + Jc = zi; + var r = new zi; + return r._ = t, n(r, e)._ + } finally { + Jc = Date + } + } + } + + function ji(n) { + function t(t) { + for (var r, u, i, o = [], a = -1, c = 0; ++a < e;) 37 === n.charCodeAt(a) && (o.push(n.substring(c, a)), null != (u = dl[r = n.charAt(++a)]) && (r = n.charAt(++a)), (i = vl[r]) && (r = i(t, null == u ? "e" === r ? " " : "0" : u)), o.push(r), c = a + 1); + return o.push(n.substring(c, a)), o.join("") + } + + var e = n.length; + return t.parse = function (t) { + var e = {y: 1900, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0, Z: null}, r = Li(e, n, t, 0); + if (r != t.length) return null; + "p" in e && (e.H = e.H % 12 + 12 * e.p); + var u = null != e.Z && Jc !== zi, i = new (u ? zi : Jc); + return "j" in e ? i.setFullYear(e.y, 0, e.j) : "w" in e && ("W" in e || "U" in e) ? (i.setFullYear(e.y, 0, 1), i.setFullYear(e.y, 0, "W" in e ? (e.w + 6) % 7 + 7 * e.W - (i.getDay() + 5) % 7 : e.w + 7 * e.U - (i.getDay() + 6) % 7)) : i.setFullYear(e.y, e.m, e.d), i.setHours(e.H + Math.floor(e.Z / 100), e.M + e.Z % 100, e.S, e.L), u ? i._ : i + }, t.toString = function () { + return n + }, t + } + + function Li(n, t, e, r) { + for (var u, i, o, a = 0, c = t.length, l = e.length; c > a;) { + if (r >= l) return -1; + if (u = t.charCodeAt(a++), 37 === u) { + if (o = t.charAt(a++), i = ml[o in dl ? t.charAt(a++) : o], !i || (r = i(n, e, r)) < 0) return -1 + } else if (u != e.charCodeAt(r++)) return -1 + } + return r + } + + function Hi(n) { + return new RegExp("^(?:" + n.map(mo.requote).join("|") + ")", "i") + } + + function Fi(n) { + for (var t = new u, e = -1, r = n.length; ++e < r;) t.set(n[e].toLowerCase(), e); + return t + } + + function Pi(n, t, e) { + var r = 0 > n ? "-" : "", u = (r ? -n : n) + "", i = u.length; + return r + (e > i ? new Array(e - i + 1).join(t) + u : u) + } + + function Oi(n, t, e) { + cl.lastIndex = 0; + var r = cl.exec(t.substring(e)); + return r ? (n.w = ll.get(r[0].toLowerCase()), e + r[0].length) : -1 + } + + function Ri(n, t, e) { + ol.lastIndex = 0; + var r = ol.exec(t.substring(e)); + return r ? (n.w = al.get(r[0].toLowerCase()), e + r[0].length) : -1 + } + + function Yi(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 1)); + return r ? (n.w = +r[0], e + r[0].length) : -1 + } + + function Ii(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e)); + return r ? (n.U = +r[0], e + r[0].length) : -1 + } + + function Ui(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e)); + return r ? (n.W = +r[0], e + r[0].length) : -1 + } + + function Zi(n, t, e) { + hl.lastIndex = 0; + var r = hl.exec(t.substring(e)); + return r ? (n.m = gl.get(r[0].toLowerCase()), e + r[0].length) : -1 + } + + function Vi(n, t, e) { + sl.lastIndex = 0; + var r = sl.exec(t.substring(e)); + return r ? (n.m = fl.get(r[0].toLowerCase()), e + r[0].length) : -1 + } + + function Xi(n, t, e) { + return Li(n, vl.c.toString(), t, e) + } + + function $i(n, t, e) { + return Li(n, vl.x.toString(), t, e) + } + + function Bi(n, t, e) { + return Li(n, vl.X.toString(), t, e) + } + + function Wi(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 4)); + return r ? (n.y = +r[0], e + r[0].length) : -1 + } + + function Ji(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 2)); + return r ? (n.y = Ki(+r[0]), e + r[0].length) : -1 + } + + function Gi(n, t, e) { + return /^[+-]\d{4}$/.test(t = t.substring(e, e + 5)) ? (n.Z = +t, e + 5) : -1 + } + + function Ki(n) { + return n + (n > 68 ? 1900 : 2e3) + } + + function Qi(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 2)); + return r ? (n.m = r[0] - 1, e + r[0].length) : -1 + } + + function no(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 2)); + return r ? (n.d = +r[0], e + r[0].length) : -1 + } + + function to(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 3)); + return r ? (n.j = +r[0], e + r[0].length) : -1 + } + + function eo(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 2)); + return r ? (n.H = +r[0], e + r[0].length) : -1 + } + + function ro(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 2)); + return r ? (n.M = +r[0], e + r[0].length) : -1 + } + + function uo(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 2)); + return r ? (n.S = +r[0], e + r[0].length) : -1 + } + + function io(n, t, e) { + yl.lastIndex = 0; + var r = yl.exec(t.substring(e, e + 3)); + return r ? (n.L = +r[0], e + r[0].length) : -1 + } + + function oo(n, t, e) { + var r = Ml.get(t.substring(e, e += 2).toLowerCase()); + return null == r ? -1 : (n.p = r, e) + } + + function ao(n) { + var t = n.getTimezoneOffset(), e = t > 0 ? "-" : "+", r = ~~(Math.abs(t) / 60), u = Math.abs(t) % 60; + return e + Pi(r, "0", 2) + Pi(u, "0", 2) + } + + function co(n, t, e) { + pl.lastIndex = 0; + var r = pl.exec(t.substring(e, e + 1)); + return r ? e + r[0].length : -1 + } + + function lo(n) { + function t(n) { + try { + Jc = zi; + var t = new Jc; + return t._ = n, e(t) + } finally { + Jc = Date + } + } + + var e = ji(n); + return t.parse = function (n) { + try { + Jc = zi; + var t = e.parse(n); + return t && t._ + } finally { + Jc = Date + } + }, t.toString = e.toString, t + } + + function so(n) { + return n.toISOString() + } + + function fo(n, t, e) { + function r(t) { + return n(t) + } + + function u(n, e) { + var r = n[1] - n[0], u = r / e, i = mo.bisect(bl, u); + return i == bl.length ? [t.year, ei(n.map(function (n) { + return n / 31536e6 + }), e)[2]] : i ? t[u / bl[i - 1] < bl[i] / u ? i - 1 : i] : [El, ei(n, e)[2]] + } + + return r.invert = function (t) { + return ho(n.invert(t)) + }, r.domain = function (t) { + return arguments.length ? (n.domain(t), r) : n.domain().map(ho) + }, r.nice = function (n, t) { + function e(e) { + return !isNaN(e) && !n.range(e, ho(+e + 1), t).length + } + + var i = r.domain(), o = $u(i), a = null == n ? u(o, 10) : "number" == typeof n && u(o, n); + return a && (n = a[0], t = a[1]), r.domain(Ju(i, t > 1 ? { + floor: function (t) { + for (; e(t = n.floor(t));) t = ho(t - 1); + return t + }, ceil: function (t) { + for (; e(t = n.ceil(t));) t = ho(+t + 1); + return t + } + } : n)) + }, r.ticks = function (n, t) { + var e = $u(r.domain()), + i = null == n ? u(e, 10) : "number" == typeof n ? u(e, n) : !n.range && [{range: n}, t]; + return i && (n = i[0], t = i[1]), n.range(e[0], ho(+e[1] + 1), 1 > t ? 1 : t) + }, r.tickFormat = function () { + return e + }, r.copy = function () { + return fo(n.copy(), t, e) + }, ni(r, n) + } + + function ho(n) { + return new Date(n) + } + + function go(n) { + return function (t) { + for (var e = n.length - 1, r = n[e]; !r[1](t);) r = n[--e]; + return r[0](t) + } + } + + function po(n) { + return JSON.parse(n.responseText) + } + + function vo(n) { + var t = xo.createRange(); + return t.selectNode(xo.body), t.createContextualFragment(n.responseText) + } + + var mo = {version: "3.3.6"}; + Date.now || (Date.now = function () { + return +new Date + }); + var yo = [].slice, Mo = function (n) { + return yo.call(n) + }, xo = document, bo = xo.documentElement, _o = window; + try { + Mo(bo.childNodes)[0].nodeType + } catch (wo) { + Mo = function (n) { + for (var t = n.length, e = new Array(t); t--;) e[t] = n[t]; + return e + } + } + try { + xo.createElement("div").style.setProperty("opacity", 0, "") + } catch (So) { + var Eo = _o.Element.prototype, ko = Eo.setAttribute, Ao = Eo.setAttributeNS, + No = _o.CSSStyleDeclaration.prototype, To = No.setProperty; + Eo.setAttribute = function (n, t) { + ko.call(this, n, t + "") + }, Eo.setAttributeNS = function (n, t, e) { + Ao.call(this, n, t, e + "") + }, No.setProperty = function (n, t, e) { + To.call(this, n, t + "", e) + } + } + mo.ascending = function (n, t) { + return t > n ? -1 : n > t ? 1 : n >= t ? 0 : 0 / 0 + }, mo.descending = function (n, t) { + return n > t ? -1 : t > n ? 1 : t >= n ? 0 : 0 / 0 + }, mo.min = function (n, t) { + var e, r, u = -1, i = n.length; + if (1 === arguments.length) { + for (; ++u < i && !(null != (e = n[u]) && e >= e);) e = void 0; + for (; ++u < i;) null != (r = n[u]) && e > r && (e = r) + } else { + for (; ++u < i && !(null != (e = t.call(n, n[u], u)) && e >= e);) e = void 0; + for (; ++u < i;) null != (r = t.call(n, n[u], u)) && e > r && (e = r) + } + return e + }, mo.max = function (n, t) { + var e, r, u = -1, i = n.length; + if (1 === arguments.length) { + for (; ++u < i && !(null != (e = n[u]) && e >= e);) e = void 0; + for (; ++u < i;) null != (r = n[u]) && r > e && (e = r) + } else { + for (; ++u < i && !(null != (e = t.call(n, n[u], u)) && e >= e);) e = void 0; + for (; ++u < i;) null != (r = t.call(n, n[u], u)) && r > e && (e = r) + } + return e + }, mo.extent = function (n, t) { + var e, r, u, i = -1, o = n.length; + if (1 === arguments.length) { + for (; ++i < o && !(null != (e = u = n[i]) && e >= e);) e = u = void 0; + for (; ++i < o;) null != (r = n[i]) && (e > r && (e = r), r > u && (u = r)) + } else { + for (; ++i < o && !(null != (e = u = t.call(n, n[i], i)) && e >= e);) e = void 0; + for (; ++i < o;) null != (r = t.call(n, n[i], i)) && (e > r && (e = r), r > u && (u = r)) + } + return [e, u] + }, mo.sum = function (n, t) { + var e, r = 0, u = n.length, i = -1; + if (1 === arguments.length) for (; ++i < u;) isNaN(e = +n[i]) || (r += e); else for (; ++i < u;) isNaN(e = +t.call(n, n[i], i)) || (r += e); + return r + }, mo.mean = function (t, e) { + var r, u = t.length, i = 0, o = -1, a = 0; + if (1 === arguments.length) for (; ++o < u;) n(r = t[o]) && (i += (r - i) / ++a); else for (; ++o < u;) n(r = e.call(t, t[o], o)) && (i += (r - i) / ++a); + return a ? i : void 0 + }, mo.quantile = function (n, t) { + var e = (n.length - 1) * t + 1, r = Math.floor(e), u = +n[r - 1], i = e - r; + return i ? u + i * (n[r] - u) : u + }, mo.median = function (t, e) { + return arguments.length > 1 && (t = t.map(e)), t = t.filter(n), t.length ? mo.quantile(t.sort(mo.ascending), .5) : void 0 + }, mo.bisector = function (n) { + return { + left: function (t, e, r, u) { + for (arguments.length < 3 && (r = 0), arguments.length < 4 && (u = t.length); u > r;) { + var i = r + u >>> 1; + n.call(t, t[i], i) < e ? r = i + 1 : u = i + } + return r + }, right: function (t, e, r, u) { + for (arguments.length < 3 && (r = 0), arguments.length < 4 && (u = t.length); u > r;) { + var i = r + u >>> 1; + e < n.call(t, t[i], i) ? u = i : r = i + 1 + } + return r + } + } + }; + var qo = mo.bisector(function (n) { + return n + }); + mo.bisectLeft = qo.left, mo.bisect = mo.bisectRight = qo.right, mo.shuffle = function (n) { + for (var t, e, r = n.length; r;) e = 0 | Math.random() * r--, t = n[r], n[r] = n[e], n[e] = t; + return n + }, mo.permute = function (n, t) { + for (var e = t.length, r = new Array(e); e--;) r[e] = n[t[e]]; + return r + }, mo.pairs = function (n) { + for (var t, e = 0, r = n.length - 1, u = n[0], i = new Array(0 > r ? 0 : r); r > e;) i[e] = [t = u, u = n[++e]]; + return i + }, mo.zip = function () { + if (!(u = arguments.length)) return []; + for (var n = -1, e = mo.min(arguments, t), r = new Array(e); ++n < e;) for (var u, i = -1, o = r[n] = new Array(u); ++i < u;) o[i] = arguments[i][n]; + return r + }, mo.transpose = function (n) { + return mo.zip.apply(mo, n) + }, mo.keys = function (n) { + var t = []; + for (var e in n) t.push(e); + return t + }, mo.values = function (n) { + var t = []; + for (var e in n) t.push(n[e]); + return t + }, mo.entries = function (n) { + var t = []; + for (var e in n) t.push({key: e, value: n[e]}); + return t + }, mo.merge = function (n) { + return Array.prototype.concat.apply([], n) + }, mo.range = function (n, t, r) { + if (arguments.length < 3 && (r = 1, arguments.length < 2 && (t = n, n = 0)), 1 / 0 === (t - n) / r) throw new Error("infinite range"); + var u, i = [], o = e(Math.abs(r)), a = -1; + if (n *= o, t *= o, r *= o, 0 > r) for (; (u = n + r * ++a) > t;) i.push(u / o); else for (; (u = n + r * ++a) < t;) i.push(u / o); + return i + }, mo.map = function (n) { + var t = new u; + if (n instanceof u) n.forEach(function (n, e) { + t.set(n, e) + }); else for (var e in n) t.set(e, n[e]); + return t + }, r(u, { + has: function (n) { + return zo + n in this + }, get: function (n) { + return this[zo + n] + }, set: function (n, t) { + return this[zo + n] = t + }, remove: function (n) { + return n = zo + n, n in this && delete this[n] + }, keys: function () { + var n = []; + return this.forEach(function (t) { + n.push(t) + }), n + }, values: function () { + var n = []; + return this.forEach(function (t, e) { + n.push(e) + }), n + }, entries: function () { + var n = []; + return this.forEach(function (t, e) { + n.push({key: t, value: e}) + }), n + }, forEach: function (n) { + for (var t in this) t.charCodeAt(0) === Co && n.call(this, t.substring(1), this[t]) + } + }); + var zo = "\x00", Co = zo.charCodeAt(0); + mo.nest = function () { + function n(t, a, c) { + if (c >= o.length) return r ? r.call(i, a) : e ? a.sort(e) : a; + for (var l, s, f, h, g = -1, p = a.length, d = o[c++], v = new u; ++g < p;) (h = v.get(l = d(s = a[g]))) ? h.push(s) : v.set(l, [s]); + return t ? (s = t(), f = function (e, r) { + s.set(e, n(t, r, c)) + }) : (s = {}, f = function (e, r) { + s[e] = n(t, r, c) + }), v.forEach(f), s + } + + function t(n, e) { + if (e >= o.length) return n; + var r = [], u = a[e++]; + return n.forEach(function (n, u) { + r.push({key: n, values: t(u, e)}) + }), u ? r.sort(function (n, t) { + return u(n.key, t.key) + }) : r + } + + var e, r, i = {}, o = [], a = []; + return i.map = function (t, e) { + return n(e, t, 0) + }, i.entries = function (e) { + return t(n(mo.map, e, 0), 0) + }, i.key = function (n) { + return o.push(n), i + }, i.sortKeys = function (n) { + return a[o.length - 1] = n, i + }, i.sortValues = function (n) { + return e = n, i + }, i.rollup = function (n) { + return r = n, i + }, i + }, mo.set = function (n) { + var t = new i; + if (n) for (var e = 0, r = n.length; r > e; ++e) t.add(n[e]); + return t + }, r(i, { + has: function (n) { + return zo + n in this + }, add: function (n) { + return this[zo + n] = !0, n + }, remove: function (n) { + return n = zo + n, n in this && delete this[n] + }, values: function () { + var n = []; + return this.forEach(function (t) { + n.push(t) + }), n + }, forEach: function (n) { + for (var t in this) t.charCodeAt(0) === Co && n.call(this, t.substring(1)) + } + }), mo.behavior = {}, mo.rebind = function (n, t) { + for (var e, r = 1, u = arguments.length; ++r < u;) n[e = arguments[r]] = o(n, t, t[e]); + return n + }; + var Do = ["webkit", "ms", "moz", "Moz", "o", "O"]; + mo.dispatch = function () { + for (var n = new l, t = -1, e = arguments.length; ++t < e;) n[arguments[t]] = s(n); + return n + }, l.prototype.on = function (n, t) { + var e = n.indexOf("."), r = ""; + if (e >= 0 && (r = n.substring(e + 1), n = n.substring(0, e)), n) return arguments.length < 2 ? this[n].on(r) : this[n].on(r, t); + if (2 === arguments.length) { + if (null == t) for (n in this) this.hasOwnProperty(n) && this[n].on(r, null); + return this + } + }, mo.event = null, mo.requote = function (n) { + return n.replace(jo, "\\$&") + }; + var jo = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g, Lo = {}.__proto__ ? function (n, t) { + n.__proto__ = t + } : function (n, t) { + for (var e in t) n[e] = t[e] + }, Ho = function (n, t) { + return t.querySelector(n) + }, Fo = function (n, t) { + return t.querySelectorAll(n) + }, Po = bo[a(bo, "matchesSelector")], Oo = function (n, t) { + return Po.call(n, t) + }; + "function" == typeof Sizzle && (Ho = function (n, t) { + return Sizzle(n, t)[0] || null + }, Fo = function (n, t) { + return Sizzle.uniqueSort(Sizzle(n, t)) + }, Oo = Sizzle.matchesSelector), mo.selection = function () { + return Uo + }; + var Ro = mo.selection.prototype = []; + Ro.select = function (n) { + var t, e, r, u, i = []; + n = d(n); + for (var o = -1, a = this.length; ++o < a;) { + i.push(t = []), t.parentNode = (r = this[o]).parentNode; + for (var c = -1, l = r.length; ++c < l;) (u = r[c]) ? (t.push(e = n.call(u, u.__data__, c, o)), e && "__data__" in u && (e.__data__ = u.__data__)) : t.push(null) + } + return p(i) + }, Ro.selectAll = function (n) { + var t, e, r = []; + n = v(n); + for (var u = -1, i = this.length; ++u < i;) for (var o = this[u], a = -1, c = o.length; ++a < c;) (e = o[a]) && (r.push(t = Mo(n.call(e, e.__data__, a, u))), t.parentNode = e); + return p(r) + }; + var Yo = { + svg: "http://www.w3.org/2000/svg", + xhtml: "http://www.w3.org/1999/xhtml", + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" + }; + mo.ns = { + prefix: Yo, qualify: function (n) { + var t = n.indexOf(":"), e = n; + return t >= 0 && (e = n.substring(0, t), n = n.substring(t + 1)), Yo.hasOwnProperty(e) ? { + space: Yo[e], + local: n + } : n + } + }, Ro.attr = function (n, t) { + if (arguments.length < 2) { + if ("string" == typeof n) { + var e = this.node(); + return n = mo.ns.qualify(n), n.local ? e.getAttributeNS(n.space, n.local) : e.getAttribute(n) + } + for (t in n) this.each(m(t, n[t])); + return this + } + return this.each(m(n, t)) + }, Ro.classed = function (n, t) { + if (arguments.length < 2) { + if ("string" == typeof n) { + var e = this.node(), r = (n = n.trim().split(/^|\s+/g)).length, u = -1; + if (t = e.classList) { + for (; ++u < r;) if (!t.contains(n[u])) return !1 + } else for (t = e.getAttribute("class"); ++u < r;) if (!M(n[u]).test(t)) return !1; + return !0 + } + for (t in n) this.each(x(t, n[t])); + return this + } + return this.each(x(n, t)) + }, Ro.style = function (n, t, e) { + var r = arguments.length; + if (3 > r) { + if ("string" != typeof n) { + 2 > r && (t = ""); + for (e in n) this.each(_(e, n[e], t)); + return this + } + if (2 > r) return _o.getComputedStyle(this.node(), null).getPropertyValue(n); + e = "" + } + return this.each(_(n, t, e)) + }, Ro.property = function (n, t) { + if (arguments.length < 2) { + if ("string" == typeof n) return this.node()[n]; + for (t in n) this.each(w(t, n[t])); + return this + } + return this.each(w(n, t)) + }, Ro.text = function (n) { + return arguments.length ? this.each("function" == typeof n ? function () { + var t = n.apply(this, arguments); + this.textContent = null == t ? "" : t + } : null == n ? function () { + this.textContent = "" + } : function () { + this.textContent = n + }) : this.node().textContent + }, Ro.html = function (n) { + return arguments.length ? this.each("function" == typeof n ? function () { + var t = n.apply(this, arguments); + this.innerHTML = null == t ? "" : t + } : null == n ? function () { + this.innerHTML = "" + } : function () { + this.innerHTML = n + }) : this.node().innerHTML + }, Ro.append = function (n) { + return n = S(n), this.select(function () { + return this.appendChild(n.apply(this, arguments)) + }) + }, Ro.insert = function (n, t) { + return n = S(n), t = d(t), this.select(function () { + return this.insertBefore(n.apply(this, arguments), t.apply(this, arguments)) + }) + }, Ro.remove = function () { + return this.each(function () { + var n = this.parentNode; + n && n.removeChild(this) + }) + }, Ro.data = function (n, t) { + function e(n, e) { + var r, i, o, a = n.length, f = e.length, h = Math.min(a, f), g = new Array(f), p = new Array(f), + d = new Array(a); + if (t) { + var v, m = new u, y = new u, M = []; + for (r = -1; ++r < a;) v = t.call(i = n[r], i.__data__, r), m.has(v) ? d[r] = i : m.set(v, i), M.push(v); + for (r = -1; ++r < f;) v = t.call(e, o = e[r], r), (i = m.get(v)) ? (g[r] = i, i.__data__ = o) : y.has(v) || (p[r] = E(o)), y.set(v, o), m.remove(v); + for (r = -1; ++r < a;) m.has(M[r]) && (d[r] = n[r]) + } else { + for (r = -1; ++r < h;) i = n[r], o = e[r], i ? (i.__data__ = o, g[r] = i) : p[r] = E(o); + for (; f > r; ++r) p[r] = E(e[r]); + for (; a > r; ++r) d[r] = n[r] + } + p.update = g, p.parentNode = g.parentNode = d.parentNode = n.parentNode, c.push(p), l.push(g), s.push(d) + } + + var r, i, o = -1, a = this.length; + if (!arguments.length) { + for (n = new Array(a = (r = this[0]).length); ++o < a;) (i = r[o]) && (n[o] = i.__data__); + return n + } + var c = T([]), l = p([]), s = p([]); + if ("function" == typeof n) for (; ++o < a;) e(r = this[o], n.call(r, r.parentNode.__data__, o)); else for (; ++o < a;) e(r = this[o], n); + return l.enter = function () { + return c + }, l.exit = function () { + return s + }, l + }, Ro.datum = function (n) { + return arguments.length ? this.property("__data__", n) : this.property("__data__") + }, Ro.filter = function (n) { + var t, e, r, u = []; + "function" != typeof n && (n = k(n)); + for (var i = 0, o = this.length; o > i; i++) { + u.push(t = []), t.parentNode = (e = this[i]).parentNode; + for (var a = 0, c = e.length; c > a; a++) (r = e[a]) && n.call(r, r.__data__, a) && t.push(r) + } + return p(u) + }, Ro.order = function () { + for (var n = -1, t = this.length; ++n < t;) for (var e, r = this[n], u = r.length - 1, i = r[u]; --u >= 0;) (e = r[u]) && (i && i !== e.nextSibling && i.parentNode.insertBefore(e, i), i = e); + return this + }, Ro.sort = function (n) { + n = A.apply(this, arguments); + for (var t = -1, e = this.length; ++t < e;) this[t].sort(n); + return this.order() + }, Ro.each = function (n) { + return N(this, function (t, e, r) { + n.call(t, t.__data__, e, r) + }) + }, Ro.call = function (n) { + var t = Mo(arguments); + return n.apply(t[0] = this, t), this + }, Ro.empty = function () { + return !this.node() + }, Ro.node = function () { + for (var n = 0, t = this.length; t > n; n++) for (var e = this[n], r = 0, u = e.length; u > r; r++) { + var i = e[r]; + if (i) return i + } + return null + }, Ro.size = function () { + var n = 0; + return this.each(function () { + ++n + }), n + }; + var Io = []; + mo.selection.enter = T, mo.selection.enter.prototype = Io, Io.append = Ro.append, Io.empty = Ro.empty, Io.node = Ro.node, Io.call = Ro.call, Io.size = Ro.size, Io.select = function (n) { + for (var t, e, r, u, i, o = [], a = -1, c = this.length; ++a < c;) { + r = (u = this[a]).update, o.push(t = []), t.parentNode = u.parentNode; + for (var l = -1, s = u.length; ++l < s;) (i = u[l]) ? (t.push(r[l] = e = n.call(u.parentNode, i.__data__, l, a)), e.__data__ = i.__data__) : t.push(null) + } + return p(o) + }, Io.insert = function (n, t) { + return arguments.length < 2 && (t = q(this)), Ro.insert.call(this, n, t) + }, Ro.transition = function () { + for (var n, t, e = Oc || ++Zc, r = [], u = Rc || { + time: Date.now(), + ease: Cr, + delay: 0, + duration: 250 + }, i = -1, o = this.length; ++i < o;) { + r.push(n = []); + for (var a = this[i], c = -1, l = a.length; ++c < l;) (t = a[c]) && Ni(t, c, e, u), n.push(t) + } + return Ei(r, e) + }, Ro.interrupt = function () { + return this.each(z) + }, mo.select = function (n) { + var t = ["string" == typeof n ? Ho(n, xo) : n]; + return t.parentNode = bo, p([t]) + }, mo.selectAll = function (n) { + var t = Mo("string" == typeof n ? Fo(n, xo) : n); + return t.parentNode = bo, p([t]) + }; + var Uo = mo.select(bo); + Ro.on = function (n, t, e) { + var r = arguments.length; + if (3 > r) { + if ("string" != typeof n) { + 2 > r && (t = !1); + for (e in n) this.each(C(e, n[e], t)); + return this + } + if (2 > r) return (r = this.node()["__on" + n]) && r._; + e = !1 + } + return this.each(C(n, t, e)) + }; + var Zo = mo.map({mouseenter: "mouseover", mouseleave: "mouseout"}); + Zo.forEach(function (n) { + "on" + n in xo && Zo.remove(n) + }); + var Vo = a(bo.style, "userSelect"), Xo = 0; + mo.mouse = function (n) { + return H(n, h()) + }; + var $o = /WebKit/.test(_o.navigator.userAgent) ? -1 : 0; + mo.touches = function (n, t) { + return arguments.length < 2 && (t = h().touches), t ? Mo(t).map(function (t) { + var e = H(n, t); + return e.identifier = t.identifier, e + }) : [] + }, mo.behavior.drag = function () { + function n() { + this.on("mousedown.drag", o).on("touchstart.drag", a) + } + + function t() { + return mo.event.changedTouches[0].identifier + } + + function e(n, t) { + return mo.touches(n).filter(function (n) { + return n.identifier === t + })[0] + } + + function r(n, t, e, r) { + return function () { + function o() { + var n = t(s, g), e = n[0] - d[0], r = n[1] - d[1]; + v |= e | r, d = n, f({type: "drag", x: n[0] + c[0], y: n[1] + c[1], dx: e, dy: r}) + } + + function a() { + m.on(e + "." + p, null).on(r + "." + p, null), y(v && mo.event.target === h), f({type: "dragend"}) + } + + var c, l = this, s = l.parentNode, f = u.of(l, arguments), h = mo.event.target, g = n(), + p = null == g ? "drag" : "drag-" + g, d = t(s, g), v = 0, + m = mo.select(_o).on(e + "." + p, o).on(r + "." + p, a), y = L(); + i ? (c = i.apply(l, arguments), c = [c.x - d[0], c.y - d[1]]) : c = [0, 0], f({type: "dragstart"}) + } + } + + var u = g(n, "drag", "dragstart", "dragend"), i = null, o = r(c, mo.mouse, "mousemove", "mouseup"), + a = r(t, e, "touchmove", "touchend"); + return n.origin = function (t) { + return arguments.length ? (i = t, n) : i + }, mo.rebind(n, u, "on") + }; + var Bo = Math.PI, Wo = 2 * Bo, Jo = Bo / 2, Go = 1e-6, Ko = Go * Go, Qo = Bo / 180, na = 180 / Bo, ta = Math.SQRT2, + ea = 2, ra = 4; + mo.interpolateZoom = function (n, t) { + function e(n) { + var t = n * y; + if (m) { + var e = Y(d), o = i / (ea * h) * (e * I(ta * t + d) - R(d)); + return [r + o * l, u + o * s, i * e / Y(ta * t + d)] + } + return [r + n * l, u + n * s, i * Math.exp(ta * t)] + } + + var r = n[0], u = n[1], i = n[2], o = t[0], a = t[1], c = t[2], l = o - r, s = a - u, f = l * l + s * s, + h = Math.sqrt(f), g = (c * c - i * i + ra * f) / (2 * i * ea * h), + p = (c * c - i * i - ra * f) / (2 * c * ea * h), d = Math.log(Math.sqrt(g * g + 1) - g), + v = Math.log(Math.sqrt(p * p + 1) - p), m = v - d, y = (m || Math.log(c / i)) / ta; + return e.duration = 1e3 * y, e + }, mo.behavior.zoom = function () { + function n(n) { + n.on(A, l).on(oa + ".zoom", h).on(N, p).on("dblclick.zoom", d).on(q, s) + } + + function t(n) { + return [(n[0] - S.x) / S.k, (n[1] - S.y) / S.k] + } + + function e(n) { + return [n[0] * S.k + S.x, n[1] * S.k + S.y] + } + + function r(n) { + S.k = Math.max(k[0], Math.min(k[1], n)) + } + + function u(n, t) { + t = e(t), S.x += n[0] - t[0], S.y += n[1] - t[1] + } + + function i() { + b && b.domain(x.range().map(function (n) { + return (n - S.x) / S.k + }).map(x.invert)), w && w.domain(_.range().map(function (n) { + return (n - S.y) / S.k + }).map(_.invert)) + } + + function o(n) { + n({type: "zoomstart"}) + } + + function a(n) { + i(), n({type: "zoom", scale: S.k, translate: [S.x, S.y]}) + } + + function c(n) { + n({type: "zoomend"}) + } + + function l() { + function n() { + s = 1, u(mo.mouse(r), h), a(i) + } + + function e() { + f.on(N, _o === r ? p : null).on(T, null), g(s && mo.event.target === l), c(i) + } + + var r = this, i = C.of(r, arguments), l = mo.event.target, s = 0, f = mo.select(_o).on(N, n).on(T, e), + h = t(mo.mouse(r)), g = L(); + z.call(r), o(i) + } + + function s() { + function n() { + var n = mo.touches(p); + return g = S.k, n.forEach(function (n) { + n.identifier in v && (v[n.identifier] = t(n)) + }), n + } + + function e() { + for (var t = mo.event.changedTouches, e = 0, i = t.length; i > e; ++e) v[t[e].identifier] = null; + var o = n(), c = Date.now(); + if (1 === o.length) { + if (500 > c - M) { + var l = o[0], s = v[l.identifier]; + r(2 * S.k), u(l, s), f(), a(d) + } + M = c + } else if (o.length > 1) { + var l = o[0], h = o[1], g = l[0] - h[0], p = l[1] - h[1]; + m = g * g + p * p + } + } + + function i() { + for (var n, t, e, i, o = mo.touches(p), c = 0, l = o.length; l > c; ++c, i = null) if (e = o[c], i = v[e.identifier]) { + if (t) break; + n = e, t = i + } + if (i) { + var s = (s = e[0] - n[0]) * s + (s = e[1] - n[1]) * s, f = m && Math.sqrt(s / m); + n = [(n[0] + e[0]) / 2, (n[1] + e[1]) / 2], t = [(t[0] + i[0]) / 2, (t[1] + i[1]) / 2], r(f * g) + } + M = null, u(n, t), a(d) + } + + function h() { + if (mo.event.touches.length) { + for (var t = mo.event.changedTouches, e = 0, r = t.length; r > e; ++e) delete v[t[e].identifier]; + for (var u in v) return void n() + } + _.on(x, null).on(b, null), w.on(A, l).on(q, s), E(), c(d) + } + + var g, p = this, d = C.of(p, arguments), v = {}, m = 0, y = mo.event.changedTouches[0].identifier, + x = "touchmove.zoom-" + y, b = "touchend.zoom-" + y, _ = mo.select(_o).on(x, i).on(b, h), + w = mo.select(p).on(A, null).on(q, e), E = L(); + z.call(p), e(), o(d) + } + + function h() { + var n = C.of(this, arguments); + y ? clearTimeout(y) : (z.call(this), o(n)), y = setTimeout(function () { + y = null, c(n) + }, 50), f(); + var e = m || mo.mouse(this); + v || (v = t(e)), r(Math.pow(2, .002 * ua()) * S.k), u(e, v), a(n) + } + + function p() { + v = null + } + + function d() { + var n = C.of(this, arguments), e = mo.mouse(this), i = t(e), l = Math.log(S.k) / Math.LN2; + o(n), r(Math.pow(2, mo.event.shiftKey ? Math.ceil(l) - 1 : Math.floor(l) + 1)), u(e, i), a(n), c(n) + } + + var v, m, y, M, x, b, _, w, S = {x: 0, y: 0, k: 1}, E = [960, 500], k = ia, A = "mousedown.zoom", + N = "mousemove.zoom", T = "mouseup.zoom", q = "touchstart.zoom", C = g(n, "zoomstart", "zoom", "zoomend"); + return n.event = function (n) { + n.each(function () { + var n = C.of(this, arguments), t = S; + Oc ? mo.select(this).transition().each("start.zoom", function () { + S = this.__chart__ || {x: 0, y: 0, k: 1}, o(n) + }).tween("zoom:zoom", function () { + var e = E[0], r = E[1], u = e / 2, i = r / 2, + o = mo.interpolateZoom([(u - S.x) / S.k, (i - S.y) / S.k, e / S.k], [(u - t.x) / t.k, (i - t.y) / t.k, e / t.k]); + return function (t) { + var r = o(t), c = e / r[2]; + this.__chart__ = S = {x: u - r[0] * c, y: i - r[1] * c, k: c}, a(n) + } + }).each("end.zoom", function () { + c(n) + }) : (this.__chart__ = S, o(n), a(n), c(n)) + }) + }, n.translate = function (t) { + return arguments.length ? (S = {x: +t[0], y: +t[1], k: S.k}, i(), n) : [S.x, S.y] + }, n.scale = function (t) { + return arguments.length ? (S = {x: S.x, y: S.y, k: +t}, i(), n) : S.k + }, n.scaleExtent = function (t) { + return arguments.length ? (k = null == t ? ia : [+t[0], +t[1]], n) : k + }, n.center = function (t) { + return arguments.length ? (m = t && [+t[0], +t[1]], n) : m + }, n.size = function (t) { + return arguments.length ? (E = t && [+t[0], +t[1]], n) : E + }, n.x = function (t) { + return arguments.length ? (b = t, x = t.copy(), S = {x: 0, y: 0, k: 1}, n) : b + }, n.y = function (t) { + return arguments.length ? (w = t, _ = t.copy(), S = {x: 0, y: 0, k: 1}, n) : w + }, mo.rebind(n, C, "on") + }; + var ua, ia = [0, 1 / 0], oa = "onwheel" in xo ? (ua = function () { + return -mo.event.deltaY * (mo.event.deltaMode ? 120 : 1) + }, "wheel") : "onmousewheel" in xo ? (ua = function () { + return mo.event.wheelDelta + }, "mousewheel") : (ua = function () { + return -mo.event.detail + }, "MozMousePixelScroll"); + Z.prototype.toString = function () { + return this.rgb() + "" + }, mo.hsl = function (n, t, e) { + return 1 === arguments.length ? n instanceof X ? V(n.h, n.s, n.l) : lt("" + n, st, V) : V(+n, +t, +e) + }; + var aa = X.prototype = new Z; + aa.brighter = function (n) { + return n = Math.pow(.7, arguments.length ? n : 1), V(this.h, this.s, this.l / n) + }, aa.darker = function (n) { + return n = Math.pow(.7, arguments.length ? n : 1), V(this.h, this.s, n * this.l) + }, aa.rgb = function () { + return $(this.h, this.s, this.l) + }, mo.hcl = function (n, t, e) { + return 1 === arguments.length ? n instanceof W ? B(n.h, n.c, n.l) : n instanceof K ? nt(n.l, n.a, n.b) : nt((n = ft((n = mo.rgb(n)).r, n.g, n.b)).l, n.a, n.b) : B(+n, +t, +e) + }; + var ca = W.prototype = new Z; + ca.brighter = function (n) { + return B(this.h, this.c, Math.min(100, this.l + la * (arguments.length ? n : 1))) + }, ca.darker = function (n) { + return B(this.h, this.c, Math.max(0, this.l - la * (arguments.length ? n : 1))) + }, ca.rgb = function () { + return J(this.h, this.c, this.l).rgb() + }, mo.lab = function (n, t, e) { + return 1 === arguments.length ? n instanceof K ? G(n.l, n.a, n.b) : n instanceof W ? J(n.l, n.c, n.h) : ft((n = mo.rgb(n)).r, n.g, n.b) : G(+n, +t, +e) + }; + var la = 18, sa = .95047, fa = 1, ha = 1.08883, ga = K.prototype = new Z; + ga.brighter = function (n) { + return G(Math.min(100, this.l + la * (arguments.length ? n : 1)), this.a, this.b) + }, ga.darker = function (n) { + return G(Math.max(0, this.l - la * (arguments.length ? n : 1)), this.a, this.b) + }, ga.rgb = function () { + return Q(this.l, this.a, this.b) + }, mo.rgb = function (n, t, e) { + return 1 === arguments.length ? n instanceof at ? ot(n.r, n.g, n.b) : lt("" + n, ot, $) : ot(~~n, ~~t, ~~e) + }; + var pa = at.prototype = new Z; + pa.brighter = function (n) { + n = Math.pow(.7, arguments.length ? n : 1); + var t = this.r, e = this.g, r = this.b, u = 30; + return t || e || r ? (t && u > t && (t = u), e && u > e && (e = u), r && u > r && (r = u), ot(Math.min(255, ~~(t / n)), Math.min(255, ~~(e / n)), Math.min(255, ~~(r / n)))) : ot(u, u, u) + }, pa.darker = function (n) { + return n = Math.pow(.7, arguments.length ? n : 1), ot(~~(n * this.r), ~~(n * this.g), ~~(n * this.b)) + }, pa.hsl = function () { + return st(this.r, this.g, this.b) + }, pa.toString = function () { + return "#" + ct(this.r) + ct(this.g) + ct(this.b) + }; + var da = mo.map({ + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 + }); + da.forEach(function (n, t) { + da.set(n, ut(t)) + }), mo.functor = pt, mo.xhr = vt(dt), mo.dsv = function (n, t) { + function e(n, e, i) { + arguments.length < 3 && (i = e, e = null); + var o = mo.xhr(n, t, i); + return o.row = function (n) { + return arguments.length ? o.response(null == (e = n) ? r : u(n)) : e + }, o.row(e) + } + + function r(n) { + return e.parse(n.responseText) + } + + function u(n) { + return function (t) { + return e.parse(t.responseText, n) + } + } + + function o(t) { + return t.map(a).join(n) + } + + function a(n) { + return c.test(n) ? '"' + n.replace(/\"/g, '""') + '"' : n + } + + var c = new RegExp('["' + n + "\n]"), l = n.charCodeAt(0); + return e.parse = function (n, t) { + var r; + return e.parseRows(n, function (n, e) { + if (r) return r(n, e - 1); + var u = new Function("d", "return {" + n.map(function (n, t) { + return JSON.stringify(n) + ": d[" + t + "]" + }).join(",") + "}"); + r = t ? function (n, e) { + return t(u(n), e) + } : u + }) + }, e.parseRows = function (n, t) { + function e() { + if (s >= c) return o; + if (u) return u = !1, i; + var t = s; + if (34 === n.charCodeAt(t)) { + for (var e = t; e++ < c;) if (34 === n.charCodeAt(e)) { + if (34 !== n.charCodeAt(e + 1)) break; + ++e + } + s = e + 2; + var r = n.charCodeAt(e + 1); + return 13 === r ? (u = !0, 10 === n.charCodeAt(e + 2) && ++s) : 10 === r && (u = !0), n.substring(t + 1, e).replace(/""/g, '"') + } + for (; c > s;) { + var r = n.charCodeAt(s++), a = 1; + if (10 === r) u = !0; else if (13 === r) u = !0, 10 === n.charCodeAt(s) && (++s, ++a); else if (r !== l) continue; + return n.substring(t, s - a) + } + return n.substring(t) + } + + for (var r, u, i = {}, o = {}, a = [], c = n.length, s = 0, f = 0; (r = e()) !== o;) { + for (var h = []; r !== i && r !== o;) h.push(r), r = e(); + (!t || (h = t(h, f++))) && a.push(h) + } + return a + }, e.format = function (t) { + if (Array.isArray(t[0])) return e.formatRows(t); + var r = new i, u = []; + return t.forEach(function (n) { + for (var t in n) r.has(t) || u.push(r.add(t)) + }), [u.map(a).join(n)].concat(t.map(function (t) { + return u.map(function (n) { + return a(t[n]) + }).join(n) + })).join("\n") + }, e.formatRows = function (n) { + return n.map(o).join("\n") + }, e + }, mo.csv = mo.dsv(",", "text/csv"), mo.tsv = mo.dsv(" ", "text/tab-separated-values"); + var va, ma, ya, Ma, xa, ba = _o[a(_o, "requestAnimationFrame")] || function (n) { + setTimeout(n, 17) + }; + mo.timer = function (n, t, e) { + var r = arguments.length; + 2 > r && (t = 0), 3 > r && (e = Date.now()); + var u = e + t, i = {callback: n, time: u, next: null}; + ma ? ma.next = i : va = i, ma = i, ya || (Ma = clearTimeout(Ma), ya = 1, ba(Mt)) + }, mo.timer.flush = function () { + bt(), _t() + }; + var _a = ".", wa = ",", Sa = [3, 3], Ea = "$", + ka = ["y", "z", "a", "f", "p", "n", "\xb5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"].map(wt); + mo.formatPrefix = function (n, t) { + var e = 0; + return n && (0 > n && (n *= -1), t && (n = mo.round(n, St(n, t))), e = 1 + Math.floor(1e-12 + Math.log(n) / Math.LN10), e = Math.max(-24, Math.min(24, 3 * Math.floor((0 >= e ? e + 1 : e - 1) / 3)))), ka[8 + e / 3] + }, mo.round = function (n, t) { + return t ? Math.round(n * (t = Math.pow(10, t))) / t : Math.round(n) + }, mo.format = function (n) { + var t = Aa.exec(n), e = t[1] || " ", r = t[2] || ">", u = t[3] || "", i = t[4] || "", o = t[5], a = +t[6], + c = t[7], l = t[8], s = t[9], f = 1, h = "", g = !1; + switch (l && (l = +l.substring(1)), (o || "0" === e && "=" === r) && (o = e = "0", r = "=", c && (a -= Math.floor((a - 1) / 4))), s) { + case"n": + c = !0, s = "g"; + break; + case"%": + f = 100, h = "%", s = "f"; + break; + case"p": + f = 100, h = "%", s = "r"; + break; + case"b": + case"o": + case"x": + case"X": + "#" === i && (i = "0" + s.toLowerCase()); + case"c": + case"d": + g = !0, l = 0; + break; + case"s": + f = -1, s = "r" + } + "#" === i ? i = "" : "$" === i && (i = Ea), "r" != s || l || (s = "g"), null != l && ("g" == s ? l = Math.max(1, Math.min(21, l)) : ("e" == s || "f" == s) && (l = Math.max(0, Math.min(20, l)))), s = Na.get(s) || Et; + var p = o && c; + return function (n) { + if (g && n % 1) return ""; + var t = 0 > n || 0 === n && 0 > 1 / n ? (n = -n, "-") : u; + if (0 > f) { + var d = mo.formatPrefix(n, l); + n = d.scale(n), h = d.symbol + } else n *= f; + n = s(n, l); + var v = n.lastIndexOf("."), m = 0 > v ? n : n.substring(0, v), y = 0 > v ? "" : _a + n.substring(v + 1); + !o && c && (m = Ta(m)); + var M = i.length + m.length + y.length + (p ? 0 : t.length), + x = a > M ? new Array(M = a - M + 1).join(e) : ""; + return p && (m = Ta(x + m)), t += i, n = m + y, ("<" === r ? t + n + x : ">" === r ? x + t + n : "^" === r ? x.substring(0, M >>= 1) + t + n + x.substring(M) : t + (p ? n : x + n)) + h + } + }; + var Aa = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i, Na = mo.map({ + b: function (n) { + return n.toString(2) + }, c: function (n) { + return String.fromCharCode(n) + }, o: function (n) { + return n.toString(8) + }, x: function (n) { + return n.toString(16) + }, X: function (n) { + return n.toString(16).toUpperCase() + }, g: function (n, t) { + return n.toPrecision(t) + }, e: function (n, t) { + return n.toExponential(t) + }, f: function (n, t) { + return n.toFixed(t) + }, r: function (n, t) { + return (n = mo.round(n, St(n, t))).toFixed(Math.max(0, Math.min(20, St(n * (1 + 1e-15), t)))) + } + }), Ta = dt; + if (Sa) { + var qa = Sa.length; + Ta = function (n) { + for (var t = n.length, e = [], r = 0, u = Sa[0]; t > 0 && u > 0;) e.push(n.substring(t -= u, t + u)), u = Sa[r = (r + 1) % qa]; + return e.reverse().join(wa) + } + } + mo.geo = {}, kt.prototype = { + s: 0, t: 0, add: function (n) { + At(n, this.t, za), At(za.s, this.s, this), this.s ? this.t += za.t : this.s = za.t + }, reset: function () { + this.s = this.t = 0 + }, valueOf: function () { + return this.s + } + }; + var za = new kt; + mo.geo.stream = function (n, t) { + n && Ca.hasOwnProperty(n.type) ? Ca[n.type](n, t) : Nt(n, t) + }; + var Ca = { + Feature: function (n, t) { + Nt(n.geometry, t) + }, FeatureCollection: function (n, t) { + for (var e = n.features, r = -1, u = e.length; ++r < u;) Nt(e[r].geometry, t) + } + }, Da = { + Sphere: function (n, t) { + t.sphere() + }, Point: function (n, t) { + n = n.coordinates, t.point(n[0], n[1], n[2]) + }, MultiPoint: function (n, t) { + for (var e = n.coordinates, r = -1, u = e.length; ++r < u;) n = e[r], t.point(n[0], n[1], n[2]) + }, LineString: function (n, t) { + Tt(n.coordinates, t, 0) + }, MultiLineString: function (n, t) { + for (var e = n.coordinates, r = -1, u = e.length; ++r < u;) Tt(e[r], t, 0) + }, Polygon: function (n, t) { + qt(n.coordinates, t) + }, MultiPolygon: function (n, t) { + for (var e = n.coordinates, r = -1, u = e.length; ++r < u;) qt(e[r], t) + }, GeometryCollection: function (n, t) { + for (var e = n.geometries, r = -1, u = e.length; ++r < u;) Nt(e[r], t) + } + }; + mo.geo.area = function (n) { + return ja = 0, mo.geo.stream(n, Ha), ja + }; + var ja, La = new kt, Ha = { + sphere: function () { + ja += 4 * Bo + }, point: c, lineStart: c, lineEnd: c, polygonStart: function () { + La.reset(), Ha.lineStart = zt + }, polygonEnd: function () { + var n = 2 * La; + ja += 0 > n ? 4 * Bo + n : n, Ha.lineStart = Ha.lineEnd = Ha.point = c + } + }; + mo.geo.bounds = function () { + function n(n, t) { + M.push(x = [s = n, h = n]), f > t && (f = t), t > g && (g = t) + } + + function t(t, e) { + var r = Ct([t * Qo, e * Qo]); + if (m) { + var u = jt(m, r), i = [u[1], -u[0], 0], o = jt(i, u); + Ft(o), o = Pt(o); + var c = t - p, l = c > 0 ? 1 : -1, d = o[0] * na * l, v = Math.abs(c) > 180; + if (v ^ (d > l * p && l * t > d)) { + var y = o[1] * na; + y > g && (g = y) + } else if (d = (d + 360) % 360 - 180, v ^ (d > l * p && l * t > d)) { + var y = -o[1] * na; + f > y && (f = y) + } else f > e && (f = e), e > g && (g = e); + v ? p > t ? a(s, t) > a(s, h) && (h = t) : a(t, h) > a(s, h) && (s = t) : h >= s ? (s > t && (s = t), t > h && (h = t)) : t > p ? a(s, t) > a(s, h) && (h = t) : a(t, h) > a(s, h) && (s = t) + } else n(t, e); + m = r, p = t + } + + function e() { + b.point = t + } + + function r() { + x[0] = s, x[1] = h, b.point = n, m = null + } + + function u(n, e) { + if (m) { + var r = n - p; + y += Math.abs(r) > 180 ? r + (r > 0 ? 360 : -360) : r + } else d = n, v = e; + Ha.point(n, e), t(n, e) + } + + function i() { + Ha.lineStart() + } + + function o() { + u(d, v), Ha.lineEnd(), Math.abs(y) > Go && (s = -(h = 180)), x[0] = s, x[1] = h, m = null + } + + function a(n, t) { + return (t -= n) < 0 ? t + 360 : t + } + + function c(n, t) { + return n[0] - t[0] + } + + function l(n, t) { + return t[0] <= t[1] ? t[0] <= n && n <= t[1] : n < t[0] || t[1] < n + } + + var s, f, h, g, p, d, v, m, y, M, x, b = { + point: n, lineStart: e, lineEnd: r, polygonStart: function () { + b.point = u, b.lineStart = i, b.lineEnd = o, y = 0, Ha.polygonStart() + }, polygonEnd: function () { + Ha.polygonEnd(), b.point = n, b.lineStart = e, b.lineEnd = r, 0 > La ? (s = -(h = 180), f = -(g = 90)) : y > Go ? g = 90 : -Go > y && (f = -90), x[0] = s, x[1] = h + } + }; + return function (n) { + g = h = -(s = f = 1 / 0), M = [], mo.geo.stream(n, b); + var t = M.length; + if (t) { + M.sort(c); + for (var e, r = 1, u = M[0], i = [u]; t > r; ++r) e = M[r], l(e[0], u) || l(e[1], u) ? (a(u[0], e[1]) > a(u[0], u[1]) && (u[1] = e[1]), a(e[0], u[1]) > a(u[0], u[1]) && (u[0] = e[0])) : i.push(u = e); + for (var o, e, p = -1 / 0, t = i.length - 1, r = 0, u = i[t]; t >= r; u = e, ++r) e = i[r], (o = a(u[1], e[0])) > p && (p = o, s = e[0], h = u[1]) + } + return M = x = null, 1 / 0 === s || 1 / 0 === f ? [[0 / 0, 0 / 0], [0 / 0, 0 / 0]] : [[s, f], [h, g]] + } + }(), mo.geo.centroid = function (n) { + Fa = Pa = Oa = Ra = Ya = Ia = Ua = Za = Va = Xa = $a = 0, mo.geo.stream(n, Ba); + var t = Va, e = Xa, r = $a, u = t * t + e * e + r * r; + return Ko > u && (t = Ia, e = Ua, r = Za, Go > Pa && (t = Oa, e = Ra, r = Ya), u = t * t + e * e + r * r, Ko > u) ? [0 / 0, 0 / 0] : [Math.atan2(e, t) * na, O(r / Math.sqrt(u)) * na] + }; + var Fa, Pa, Oa, Ra, Ya, Ia, Ua, Za, Va, Xa, $a, Ba = { + sphere: c, point: Rt, lineStart: It, lineEnd: Ut, polygonStart: function () { + Ba.lineStart = Zt + }, polygonEnd: function () { + Ba.lineStart = It + } + }, Wa = Bt(Vt, Qt, te, [-Bo, -Bo / 2]), Ja = 1e9; + mo.geo.clipExtent = function () { + var n, t, e, r, u, i, o = { + stream: function (n) { + return u && (u.valid = !1), u = i(n), u.valid = !0, u + }, extent: function (a) { + return arguments.length ? (i = re(n = +a[0][0], t = +a[0][1], e = +a[1][0], r = +a[1][1]), u && (u.valid = !1, u = null), o) : [[n, t], [e, r]] + } + }; + return o.extent([[0, 0], [960, 500]]) + }, (mo.geo.conicEqualArea = function () { + return oe(ae) + }).raw = ae, mo.geo.albers = function () { + return mo.geo.conicEqualArea().rotate([96, 0]).center([-.6, 38.7]).parallels([29.5, 45.5]).scale(1070) + }, mo.geo.albersUsa = function () { + function n(n) { + var i = n[0], o = n[1]; + return t = null, e(i, o), t || (r(i, o), t) || u(i, o), t + } + + var t, e, r, u, i = mo.geo.albers(), + o = mo.geo.conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), + a = mo.geo.conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), c = { + point: function (n, e) { + t = [n, e] + } + }; + return n.invert = function (n) { + var t = i.scale(), e = i.translate(), r = (n[0] - e[0]) / t, u = (n[1] - e[1]) / t; + return (u >= .12 && .234 > u && r >= -.425 && -.214 > r ? o : u >= .166 && .234 > u && r >= -.214 && -.115 > r ? a : i).invert(n) + }, n.stream = function (n) { + var t = i.stream(n), e = o.stream(n), r = a.stream(n); + return { + point: function (n, u) { + t.point(n, u), e.point(n, u), r.point(n, u) + }, sphere: function () { + t.sphere(), e.sphere(), r.sphere() + }, lineStart: function () { + t.lineStart(), e.lineStart(), r.lineStart() + }, lineEnd: function () { + t.lineEnd(), e.lineEnd(), r.lineEnd() + }, polygonStart: function () { + t.polygonStart(), e.polygonStart(), r.polygonStart() + }, polygonEnd: function () { + t.polygonEnd(), e.polygonEnd(), r.polygonEnd() + } + } + }, n.precision = function (t) { + return arguments.length ? (i.precision(t), o.precision(t), a.precision(t), n) : i.precision() + }, n.scale = function (t) { + return arguments.length ? (i.scale(t), o.scale(.35 * t), a.scale(t), n.translate(i.translate())) : i.scale() + }, n.translate = function (t) { + if (!arguments.length) return i.translate(); + var l = i.scale(), s = +t[0], f = +t[1]; + return e = i.translate(t).clipExtent([[s - .455 * l, f - .238 * l], [s + .455 * l, f + .238 * l]]).stream(c).point, r = o.translate([s - .307 * l, f + .201 * l]).clipExtent([[s - .425 * l + Go, f + .12 * l + Go], [s - .214 * l - Go, f + .234 * l - Go]]).stream(c).point, u = a.translate([s - .205 * l, f + .212 * l]).clipExtent([[s - .214 * l + Go, f + .166 * l + Go], [s - .115 * l - Go, f + .234 * l - Go]]).stream(c).point, n + }, n.scale(1070) + }; + var Ga, Ka, Qa, nc, tc, ec, rc = { + point: c, lineStart: c, lineEnd: c, polygonStart: function () { + Ka = 0, rc.lineStart = ce + }, polygonEnd: function () { + rc.lineStart = rc.lineEnd = rc.point = c, Ga += Math.abs(Ka / 2) + } + }, uc = {point: le, lineStart: c, lineEnd: c, polygonStart: c, polygonEnd: c}, ic = { + point: he, lineStart: ge, lineEnd: pe, polygonStart: function () { + ic.lineStart = de + }, polygonEnd: function () { + ic.point = he, ic.lineStart = ge, ic.lineEnd = pe + } + }; + mo.geo.transform = function (n) { + return { + stream: function (t) { + var e = new ye(t); + for (var r in n) e[r] = n[r]; + return e + } + } + }, ye.prototype = { + point: function (n, t) { + this.stream.point(n, t) + }, sphere: function () { + this.stream.sphere() + }, lineStart: function () { + this.stream.lineStart() + }, lineEnd: function () { + this.stream.lineEnd() + }, polygonStart: function () { + this.stream.polygonStart() + }, polygonEnd: function () { + this.stream.polygonEnd() + } + }, mo.geo.path = function () { + function n(n) { + return n && ("function" == typeof a && i.pointRadius(+a.apply(this, arguments)), o && o.valid || (o = u(i)), mo.geo.stream(n, o)), i.result() + } + + function t() { + return o = null, n + } + + var e, r, u, i, o, a = 4.5; + return n.area = function (n) { + return Ga = 0, mo.geo.stream(n, u(rc)), Ga + }, n.centroid = function (n) { + return Oa = Ra = Ya = Ia = Ua = Za = Va = Xa = $a = 0, mo.geo.stream(n, u(ic)), $a ? [Va / $a, Xa / $a] : Za ? [Ia / Za, Ua / Za] : Ya ? [Oa / Ya, Ra / Ya] : [0 / 0, 0 / 0] + }, n.bounds = function (n) { + return tc = ec = -(Qa = nc = 1 / 0), mo.geo.stream(n, u(uc)), [[Qa, nc], [tc, ec]] + }, n.projection = function (n) { + return arguments.length ? (u = (e = n) ? n.stream || Me(n) : dt, t()) : e + }, n.context = function (n) { + return arguments.length ? (i = null == (r = n) ? new se : new ve(n), "function" != typeof a && i.pointRadius(a), t()) : r + }, n.pointRadius = function (t) { + return arguments.length ? (a = "function" == typeof t ? t : (i.pointRadius(+t), +t), n) : a + }, n.projection(mo.geo.albersUsa()).context(null) + }, mo.geo.projection = xe, mo.geo.projectionMutator = be, (mo.geo.equirectangular = function () { + return xe(we) + }).raw = we.invert = we, mo.geo.rotation = function (n) { + function t(t) { + return t = n(t[0] * Qo, t[1] * Qo), t[0] *= na, t[1] *= na, t + } + + return n = Ee(n[0] % 360 * Qo, n[1] * Qo, n.length > 2 ? n[2] * Qo : 0), t.invert = function (t) { + return t = n.invert(t[0] * Qo, t[1] * Qo), t[0] *= na, t[1] *= na, t + }, t + }, Se.invert = we, mo.geo.circle = function () { + function n() { + var n = "function" == typeof r ? r.apply(this, arguments) : r, t = Ee(-n[0] * Qo, -n[1] * Qo, 0).invert, + u = []; + return e(null, null, 1, { + point: function (n, e) { + u.push(n = t(n, e)), n[0] *= na, n[1] *= na + } + }), {type: "Polygon", coordinates: [u]} + } + + var t, e, r = [0, 0], u = 6; + return n.origin = function (t) { + return arguments.length ? (r = t, n) : r + }, n.angle = function (r) { + return arguments.length ? (e = Te((t = +r) * Qo, u * Qo), n) : t + }, n.precision = function (r) { + return arguments.length ? (e = Te(t * Qo, (u = +r) * Qo), n) : u + }, n.angle(90) + }, mo.geo.distance = function (n, t) { + var e, r = (t[0] - n[0]) * Qo, u = n[1] * Qo, i = t[1] * Qo, o = Math.sin(r), a = Math.cos(r), c = Math.sin(u), + l = Math.cos(u), s = Math.sin(i), f = Math.cos(i); + return Math.atan2(Math.sqrt((e = f * o) * e + (e = l * s - c * f * a) * e), c * s + l * f * a) + }, mo.geo.graticule = function () { + function n() { + return {type: "MultiLineString", coordinates: t()} + } + + function t() { + return mo.range(Math.ceil(i / v) * v, u, v).map(h).concat(mo.range(Math.ceil(l / m) * m, c, m).map(g)).concat(mo.range(Math.ceil(r / p) * p, e, p).filter(function (n) { + return Math.abs(n % v) > Go + }).map(s)).concat(mo.range(Math.ceil(a / d) * d, o, d).filter(function (n) { + return Math.abs(n % m) > Go + }).map(f)) + } + + var e, r, u, i, o, a, c, l, s, f, h, g, p = 10, d = p, v = 90, m = 360, y = 2.5; + return n.lines = function () { + return t().map(function (n) { + return {type: "LineString", coordinates: n} + }) + }, n.outline = function () { + return { + type: "Polygon", + coordinates: [h(i).concat(g(c).slice(1), h(u).reverse().slice(1), g(l).reverse().slice(1))] + } + }, n.extent = function (t) { + return arguments.length ? n.majorExtent(t).minorExtent(t) : n.minorExtent() + }, n.majorExtent = function (t) { + return arguments.length ? (i = +t[0][0], u = +t[1][0], l = +t[0][1], c = +t[1][1], i > u && (t = i, i = u, u = t), l > c && (t = l, l = c, c = t), n.precision(y)) : [[i, l], [u, c]] + }, n.minorExtent = function (t) { + return arguments.length ? (r = +t[0][0], e = +t[1][0], a = +t[0][1], o = +t[1][1], r > e && (t = r, r = e, e = t), a > o && (t = a, a = o, o = t), n.precision(y)) : [[r, a], [e, o]] + }, n.step = function (t) { + return arguments.length ? n.majorStep(t).minorStep(t) : n.minorStep() + }, n.majorStep = function (t) { + return arguments.length ? (v = +t[0], m = +t[1], n) : [v, m] + }, n.minorStep = function (t) { + return arguments.length ? (p = +t[0], d = +t[1], n) : [p, d] + }, n.precision = function (t) { + return arguments.length ? (y = +t, s = ze(a, o, 90), f = Ce(r, e, y), h = ze(l, c, 90), g = Ce(i, u, y), n) : y + }, n.majorExtent([[-180, -90 + Go], [180, 90 - Go]]).minorExtent([[-180, -80 - Go], [180, 80 + Go]]) + }, mo.geo.greatArc = function () { + function n() { + return {type: "LineString", coordinates: [t || r.apply(this, arguments), e || u.apply(this, arguments)]} + } + + var t, e, r = De, u = je; + return n.distance = function () { + return mo.geo.distance(t || r.apply(this, arguments), e || u.apply(this, arguments)) + }, n.source = function (e) { + return arguments.length ? (r = e, t = "function" == typeof e ? null : e, n) : r + }, n.target = function (t) { + return arguments.length ? (u = t, e = "function" == typeof t ? null : t, n) : u + }, n.precision = function () { + return arguments.length ? n : 0 + }, n + }, mo.geo.interpolate = function (n, t) { + return Le(n[0] * Qo, n[1] * Qo, t[0] * Qo, t[1] * Qo) + }, mo.geo.length = function (n) { + return oc = 0, mo.geo.stream(n, ac), oc + }; + var oc, ac = {sphere: c, point: c, lineStart: He, lineEnd: c, polygonStart: c, polygonEnd: c}, + cc = Fe(function (n) { + return Math.sqrt(2 / (1 + n)) + }, function (n) { + return 2 * Math.asin(n / 2) + }); + (mo.geo.azimuthalEqualArea = function () { + return xe(cc) + }).raw = cc; + var lc = Fe(function (n) { + var t = Math.acos(n); + return t && t / Math.sin(t) + }, dt); + (mo.geo.azimuthalEquidistant = function () { + return xe(lc) + }).raw = lc, (mo.geo.conicConformal = function () { + return oe(Pe) + }).raw = Pe, (mo.geo.conicEquidistant = function () { + return oe(Oe) + }).raw = Oe; + var sc = Fe(function (n) { + return 1 / n + }, Math.atan); + (mo.geo.gnomonic = function () { + return xe(sc) + }).raw = sc, Re.invert = function (n, t) { + return [n, 2 * Math.atan(Math.exp(t)) - Jo] + }, (mo.geo.mercator = function () { + return Ye(Re) + }).raw = Re; + var fc = Fe(function () { + return 1 + }, Math.asin); + (mo.geo.orthographic = function () { + return xe(fc) + }).raw = fc; + var hc = Fe(function (n) { + return 1 / (1 + n) + }, function (n) { + return 2 * Math.atan(n) + }); + (mo.geo.stereographic = function () { + return xe(hc) + }).raw = hc, Ie.invert = function (n, t) { + return [Math.atan2(R(n), Math.cos(t)), O(Math.sin(t) / Y(n))] + }, (mo.geo.transverseMercator = function () { + return Ye(Ie) + }).raw = Ie, mo.geom = {}, mo.svg = {}, mo.svg.line = function () { + return Ue(dt) + }; + var gc = mo.map({ + linear: Xe, + "linear-closed": $e, + step: Be, + "step-before": We, + "step-after": Je, + basis: er, + "basis-open": rr, + "basis-closed": ur, + bundle: ir, + cardinal: Qe, + "cardinal-open": Ge, + "cardinal-closed": Ke, + monotone: fr + }); + gc.forEach(function (n, t) { + t.key = n, t.closed = /-closed$/.test(n) + }); + var pc = [0, 2 / 3, 1 / 3, 0], dc = [0, 1 / 3, 2 / 3, 0], vc = [0, 1 / 6, 2 / 3, 1 / 6]; + mo.geom.hull = function (n) { + function t(n) { + if (n.length < 3) return []; + var t, u, i, o, a, c, l, s, f, h, g, p, d = pt(e), v = pt(r), m = n.length, y = m - 1, M = [], x = [], + b = 0; + if (d === Ze && r === Ve) t = n; else for (i = 0, t = []; m > i; ++i) t.push([+d.call(this, u = n[i], i), +v.call(this, u, i)]); + for (i = 1; m > i; ++i) (t[i][1] < t[b][1] || t[i][1] == t[b][1] && t[i][0] < t[b][0]) && (b = i); + for (i = 0; m > i; ++i) i !== b && (c = t[i][1] - t[b][1], a = t[i][0] - t[b][0], M.push({ + angle: Math.atan2(c, a), + index: i + })); + for (M.sort(function (n, t) { + return n.angle - t.angle + }), g = M[0].angle, h = M[0].index, f = 0, i = 1; y > i; ++i) { + if (o = M[i].index, g == M[i].angle) { + if (a = t[h][0] - t[b][0], c = t[h][1] - t[b][1], l = t[o][0] - t[b][0], s = t[o][1] - t[b][1], a * a + c * c >= l * l + s * s) { + M[i].index = -1; + continue + } + M[f].index = -1 + } + g = M[i].angle, f = i, h = o + } + for (x.push(b), i = 0, o = 0; 2 > i; ++o) M[o].index > -1 && (x.push(M[o].index), i++); + for (p = x.length; y > o; ++o) if (!(M[o].index < 0)) { + for (; !hr(x[p - 2], x[p - 1], M[o].index, t);) --p; + x[p++] = M[o].index + } + var _ = []; + for (i = p - 1; i >= 0; --i) _.push(n[x[i]]); + return _ + } + + var e = Ze, r = Ve; + return arguments.length ? t(n) : (t.x = function (n) { + return arguments.length ? (e = n, t) : e + }, t.y = function (n) { + return arguments.length ? (r = n, t) : r + }, t) + }, mo.geom.polygon = function (n) { + return Lo(n, mc), n + }; + var mc = mo.geom.polygon.prototype = []; + mc.area = function () { + for (var n, t = -1, e = this.length, r = this[e - 1], u = 0; ++t < e;) n = r, r = this[t], u += n[1] * r[0] - n[0] * r[1]; + return .5 * u + }, mc.centroid = function (n) { + var t, e, r = -1, u = this.length, i = 0, o = 0, a = this[u - 1]; + for (arguments.length || (n = -1 / (6 * this.area())); ++r < u;) t = a, a = this[r], e = t[0] * a[1] - a[0] * t[1], i += (t[0] + a[0]) * e, o += (t[1] + a[1]) * e; + return [i * n, o * n] + }, mc.clip = function (n) { + for (var t, e, r, u, i, o, a = dr(n), c = -1, l = this.length - dr(this), s = this[l - 1]; ++c < l;) { + for (t = n.slice(), n.length = 0, u = this[c], i = t[(r = t.length - a) - 1], e = -1; ++e < r;) o = t[e], gr(o, s, u) ? (gr(i, s, u) || n.push(pr(i, o, s, u)), n.push(o)) : gr(i, s, u) && n.push(pr(i, o, s, u)), i = o; + a && n.push(n[0]), s = u + } + return n + }, mo.geom.delaunay = function (n) { + var t = n.map(function () { + return [] + }), e = []; + return vr(n, function (e) { + t[e.region.l.index].push(n[e.region.r.index]) + }), t.forEach(function (t, r) { + var u = n[r], i = u[0], o = u[1]; + t.forEach(function (n) { + n.angle = Math.atan2(n[0] - i, n[1] - o) + }), t.sort(function (n, t) { + return n.angle - t.angle + }); + for (var a = 0, c = t.length - 1; c > a; a++) e.push([u, t[a], t[a + 1]]) + }), e + }, mo.geom.voronoi = function (n) { + function t(n) { + var t, i, o, a = n.map(function () { + return [] + }), c = pt(e), l = pt(r), s = n.length, f = 1e6; + if (c === Ze && l === Ve) t = n; else for (t = new Array(s), o = 0; s > o; ++o) t[o] = [+c.call(this, i = n[o], o), +l.call(this, i, o)]; + if (vr(t, function (n) { + var t, e, r, u, i, o; + 1 === n.a && n.b >= 0 ? (t = n.ep.r, e = n.ep.l) : (t = n.ep.l, e = n.ep.r), 1 === n.a ? (i = t ? t.y : -f, r = n.c - n.b * i, o = e ? e.y : f, u = n.c - n.b * o) : (r = t ? t.x : -f, i = n.c - n.a * r, u = e ? e.x : f, o = n.c - n.a * u); + var c = [r, i], l = [u, o]; + a[n.region.l.index].push(c, l), a[n.region.r.index].push(c, l) + }), a = a.map(function (n, e) { + var r = t[e][0], u = t[e][1], i = n.map(function (n) { + return Math.atan2(n[0] - r, n[1] - u) + }), o = mo.range(n.length).sort(function (n, t) { + return i[n] - i[t] + }); + return o.filter(function (n, t) { + return !t || i[n] - i[o[t - 1]] > Go + }).map(function (t) { + return n[t] + }) + }), a.forEach(function (n, e) { + var r = n.length; + if (!r) return n.push([-f, -f], [-f, f], [f, f], [f, -f]); + if (!(r > 2)) { + var u = t[e], i = n[0], o = n[1], a = u[0], c = u[1], l = i[0], s = i[1], h = o[0], g = o[1], + p = Math.abs(h - l), d = g - s; + if (Math.abs(d) < Go) { + var v = s > c ? -f : f; + n.push([-f, v], [f, v]) + } else if (Go > p) { + var m = l > a ? -f : f; + n.push([m, -f], [m, f]) + } else { + var v = (l - a) * (g - s) > (h - l) * (s - c) ? f : -f, y = Math.abs(d) - p; + Math.abs(y) < Go ? n.push([0 > d ? v : -v, v]) : (y > 0 && (v *= -1), n.push([-f, v], [f, v])) + } + } + }), u) for (o = 0; s > o; ++o) u.clip(a[o]); + for (o = 0; s > o; ++o) a[o].point = n[o]; + return a + } + + var e = Ze, r = Ve, u = null; + return arguments.length ? t(n) : (t.x = function (n) { + return arguments.length ? (e = n, t) : e + }, t.y = function (n) { + return arguments.length ? (r = n, t) : r + }, t.clipExtent = function (n) { + if (!arguments.length) return u && [u[0], u[2]]; + if (null == n) u = null; else { + var e = +n[0][0], r = +n[0][1], i = +n[1][0], o = +n[1][1]; + u = mo.geom.polygon([[e, r], [e, o], [i, o], [i, r]]) + } + return t + }, t.size = function (n) { + return arguments.length ? t.clipExtent(n && [[0, 0], n]) : u && u[2] + }, t.links = function (n) { + var t, u, i, o = n.map(function () { + return [] + }), a = [], c = pt(e), l = pt(r), s = n.length; + if (c === Ze && l === Ve) t = n; else for (t = new Array(s), i = 0; s > i; ++i) t[i] = [+c.call(this, u = n[i], i), +l.call(this, u, i)]; + return vr(t, function (t) { + var e = t.region.l.index, r = t.region.r.index; + o[e][r] || (o[e][r] = o[r][e] = !0, a.push({source: n[e], target: n[r]})) + }), a + }, t.triangles = function (n) { + if (e === Ze && r === Ve) return mo.geom.delaunay(n); + for (var t, u = new Array(c), i = pt(e), o = pt(r), a = -1, c = n.length; ++a < c;) (u[a] = [+i.call(this, t = n[a], a), +o.call(this, t, a)]).data = t; + return mo.geom.delaunay(u).map(function (n) { + return n.map(function (n) { + return n.data + }) + }) + }, t) + }; + var yc = {l: "r", r: "l"}; + mo.geom.quadtree = function (n, t, e, r, u) { + function i(n) { + function i(n, t, e, r, u, i, o, a) { + if (!isNaN(e) && !isNaN(r)) if (n.leaf) { + var c = n.x, s = n.y; + if (null != c) if (Math.abs(c - e) + Math.abs(s - r) < .01) l(n, t, e, r, u, i, o, a); else { + var f = n.point; + n.x = n.y = n.point = null, l(n, f, c, s, u, i, o, a), l(n, t, e, r, u, i, o, a) + } else n.x = e, n.y = r, n.point = t + } else l(n, t, e, r, u, i, o, a) + } + + function l(n, t, e, r, u, o, a, c) { + var l = .5 * (u + a), s = .5 * (o + c), f = e >= l, h = r >= s, g = (h << 1) + f; + n.leaf = !1, n = n.nodes[g] || (n.nodes[g] = Mr()), f ? u = l : a = l, h ? o = s : c = s, i(n, t, e, r, u, o, a, c) + } + + var s, f, h, g, p, d, v, m, y, M = pt(a), x = pt(c); + if (null != t) d = t, v = e, m = r, y = u; else if (m = y = -(d = v = 1 / 0), f = [], h = [], p = n.length, o) for (g = 0; p > g; ++g) s = n[g], s.x < d && (d = s.x), s.y < v && (v = s.y), s.x > m && (m = s.x), s.y > y && (y = s.y), f.push(s.x), h.push(s.y); else for (g = 0; p > g; ++g) { + var b = +M(s = n[g], g), _ = +x(s, g); + d > b && (d = b), v > _ && (v = _), b > m && (m = b), _ > y && (y = _), f.push(b), h.push(_) + } + var w = m - d, S = y - v; + w > S ? y = v + w : m = d + S; + var E = Mr(); + if (E.add = function (n) { + i(E, n, +M(n, ++g), +x(n, g), d, v, m, y) + }, E.visit = function (n) { + xr(n, E, d, v, m, y) + }, g = -1, null == t) { + for (; ++g < p;) i(E, n[g], f[g], h[g], d, v, m, y); + --g + } else n.forEach(E.add); + return f = h = n = s = null, E + } + + var o, a = Ze, c = Ve; + return (o = arguments.length) ? (a = mr, c = yr, 3 === o && (u = e, r = t, e = t = 0), i(n)) : (i.x = function (n) { + return arguments.length ? (a = n, i) : a + }, i.y = function (n) { + return arguments.length ? (c = n, i) : c + }, i.extent = function (n) { + return arguments.length ? (null == n ? t = e = r = u = null : (t = +n[0][0], e = +n[0][1], r = +n[1][0], u = +n[1][1]), i) : null == t ? null : [[t, e], [r, u]] + }, i.size = function (n) { + return arguments.length ? (null == n ? t = e = r = u = null : (t = e = 0, r = +n[0], u = +n[1]), i) : null == t ? null : [r - t, u - e] + }, i) + }, mo.interpolateRgb = br, mo.interpolateObject = _r, mo.interpolateNumber = wr, mo.interpolateString = Sr; + var Mc = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; + mo.interpolate = Er, mo.interpolators = [function (n, t) { + var e = typeof t; + return ("string" === e ? da.has(t) || /^(#|rgb\(|hsl\()/.test(t) ? br : Sr : t instanceof Z ? br : "object" === e ? Array.isArray(t) ? kr : _r : wr)(n, t) + }], mo.interpolateArray = kr; + var xc = function () { + return dt + }, bc = mo.map({ + linear: xc, poly: Dr, quad: function () { + return qr + }, cubic: function () { + return zr + }, sin: function () { + return jr + }, exp: function () { + return Lr + }, circle: function () { + return Hr + }, elastic: Fr, back: Pr, bounce: function () { + return Or + } + }), _c = mo.map({ + "in": dt, out: Nr, "in-out": Tr, "out-in": function (n) { + return Tr(Nr(n)) + } + }); + mo.ease = function (n) { + var t = n.indexOf("-"), e = t >= 0 ? n.substring(0, t) : n, r = t >= 0 ? n.substring(t + 1) : "in"; + return e = bc.get(e) || xc, r = _c.get(r) || dt, Ar(r(e.apply(null, Array.prototype.slice.call(arguments, 1)))) + }, mo.interpolateHcl = Rr, mo.interpolateHsl = Yr, mo.interpolateLab = Ir, mo.interpolateRound = Ur, mo.transform = function (n) { + var t = xo.createElementNS(mo.ns.prefix.svg, "g"); + return (mo.transform = function (n) { + if (null != n) { + t.setAttribute("transform", n); + var e = t.transform.baseVal.consolidate() + } + return new Zr(e ? e.matrix : wc) + })(n) + }, Zr.prototype.toString = function () { + return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")" + }; + var wc = {a: 1, b: 0, c: 0, d: 1, e: 0, f: 0}; + mo.interpolateTransform = Br, mo.layout = {}, mo.layout.bundle = function () { + return function (n) { + for (var t = [], e = -1, r = n.length; ++e < r;) t.push(Gr(n[e])); + return t + } + }, mo.layout.chord = function () { + function n() { + var n, l, f, h, g, p = {}, d = [], v = mo.range(i), m = []; + for (e = [], r = [], n = 0, h = -1; ++h < i;) { + for (l = 0, g = -1; ++g < i;) l += u[h][g]; + d.push(l), m.push(mo.range(i)), n += l + } + for (o && v.sort(function (n, t) { + return o(d[n], d[t]) + }), a && m.forEach(function (n, t) { + n.sort(function (n, e) { + return a(u[t][n], u[t][e]) + }) + }), n = (Wo - s * i) / n, l = 0, h = -1; ++h < i;) { + for (f = l, g = -1; ++g < i;) { + var y = v[h], M = m[y][g], x = u[y][M], b = l, _ = l += x * n; + p[y + "-" + M] = {index: y, subindex: M, startAngle: b, endAngle: _, value: x} + } + r[y] = {index: y, startAngle: f, endAngle: l, value: (l - f) / n}, l += s + } + for (h = -1; ++h < i;) for (g = h - 1; ++g < i;) { + var w = p[h + "-" + g], S = p[g + "-" + h]; + (w.value || S.value) && e.push(w.value < S.value ? {source: S, target: w} : {source: w, target: S}) + } + c && t() + } + + function t() { + e.sort(function (n, t) { + return c((n.source.value + n.target.value) / 2, (t.source.value + t.target.value) / 2) + }) + } + + var e, r, u, i, o, a, c, l = {}, s = 0; + return l.matrix = function (n) { + return arguments.length ? (i = (u = n) && u.length, e = r = null, l) : u + }, l.padding = function (n) { + return arguments.length ? (s = n, e = r = null, l) : s + }, l.sortGroups = function (n) { + return arguments.length ? (o = n, e = r = null, l) : o + }, l.sortSubgroups = function (n) { + return arguments.length ? (a = n, e = null, l) : a + }, l.sortChords = function (n) { + return arguments.length ? (c = n, e && t(), l) : c + }, l.chords = function () { + return e || n(), e + }, l.groups = function () { + return r || n(), r + }, l + }, mo.layout.force = function () { + function n(n) { + return function (t, e, r, u) { + if (t.point !== n) { + var i = t.cx - n.x, o = t.cy - n.y, a = 1 / Math.sqrt(i * i + o * o); + if (d > (u - e) * a) { + var c = t.charge * a * a; + return n.px -= i * c, n.py -= o * c, !0 + } + if (t.point && isFinite(a)) { + var c = t.pointCharge * a * a; + n.px -= i * c, n.py -= o * c + } + } + return !t.charge + } + } + + function t(n) { + n.px = mo.event.x, n.py = mo.event.y, a.resume() + } + + var e, r, u, i, o, a = {}, c = mo.dispatch("start", "tick", "end"), l = [1, 1], s = .9, f = Sc, h = Ec, g = -30, + p = .1, d = .8, v = [], m = []; + return a.tick = function () { + if ((r *= .99) < .005) return c.end({type: "end", alpha: r = 0}), !0; + var t, e, a, f, h, d, y, M, x, b = v.length, _ = m.length; + for (e = 0; _ > e; ++e) a = m[e], f = a.source, h = a.target, M = h.x - f.x, x = h.y - f.y, (d = M * M + x * x) && (d = r * i[e] * ((d = Math.sqrt(d)) - u[e]) / d, M *= d, x *= d, h.x -= M * (y = f.weight / (h.weight + f.weight)), h.y -= x * y, f.x += M * (y = 1 - y), f.y += x * y); + if ((y = r * p) && (M = l[0] / 2, x = l[1] / 2, e = -1, y)) for (; ++e < b;) a = v[e], a.x += (M - a.x) * y, a.y += (x - a.y) * y; + if (g) for (uu(t = mo.geom.quadtree(v), r, o), e = -1; ++e < b;) (a = v[e]).fixed || t.visit(n(a)); + for (e = -1; ++e < b;) a = v[e], a.fixed ? (a.x = a.px, a.y = a.py) : (a.x -= (a.px - (a.px = a.x)) * s, a.y -= (a.py - (a.py = a.y)) * s); + c.tick({type: "tick", alpha: r}) + }, a.nodes = function (n) { + return arguments.length ? (v = n, a) : v + }, a.links = function (n) { + return arguments.length ? (m = n, a) : m + }, a.size = function (n) { + return arguments.length ? (l = n, a) : l + }, a.linkDistance = function (n) { + return arguments.length ? (f = "function" == typeof n ? n : +n, a) : f + }, a.distance = a.linkDistance, a.linkStrength = function (n) { + return arguments.length ? (h = "function" == typeof n ? n : +n, a) : h + }, a.friction = function (n) { + return arguments.length ? (s = +n, a) : s + }, a.charge = function (n) { + return arguments.length ? (g = "function" == typeof n ? n : +n, a) : g + }, a.gravity = function (n) { + return arguments.length ? (p = +n, a) : p + }, a.theta = function (n) { + return arguments.length ? (d = +n, a) : d + }, a.alpha = function (n) { + return arguments.length ? (n = +n, r ? r = n > 0 ? n : 0 : n > 0 && (c.start({ + type: "start", + alpha: r = n + }), mo.timer(a.tick)), a) : r + }, a.start = function () { + function n(n, r) { + for (var u, i = t(e), o = -1, a = i.length; ++o < a;) if (!isNaN(u = i[o][n])) return u; + return Math.random() * r + } + + function t() { + if (!c) { + for (c = [], r = 0; p > r; ++r) c[r] = []; + for (r = 0; d > r; ++r) { + var n = m[r]; + c[n.source.index].push(n.target), c[n.target.index].push(n.source) + } + } + return c[e] + } + + var e, r, c, s, p = v.length, d = m.length, y = l[0], M = l[1]; + for (e = 0; p > e; ++e) (s = v[e]).index = e, s.weight = 0; + for (e = 0; d > e; ++e) s = m[e], "number" == typeof s.source && (s.source = v[s.source]), "number" == typeof s.target && (s.target = v[s.target]), ++s.source.weight, ++s.target.weight; + for (e = 0; p > e; ++e) s = v[e], isNaN(s.x) && (s.x = n("x", y)), isNaN(s.y) && (s.y = n("y", M)), isNaN(s.px) && (s.px = s.x), isNaN(s.py) && (s.py = s.y); + if (u = [], "function" == typeof f) for (e = 0; d > e; ++e) u[e] = +f.call(this, m[e], e); else for (e = 0; d > e; ++e) u[e] = f; + if (i = [], "function" == typeof h) for (e = 0; d > e; ++e) i[e] = +h.call(this, m[e], e); else for (e = 0; d > e; ++e) i[e] = h; + if (o = [], "function" == typeof g) for (e = 0; p > e; ++e) o[e] = +g.call(this, v[e], e); else for (e = 0; p > e; ++e) o[e] = g; + return a.resume() + }, a.resume = function () { + return a.alpha(.1) + }, a.stop = function () { + return a.alpha(0) + }, a.drag = function () { + return e || (e = mo.behavior.drag().origin(dt).on("dragstart.force", nu).on("drag.force", t).on("dragend.force", tu)), arguments.length ? (this.on("mouseover.force", eu).on("mouseout.force", ru).call(e), void 0) : e + }, mo.rebind(a, c, "on") + }; + var Sc = 20, Ec = 1; + mo.layout.hierarchy = function () { + function n(t, o, a) { + var c = u.call(e, t, o); + if (t.depth = o, a.push(t), c && (l = c.length)) { + for (var l, s, f = -1, h = t.children = [], g = 0, p = o + 1; ++f < l;) s = n(c[f], p, a), s.parent = t, h.push(s), g += s.value; + r && h.sort(r), i && (t.value = g) + } else i && (t.value = +i.call(e, t, o) || 0); + return t + } + + function t(n, r) { + var u = n.children, o = 0; + if (u && (a = u.length)) for (var a, c = -1, l = r + 1; ++c < a;) o += t(u[c], l); else i && (o = +i.call(e, n, r) || 0); + return i && (n.value = o), o + } + + function e(t) { + var e = []; + return n(t, 0, e), e + } + + var r = cu, u = ou, i = au; + return e.sort = function (n) { + return arguments.length ? (r = n, e) : r + }, e.children = function (n) { + return arguments.length ? (u = n, e) : u + }, e.value = function (n) { + return arguments.length ? (i = n, e) : i + }, e.revalue = function (n) { + return t(n, 0), n + }, e + }, mo.layout.partition = function () { + function n(t, e, r, u) { + var i = t.children; + if (t.x = e, t.y = t.depth * u, t.dx = r, t.dy = u, i && (o = i.length)) { + var o, a, c, l = -1; + for (r = t.value ? r / t.value : 0; ++l < o;) n(a = i[l], e, c = a.value * r, u), e += c + } + } + + function t(n) { + var e = n.children, r = 0; + if (e && (u = e.length)) for (var u, i = -1; ++i < u;) r = Math.max(r, t(e[i])); + return 1 + r + } + + function e(e, i) { + var o = r.call(this, e, i); + return n(o[0], 0, u[0], u[1] / t(o[0])), o + } + + var r = mo.layout.hierarchy(), u = [1, 1]; + return e.size = function (n) { + return arguments.length ? (u = n, e) : u + }, iu(e, r) + }, mo.layout.pie = function () { + function n(i) { + var o = i.map(function (e, r) { + return +t.call(n, e, r) + }), a = +("function" == typeof r ? r.apply(this, arguments) : r), + c = (("function" == typeof u ? u.apply(this, arguments) : u) - a) / mo.sum(o), l = mo.range(i.length); + null != e && l.sort(e === kc ? function (n, t) { + return o[t] - o[n] + } : function (n, t) { + return e(i[n], i[t]) + }); + var s = []; + return l.forEach(function (n) { + var t; + s[n] = {data: i[n], value: t = o[n], startAngle: a, endAngle: a += t * c} + }), s + } + + var t = Number, e = kc, r = 0, u = Wo; + return n.value = function (e) { + return arguments.length ? (t = e, n) : t + }, n.sort = function (t) { + return arguments.length ? (e = t, n) : e + }, n.startAngle = function (t) { + return arguments.length ? (r = t, n) : r + }, n.endAngle = function (t) { + return arguments.length ? (u = t, n) : u + }, n + }; + var kc = {}; + mo.layout.stack = function () { + function n(a, c) { + var l = a.map(function (e, r) { + return t.call(n, e, r) + }), s = l.map(function (t) { + return t.map(function (t, e) { + return [i.call(n, t, e), o.call(n, t, e)] + }) + }), f = e.call(n, s, c); + l = mo.permute(l, f), s = mo.permute(s, f); + var h, g, p, d = r.call(n, s, c), v = l.length, m = l[0].length; + for (g = 0; m > g; ++g) for (u.call(n, l[0][g], p = d[g], s[0][g][1]), h = 1; v > h; ++h) u.call(n, l[h][g], p += s[h - 1][g][1], s[h][g][1]); + return a + } + + var t = dt, e = gu, r = pu, u = hu, i = su, o = fu; + return n.values = function (e) { + return arguments.length ? (t = e, n) : t + }, n.order = function (t) { + return arguments.length ? (e = "function" == typeof t ? t : Ac.get(t) || gu, n) : e + }, n.offset = function (t) { + return arguments.length ? (r = "function" == typeof t ? t : Nc.get(t) || pu, n) : r + }, n.x = function (t) { + return arguments.length ? (i = t, n) : i + }, n.y = function (t) { + return arguments.length ? (o = t, n) : o + }, n.out = function (t) { + return arguments.length ? (u = t, n) : u + }, n + }; + var Ac = mo.map({ + "inside-out": function (n) { + var t, e, r = n.length, u = n.map(du), i = n.map(vu), o = mo.range(r).sort(function (n, t) { + return u[n] - u[t] + }), a = 0, c = 0, l = [], s = []; + for (t = 0; r > t; ++t) e = o[t], c > a ? (a += i[e], l.push(e)) : (c += i[e], s.push(e)); + return s.reverse().concat(l) + }, reverse: function (n) { + return mo.range(n.length).reverse() + }, "default": gu + }), Nc = mo.map({ + silhouette: function (n) { + var t, e, r, u = n.length, i = n[0].length, o = [], a = 0, c = []; + for (e = 0; i > e; ++e) { + for (t = 0, r = 0; u > t; t++) r += n[t][e][1]; + r > a && (a = r), o.push(r) + } + for (e = 0; i > e; ++e) c[e] = (a - o[e]) / 2; + return c + }, wiggle: function (n) { + var t, e, r, u, i, o, a, c, l, s = n.length, f = n[0], h = f.length, g = []; + for (g[0] = c = l = 0, e = 1; h > e; ++e) { + for (t = 0, u = 0; s > t; ++t) u += n[t][e][1]; + for (t = 0, i = 0, a = f[e][0] - f[e - 1][0]; s > t; ++t) { + for (r = 0, o = (n[t][e][1] - n[t][e - 1][1]) / (2 * a); t > r; ++r) o += (n[r][e][1] - n[r][e - 1][1]) / a; + i += o * n[t][e][1] + } + g[e] = c -= u ? i / u * a : 0, l > c && (l = c) + } + for (e = 0; h > e; ++e) g[e] -= l; + return g + }, expand: function (n) { + var t, e, r, u = n.length, i = n[0].length, o = 1 / u, a = []; + for (e = 0; i > e; ++e) { + for (t = 0, r = 0; u > t; t++) r += n[t][e][1]; + if (r) for (t = 0; u > t; t++) n[t][e][1] /= r; else for (t = 0; u > t; t++) n[t][e][1] = o + } + for (e = 0; i > e; ++e) a[e] = 0; + return a + }, zero: pu + }); + mo.layout.histogram = function () { + function n(n, i) { + for (var o, a, c = [], l = n.map(e, this), s = r.call(this, l, i), f = u.call(this, s, l, i), i = -1, h = l.length, g = f.length - 1, p = t ? 1 : 1 / h; ++i < g;) o = c[i] = [], o.dx = f[i + 1] - (o.x = f[i]), o.y = 0; + if (g > 0) for (i = -1; ++i < h;) a = l[i], a >= s[0] && a <= s[1] && (o = c[mo.bisect(f, a, 1, g) - 1], o.y += p, o.push(n[i])); + return c + } + + var t = !0, e = Number, r = xu, u = yu; + return n.value = function (t) { + return arguments.length ? (e = t, n) : e + }, n.range = function (t) { + return arguments.length ? (r = pt(t), n) : r + }, n.bins = function (t) { + return arguments.length ? (u = "number" == typeof t ? function (n) { + return Mu(n, t) + } : pt(t), n) : u + }, n.frequency = function (e) { + return arguments.length ? (t = !!e, n) : t + }, n + }, mo.layout.tree = function () { + function n(n, i) { + function o(n, t) { + var r = n.children, u = n._tree; + if (r && (i = r.length)) { + for (var i, a, l, s = r[0], f = s, h = -1; ++h < i;) l = r[h], o(l, a), f = c(l, a, f), a = l; + Tu(n); + var g = .5 * (s._tree.prelim + l._tree.prelim); + t ? (u.prelim = t._tree.prelim + e(n, t), u.mod = u.prelim - g) : u.prelim = g + } else t && (u.prelim = t._tree.prelim + e(n, t)) + } + + function a(n, t) { + n.x = n._tree.prelim + t; + var e = n.children; + if (e && (r = e.length)) { + var r, u = -1; + for (t += n._tree.mod; ++u < r;) a(e[u], t) + } + } + + function c(n, t, r) { + if (t) { + for (var u, i = n, o = n, a = t, c = n.parent.children[0], l = i._tree.mod, s = o._tree.mod, f = a._tree.mod, h = c._tree.mod; a = wu(a), i = _u(i), a && i;) c = _u(c), o = wu(o), o._tree.ancestor = n, u = a._tree.prelim + f - i._tree.prelim - l + e(a, i), u > 0 && (qu(zu(a, n, r), n, u), l += u, s += u), f += a._tree.mod, l += i._tree.mod, h += c._tree.mod, s += o._tree.mod; + a && !wu(o) && (o._tree.thread = a, o._tree.mod += f - s), i && !_u(c) && (c._tree.thread = i, c._tree.mod += l - h, r = n) + } + return r + } + + var l = t.call(this, n, i), s = l[0]; + Nu(s, function (n, t) { + n._tree = {ancestor: n, prelim: 0, mod: 0, change: 0, shift: 0, number: t ? t._tree.number + 1 : 0} + }), o(s), a(s, -s._tree.prelim); + var f = Su(s, ku), h = Su(s, Eu), g = Su(s, Au), p = f.x - e(f, h) / 2, d = h.x + e(h, f) / 2, + v = g.depth || 1; + return Nu(s, u ? function (n) { + n.x *= r[0], n.y = n.depth * r[1], delete n._tree + } : function (n) { + n.x = (n.x - p) / (d - p) * r[0], n.y = n.depth / v * r[1], delete n._tree + }), l + } + + var t = mo.layout.hierarchy().sort(null).value(null), e = bu, r = [1, 1], u = !1; + return n.separation = function (t) { + return arguments.length ? (e = t, n) : e + }, n.size = function (t) { + return arguments.length ? (u = null == (r = t), n) : u ? null : r + }, n.nodeSize = function (t) { + return arguments.length ? (u = null != (r = t), n) : u ? r : null + }, iu(n, t) + }, mo.layout.pack = function () { + function n(n, i) { + var o = e.call(this, n, i), a = o[0], c = u[0], l = u[1], + s = null == t ? Math.sqrt : "function" == typeof t ? t : function () { + return t + }; + if (a.x = a.y = 0, Nu(a, function (n) { + n.r = +s(n.value) + }), Nu(a, Hu), r) { + var f = r * (t ? 1 : Math.max(2 * a.r / c, 2 * a.r / l)) / 2; + Nu(a, function (n) { + n.r += f + }), Nu(a, Hu), Nu(a, function (n) { + n.r -= f + }) + } + return Ou(a, c / 2, l / 2, t ? 1 : 1 / Math.max(2 * a.r / c, 2 * a.r / l)), o + } + + var t, e = mo.layout.hierarchy().sort(Cu), r = 0, u = [1, 1]; + return n.size = function (t) { + return arguments.length ? (u = t, n) : u + }, n.radius = function (e) { + return arguments.length ? (t = null == e || "function" == typeof e ? e : +e, n) : t + }, n.padding = function (t) { + return arguments.length ? (r = +t, n) : r + }, iu(n, e) + }, mo.layout.cluster = function () { + function n(n, i) { + var o, a = t.call(this, n, i), c = a[0], l = 0; + Nu(c, function (n) { + var t = n.children; + t && t.length ? (n.x = Iu(t), n.y = Yu(t)) : (n.x = o ? l += e(n, o) : 0, n.y = 0, o = n) + }); + var s = Uu(c), f = Zu(c), h = s.x - e(s, f) / 2, g = f.x + e(f, s) / 2; + return Nu(c, u ? function (n) { + n.x = (n.x - c.x) * r[0], n.y = (c.y - n.y) * r[1] + } : function (n) { + n.x = (n.x - h) / (g - h) * r[0], n.y = (1 - (c.y ? n.y / c.y : 1)) * r[1] + }), a + } + + var t = mo.layout.hierarchy().sort(null).value(null), e = bu, r = [1, 1], u = !1; + return n.separation = function (t) { + return arguments.length ? (e = t, n) : e + }, n.size = function (t) { + return arguments.length ? (u = null == (r = t), n) : u ? null : r + }, n.nodeSize = function (t) { + return arguments.length ? (u = null != (r = t), n) : u ? r : null + }, iu(n, t) + }, mo.layout.treemap = function () { + function n(n, t) { + for (var e, r, u = -1, i = n.length; ++u < i;) r = (e = n[u]).value * (0 > t ? 0 : t), e.area = isNaN(r) || 0 >= r ? 0 : r + } + + function t(e) { + var i = e.children; + if (i && i.length) { + var o, a, c, l = f(e), s = [], h = i.slice(), p = 1 / 0, + d = "slice" === g ? l.dx : "dice" === g ? l.dy : "slice-dice" === g ? 1 & e.depth ? l.dy : l.dx : Math.min(l.dx, l.dy); + for (n(h, l.dx * l.dy / e.value), s.area = 0; (c = h.length) > 0;) s.push(o = h[c - 1]), s.area += o.area, "squarify" !== g || (a = r(s, d)) <= p ? (h.pop(), p = a) : (s.area -= s.pop().area, u(s, d, l, !1), d = Math.min(l.dx, l.dy), s.length = s.area = 0, p = 1 / 0); + s.length && (u(s, d, l, !0), s.length = s.area = 0), i.forEach(t) + } + } + + function e(t) { + var r = t.children; + if (r && r.length) { + var i, o = f(t), a = r.slice(), c = []; + for (n(a, o.dx * o.dy / t.value), c.area = 0; i = a.pop();) c.push(i), c.area += i.area, null != i.z && (u(c, i.z ? o.dx : o.dy, o, !a.length), c.length = c.area = 0); + r.forEach(e) + } + } + + function r(n, t) { + for (var e, r = n.area, u = 0, i = 1 / 0, o = -1, a = n.length; ++o < a;) (e = n[o].area) && (i > e && (i = e), e > u && (u = e)); + return r *= r, t *= t, r ? Math.max(t * u * p / r, r / (t * i * p)) : 1 / 0 + } + + function u(n, t, e, r) { + var u, i = -1, o = n.length, a = e.x, l = e.y, s = t ? c(n.area / t) : 0; + if (t == e.dx) { + for ((r || s > e.dy) && (s = e.dy); ++i < o;) u = n[i], u.x = a, u.y = l, u.dy = s, a += u.dx = Math.min(e.x + e.dx - a, s ? c(u.area / s) : 0); + u.z = !0, u.dx += e.x + e.dx - a, e.y += s, e.dy -= s + } else { + for ((r || s > e.dx) && (s = e.dx); ++i < o;) u = n[i], u.x = a, u.y = l, u.dx = s, l += u.dy = Math.min(e.y + e.dy - l, s ? c(u.area / s) : 0); + u.z = !1, u.dy += e.y + e.dy - l, e.x += s, e.dx -= s + } + } + + function i(r) { + var u = o || a(r), i = u[0]; + return i.x = 0, i.y = 0, i.dx = l[0], i.dy = l[1], o && a.revalue(i), n([i], i.dx * i.dy / i.value), (o ? e : t)(i), h && (o = u), u + } + + var o, a = mo.layout.hierarchy(), c = Math.round, l = [1, 1], s = null, f = Vu, h = !1, g = "squarify", + p = .5 * (1 + Math.sqrt(5)); + return i.size = function (n) { + return arguments.length ? (l = n, i) : l + }, i.padding = function (n) { + function t(t) { + var e = n.call(i, t, t.depth); + return null == e ? Vu(t) : Xu(t, "number" == typeof e ? [e, e, e, e] : e) + } + + function e(t) { + return Xu(t, n) + } + + if (!arguments.length) return s; + var r; + return f = null == (s = n) ? Vu : "function" == (r = typeof n) ? t : "number" === r ? (n = [n, n, n, n], e) : e, i + }, i.round = function (n) { + return arguments.length ? (c = n ? Math.round : Number, i) : c != Number + }, i.sticky = function (n) { + return arguments.length ? (h = n, o = null, i) : h + }, i.ratio = function (n) { + return arguments.length ? (p = n, i) : p + }, i.mode = function (n) { + return arguments.length ? (g = n + "", i) : g + }, iu(i, a) + }, mo.random = { + normal: function (n, t) { + var e = arguments.length; + return 2 > e && (t = 1), 1 > e && (n = 0), function () { + var e, r, u; + do e = 2 * Math.random() - 1, r = 2 * Math.random() - 1, u = e * e + r * r; while (!u || u > 1); + return n + t * e * Math.sqrt(-2 * Math.log(u) / u) + } + }, logNormal: function () { + var n = mo.random.normal.apply(mo, arguments); + return function () { + return Math.exp(n()) + } + }, irwinHall: function (n) { + return function () { + for (var t = 0, e = 0; n > e; e++) t += Math.random(); + return t / n + } + } + }, mo.scale = {}; + var Tc = {floor: dt, ceil: dt}; + mo.scale.linear = function () { + return Qu([0, 1], [0, 1], Er, !1) + }, mo.scale.log = function () { + return ii(mo.scale.linear().domain([0, 1]), 10, !0, [1, 10]) + }; + var qc = mo.format(".0e"), zc = { + floor: function (n) { + return -Math.ceil(-n) + }, ceil: function (n) { + return -Math.floor(-n) + } + }; + mo.scale.pow = function () { + return oi(mo.scale.linear(), 1, [0, 1]) + }, mo.scale.sqrt = function () { + return mo.scale.pow().exponent(.5) + }, mo.scale.ordinal = function () { + return ci([], {t: "range", a: [[]]}) + }, mo.scale.category10 = function () { + return mo.scale.ordinal().range(Cc) + }, mo.scale.category20 = function () { + return mo.scale.ordinal().range(Dc) + }, mo.scale.category20b = function () { + return mo.scale.ordinal().range(jc) + }, mo.scale.category20c = function () { + return mo.scale.ordinal().range(Lc) + }; + var Cc = [2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175].map(it), + Dc = [2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725].map(it), + jc = [3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654].map(it), + Lc = [3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081].map(it); + mo.scale.quantile = function () { + return li([], []) + }, mo.scale.quantize = function () { + return si(0, 1, [0, 1]) + }, mo.scale.threshold = function () { + return fi([.5], [0, 1]) + }, mo.scale.identity = function () { + return hi([0, 1]) + }, mo.svg.arc = function () { + function n() { + var n = t.apply(this, arguments), i = e.apply(this, arguments), o = r.apply(this, arguments) + Hc, + a = u.apply(this, arguments) + Hc, c = (o > a && (c = o, o = a, a = c), a - o), l = Bo > c ? "0" : "1", + s = Math.cos(o), f = Math.sin(o), h = Math.cos(a), g = Math.sin(a); + return c >= Fc ? n ? "M0," + i + "A" + i + "," + i + " 0 1,1 0," + -i + "A" + i + "," + i + " 0 1,1 0," + i + "M0," + n + "A" + n + "," + n + " 0 1,0 0," + -n + "A" + n + "," + n + " 0 1,0 0," + n + "Z" : "M0," + i + "A" + i + "," + i + " 0 1,1 0," + -i + "A" + i + "," + i + " 0 1,1 0," + i + "Z" : n ? "M" + i * s + "," + i * f + "A" + i + "," + i + " 0 " + l + ",1 " + i * h + "," + i * g + "L" + n * h + "," + n * g + "A" + n + "," + n + " 0 " + l + ",0 " + n * s + "," + n * f + "Z" : "M" + i * s + "," + i * f + "A" + i + "," + i + " 0 " + l + ",1 " + i * h + "," + i * g + "L0,0" + "Z" + } + + var t = gi, e = pi, r = di, u = vi; + return n.innerRadius = function (e) { + return arguments.length ? (t = pt(e), n) : t + }, n.outerRadius = function (t) { + return arguments.length ? (e = pt(t), n) : e + }, n.startAngle = function (t) { + return arguments.length ? (r = pt(t), n) : r + }, n.endAngle = function (t) { + return arguments.length ? (u = pt(t), n) : u + }, n.centroid = function () { + var n = (t.apply(this, arguments) + e.apply(this, arguments)) / 2, + i = (r.apply(this, arguments) + u.apply(this, arguments)) / 2 + Hc; + return [Math.cos(i) * n, Math.sin(i) * n] + }, n + }; + var Hc = -Jo, Fc = Wo - Go; + mo.svg.line.radial = function () { + var n = Ue(mi); + return n.radius = n.x, delete n.x, n.angle = n.y, delete n.y, n + }, We.reverse = Je, Je.reverse = We, mo.svg.area = function () { + return yi(dt) + }, mo.svg.area.radial = function () { + var n = yi(mi); + return n.radius = n.x, delete n.x, n.innerRadius = n.x0, delete n.x0, n.outerRadius = n.x1, delete n.x1, n.angle = n.y, delete n.y, n.startAngle = n.y0, delete n.y0, n.endAngle = n.y1, delete n.y1, n + }, mo.svg.chord = function () { + function n(n, a) { + var c = t(this, i, n, a), l = t(this, o, n, a); + return "M" + c.p0 + r(c.r, c.p1, c.a1 - c.a0) + (e(c, l) ? u(c.r, c.p1, c.r, c.p0) : u(c.r, c.p1, l.r, l.p0) + r(l.r, l.p1, l.a1 - l.a0) + u(l.r, l.p1, c.r, c.p0)) + "Z" + } + + function t(n, t, e, r) { + var u = t.call(n, e, r), i = a.call(n, u, r), o = c.call(n, u, r) + Hc, s = l.call(n, u, r) + Hc; + return {r: i, a0: o, a1: s, p0: [i * Math.cos(o), i * Math.sin(o)], p1: [i * Math.cos(s), i * Math.sin(s)]} + } + + function e(n, t) { + return n.a0 == t.a0 && n.a1 == t.a1 + } + + function r(n, t, e) { + return "A" + n + "," + n + " 0 " + +(e > Bo) + ",1 " + t + } + + function u(n, t, e, r) { + return "Q 0,0 " + r + } + + var i = De, o = je, a = Mi, c = di, l = vi; + return n.radius = function (t) { + return arguments.length ? (a = pt(t), n) : a + }, n.source = function (t) { + return arguments.length ? (i = pt(t), n) : i + }, n.target = function (t) { + return arguments.length ? (o = pt(t), n) : o + }, n.startAngle = function (t) { + return arguments.length ? (c = pt(t), n) : c + }, n.endAngle = function (t) { + return arguments.length ? (l = pt(t), n) : l + }, n + }, mo.svg.diagonal = function () { + function n(n, u) { + var i = t.call(this, n, u), o = e.call(this, n, u), a = (i.y + o.y) / 2, + c = [i, {x: i.x, y: a}, {x: o.x, y: a}, o]; + return c = c.map(r), "M" + c[0] + "C" + c[1] + " " + c[2] + " " + c[3] + } + + var t = De, e = je, r = xi; + return n.source = function (e) { + return arguments.length ? (t = pt(e), n) : t + }, n.target = function (t) { + return arguments.length ? (e = pt(t), n) : e + }, n.projection = function (t) { + return arguments.length ? (r = t, n) : r + }, n + }, mo.svg.diagonal.radial = function () { + var n = mo.svg.diagonal(), t = xi, e = n.projection; + return n.projection = function (n) { + return arguments.length ? e(bi(t = n)) : t + }, n + }, mo.svg.symbol = function () { + function n(n, r) { + return (Pc.get(t.call(this, n, r)) || Si)(e.call(this, n, r)) + } + + var t = wi, e = _i; + return n.type = function (e) { + return arguments.length ? (t = pt(e), n) : t + }, n.size = function (t) { + return arguments.length ? (e = pt(t), n) : e + }, n + }; + var Pc = mo.map({ + circle: Si, cross: function (n) { + var t = Math.sqrt(n / 5) / 2; + return "M" + -3 * t + "," + -t + "H" + -t + "V" + -3 * t + "H" + t + "V" + -t + "H" + 3 * t + "V" + t + "H" + t + "V" + 3 * t + "H" + -t + "V" + t + "H" + -3 * t + "Z" + }, diamond: function (n) { + var t = Math.sqrt(n / (2 * Ic)), e = t * Ic; + return "M0," + -t + "L" + e + ",0" + " 0," + t + " " + -e + ",0" + "Z" + }, square: function (n) { + var t = Math.sqrt(n) / 2; + return "M" + -t + "," + -t + "L" + t + "," + -t + " " + t + "," + t + " " + -t + "," + t + "Z" + }, "triangle-down": function (n) { + var t = Math.sqrt(n / Yc), e = t * Yc / 2; + return "M0," + e + "L" + t + "," + -e + " " + -t + "," + -e + "Z" + }, "triangle-up": function (n) { + var t = Math.sqrt(n / Yc), e = t * Yc / 2; + return "M0," + -e + "L" + t + "," + e + " " + -t + "," + e + "Z" + } + }); + mo.svg.symbolTypes = Pc.keys(); + var Oc, Rc, Yc = Math.sqrt(3), Ic = Math.tan(30 * Qo), Uc = [], Zc = 0; + Uc.call = Ro.call, Uc.empty = Ro.empty, Uc.node = Ro.node, Uc.size = Ro.size, mo.transition = function (n) { + return arguments.length ? Oc ? n.transition() : n : Uo.transition() + }, mo.transition.prototype = Uc, Uc.select = function (n) { + var t, e, r, u = this.id, i = []; + n = d(n); + for (var o = -1, a = this.length; ++o < a;) { + i.push(t = []); + for (var c = this[o], l = -1, s = c.length; ++l < s;) (r = c[l]) && (e = n.call(r, r.__data__, l, o)) ? ("__data__" in r && (e.__data__ = r.__data__), Ni(e, l, u, r.__transition__[u]), t.push(e)) : t.push(null) + } + return Ei(i, u) + }, Uc.selectAll = function (n) { + var t, e, r, u, i, o = this.id, a = []; + n = v(n); + for (var c = -1, l = this.length; ++c < l;) for (var s = this[c], f = -1, h = s.length; ++f < h;) if (r = s[f]) { + i = r.__transition__[o], e = n.call(r, r.__data__, f, c), a.push(t = []); + for (var g = -1, p = e.length; ++g < p;) (u = e[g]) && Ni(u, g, o, i), t.push(u) + } + return Ei(a, o) + }, Uc.filter = function (n) { + var t, e, r, u = []; + "function" != typeof n && (n = k(n)); + for (var i = 0, o = this.length; o > i; i++) { + u.push(t = []); + for (var e = this[i], a = 0, c = e.length; c > a; a++) (r = e[a]) && n.call(r, r.__data__, a) && t.push(r) + } + return Ei(u, this.id) + }, Uc.tween = function (n, t) { + var e = this.id; + return arguments.length < 2 ? this.node().__transition__[e].tween.get(n) : N(this, null == t ? function (t) { + t.__transition__[e].tween.remove(n) + } : function (r) { + r.__transition__[e].tween.set(n, t) + }) + }, Uc.attr = function (n, t) { + function e() { + this.removeAttribute(a) + } + + function r() { + this.removeAttributeNS(a.space, a.local) + } + + function u(n) { + return null == n ? e : (n += "", function () { + var t, e = this.getAttribute(a); + return e !== n && (t = o(e, n), function (n) { + this.setAttribute(a, t(n)) + }) + }) + } + + function i(n) { + return null == n ? r : (n += "", function () { + var t, e = this.getAttributeNS(a.space, a.local); + return e !== n && (t = o(e, n), function (n) { + this.setAttributeNS(a.space, a.local, t(n)) + }) + }) + } + + if (arguments.length < 2) { + for (t in n) this.attr(t, n[t]); + return this + } + var o = "transform" == n ? Br : Er, a = mo.ns.qualify(n); + return ki(this, "attr." + n, t, a.local ? i : u) + }, Uc.attrTween = function (n, t) { + function e(n, e) { + var r = t.call(this, n, e, this.getAttribute(u)); + return r && function (n) { + this.setAttribute(u, r(n)) + } + } + + function r(n, e) { + var r = t.call(this, n, e, this.getAttributeNS(u.space, u.local)); + return r && function (n) { + this.setAttributeNS(u.space, u.local, r(n)) + } + } + + var u = mo.ns.qualify(n); + return this.tween("attr." + n, u.local ? r : e) + }, Uc.style = function (n, t, e) { + function r() { + this.style.removeProperty(n) + } + + function u(t) { + return null == t ? r : (t += "", function () { + var r, u = _o.getComputedStyle(this, null).getPropertyValue(n); + return u !== t && (r = Er(u, t), function (t) { + this.style.setProperty(n, r(t), e) + }) + }) + } + + var i = arguments.length; + if (3 > i) { + if ("string" != typeof n) { + 2 > i && (t = ""); + for (e in n) this.style(e, n[e], t); + return this + } + e = "" + } + return ki(this, "style." + n, t, u) + }, Uc.styleTween = function (n, t, e) { + function r(r, u) { + var i = t.call(this, r, u, _o.getComputedStyle(this, null).getPropertyValue(n)); + return i && function (t) { + this.style.setProperty(n, i(t), e) + } + } + + return arguments.length < 3 && (e = ""), this.tween("style." + n, r) + }, Uc.text = function (n) { + return ki(this, "text", n, Ai) + }, Uc.remove = function () { + return this.each("end.transition", function () { + var n; + this.__transition__.count < 2 && (n = this.parentNode) && n.removeChild(this) + }) + }, Uc.ease = function (n) { + var t = this.id; + return arguments.length < 1 ? this.node().__transition__[t].ease : ("function" != typeof n && (n = mo.ease.apply(mo, arguments)), N(this, function (e) { + e.__transition__[t].ease = n + })) + }, Uc.delay = function (n) { + var t = this.id; + return N(this, "function" == typeof n ? function (e, r, u) { + e.__transition__[t].delay = +n.call(e, e.__data__, r, u) + } : (n = +n, function (e) { + e.__transition__[t].delay = n + })) + }, Uc.duration = function (n) { + var t = this.id; + return N(this, "function" == typeof n ? function (e, r, u) { + e.__transition__[t].duration = Math.max(1, n.call(e, e.__data__, r, u)) + } : (n = Math.max(1, n), function (e) { + e.__transition__[t].duration = n + })) + }, Uc.each = function (n, t) { + var e = this.id; + if (arguments.length < 2) { + var r = Rc, u = Oc; + Oc = e, N(this, function (t, r, u) { + Rc = t.__transition__[e], n.call(t, t.__data__, r, u) + }), Rc = r, Oc = u + } else N(this, function (r) { + var u = r.__transition__[e]; + (u.event || (u.event = mo.dispatch("start", "end"))).on(n, t) + }); + return this + }, Uc.transition = function () { + for (var n, t, e, r, u = this.id, i = ++Zc, o = [], a = 0, c = this.length; c > a; a++) { + o.push(n = []); + for (var t = this[a], l = 0, s = t.length; s > l; l++) (e = t[l]) && (r = Object.create(e.__transition__[u]), r.delay += r.duration, Ni(e, l, i, r)), n.push(e) + } + return Ei(o, i) + }, mo.svg.axis = function () { + function n(n) { + n.each(function () { + var n, l = mo.select(this), s = this.__chart__ || e, f = this.__chart__ = e.copy(), + h = null == c ? f.ticks ? f.ticks.apply(f, a) : f.domain() : c, + g = null == t ? f.tickFormat ? f.tickFormat.apply(f, a) : dt : t, + p = l.selectAll(".tick").data(h, f), + d = p.enter().insert("g", ".domain").attr("class", "tick").style("opacity", Go), + v = mo.transition(p.exit()).style("opacity", Go).remove(), m = mo.transition(p).style("opacity", 1), + y = Bu(f), M = l.selectAll(".domain").data([0]), + x = (M.enter().append("path").attr("class", "domain"), mo.transition(M)); + d.append("line"), d.append("text"); + var b = d.select("line"), _ = m.select("line"), w = p.select("text").text(g), S = d.select("text"), + E = m.select("text"); + switch (r) { + case"bottom": + n = Ti, b.attr("y2", u), S.attr("y", Math.max(u, 0) + o), _.attr("x2", 0).attr("y2", u), E.attr("x", 0).attr("y", Math.max(u, 0) + o), w.attr("dy", ".71em").style("text-anchor", "middle"), x.attr("d", "M" + y[0] + "," + i + "V0H" + y[1] + "V" + i); + break; + case"top": + n = Ti, b.attr("y2", -u), S.attr("y", -(Math.max(u, 0) + o)), _.attr("x2", 0).attr("y2", -u), E.attr("x", 0).attr("y", -(Math.max(u, 0) + o)), w.attr("dy", "0em").style("text-anchor", "middle"), x.attr("d", "M" + y[0] + "," + -i + "V0H" + y[1] + "V" + -i); + break; + case"left": + n = qi, b.attr("x2", -u), S.attr("x", -(Math.max(u, 0) + o)), _.attr("x2", -u).attr("y2", 0), E.attr("x", -(Math.max(u, 0) + o)).attr("y", 0), w.attr("dy", ".32em").style("text-anchor", "end"), x.attr("d", "M" + -i + "," + y[0] + "H0V" + y[1] + "H" + -i); + break; + case"right": + n = qi, b.attr("x2", u), S.attr("x", Math.max(u, 0) + o), _.attr("x2", u).attr("y2", 0), E.attr("x", Math.max(u, 0) + o).attr("y", 0), w.attr("dy", ".32em").style("text-anchor", "start"), x.attr("d", "M" + i + "," + y[0] + "H0V" + y[1] + "H" + i) + } + if (f.rangeBand) { + var k = f.rangeBand() / 2, A = function (n) { + return f(n) + k + }; + d.call(n, A), m.call(n, A) + } else d.call(n, s), m.call(n, f), v.call(n, f) + }) + } + + var t, e = mo.scale.linear(), r = Vc, u = 6, i = 6, o = 3, a = [10], c = null; + return n.scale = function (t) { + return arguments.length ? (e = t, n) : e + }, n.orient = function (t) { + return arguments.length ? (r = t in Xc ? t + "" : Vc, n) : r + }, n.ticks = function () { + return arguments.length ? (a = arguments, n) : a + }, n.tickValues = function (t) { + return arguments.length ? (c = t, n) : c + }, n.tickFormat = function (e) { + return arguments.length ? (t = e, n) : t + }, n.tickSize = function (t) { + var e = arguments.length; + return e ? (u = +t, i = +arguments[e - 1], n) : u + }, n.innerTickSize = function (t) { + return arguments.length ? (u = +t, n) : u + }, n.outerTickSize = function (t) { + return arguments.length ? (i = +t, n) : i + }, n.tickPadding = function (t) { + return arguments.length ? (o = +t, n) : o + }, n.tickSubdivide = function () { + return arguments.length && n + }, n + }; + var Vc = "bottom", Xc = {top: 1, right: 1, bottom: 1, left: 1}; + mo.svg.brush = function () { + function n(i) { + i.each(function () { + var i = mo.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", u).on("touchstart.brush", u), + o = i.selectAll(".background").data([0]); + o.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), i.selectAll(".extent").data([0]).enter().append("rect").attr("class", "extent").style("cursor", "move"); + var a = i.selectAll(".resize").data(v, dt); + a.exit().remove(), a.enter().append("g").attr("class", function (n) { + return "resize " + n + }).style("cursor", function (n) { + return $c[n] + }).append("rect").attr("x", function (n) { + return /[ew]$/.test(n) ? -3 : null + }).attr("y", function (n) { + return /^[ns]/.test(n) ? -3 : null + }).attr("width", 6).attr("height", 6).style("visibility", "hidden"), a.style("display", n.empty() ? "none" : null); + var s, f = mo.transition(i), h = mo.transition(o); + c && (s = Bu(c), h.attr("x", s[0]).attr("width", s[1] - s[0]), e(f)), l && (s = Bu(l), h.attr("y", s[0]).attr("height", s[1] - s[0]), r(f)), t(f) + }) + } + + function t(n) { + n.selectAll(".resize").attr("transform", function (n) { + return "translate(" + s[+/e$/.test(n)] + "," + h[+/^s/.test(n)] + ")" + }) + } + + function e(n) { + n.select(".extent").attr("x", s[0]), n.selectAll(".extent,.n>rect,.s>rect").attr("width", s[1] - s[0]) + } + + function r(n) { + n.select(".extent").attr("y", h[0]), n.selectAll(".extent,.e>rect,.w>rect").attr("height", h[1] - h[0]) + } + + function u() { + function u() { + 32 == mo.event.keyCode && (N || (M = null, q[0] -= s[1], q[1] -= h[1], N = 2), f()) + } + + function g() { + 32 == mo.event.keyCode && 2 == N && (q[0] += s[1], q[1] += h[1], N = 0, f()) + } + + function v() { + var n = mo.mouse(b), u = !1; + x && (n[0] += x[0], n[1] += x[1]), N || (mo.event.altKey ? (M || (M = [(s[0] + s[1]) / 2, (h[0] + h[1]) / 2]), q[0] = s[+(n[0] < M[0])], q[1] = h[+(n[1] < M[1])]) : M = null), k && m(n, c, 0) && (e(S), u = !0), A && m(n, l, 1) && (r(S), u = !0), u && (t(S), w({ + type: "brush", + mode: N ? "move" : "resize" + })) + } + + function m(n, t, e) { + var r, u, a = Bu(t), c = a[0], l = a[1], f = q[e], g = e ? h : s, v = g[1] - g[0]; + return N && (c -= f, l -= v + f), r = (e ? d : p) ? Math.max(c, Math.min(l, n[e])) : n[e], N ? u = (r += f) + v : (M && (f = Math.max(c, Math.min(l, 2 * M[e] - r))), r > f ? (u = r, r = f) : u = f), g[0] != r || g[1] != u ? (e ? o = null : i = null, g[0] = r, g[1] = u, !0) : void 0 + } + + function y() { + v(), S.style("pointer-events", "all").selectAll(".resize").style("display", n.empty() ? "none" : null), mo.select("body").style("cursor", null), z.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), T(), w({type: "brushend"}) + } + + var M, x, b = this, _ = mo.select(mo.event.target), w = a.of(b, arguments), S = mo.select(b), E = _.datum(), + k = !/^(n|s)$/.test(E) && c, A = !/^(e|w)$/.test(E) && l, N = _.classed("extent"), T = L(), + q = mo.mouse(b), z = mo.select(_o).on("keydown.brush", u).on("keyup.brush", g); + if (mo.event.changedTouches ? z.on("touchmove.brush", v).on("touchend.brush", y) : z.on("mousemove.brush", v).on("mouseup.brush", y), S.interrupt().selectAll("*").interrupt(), N) q[0] = s[0] - q[0], q[1] = h[0] - q[1]; else if (E) { + var C = +/w$/.test(E), D = +/^n/.test(E); + x = [s[1 - C] - q[0], h[1 - D] - q[1]], q[0] = s[C], q[1] = h[D] + } else mo.event.altKey && (M = q.slice()); + S.style("pointer-events", "none").selectAll(".resize").style("display", null), mo.select("body").style("cursor", _.style("cursor")), w({type: "brushstart"}), v() + } + + var i, o, a = g(n, "brushstart", "brush", "brushend"), c = null, l = null, s = [0, 0], h = [0, 0], p = !0, + d = !0, v = Bc[0]; + return n.event = function (n) { + n.each(function () { + var n = a.of(this, arguments), t = {x: s, y: h, i: i, j: o}, e = this.__chart__ || t; + this.__chart__ = t, Oc ? mo.select(this).transition().each("start.brush", function () { + i = e.i, o = e.j, s = e.x, h = e.y, n({type: "brushstart"}) + }).tween("brush:brush", function () { + var e = kr(s, t.x), r = kr(h, t.y); + return i = o = null, function (u) { + s = t.x = e(u), h = t.y = r(u), n({type: "brush", mode: "resize"}) + } + }).each("end.brush", function () { + i = t.i, o = t.j, n({type: "brush", mode: "resize"}), n({type: "brushend"}) + }) : (n({type: "brushstart"}), n({type: "brush", mode: "resize"}), n({type: "brushend"})) + }) + }, n.x = function (t) { + return arguments.length ? (c = t, v = Bc[!c << 1 | !l], n) : c + }, n.y = function (t) { + return arguments.length ? (l = t, v = Bc[!c << 1 | !l], n) : l + }, n.clamp = function (t) { + return arguments.length ? (c && l ? (p = !!t[0], d = !!t[1]) : c ? p = !!t : l && (d = !!t), n) : c && l ? [p, d] : c ? p : l ? d : null + }, n.extent = function (t) { + var e, r, u, a, f; + return arguments.length ? (c && (e = t[0], r = t[1], l && (e = e[0], r = r[0]), i = [e, r], c.invert && (e = c(e), r = c(r)), e > r && (f = e, e = r, r = f), (e != s[0] || r != s[1]) && (s = [e, r])), l && (u = t[0], a = t[1], c && (u = u[1], a = a[1]), o = [u, a], l.invert && (u = l(u), a = l(a)), u > a && (f = u, u = a, a = f), (u != h[0] || a != h[1]) && (h = [u, a])), n) : (c && (i ? (e = i[0], r = i[1]) : (e = s[0], r = s[1], c.invert && (e = c.invert(e), r = c.invert(r)), e > r && (f = e, e = r, r = f))), l && (o ? (u = o[0], a = o[1]) : (u = h[0], a = h[1], l.invert && (u = l.invert(u), a = l.invert(a)), u > a && (f = u, u = a, a = f))), c && l ? [[e, u], [r, a]] : c ? [e, r] : l && [u, a]) + }, n.clear = function () { + return n.empty() || (s = [0, 0], h = [0, 0], i = o = null), n + }, n.empty = function () { + return !!c && s[0] == s[1] || !!l && h[0] == h[1] + }, mo.rebind(n, a, "on") + }; + var $c = { + n: "ns-resize", + e: "ew-resize", + s: "ns-resize", + w: "ew-resize", + nw: "nwse-resize", + ne: "nesw-resize", + se: "nwse-resize", + sw: "nesw-resize" + }, Bc = [["n", "e", "s", "w", "nw", "ne", "se", "sw"], ["e", "w"], ["n", "s"], []], Wc = mo.time = {}, Jc = Date, + Gc = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; + zi.prototype = { + getDate: function () { + return this._.getUTCDate() + }, getDay: function () { + return this._.getUTCDay() + }, getFullYear: function () { + return this._.getUTCFullYear() + }, getHours: function () { + return this._.getUTCHours() + }, getMilliseconds: function () { + return this._.getUTCMilliseconds() + }, getMinutes: function () { + return this._.getUTCMinutes() + }, getMonth: function () { + return this._.getUTCMonth() + }, getSeconds: function () { + return this._.getUTCSeconds() + }, getTime: function () { + return this._.getTime() + }, getTimezoneOffset: function () { + return 0 + }, valueOf: function () { + return this._.valueOf() + }, setDate: function () { + Kc.setUTCDate.apply(this._, arguments) + }, setDay: function () { + Kc.setUTCDay.apply(this._, arguments) + }, setFullYear: function () { + Kc.setUTCFullYear.apply(this._, arguments) + }, setHours: function () { + Kc.setUTCHours.apply(this._, arguments) + }, setMilliseconds: function () { + Kc.setUTCMilliseconds.apply(this._, arguments) + }, setMinutes: function () { + Kc.setUTCMinutes.apply(this._, arguments) + }, setMonth: function () { + Kc.setUTCMonth.apply(this._, arguments) + }, setSeconds: function () { + Kc.setUTCSeconds.apply(this._, arguments) + }, setTime: function () { + Kc.setTime.apply(this._, arguments) + } + }; + var Kc = Date.prototype, Qc = "%a %b %e %X %Y", nl = "%m/%d/%Y", tl = "%H:%M:%S", + el = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + rl = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + ul = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + il = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + Wc.year = Ci(function (n) { + return n = Wc.day(n), n.setMonth(0, 1), n + }, function (n, t) { + n.setFullYear(n.getFullYear() + t) + }, function (n) { + return n.getFullYear() + }), Wc.years = Wc.year.range, Wc.years.utc = Wc.year.utc.range, Wc.day = Ci(function (n) { + var t = new Jc(2e3, 0); + return t.setFullYear(n.getFullYear(), n.getMonth(), n.getDate()), t + }, function (n, t) { + n.setDate(n.getDate() + t) + }, function (n) { + return n.getDate() - 1 + }), Wc.days = Wc.day.range, Wc.days.utc = Wc.day.utc.range, Wc.dayOfYear = function (n) { + var t = Wc.year(n); + return Math.floor((n - t - 6e4 * (n.getTimezoneOffset() - t.getTimezoneOffset())) / 864e5) + }, Gc.forEach(function (n, t) { + n = n.toLowerCase(), t = 7 - t; + var e = Wc[n] = Ci(function (n) { + return (n = Wc.day(n)).setDate(n.getDate() - (n.getDay() + t) % 7), n + }, function (n, t) { + n.setDate(n.getDate() + 7 * Math.floor(t)) + }, function (n) { + var e = Wc.year(n).getDay(); + return Math.floor((Wc.dayOfYear(n) + (e + t) % 7) / 7) - (e !== t) + }); + Wc[n + "s"] = e.range, Wc[n + "s"].utc = e.utc.range, Wc[n + "OfYear"] = function (n) { + var e = Wc.year(n).getDay(); + return Math.floor((Wc.dayOfYear(n) + (e + t) % 7) / 7) + } + }), Wc.week = Wc.sunday, Wc.weeks = Wc.sunday.range, Wc.weeks.utc = Wc.sunday.utc.range, Wc.weekOfYear = Wc.sundayOfYear, Wc.format = ji; + var ol = Hi(el), al = Fi(el), cl = Hi(rl), ll = Fi(rl), sl = Hi(ul), fl = Fi(ul), hl = Hi(il), gl = Fi(il), + pl = /^%/, dl = {"-": "", _: " ", 0: "0"}, vl = { + a: function (n) { + return rl[n.getDay()] + }, A: function (n) { + return el[n.getDay()] + }, b: function (n) { + return il[n.getMonth()] + }, B: function (n) { + return ul[n.getMonth()] + }, c: ji(Qc), d: function (n, t) { + return Pi(n.getDate(), t, 2) + }, e: function (n, t) { + return Pi(n.getDate(), t, 2) + }, H: function (n, t) { + return Pi(n.getHours(), t, 2) + }, I: function (n, t) { + return Pi(n.getHours() % 12 || 12, t, 2) + }, j: function (n, t) { + return Pi(1 + Wc.dayOfYear(n), t, 3) + }, L: function (n, t) { + return Pi(n.getMilliseconds(), t, 3) + }, m: function (n, t) { + return Pi(n.getMonth() + 1, t, 2) + }, M: function (n, t) { + return Pi(n.getMinutes(), t, 2) + }, p: function (n) { + return n.getHours() >= 12 ? "PM" : "AM" + }, S: function (n, t) { + return Pi(n.getSeconds(), t, 2) + }, U: function (n, t) { + return Pi(Wc.sundayOfYear(n), t, 2) + }, w: function (n) { + return n.getDay() + }, W: function (n, t) { + return Pi(Wc.mondayOfYear(n), t, 2) + }, x: ji(nl), X: ji(tl), y: function (n, t) { + return Pi(n.getFullYear() % 100, t, 2) + }, Y: function (n, t) { + return Pi(n.getFullYear() % 1e4, t, 4) + }, Z: ao, "%": function () { + return "%" + } + }, ml = { + a: Oi, + A: Ri, + b: Zi, + B: Vi, + c: Xi, + d: no, + e: no, + H: eo, + I: eo, + j: to, + L: io, + m: Qi, + M: ro, + p: oo, + S: uo, + U: Ii, + w: Yi, + W: Ui, + x: $i, + X: Bi, + y: Ji, + Y: Wi, + Z: Gi, + "%": co + }, yl = /^\s*\d+/, Ml = mo.map({am: 0, pm: 1}); + ji.utc = lo; + var xl = lo("%Y-%m-%dT%H:%M:%S.%LZ"); + ji.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? so : xl, so.parse = function (n) { + var t = new Date(n); + return isNaN(t) ? null : t + }, so.toString = xl.toString, Wc.second = Ci(function (n) { + return new Jc(1e3 * Math.floor(n / 1e3)) + }, function (n, t) { + n.setTime(n.getTime() + 1e3 * Math.floor(t)) + }, function (n) { + return n.getSeconds() + }), Wc.seconds = Wc.second.range, Wc.seconds.utc = Wc.second.utc.range, Wc.minute = Ci(function (n) { + return new Jc(6e4 * Math.floor(n / 6e4)) + }, function (n, t) { + n.setTime(n.getTime() + 6e4 * Math.floor(t)) + }, function (n) { + return n.getMinutes() + }), Wc.minutes = Wc.minute.range, Wc.minutes.utc = Wc.minute.utc.range, Wc.hour = Ci(function (n) { + var t = n.getTimezoneOffset() / 60; + return new Jc(36e5 * (Math.floor(n / 36e5 - t) + t)) + }, function (n, t) { + n.setTime(n.getTime() + 36e5 * Math.floor(t)) + }, function (n) { + return n.getHours() + }), Wc.hours = Wc.hour.range, Wc.hours.utc = Wc.hour.utc.range, Wc.month = Ci(function (n) { + return n = Wc.day(n), n.setDate(1), n + }, function (n, t) { + n.setMonth(n.getMonth() + t) + }, function (n) { + return n.getMonth() + }), Wc.months = Wc.month.range, Wc.months.utc = Wc.month.utc.range; + var bl = [1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6], + _l = [[Wc.second, 1], [Wc.second, 5], [Wc.second, 15], [Wc.second, 30], [Wc.minute, 1], [Wc.minute, 5], [Wc.minute, 15], [Wc.minute, 30], [Wc.hour, 1], [Wc.hour, 3], [Wc.hour, 6], [Wc.hour, 12], [Wc.day, 1], [Wc.day, 2], [Wc.week, 1], [Wc.month, 1], [Wc.month, 3], [Wc.year, 1]], + wl = [[ji("%Y"), Vt], [ji("%B"), function (n) { + return n.getMonth() + }], [ji("%b %d"), function (n) { + return 1 != n.getDate() + }], [ji("%a %d"), function (n) { + return n.getDay() && 1 != n.getDate() + }], [ji("%I %p"), function (n) { + return n.getHours() + }], [ji("%I:%M"), function (n) { + return n.getMinutes() + }], [ji(":%S"), function (n) { + return n.getSeconds() + }], [ji(".%L"), function (n) { + return n.getMilliseconds() + }]], Sl = go(wl); + _l.year = Wc.year, Wc.scale = function () { + return fo(mo.scale.linear(), _l, Sl) + }; + var El = { + range: function (n, t, e) { + return mo.range(+n, +t, e).map(ho) + } + }, kl = _l.map(function (n) { + return [n[0].utc, n[1]] + }), Al = [[lo("%Y"), Vt], [lo("%B"), function (n) { + return n.getUTCMonth() + }], [lo("%b %d"), function (n) { + return 1 != n.getUTCDate() + }], [lo("%a %d"), function (n) { + return n.getUTCDay() && 1 != n.getUTCDate() + }], [lo("%I %p"), function (n) { + return n.getUTCHours() + }], [lo("%I:%M"), function (n) { + return n.getUTCMinutes() + }], [lo(":%S"), function (n) { + return n.getUTCSeconds() + }], [lo(".%L"), function (n) { + return n.getUTCMilliseconds() + }]], Nl = go(Al); + return kl.year = Wc.year.utc, Wc.scale.utc = function () { + return fo(mo.scale.linear(), kl, Nl) + }, mo.text = vt(function (n) { + return n.responseText + }), mo.json = function (n, t) { + return mt(n, "application/json", po, t) + }, mo.html = function (n, t) { + return mt(n, "text/html", vo, t) + }, mo.xml = vt(function (n) { + return n.responseXML + }), mo +}(); diff --git a/static/js/plugins/simditor/jquery.min.js b/static/js/plugins/simditor/jquery.min.js index 9c71568d82c9c3aa6ee9625a7005840eead16640..f7b0ae37b8f22e53426214bfc4fe35daafad91ac 100644 --- a/static/js/plugins/simditor/jquery.min.js +++ b/static/js/plugins/simditor/jquery.min.js @@ -1,5 +1,2444 @@ /*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
    ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) -},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("',"
    ","
    "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

    ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

    "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

    "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

      ','
    • ','','
      ','',"
      ","
    • ",'
    • ','','
      ','",'","
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
  • '+e+'
  • ')}),'
      '+t.join("")+"
    "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
      ','
    • ','','
      ','","
      ","
    • ",'
    • ','','
      ','',"
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/layer.js b/static/public/user/layui-v2.5.6/layui/lay/modules/layer.js new file mode 100644 index 0000000000000000000000000000000000000000..03e780cbdbc076295400e5b7a574604be78f6a45 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/layer.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
    '+(f?r.title[0]:r.title)+"
    ":"";return r.zIndex=s,t([r.shade?'
    ':"",'
    '+(e&&2!=r.type?"":u)+'
    '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
    '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
    '+e+"
    "}():"")+(r.resize?'':"")+"
    "],u,i('
    ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
      '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
    • '+(t[0].content||"no content")+"
    • ";i'+(t[i].content||"no content")+"";return a}()+"
    ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
    '+(u.length>1?'':"")+'
    '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
    ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/laypage.js b/static/public/user/layui-v2.5.6/layui/lay/modules/laypage.js new file mode 100644 index 0000000000000000000000000000000000000000..2e2ab0dfd3da0ad3eca6a9897d3c95554121cb51 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/laypage.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/laytpl.js b/static/public/user/layui-v2.5.6/layui/lay/modules/laytpl.js new file mode 100644 index 0000000000000000000000000000000000000000..11cc3c4b1446838b00b5aca9d98bd920d11aa574 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/laytpl.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/mobile.js b/static/public/user/layui-v2.5.6/layui/lay/modules/mobile.js new file mode 100644 index 0000000000000000000000000000000000000000..ebda60108534f27b9da0e03cf69326e815b5feb0 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/mobile.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define(function(i){i("layui.mobile",layui.v)});layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var t=(window,document),i="querySelectorAll",n="getElementsByClassName",a=function(e){return t[i](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var i in e)t[i]=e[i];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var o=0,r=["layui-m-layer"],d=function(e){var t=this;t.config=l.extend(e),t.view()};d.prototype.view=function(){var e=this,i=e.config,s=t.createElement("div");e.id=s.id=r[0]+o,s.setAttribute("class",r[0]+" "+r[0]+(i.type||0)),s.setAttribute("index",o);var l=function(){var e="object"==typeof i.title;return i.title?'

    '+(e?i.title[0]:i.title)+"

    ":""}(),d=function(){"string"==typeof i.btn&&(i.btn=[i.btn]);var e,t=(i.btn||[]).length;return 0!==t&&i.btn?(e=''+i.btn[0]+"",2===t&&(e=''+i.btn[1]+""+e),'
    '+e+"
    "):""}();if(i.fixed||(i.top=i.hasOwnProperty("top")?i.top:100,i.style=i.style||"",i.style+=" top:"+(t.body.scrollTop+i.top)+"px"),2===i.type&&(i.content='

    '+(i.content||"")+"

    "),i.skin&&(i.anim="up"),"msg"===i.skin&&(i.shade=!1),s.innerHTML=(i.shade?"
    ':"")+'
    "+l+'
    '+i.content+"
    "+d+"
    ",!i.type||2===i.type){var y=t[n](r[0]+i.type),u=y.length;u>=1&&c.close(y[0].getAttribute("index"))}document.body.appendChild(s);var m=e.elem=a("#"+e.id)[0];i.success&&i.success(m),e.index=o++,e.action(i,m)},d.prototype.action=function(e,t){var i=this;e.time&&(l.timer[i.index]=setTimeout(function(){c.close(i.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),c.close(i.index)):e.yes?e.yes(i.index):c.close(i.index)};if(e.btn)for(var s=t[n]("layui-m-layerbtn")[0].children,o=s.length,r=0;r0&&e-1 in t)}function s(t){return A.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||k[c(t)]?e:e+"px"}function h(t){var e,n;return $[t]||(e=L.createElement(t),L.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),$[t]=n),$[t]}function p(t){return"children"in t?D.call(t.children):T.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function d(t,e){var n,r=t?t.length:0;for(n=0;n]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/^(?:body|html)$/i,q=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],V=L.createElement("table"),_=L.createElement("tr"),B={tr:L.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:_,th:_,"*":L.createElement("div")},U=/complete|loaded|interactive/,X=/^[\w-]*$/,J={},W=J.toString,Y={},G=L.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=G).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&G.removeChild(t),r},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return A.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,a;return R.test(t)&&(r=T(L.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(z,"<$1>")),e===E&&(e=M.test(t)&&RegExp.$1),e in B||(e="*"),a=B[e],a.innerHTML=""+t,r=T.each(D.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(i=T(r),T.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return new d(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}else{if(e(t))return T(L).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(i(t))r=[t],t=null;else if(M.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}}return Y.Z(r,t)},T=function(t,e){return Y.init(t,e)},T.extend=function(t){var e,n=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){m(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,a=X.test(o);return t.getElementById&&a&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(a&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=L.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=Q,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},T.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},T.camelCase=C,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.noop=function(){},T.map=function(t,e){var n,r,i,o=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(A.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return T(N(this.concat(T(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?D.call(t):T(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return i(t)?T.contains(this,t):T(this).find(t).size()})},eq:function(t){return t===-1?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return O.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):T()},closest:function(t,e){var n=[],i="object"==typeof t&&T(t);return this.each(function(o,a){for(;a&&!(i?i.indexOf(a)>=0:Y.matches(a,t));)a=a!==e&&!r(a)&&a.parentNode;a&&n.indexOf(a)<0&&n.push(a)}),T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){if((t=t.parentNode)&&!r(t)&&e.indexOf(t)<0)return e.push(t),t});return v(e,t)},parent:function(t){return v(N(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return A.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=T(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=T(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(j in t)y(this,j,t[j]);else y(this,t,g(this,e,n,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=K[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var n="data-"+t.replace(q,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=g(this,t,e,this.value)})):this[0]&&(this[0].multiple?T(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=T(this),r=g(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(L.documentElement!==this[0]&&!T.contains(L.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r=this[0];if("string"==typeof e){if(!r)return;return r.style[C(e)]||getComputedStyle(r,"").getPropertyValue(e)}if(Q(e)){if(!r)return;var i={},o=getComputedStyle(r,"");return T.each(e,function(t,e){i[e]=r.style[C(e)]||o.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(j in e)e[j]||0===e[j]?a+=c(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(c(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&O.some.call(this,function(t){return this.test(x(t))},l(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){S=[];var n=x(this),r=g(this,t,e,n);r.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||S.push(t)},this),S.length&&x(this,n+(n?" ":"")+S.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return x(this,"");S=x(this),g(this,t,e,S).split(/\s+/g).forEach(function(t){S=S.replace(l(t)," ")}),x(this,S.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=g(this,t,n,x(this));i.split(/\s+/g).forEach(function(t){(e===E?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===E?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=Z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,r.top+=parseFloat(T(e[0]).css("border-top-width"))||0,r.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||L.body;t&&!Z.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(i){var o,a=this[0];return i===E?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=T(this),a.css(t,g(this,i,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,o=T.map(arguments,function(n){var r=[];return e=t(n),"array"==e?(n.forEach(function(t){return t.nodeType!==E?r.push(t):T.zepto.isZ(t)?r=r.concat(t.get()):void(r=r.concat(Y.fragment(t)))}),r):"object"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=T.contains(L.documentElement,i);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),s&&w(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},T.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),Y.Z.prototype=d.prototype=T.fn,Y.uniq=N,Y.deserializeValue=b,T.zepto=Y,T}();!function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=r(n),n.ns)var s=i(n.ns);return(v[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!o||e(t.fn)===e(o))&&(!a||t.sel==a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in x||!!e}function a(t){return b[t]||y&&x[t]||t}function s(n,i,s,u,l,h,p){var d=e(n),m=v[d]||(v[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var i=r(e);i.fn=s,i.sel=l,i.e in b&&(s=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return i.fn.apply(this,arguments)}),i.del=h;var d=h||s;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=m.length,m.push(i),"addEventListener"in n&&n.addEventListener(a(i.e),i.proxy,o(i,p))})}function u(t,r,i,s,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,s).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return!n&&e.isDefaultPrevented||(n||(n=e),t.each(T,function(t,r){var i=n[t];e[t]=function(){return this[r]=w,i&&i.apply(n,arguments)},e[r]=E}),e.timeStamp||(e.timeStamp=Date.now()),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,m=function(t){return"string"==typeof t},v={},g={},y="onfocusin"in window,x={focus:"focusin",blur:"focusout"},b={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(m(n)||d(i)||i===!1||(i=r,r=n,n=f),i!==f&&r!==!1||(i=r,r=f),i===!1&&(i=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);if(o&&o!==h)return r=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||i).apply(o,[r].concat(p.call(arguments,1)))}),s(h,e,i,r,n,c||a)}))},t.fn.off=function(e,n,r){var i=this;return e&&!m(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(m(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=E),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in x&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(a,s){i=l(m(e)?t.Event(e):e),i._args=r,i.target=s,t.each(n(s,e.type||e),function(t,e){if(o=e.proxy(i),i.isImmediatePropagationStopped())return!1})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){m(t)||(e=t,t=e.type);var n=document.createEvent(g[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(e),function(t){function e(e,n,r){var i=t.Event(n);return t(e).trigger(i,r),!i.isDefaultPrevented()}function n(t,n,r,i){if(t.global)return e(n||x,r,i)}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var r=e.context;return e.beforeSend.call(r,t,e)!==!1&&n(e,r,"ajaxBeforeSend",[t,e])!==!1&&void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,i){var o=r.context,a="success";r.success.call(o,t,a,e),i&&i.resolveWith(o,[t,a,e]),n(r,o,"ajaxSuccess",[e,r,t]),u(a,e,r)}function s(t,e,r,i,o){var a=i.context;i.error.call(a,r,e,t),o&&o.rejectWith(a,[r,e,t]),n(i,a,"ajaxError",[r,i,t||e]),u(e,r,i)}function u(t,e,r){var o=r.context;r.complete.call(o,e,t),n(r,o,"ajaxComplete",[e,r]),i(r)}function c(t,e,n){if(n.dataFilter==l)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function l(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==j?"json":w.test(t)?"script":E.test(t)&&"xml")||"text"}function h(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function d(e,n,r,i){return t.isFunction(n)&&(i=r,r=n,n=void 0),t.isFunction(r)||(i=r,r=void 0),{url:e,data:n,success:r,dataType:i}}function m(e,n,r,i){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),i&&(n=r?i:i+"["+(s||"object"==o||"array"==o?n:"")+"]"),!i&&a?e.add(u.name,u.value):"array"==o||!r&&"object"==o?m(e,u,r,n):e.add(n,u)})}var v,g,y=+new Date,x=window.document,b=/)<[^<]*)*<\/script>/gi,w=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,j="application/json",T="text/html",S=/^\s*$/,C=x.createElement("a");C.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,i,u=e.jsonpCallback,c=(t.isFunction(u)?u():u)||"Zepto"+y++,l=x.createElement("script"),f=window[c],h=function(e){t(l).triggerHandler("error",e||"abort")},p={abort:h};return n&&n.promise(p),t(l).on("load error",function(o,u){clearTimeout(i),t(l).off().remove(),"error"!=o.type&&r?a(r[0],p,e,n):s(null,u||"error",p,e,n),window[c]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),o(p,e)===!1?(h("abort"),p):(window[c]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),x.head.appendChild(l),e.timeout>0&&(i=setTimeout(function(){h("timeout")},e.timeout)),p)},t.ajaxSettings={type:"GET",beforeSend:l,success:l,error:l,complete:l,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:j,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:l},t.ajax=function(e){var n,i,u=t.extend({},e||{}),d=t.Deferred&&t.Deferred();for(v in t.ajaxSettings)void 0===u[v]&&(u[v]=t.ajaxSettings[v]);r(u),u.crossDomain||(n=x.createElement("a"),n.href=u.url,n.href=n.href,u.crossDomain=C.protocol+"//"+C.host!=n.protocol+"//"+n.host),u.url||(u.url=window.location.toString()),(i=u.url.indexOf("#"))>-1&&(u.url=u.url.slice(0,i)),p(u);var m=u.dataType,y=/\?.+=\?/.test(u.url);if(y&&(m="jsonp"),u.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(u.url=h(u.url,"_="+Date.now())),"jsonp"==m)return y||(u.url=h(u.url,u.jsonp?u.jsonp+"=?":u.jsonp===!1?"":"callback=?")),t.ajaxJSONP(u,d);var b,w=u.accepts[m],E={},j=function(t,e){E[t.toLowerCase()]=[t,e]},T=/^([\w-]+:)\/\//.test(u.url)?RegExp.$1:window.location.protocol,N=u.xhr(),O=N.setRequestHeader;if(d&&d.promise(N),u.crossDomain||j("X-Requested-With","XMLHttpRequest"),j("Accept",w||"*/*"),(w=u.mimeType||w)&&(w.indexOf(",")>-1&&(w=w.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(w)),(u.contentType||u.contentType!==!1&&u.data&&"GET"!=u.type.toUpperCase())&&j("Content-Type",u.contentType||"application/x-www-form-urlencoded"),u.headers)for(g in u.headers)j(g,u.headers[g]);if(N.setRequestHeader=j,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=l,clearTimeout(b);var e,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==T){if(m=m||f(u.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)e=N.response;else{e=N.responseText;try{e=c(e,m,u),"script"==m?(0,eval)(e):"xml"==m?e=N.responseXML:"json"==m&&(e=S.test(e)?null:t.parseJSON(e))}catch(r){n=r}if(n)return s(n,"parsererror",N,u,d)}a(e,N,u,d)}else s(N.statusText||null,N.status?"error":"abort",N,u,d)}},o(N,u)===!1)return N.abort(),s(null,"abort",N,u,d),N;var P=!("async"in u)||u.async;if(N.open(u.type,u.url,P,u.username,u.password),u.xhrFields)for(g in u.xhrFields)N[g]=u.xhrFields[g];for(g in E)O.apply(N,E[g]);return u.timeout>0&&(b=setTimeout(function(){N.onreadystatechange=l,N.abort(),s(null,"timeout",N,u,d)},u.timeout)),N.send(u.data?u.data:null),N},t.get=function(){return t.ajax(d.apply(null,arguments))},t.post=function(){var e=d.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=d.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var i,o=this,a=e.split(/\s/),s=d(e,n,r),u=s.success;return a.length>1&&(s.url=a[0],i=a[1]),s.success=function(e){o.html(i?t("
    ").html(e.replace(b,"")).find(i):e),u&&u.apply(o,arguments)},t.ajax(s),this};var N=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(e)+"="+N(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,n){try{return e(t,n)}catch(r){return null}}}}(),t("zepto",e)});layui.define(function(i){i("layim-mobile",layui.v)});layui["layui.mobile"]||layui.config({base:layui.cache.dir+"lay/modules/mobile/"}).extend({"layer-mobile":"layer-mobile",zepto:"zepto","upload-mobile":"upload-mobile","layim-mobile":"layim-mobile"}),layui.define(["layer-mobile","zepto","layim-mobile"],function(l){l("mobile",{layer:layui["layer-mobile"],layim:layui["layim-mobile"]})}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/rate.js b/static/public/user/layui-v2.5.6/layui/lay/modules/rate.js new file mode 100644 index 0000000000000000000000000000000000000000..7feef3449bff309c53065f6b768a7a8bb755dd39 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/rate.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
      ",u=1;u<=i.length;u++){var r='
    • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
    • ":n+=r}n+="
    "+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/slider.js b/static/public/user/layui-v2.5.6/layui/lay/modules/slider.js new file mode 100644 index 0000000000000000000000000000000000000000..6f824a9eeacc757a6601607067bf97b8d7bd1e0e --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/slider.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
    '+(t.tips?'
    ':"")+'
    '+(t.range?'
    ':"")+"
    ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
    ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
    ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
    f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/table.js b/static/public/user/layui-v2.5.6/layui/lay/modules/table.js new file mode 100644 index 0000000000000000000000000000000000000000..0882b71627e693b6dd20f52f67e61012e6e58f53 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/table.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define(["laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=(layui.util,layui.hint()),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,y,e,t)}},c=function(){var e=this,t=e.config,i=t.id||t.index;return i&&(c.that[i]=e,c.config[i]=t),{config:t,reload:function(t){e.reload.call(e,t)},setColsWidth:function(){e.setColsWidth.call(e)},resize:function(){e.resize.call(e)}}},s=function(e){var t=c.config[e];return t||o.error("The ID option was not found in the table instance"),t||null},u=function(e,a,l,n){var o=e.templet?function(){return"function"==typeof e.templet?e.templet(l):i(t(e.templet).html()||String(a)).render(l)}():a;return n?t("
    "+o+"
    ").text():o},y="table",h=".layui-table",f="layui-hide",p="layui-none",v="layui-table-view",m=".layui-table-tool",g=".layui-table-box",b=".layui-table-init",x=".layui-table-header",k=".layui-table-body",C=".layui-table-main",w=".layui-table-fixed",T=".layui-table-fixed-l",A=".layui-table-fixed-r",L=".layui-table-total",N=".layui-table-page",S=".layui-table-sort",R="layui-table-edit",W="layui-table-hover",_=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
    ','
    ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
    ","
    "].join("")},E=['',"","
    "].join(""),z=['
    ',"{{# if(d.data.toolbar){ }}",'
    ','
    ','
    ',"
    ","{{# } }}",'
    ',"{{# if(d.data.loading){ }}",'
    ','',"
    ","{{# } }}","{{# var left, right; }}",'
    ',_(),"
    ",'
    ',E,"
    ","{{# if(left){ }}",'
    ','
    ',_({fixed:!0}),"
    ",'
    ',E,"
    ","
    ","{{# }; }}","{{# if(right){ }}",'
    ','
    ',_({fixed:"right"}),'
    ',"
    ",'
    ',E,"
    ","
    ","{{# }; }}","
    ","{{# if(d.data.totalRow){ }}",'
    ','','',"
    ","
    ","{{# } }}","{{# if(d.data.page){ }}",'
    ','
    ',"
    ","{{# } }}","","
    "].join(""),H=t(window),j=t(document),F=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};F.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],autoSort:!0,text:{none:"无数据"}},F.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id")||e.index,a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",totalRowName:"totalRow",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;a.height&&/^full-\d+$/.test(a.height)&&(e.fullHeightGap=a.height.split("-")[1],a.height=H.height()-e.fullHeightGap),e.setInit();var l=a.elem,n=l.next("."+v),o=e.elem=t(i(z).render({VIEW_CLASS:v,data:a,index:e.index}));if(a.index=e.index,e.key=a.id||a.index,n[0]&&n.remove(),l.after(o),e.layTool=o.find(m),e.layBox=o.find(g),e.layHeader=o.find(x),e.layMain=o.find(C),e.layBody=o.find(k),e.layFixed=o.find(w),e.layFixLeft=o.find(T),e.layFixRight=o.find(A),e.layTotal=o.find(L),e.layPage=o.find(N),e.renderToolbar(),e.fullSize(),a.cols.length>1){var r=e.layFixed.find(x).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},F.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},F.prototype.setInit=function(e){var t=this,i=t.config;return i.clientWidth=i.width||function(){var e=function(t){var a,l;t=t||i.elem.parent(),a=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||a&&!l?a:e(t.parent())};return e()}(),"width"===e?i.clientWidth:void layui.each(i.cols,function(e,a){layui.each(a,function(l,n){if(!n)return void a.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(i.cols[e+1],function(t,i){i.HAS_PARENT||o>1&&o==n.colspan||(i.HAS_PARENT=!0,i.parentKey=e+"-"+l,o+=parseInt(i.colspan>1?i.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},F.prototype.renderToolbar=function(){var e=this,a=e.config,l=['
    ','
    ','
    '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===a.toolbar)n.html(l);else if("string"==typeof a.toolbar){var o=t(a.toolbar).html()||"";o&&n.html(i(o).render(a))}var r={filter:{title:"筛选列",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"导出",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"打印",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof a.defaultToolbar&&layui.each(a.defaultToolbar,function(e,t){var i="string"==typeof t?r[t]:t;i&&d.push('
    ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},F.prototype.setParentCol=function(e,t){var i=this,a=i.config,l=i.layHeader.find('th[data-key="'+a.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=a.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](f),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&i.setParentCol(e,d)}},F.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,i){layui.each(i,function(t,i){i.hide&&e.setParentCol(i.hide,i.parentKey)})})},F.prototype.setColsWidth=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||i++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:i+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(i,r){layui.each(r,function(i,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&a&&(l=(o-n)/a)};r(),r(!0),e.autoColNums=a,e.eachCols(function(i,a){var n=a.minWidth||t.cellMinWidth;a.colGroup||a.hide||(0===a.width?e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(a.width)&&e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(parseFloat(a.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-i&&d<=i){var c=function(t){var i;return t=t||e.layHeader.eq(0).find("thead th:last-child"),i=t.data("field"),!i&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var i=t.style.width||s.outerWidth();t.style.width=parseFloat(i)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},F.prototype.resize=function(){var e=this;e.fullSize(),e.setColsWidth(),e.scrollPatch()},F.prototype.reload=function(e){var i=this;e=e||{},delete i.haveInit,e.data&&e.data.constructor===Array&&delete i.config.data,i.config=t.extend(!0,{},i.config,e),i.render()},F.prototype.errorView=function(e){var i=this,a=i.layMain.find("."+p),l=t('
    '+(e||"Error")+"
    ");a[0]&&(i.layNone.remove(),a.remove()),i.layFixed.addClass(f),i.layMain.find("tbody").html(""),i.layMain.append(i.layNone=l),d.cache[i.key]=[]},F.prototype.page=1,F.prototype.pullData=function(e){var i=this,a=i.config,l=a.request,n=a.response,o=function(){"object"==typeof a.initSort&&i.sort(a.initSort.field,a.initSort.type)};if(i.startTime=(new Date).getTime(),a.url){var r={};r[l.pageName]=e,r[l.limitName]=a.limit;var d=t.extend(r,a.where);a.contentType&&0==a.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),i.loading(),t.ajax({type:a.method||"get",url:a.url,contentType:a.contentType,data:d,dataType:"json",headers:a.headers||{},success:function(t){"function"==typeof a.parseData&&(t=a.parseData(t)||t),t[n.statusName]!=n.statusCode?(i.renderForm(),i.errorView(t[n.msgName]||'返回的数据不符合规范,正确的成功状态码应为:"'+n.statusName+'": '+n.statusCode)):(i.renderData(t,e,t[n.countName]),o(),a.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof a.done&&a.done(t,e,t[n.countName])},error:function(e,t){i.errorView("数据接口请求异常:"+t),i.renderForm(),i.setColsWidth()}})}else if(a.data&&a.data.constructor===Array){var c={},s=e*a.limit-a.limit;c[n.dataName]=a.data.concat().splice(s,a.limit),c[n.countName]=a.data.length,"object"==typeof a.totalRow&&(c[n.totalRowName]=t.extend({},a.totalRow)),i.renderData(c,e,c[n.countName]),o(),i.setColsWidth(),"function"==typeof a.done&&a.done(c,e,c[n.countName])}},F.prototype.eachCols=function(e){var t=this;return d.eachCols(null,e,t.config.cols),t},F.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,y=e[s.response.dataName]||[],h=e[s.response.totalRowName],v=[],m=[],g=[],b=function(){var e;return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(y,function(a,l){var o=[],y=[],h=[],p=a+s.limit*(n-1)+1;0!==l.length&&(r||(l[d.config.indexName]=a),c.eachCols(function(n,r){var c=r.field||n,v=s.index+"-"+r.key,m=l[c];if(void 0!==m&&null!==m||(m=""),!r.colGroup){var g=['','
    '+function(){var n=t.extend(!0,{LAY_INDEX:p},l),o=d.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=a),'';case"numbers":return p}return r.toolbar?i(t(r.toolbar).html()||"").render(n):u(r,m,n)}(),"
    "].join("");o.push(g),r.fixed&&"right"!==r.fixed&&y.push(g),"right"===r.fixed&&h.push(g)}}),v.push(''+o.join("")+""),m.push(''+y.join("")+""),g.push(''+h.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+p).remove(),c.layMain.find("tbody").html(v.join("")),c.layFixLeft.find("tbody").html(m.join("")),c.layFixRight.find("tbody").html(g.join("")),c.renderForm(),"number"==typeof e&&c.setThisRowChecked(e),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,l.close(c.tipsIndex),s.HAS_SET_COLS_PATCH||c.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return d.cache[c.key]=y,c.layPage[0==o||0===y.length&&1==n?"addClass":"removeClass"](f),r?b():0===y.length?(c.renderForm(),c.errorView(s.text.none)):(c.layFixed.removeClass(f),b(),c.renderTotal(y,h),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr))}},s.page),s.page.count=o,a.render(s.page))))},F.prototype.renderTotal=function(e,t){var i=this,a=i.config,l={};if(a.totalRow){layui.each(e,function(e,t){0!==t.length&&i.eachCols(function(e,i){var a=i.field||e,n=t[a];i.totalRow&&(l[a]=(l[a]||0)+(parseFloat(n)||0))})}),i.dataTotal={};var n=[];i.eachCols(function(e,o){var r=o.field||e,d=function(){var e=o.totalRowText||"",i=parseFloat(l[r]).toFixed(2),a={};return a[r]=i,i=u(o,i,a),t?t[o.field]||e:o.totalRow?i||e:e}(),c=['','
    '+d,"
    "].join("");o.field&&(i.dataTotal[r]=d),n.push(c)}),i.layTotal.find("tbody").html(""+n.join("")+"")}},F.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},F.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},F.prototype.setThisRowChecked=function(e){var t=this,i=(t.config,"layui-table-click"),a=t.layBody.find('tr[data-index="'+e+'"]');a.addClass(i).siblings("tr").removeClass(i)},F.prototype.sort=function(e,i,a,l){var n,r,c=this,s={},u=c.config,h=u.elem.attr("lay-filter"),f=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field"),p=e.data("key");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var v=c.layHeader.find("th .laytable-cell-"+p).find(S);c.layHeader.find("th").find(S).removeAttr("lay-sort"),v.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},u.autoSort&&("asc"===i?r=layui.sort(f,n):"desc"===i?r=layui.sort(f,n,!0):(r=layui.sort(f,d.config.indexName),delete c.sortKey)),s[u.response.dataName]=r||f,c.renderData(s,c.page,c.count,!0),l&&layui.event.call(e,y,"sort("+h+")",{field:n,type:i})},F.prototype.loading=function(e){var i=this,a=i.config;a.loading&&(e?(i.layInit&&i.layInit.remove(),delete i.layInit,i.layBox.find(b).remove()):(i.layInit=t(['
    ','',"
    "].join("")),i.layBox.append(i.layInit)))},F.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},F.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},F.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(i,a){if(a.selectorText===".laytable-cell-"+e)return t(a),!0})},F.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=H.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),a&&(e=parseFloat(a)-(t.layHeader.outerHeight()||38),i.toolbar&&(e-=t.layTool.outerHeight()||50),i.totalRow&&(e-=t.layTotal.outerHeight()||40),i.page&&(e-=t.layPage.outerHeight()||41),t.layMain.css("height",e-2))},F.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},F.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),i.outerWidth()-e.layMain.width()),o=function(e){if(a&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var i=t('
    ');i.find("div").css({width:a}),e.find("tr").append(i)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(k).css("height",i.height()>=d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](f),e.layFixRight.css("right",a-1)},F.prototype.events=function(){var e,i=this,a=i.config,o=t("body"),c={},s=i.layHeader.find("th"),h=".layui-table-cell",p=a.elem.attr("lay-filter");i.layTool.on("click","*[lay-event]",function(e){var o=t(this),c=o.attr("lay-event"),s=function(e){var l=t(e.list),n=t('
      ');n.html(l),a.height&&n.css("max-height",a.height-(i.layTool.outerHeight()||50)),o.find(".layui-table-tool-panel")[0]||o.append(n),i.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),j.trigger("table.tool.panel.remove"),l.close(i.tipsIndex),c){case"LAYTABLE_COLS":s({list:function(){var e=[];return i.eachCols(function(t,i){i.field&&"normal"==i.type&&e.push('
    • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var l=t(e.elem),n=this.checked,o=l.data("key"),r=l.data("parentkey");layui.each(a.cols,function(e,t){layui.each(t,function(t,l){if(e+"-"+t===o){var d=l.hide;l.hide=!n,i.elem.find('*[data-key="'+a.index+"-"+o+'"]')[n?"removeClass":"addClass"](f),d!=l.hide&&i.setParentCol(!n,r),i.resize()}})})})}});break;case"LAYTABLE_EXPORT":r.ie?l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出",this,{tips:3}):s({list:function(){return['
    • 导出到 Csv 文件
    • ','
    • 导出到 Excel 文件
    • '].join("")}(),done:function(e,l){l.on("click",function(){var e=t(this).data("type");d.exportFile.call(i,a.id,null,e)})}});break;case"LAYTABLE_PRINT":var u=window.open("打印窗口","_blank"),h=[""].join(""),v=t(i.layHeader.html());v.append(i.layMain.find("table").html()),v.append(i.layTotal.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),u.document.write(h+v.prop("outerHTML")),u.document.close(),u.print(),u.close()}layui.event.call(this,y,"toolbar("+p+")",t.extend({event:c,config:a},{}))}),s.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.data("unresize")||c.resizeStart||(c.allowResize=i.width()-l<=10,o.css("cursor",c.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);c.resizeStart||o.css("cursor","")}).on("mousedown",function(e){var l=t(this);if(c.allowResize){var n=l.data("key");e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],i.getCssRule(n,function(e){var t=e.style.width||l.outerWidth();c.rule=e,c.ruleWidth=parseFloat(t),c.minWidth=l.data("minwidth")||a.cellMinWidth})}}),j.on("mousemove",function(t){if(c.resizeStart){if(t.preventDefault(),c.rule){var a=c.ruleWidth+t.clientX-c.offset[0];a');return n[0].value=i.data("content")||l.text(),i.find("."+R)[0]||i.append(n),n.focus(),void layui.stope(e)}}).on("mouseenter","td",function(){b.call(this)}).on("mouseleave","td",function(){b.call(this,"hide")});var g="layui-table-grid-down",b=function(e){var i=t(this),a=i.children(h);if(!i.data("off"))if(e)i.find(".layui-table-grid-down").remove();else if(a.prop("scrollWidth")>a.outerWidth()){if(a.find("."+g)[0])return;i.append('
      ')}};i.layBody.on("click","."+g,function(e){var n=t(this),o=n.parent(),d=o.children(h);i.tipsIndex=l.tips(['
      ',d.html(),"
      ",''].join(""),d[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:i.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}),layui.stope(e)}),i.layBody.on("click","*[lay-event]",function(){var e=t(this),a=e.parents("tr").eq(0).data("index");layui.event.call(this,y,"tool("+p+")",v.call(this,{event:e.attr("lay-event")})),i.setThisRowChecked(a)}),i.layMain.on("scroll",function(){var e=t(this),a=e.scrollLeft(),n=e.scrollTop();i.layHeader.scrollLeft(a),i.layTotal.scrollLeft(a),i.layFixed.find(k).scrollTop(n),l.close(i.tipsIndex)}),H.on("resize",function(){i.resize()})},function(){j.on("click",function(){j.trigger("table.remove.tool.panel")}),j.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()})}(),d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':h+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},c.that={},c.config={},d.eachCols=function(e,i,a){var l=c.config[e]||{},n=[],o=0;a=t.extend(!0,[],a||l.cols),layui.each(a,function(e,t){layui.each(t,function(t,i){if(i.colGroup){var l=0;o++,i.CHILD_COLS=[],layui.each(a[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==i.colspan||(t.PARENT_COL_INDEX=o,i.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}i.PARENT_COL_INDEX||n.push(i)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof i&&i(e,t))})};r()},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},d.exportFile=function(e,t,i){var a=this;t=t||d.clearCacheKey(d.cache[e]),i=i||"csv";var l=c.config[e]||{},n={csv:"text/csv",xls:"application/vnd.ms-excel"}[i],s=document.createElement("a");return r.ie?o.error("IE_NOT_SUPPORT_EXPORTS"):(s.href="data:"+n+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var i=[],l=[],n=[];return layui.each(t,function(t,a){var n=[];"object"==typeof e?(layui.each(e,function(e,a){0==t&&i.push(a||"")}),layui.each(d.clearCacheKey(a),function(e,t){n.push('"'+(t||"")+'"')})):d.eachCols(e,function(e,l){if(l.field&&"normal"==l.type&&!l.hide){var o=a[l.field];void 0!==o&&null!==o||(o=""),0==t&&i.push(l.title||""),n.push('"'+u(l,o,a,"text")+'"')}}),l.push(n.join(","))}),layui.each(a.dataTotal,function(e,t){n.push(t)}),i.join(",")+"\r\n"+l.join("\r\n")+"\r\n"+n.join(",")}()),s.download=(l.title||"table_"+(l.index||""))+"."+i,document.body.appendChild(s),s.click(),void document.body.removeChild(s))},d.resize=function(e){if(e){var t=s(e);if(!t)return;c.that[e].resize()}else layui.each(c.that,function(){this.resize()})},d.reload=function(e,t){var i=s(e);if(i){var a=c.that[e];return a.reload(t),c.call(a)}},d.render=function(e){var t=new F(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(y,d)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/transfer.js b/static/public/user/layui-v2.5.6/layui/lay/modules/transfer.js new file mode 100644 index 0000000000000000000000000000000000000000..24839215cdc529116619141b484a700a436a32c2 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/transfer.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,n=layui.form,i="transfer",l={config:{},index:layui[i]?layui[i].index+1e4:0,set:function(e){var t=this;return t.config=a.extend({},t.config,e),t},on:function(e,a){return layui.onevent.call(this,i,e,a)}},r=function(){var e=this,a=e.config,t=a.id||e.index;return r.that[t]=e,r.config[t]=a,{config:a,reload:function(a){e.reload.call(e,a)},getData:function(){return e.getData.call(e)}}},c="layui-hide",o="layui-btn-disabled",d="layui-none",s="layui-transfer-box",u="layui-transfer-header",h="layui-transfer-search",f="layui-transfer-active",y="layui-transfer-data",p=function(e){return e=e||{},['
      ','
      ','","
      ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
        ',"
        "].join("")},v=['
        ',p({index:0,checkAllName:"layTransferLeftCheckAll"}),'
        ','",'","
        ",p({index:1,checkAllName:"layTransferRightCheckAll"}),"
        "].join(""),x=function(e){var t=this;t.index=++l.index,t.config=a.extend({},t.config,l.config,e),t.render()};x.prototype.config={title:["列表一","列表二"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"无数据",searchNone:"无匹配数据"}},x.prototype.reload=function(e){var t=this;layui.each(e,function(e,a){a.constructor===Array&&delete t.config[e]}),t.config=a.extend(!0,{},t.config,e),t.render()},x.prototype.render=function(){var e=this,n=e.config,i=e.elem=a(t(v).render({data:n,index:e.index})),l=n.elem=a(n.elem);l[0]&&(n.data=n.data||[],n.value=n.value||[],e.key=n.id||e.index,l.html(e.elem),e.layBox=e.elem.find("."+s),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+h),e.layData=i.find("."+y),e.layBtn=i.find("."+f+" .layui-btn"),e.layBox.css({width:n.width,height:n.height}),e.layData.css({height:function(){return n.height-e.layHeader.outerHeight()-e.laySearch.outerHeight()-2}()}),e.renderData(),e.events())},x.prototype.renderData=function(){var e=this,a=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,n=["
      • ",'',"
      • "].join("");a[t].views.push(n),delete e.selected}),e.layData.eq(0).html(a[0].views.join("")),e.layData.eq(1).html(a[1].views.join("")),e.renderCheckBtn()},x.prototype.renderForm=function(e){n.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,n=t.config;e=e||{},t.layBox.each(function(i){var l=a(this),r=l.find("."+y),d=l.find("."+u).find('input[type="checkbox"]'),s=r.find('input[type="checkbox"]'),h=0,f=!1;if(s.each(function(){var e=a(this).data("hide");(this.checked||this.disabled||e)&&h++,this.checked&&!e&&(f=!0)}),d.prop("checked",f&&h===s.length),t.layBtn.eq(i)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":n.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var n=a('

        '+(t||"")+"

        ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(n)},x.prototype.setValue=function(){var e=this,t=e.config,n=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||n.push(this.value)}),t.value=n,e},x.prototype.parseData=function(e){var t=this,n=t.config,i=[];return layui.each(n.data,function(t,l){l=("function"==typeof n.parseData?n.parseData(l):l)||l,i.push(l=a.extend({},l)),layui.each(n.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),n.data=i,t},x.prototype.getData=function(e){var a=this,t=a.config,n=[];return a.setValue(),layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&n.push(t)})}),n},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),n=t[0].checked,i=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&i.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=n)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var n=a(this),i=n.data("index"),l=e.layBox.eq(i),r=[];if(!n.hasClass(o)){e.layBox.eq(i).each(function(t){var n=a(this),i=n.find("."+y);i.children("li").each(function(){var t=a(this),n=t.find('input[type="checkbox"]'),i=n.data("hide");n[0].checked&&!i&&(n[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(n[0].value)),e.setValue()})}),e.renderCheckBtn();var c=l.siblings("."+s).find("."+h+" input");""===c.val()||c.trigger("keyup"),t.onchange&&t.onchange(e.getData(r),i)}}),e.laySearch.find("input").on("keyup",function(){var n=this.value,i=a(this).parents("."+h).eq(0).siblings("."+y),l=i.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),i=t[0].title.indexOf(n)!==-1;e[i?"removeClass":"addClass"](c),t.data("hide",!i)}),e.renderCheckBtn();var r=l.length===i.children("li."+c).length;e.noneView(i,r?t.text.searchNone:"")})},r.that={},r.config={},l.reload=function(e,a){var t=r.that[e];return t.reload(a),r.call(t)},l.getData=function(e){var a=r.that[e];return a.getData()},l.render=function(e){var a=new x(e);return r.call(a)},e(i,l)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/tree.js b/static/public/user/layui-v2.5.6/layui/lay/modules/tree.js new file mode 100644 index 0000000000000000000000000000000000000000..c9c93a2ff84f56a599d2bf54ea75e9663267f04a --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/tree.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define("form",function(e){"use strict";var i=layui.$,a=layui.form,n=layui.layer,t="tree",r={config:{},index:layui[t]?layui[t].index+1e4:0,set:function(e){var a=this;return a.config=i.extend({},a.config,e),a},on:function(e,i){return layui.onevent.call(this,t,e,i)}},l=function(){var e=this,i=e.config,a=i.id||e.index;return l.that[a]=e,l.config[a]=i,{config:i,reload:function(i){e.reload.call(e,i)},getChecked:function(){return e.getChecked.call(e)},setChecked:function(i){return e.setChecked.call(e,i)}}},c="layui-hide",d="layui-disabled",s="layui-tree-set",o="layui-tree-iconClick",h="layui-icon-addition",u="layui-icon-subtraction",p="layui-tree-entry",f="layui-tree-main",y="layui-tree-txt",v="layui-tree-pack",C="layui-tree-spread",k="layui-tree-setLineShort",m="layui-tree-showLine",x="layui-tree-lineExtend",b=function(e){var a=this;a.index=++r.index,a.config=i.extend({},a.config,r.config,e),a.render()};b.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"未命名",none:"无数据"}},b.prototype.reload=function(e){var a=this;layui.each(e,function(e,i){i.constructor===Array&&delete a.config[e]}),a.config=i.extend(!0,{},a.config,e),a.render()},b.prototype.render=function(){var e=this,a=e.config;e.checkids=[];var n=i('
        ');e.tree(n);var t=a.elem=i(a.elem);if(t[0]){if(e.key=a.id||e.index,e.elem=n,e.elemNone=i('
        '+a.text.none+"
        "),t.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);a.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=i(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(k),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(k)}),e.events()}},b.prototype.renderForm=function(e){a.render(e,"LAY-tree-"+this.index)},b.prototype.tree=function(e,a){var n=this,t=n.config,r=a||t.data;layui.each(r,function(a,r){var l=r.children&&r.children.length>0,o=i('
        '),h=i(['
        ','
        ','
        ',function(){return t.showLine?l?'':'':''}(),function(){return t.showCheckbox?'':""}(),function(){return t.isJump&&r.href?''+(r.title||r.label||t.text.defaultNodeName)+"":''+(r.title||r.label||t.text.defaultNodeName)+""}(),"
        ",function(){if(!t.edit)return"";var e={add:'',update:'',del:''},i=['
        '];return t.edit===!0&&(t.edit=["update","del"]),"object"==typeof t.edit?(layui.each(t.edit,function(a,n){i.push(e[n]||"")}),i.join("")+"
        "):void 0}(),"
        "].join(""));l&&(h.append(o),n.tree(o,r.children)),e.append(h),h.prev("."+s)[0]&&h.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),l||h.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),n.spread(h,r),t.showCheckbox&&(r.checked&&n.checkids.push(r.id),n.checkClick(h,r)),t.edit&&n.operate(h,r)})},b.prototype.spread=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f),c=r.find("."+o),k=r.find("."+y),m=t.onlyIconControl?c:l,x="";m.on("click",function(i){var a=e.children("."+v),n=m.children(".layui-icon")[0]?m.children(".layui-icon"):m.find(".layui-tree-icon").children(".layui-icon");if(a[0]){if(e.hasClass(C))e.removeClass(C),a.slideUp(200),n.removeClass(u).addClass(h);else if(e.addClass(C),a.slideDown(200),n.addClass(u).removeClass(h),t.accordion){var r=e.siblings("."+s);r.removeClass(C),r.children("."+v).slideUp(200),r.find(".layui-tree-icon").children(".layui-icon").removeClass(u).addClass(h)}}else x="normal"}),k.on("click",function(){var n=i(this);n.hasClass(d)||(x=e.hasClass(C)?t.onlyIconControl?"open":"close":t.onlyIconControl?"close":"open",t.click&&t.click({elem:e,state:x,data:a}))})},b.prototype.setCheckbox=function(e,i,a){var n=this,t=(n.config,a.prop("checked"));if(!a.prop("disabled")){if("object"==typeof i.children||e.find("."+v)[0]){var r=e.find("."+v).find('input[same="layuiTreeCheck"]');r.each(function(){this.disabled||(this.checked=t)})}var l=function(e){if(e.parents("."+s)[0]){var i,a=e.parent("."+v),n=a.parent(),r=a.prev().find('input[same="layuiTreeCheck"]');t?r.prop("checked",t):(a.find('input[same="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||r.prop("checked",!1)),l(n)}};l(e),n.renderForm("checkbox")}},b.prototype.checkClick=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f);l.on("click",'input[same="layuiTreeCheck"]+',function(r){layui.stope(r);var l=i(this).prev(),c=l.prop("checked");l.prop("disabled")||(n.setCheckbox(e,a,l),t.oncheck&&t.oncheck({elem:e,checked:c,data:a}))})},b.prototype.operate=function(e,a){var t=this,r=t.config,l=e.children("."+p),d=l.children("."+f);l.children(".layui-tree-btnGroup").on("click",".layui-icon",function(l){layui.stope(l);var f=i(this).data("type"),b=e.children("."+v),g={data:a,type:f,elem:e};if("add"==f){b[0]||(r.showLine?(d.find("."+o).addClass("layui-tree-icon"),d.find("."+o).children(".layui-icon").addClass(h).removeClass("layui-icon-file")):d.find(".layui-tree-iconArrow").removeClass(c),e.append('
        '));var w=r.operate&&r.operate(g),N={};if(N.title=r.text.defaultNodeName,N.id=w,t.tree(e.children("."+v),[N]),r.showLine)if(b[0])b.hasClass(x)||b.addClass(x),e.find("."+v).each(function(){i(this).children("."+s).last().addClass(k)}),b.children("."+s).last().prev().hasClass(k)?b.children("."+s).last().prev().removeClass(k):b.children("."+s).last().removeClass(k),!e.parent("."+v)[0]&&e.next()[0]&&b.children("."+s).last().removeClass(k);else{var T=e.siblings("."+s),L=1,A=e.parent("."+v);layui.each(T,function(e,a){i(a).children("."+v)[0]||(L=0)}),1==L?(T.children("."+v).addClass(m),T.children("."+v).children("."+s).removeClass(k),e.children("."+v).addClass(m),A.removeClass(x),A.children("."+s).last().children("."+v).children("."+s).last().addClass(k)):e.children("."+v).children("."+s).addClass(k)}if(!r.showCheckbox)return;if(d.find('input[same="layuiTreeCheck"]')[0].checked){var I=e.children("."+v).children("."+s).last();I.find('input[same="layuiTreeCheck"]')[0].checked=!0}t.renderForm("checkbox")}else if("update"==f){var F=d.children("."+y).html();d.children("."+y).html(""),d.append(''),d.children(".layui-tree-editInput").val(F).focus();var j=function(e){var i=e.val().trim();i=i?i:r.text.defaultNodeName,e.remove(),d.children("."+y).html(i),g.data.title=i,r.operate&&r.operate(g)};d.children(".layui-tree-editInput").blur(function(){j(i(this))}),d.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),j(i(this)))})}else n.confirm('确认删除该节点 "'+(a.title||"")+'" 吗?',function(a){if(r.operate&&r.operate(g),g.status="remove",n.close(a),!e.prev("."+s)[0]&&!e.next("."+s)[0]&&!e.parent("."+v)[0])return e.remove(),void t.elem.append(t.elemNone);if(e.siblings("."+s).children("."+p)[0]){if(r.showCheckbox){var l=function(e){if(e.parents("."+s)[0]){var a=e.siblings("."+s).children("."+p),n=e.parent("."+v).prev(),r=n.find('input[same="layuiTreeCheck"]')[0],c=1,d=0;0==r.checked&&(a.each(function(e,a){var n=i(a).find('input[same="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(c=0),n.disabled||(d=1)}),1==c&&1==d&&(r.checked=!0,t.renderForm("checkbox"),l(n.parent("."+s))))}};l(e)}if(r.showLine){var d=e.siblings("."+s),h=1,f=e.parent("."+v);layui.each(d,function(e,a){i(a).children("."+v)[0]||(h=0)}),1==h?(b[0]||(f.removeClass(x),d.children("."+v).addClass(m),d.children("."+v).children("."+s).removeClass(k)),e.next()[0]?f.children("."+s).last().children("."+v).children("."+s).last().addClass(k):e.prev().children("."+v).children("."+s).last().addClass(k),e.next()[0]||e.parents("."+s)[1]||e.parents("."+s).eq(0).next()[0]||e.prev("."+s).addClass(k)):!e.next()[0]&&e.hasClass(k)&&e.prev().addClass(k)}}else{var y=e.parent("."+v).prev();if(r.showLine){y.find("."+o).removeClass("layui-tree-icon"),y.find("."+o).children(".layui-icon").removeClass(u).addClass("layui-icon-file");var w=y.parents("."+v).eq(0);w.addClass(x),w.children("."+s).each(function(){i(this).children("."+v).children("."+s).last().addClass(k)})}else y.find(".layui-tree-iconArrow").addClass(c);e.parents("."+s).eq(0).removeClass(C),e.parent("."+v).remove()}e.remove()})})},b.prototype.events=function(){var e=this,a=e.config;e.elem.find(".layui-tree-checkedFirst");e.setChecked(e.checkids),e.elem.find(".layui-tree-search").on("keyup",function(){var n=i(this),t=n.val(),r=n.nextAll(),l=[];r.find("."+y).each(function(){var e=i(this).parents("."+p);if(i(this).html().indexOf(t)!=-1){l.push(i(this).parent());var a=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+v)[0]&&a(e.parent("."+v).parent("."+s))};a(e.parent("."+s))}}),r.find("."+p).each(function(){var e=i(this).parent("."+s);e.hasClass("layui-tree-searchShow")||e.addClass(c)}),0==r.find(".layui-tree-searchShow").length&&e.elem.append(e.elemNone),a.onsearch&&a.onsearch({elem:l})}),e.elem.find(".layui-tree-search").on("keydown",function(){i(this).nextAll().find("."+p).each(function(){var e=i(this).parent("."+s);e.removeClass("layui-tree-searchShow "+c)}),i(".layui-tree-emptyText")[0]&&i(".layui-tree-emptyText").remove()})},b.prototype.getChecked=function(){var e=this,a=e.config,n=[],t=[];e.elem.find(".layui-form-checked").each(function(){n.push(i(this).prev()[0].value)});var r=function(e,a){layui.each(e,function(e,t){layui.each(n,function(e,n){if(t.id==n){var l=i.extend({},t);return delete l.children,a.push(l),t.children&&(l.children=[],r(t.children,l.children)),!0}})})};return r(i.extend({},a.data),t),t},b.prototype.setChecked=function(e){var a=this;a.config;a.elem.find("."+s).each(function(a,n){var t=i(this).data("id"),r=i(n).children("."+p).find('input[same="layuiTreeCheck"]'),l=r.next();if("number"==typeof e){if(t==e)return r[0].checked||l.click(),!1}else"object"==typeof e&&layui.each(e,function(e,i){if(i==t&&!r[0].checked)return l.click(),!0})})},l.that={},l.config={},r.reload=function(e,i){var a=l.that[e];return a.reload(i),l.call(a)},r.getChecked=function(e){var i=l.that[e];return i.getChecked()},r.setChecked=function(e,i){var a=l.that[e];return a.setChecked(i)},r.render=function(e){var i=new b(e);return l.call(i)},e(t,r)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/upload.js b/static/public/user/layui-v2.5.6/layui/lay/modules/upload.js new file mode 100644 index 0000000000000000000000000000000000000000..9298ecf94df4789e1363e4411892e4b3632d5ccf --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/upload.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),o=layui.device(),a={config:{},set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,r,e,t)}},l=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var i=this;i.config=t.extend({},i.config,a.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var i=this,e=i.config;e.elem=t(e.elem),e.bindAction=t(e.bindAction),i.file(),i.events()},p.prototype.file=function(){var e=this,i=e.config,n=e.elemFile=t(['"].join("")),a=i.elem.next();(a.hasClass(u)||a.hasClass(c))&&a.remove(),o.ie&&o.ie<10&&i.elem.wrap('
        '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),o.ie&&o.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),o=t(['
        ',"
        "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(o),i.elem.next("."+c).append(function(){var e=[];return layui.each(i.data,function(t,i){i="function"==typeof i?i():i,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var t=this;window.FileReader&&layui.each(t.chooseFiles,function(t,i){var n=new FileReader;n.readAsDataURL(i),n.onload=function(){e&&e(t,i,this.result)}})},p.prototype.upload=function(e,i){var n,a=this,l=a.config,r=a.elemFile[0],u=function(){var i=0,n=0,o=e||a.files||a.chooseFiles||r.files,u=function(){l.multiple&&i+n===a.fileLength&&"function"==typeof l.allDone&&l.allDone({total:a.fileLength,successful:i,aborted:n})};layui.each(o,function(e,o){var r=new FormData;r.append(l.field,o),layui.each(l.data,function(e,t){t="function"==typeof t?t():t,r.append(e,t)});var c={url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(t){i++,d(e,t),u()},error:function(){n++,a.msg("请求上传接口出现异常"),m(e),u()}};"function"==typeof l.progress&&(c.xhr=function(){var e=t.ajaxSettings.xhr();return e.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=Math.floor(e.loaded/e.total*100);l.progress(t,l.item[0],e)}}),e}),t.ajax(c)})},c=function(){var e=t("#"+f);a.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){a.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(a.elemFile.next("."+s).remove(),r.value="","object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(t,e||0,function(e){a.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){a.upload(e)})},h=l.exts,v=function(){var t=[];return layui.each(e||a.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){a.preview(e)},upload:function(e,t){var i={};i[e]=t,a.upload(i)},pushFile:function(){return a.files=a.files||{},layui.each(a.chooseFiles,function(e,t){a.files[e]=t}),a.files},resetFile:function(e,t,i){var n=new File([t],i);a.files=a.files||{},a.files[e]=n}},y=function(){if("choose"!==i&&!l.auto||(l.choose&&l.choose(g),"choose"!==i))return l.before&&l.before(g),o.ie?o.ie>9?u():c():void u()};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return a.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return a.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return a.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,t){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(t))||(n=!0)}),n)return a.msg("选择的图片中包含不支持的格式"),r.value=""}if(a.fileLength=function(){var t=0,i=e||a.files||a.chooseFiles||r.files;return layui.each(i,function(){t++}),t}(),l.number&&a.fileLength>l.number)return a.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(o.ie&&o.ie<10)){var F;if(layui.each(a.chooseFiles,function(e,t){if(t.size>1024*l.size){var i=l.size/1024;i=i>=1?i.toFixed(2)+"MB":l.size+"KB",r.value="",F=i}}),F)return a.msg("文件不能超过"+F)}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,a.config,e),n=e.elem.next();n.attr({name:e.name,accept:e.acceptMime,multiple:e.multiple})},p.prototype.events=function(){var e=this,i=e.config,a=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},l=function(t,n){var o=e.elemFile,a=t.length>1?t.length+"个文件":(t[0]||{}).name||o[0].value.match(/[^\/\\]+\..+/g)||[]||"";o.next().hasClass(s)&&o.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||o.after(''+a+"")};i.elem.off("upload.start").on("upload.start",function(){var o=t(this),a=o.attr("lay-data");if(a)try{a=new Function("return "+a)(),e.config=t.extend({},i,a)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+a)}e.config.item=o,e.elemFile[0].click()}),o.ie&&o.ie<10||i.elem.off("upload.over").on("upload.over",function(){var e=t(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=t(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,o){var r=t(this),u=o.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),a(u),i.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];a(t),i.auto?e.upload():l(t)}),i.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),i.elem.data("haveEvents")||(e.elemFile.on("change",function(){t(this).trigger("upload.change")}),i.elem.on("click",function(){e.isFile()||t(this).trigger("upload.start")}),i.drag&&i.elem.on("dragover",function(e){e.preventDefault(),t(this).trigger("upload.over")}).on("dragleave",function(e){t(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),t(this).trigger("upload.drop",e)}),i.bindAction.on("click",function(){t(this).trigger("upload.action")}),i.elem.data("haveEvents",!0))},a.render=function(e){var t=new p(e);return l.call(t)},e(r,a)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/lay/modules/util.js b/static/public/user/layui-v2.5.6/layui/lay/modules/util.js new file mode 100644 index 0000000000000000000000000000000000000000..fdc1ec2d4cf3b73471db6fa5339138a3f147ae17 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/lay/modules/util.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],u=t(['
          ',e.bar1?'
        • '+c[0]+"
        • ":"",e.bar2?'
        • '+c[1]+"
        • ":"",'
        • '+c[2]+"
        • ","
        "].join("")),g=u.find("."+o),s=function(){var t=r.scrollTop();t>=e.showHeight?i||(g.show(),i=1):i&&(g.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&u.css(e.css),l.append(u),s(),u.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var u=setTimeout(function(){n.countdown(e,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,u),l<=0&&clearTimeout(u),u},timeAgo:function(e,t){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>26784e5?(a=new Date(e),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),t||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=18e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(e,n,a){var o=t("body");return a=a||"click",n=i.event[e]=t.extend(!0,i.event[e],n)||{},i.event.UTIL_EVENT_CALLBACK=i.event.UTIL_EVENT_CALLBACK||{},o.off(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),i.event.UTIL_EVENT_CALLBACK[e]=function(){var i=t(this),a=i.attr(e);"function"==typeof n[a]&&n[a].call(this,i)},o.on(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),n}};!function(e,t,i){"$:nomunge";function n(){a=t[l](function(){o.each(function(){var t=e(this),i=t.width(),n=t.height(),a=e.data(this,u);(i!==a.w||n!==a.h)&&t.trigger(c,[a.w=i,a.h=n])}),n()},r[g])}var a,o=e([]),r=e.resize=e.extend(e.resize,{}),l="setTimeout",c="resize",u=c+"-special-event",g="delay",s="throttleWindow";r[g]=250,r[s]=!0,e.event.special[c]={setup:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.add(t),e.data(this,u,{w:t.width(),h:t.height()}),1===o.length&&n()},teardown:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.not(t),t.removeData(u),o.length||clearTimeout(a)},add:function(t){function n(t,n,o){var r=e(this),l=e.data(this,u)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[s]&&this[l])return!1;var a;return e.isFunction(t)?(a=t,n):(a=t.handler,void(t.handler=n))}}}(t,window),e("util",i)}); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/layui.all.js b/static/public/user/layui-v2.5.6/layui/layui.all.js new file mode 100644 index 0000000000000000000000000000000000000000..af3355c23913323c44ca0d0c95516301c6cdd595 --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/layui.all.js @@ -0,0 +1,5 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},r=function(){this.v="2.5.6"},o=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,r=n.length-1,o=r;o>0;o--)if("interactive"===n[o].readyState){e=n[o].src;break}return e||n[r].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};r.prototype.cache=n,r.prototype.define=function(e,t){var r=this,o="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(r,o){e(r,o),n.callback[r]=function(){t(e)}}),this};return o&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?a.call(r):(r.use(e,a),r)},r.prototype.use=function(e,r,l){function c(e,t){var r="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||r.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[d]=t,y.removeChild(h),function o(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void(n.status[d]?s():setTimeout(o,4))}())}function s(){l.push(layui[d]),e.length>1?p.use(e.slice(1),r,l):"function"==typeof r&&r.apply(layui,l)}var p=this,f=n.dir=n.dir?n.dir:o,y=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(p.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var d=e[0],m=0;if(l=l||[],n.host=n.host||(f.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[d]||!layui["layui.all"]&&layui["layui.mobile"]&&u[d])return s(),p;var v=(u[d]?f+"lay/":/^\{\/\}/.test(p.modules[d])?"":n.base||"")+(p.modules[d]||d)+".js";if(v=v.replace(/^\{\/\}/,""),!n.modules[d]&&layui[d]&&(n.modules[d]=v),n.modules[d])!function g(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void("string"==typeof n.modules[d]&&n.status[d]?s():setTimeout(g,4))}();else{var h=t.createElement("script");h.async=!0,h.charset="utf-8",h.src=v+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),y.appendChild(h),!h.attachEvent||h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0||i?h.addEventListener("load",function(e){c(e,v)},!1):h.attachEvent("onreadystatechange",function(e){c(e,v)}),n.modules[d]=v}return p},r.prototype.getStyle=function(t,n){var r=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return r[r.getPropertyValue?"getPropertyValue":"getAttribute"](n)},r.prototype.link=function(e,r,o){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof r&&(o=r);var c=(o||e).replace(/\.|\//g,""),s=u.id="layuicss-"+c,p=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(s)||l.appendChild(u),"function"!=typeof r?i:(function f(){return++p>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(s),"width"))?function(){r()}():setTimeout(f,100))}(),i)},n.callback={},r.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},r.prototype.addcss=function(e,t,r){return layui.link(n.dir+"css/"+e,t,r)},r.prototype.img=function(e,t,n){var r=new Image;return r.src=e,r.complete?t(r):(r.onload=function(){r.onload=null,"function"==typeof t&&t(r)},void(r.onerror=function(e){r.onerror=null,"function"==typeof n&&n(e)}))},r.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},r.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),r.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},r.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),n.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},r.prototype.url=function(e){var t=this,n={pathname:function(){var t=e?function(){var t=(e.match(/\.[^.]+?\/.+/)||[])[0]||"";return t.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return t.replace(/^\//,"").split("/")}(),search:function(){var n={},r=(e?function(){var t=(e.match(/\?.+/)||[])[0]||"";return t.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");return t.each(r,function(e,t){var r=t.indexOf("="),o=function(){return r<0?t.substr(0,t.length):0!==r&&t.substr(0,r)}();o&&(n[o]=r>0?t.substr(r+1):null)}),n}(),hash:t.router(function(){return e?(e.match(/#.+/)||[])[0]||"":location.hash}())};return n},r.prototype.data=function(t,n,r){if(t=t||"layui",r=r||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete r[t];n="object"==typeof n?n:{key:n};try{var o=JSON.parse(r[t])}catch(a){var o={}}return"value"in n&&(o[n.key]=n.value),n.remove&&delete o[n.key],r[t]=JSON.stringify(o),n.key?o[n.key]:o}},r.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},r.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),r=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},o={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:r("micromessenger")};return t&&!o[t]&&(o[t]=r(t)),o.android=/android/.test(n),o.ios="ios"===o.os,o.mobile=!(!o.android&&!o.ios),o},r.prototype.hint=function(){return{error:a}},r.prototype.each=function(e,t){var n,r=this;if("function"!=typeof t)return r;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:o/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
        ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
        "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)if("interactive"===t[a].readyState){e=t[a].src;break}return e||t[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.9",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var t=this;return t.config=w.extend({},t.config,e),t},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return e?layui.addcss(o,a,i):t.link(o,a,i),this}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
        建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElemDate),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElemDate=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n.hasClass(c)||t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));t.elem&&(n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3))},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
        "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
        已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month||12,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

        "+r.time[e]+"

          "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
        ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?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)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.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+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,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(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===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]||t.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]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},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,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), +l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?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===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.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.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.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"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.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,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.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 pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
        a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
        ","
        "],area:[1,"",""],param:[1,"",""],thead:[1,"","
        "],tr:[2,"","
        "],col:[2,"","
        "],td:[3,"","
        "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
        ","
        "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.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=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=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):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
        a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.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){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
        ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ +for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({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)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe});!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
        '+(f?r.title[0]:r.title)+"
        ":"";return r.zIndex=s,t([r.shade?'
        ':"",'
        '+(e&&2!=r.type?"":u)+'
        '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
        '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
        '+e+"
        "}():"")+(r.resize?'':"")+"
        "],u,i('
        ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
          '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
        • '+(t[0].content||"no content")+"
        • ";i'+(t[i].content||"no content")+"";return a}()+"
        ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
        '+(u.length>1?'':"")+'
        '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
        ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
        是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);layui.define("jquery",function(t){"use strict";var a=layui.$,i=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(t){var i=this;return a.extend(!0,i.config,t),i},s.prototype.on=function(t,a){return layui.onevent.call(this,e,t,a)},s.prototype.tabAdd=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),r='
      • "+(i.title||"unnaming")+"
      • ";return s[0]?s.before(r):n.append(r),o.append('
        '+(i.content||"")+"
        "),f.hideTabMore(!0),f.tabAuto(),this},s.prototype.tabDelete=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabDelete(null,s),this},s.prototype.tabChange=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},b.on("click",t.headerElem,function(i){var e=a(this).index();f.tabClick.call(this,i,e,null,t)})},s.prototype.progress=function(t,i){var e="layui-progress",l=a("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",i),s.text(i),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",y="layui-nav-more",h="layui-anim layui-anim-upbit",f={tabClick:function(t,i,s,o){o=o||{};var r=s||a(this),i=i||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?a(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),d=r.find("a"),y=c.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(r.addClass(l).siblings().removeClass(l),u.eq(i).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+y+")",{elem:c,index:i})},tabDelete:function(t,i){var n=i||a(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),r=o.children(".layui-tab-content").children(".layui-tab-item"),c=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?f.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&f.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){f.tabAuto()},50),layui.event.call(this,e,"tabDelete("+c+")",{elem:o,index:s})},tabAuto:function(){var t="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=a('');if(n===window&&8!=i.ie&&f.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=a(this);if(!t.find("."+l)[0]){var i=a('');i.on("click",f.tabDelete),t.append(i)}}),"string"!=typeof s.attr("lay-unauto"))if(o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(c),s.attr("overflow",""),c.on("click",function(a){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var i=a(".layui-tab-title");t!==!0&&"tabmore"===a(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=a(this),i=t.parents(o),n=i.attr("lay-filter"),s=t.parent(),c=t.siblings("."+d),y="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||y||c[0]||(i.find("."+l).removeClass(l),s.addClass(l)),i.hasClass(u)&&(c.removeClass(h),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===i.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=a(this),i=t.find(".layui-colla-icon"),l=t.siblings(".layui-colla-content"),s=t.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),r="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var c=s.children(".layui-colla-item").children("."+n);c.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),c.removeClass(n)}l[r?"addClass":"removeClass"](n),i.html(r?"":""),layui.event.call(this,e,"collapse("+o+")",{title:t,content:l,show:r})}};s.prototype.init=function(t,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){f.tabAuto.call({})},nav:function(){var t=200,e={},s={},p={},b=function(l,o,r){var c=a(this),f=c.find("."+d);o.hasClass(u)?l.css({top:c.position().top,height:c.children("a").outerHeight(),opacity:1}):(f.addClass(h),l.css({left:c.position().left+parseFloat(c.css("marginLeft")),top:c.position().top+c.height()-l.height()}),e[r]=setTimeout(function(){l.css({width:c.width(),opacity:1})},i.ie&&i.ie<10?0:t),clearTimeout(p[r]),"block"===f.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){f.addClass(n),c.find("."+y).addClass(y+"d")},300))};a(o+l).each(function(i){var l=a(this),o=a(''),h=l.find("."+r);l.find("."+c)[0]||(l.append(o),h.on("mouseenter",function(){b.call(this,o,l,i)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[i]),s[i]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+y).removeClass(y+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[i]),p[i]=setTimeout(function(){l.hasClass(u)?o.css({height:0,top:o.position().top+o.height()/2,opacity:0}):o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},t)})),h.find("a").each(function(){var t=a(this),i=(t.parent(),t.siblings("."+d));i[0]&&!t.children("."+y)[0]&&t.append(''),t.off("click",f.clickThis).on("click",f.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";a(t+l).each(function(){var t=a(this),i="lay-separator",e=t.attr(i)||"/",l=t.find("a");l.next("span["+i+"]")[0]||(l.each(function(t){t!==l.length-1&&a(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";a("."+t+l).each(function(){var i=a(this),e=i.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),i.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";a("."+t+l).each(function(){var t=a(this).find(".layui-colla-item");t.each(function(){var t=a(this),i=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");i.find(".layui-colla-icon").remove(),i.append(''+(l?"":"")+""),i.off("click",f.collapse).on("click",f.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,a){a()})},s.prototype.render=s.prototype.init;var p=new s,b=a(document);p.render();var v=".layui-tab-title li";b.on("click",v,f.tabClick),b.on("click",f.hideTabMore),a(window).on("resize",f.tabAuto),t(e,p)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),o=layui.device(),a={config:{},set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,r,e,t)}},l=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var i=this;i.config=t.extend({},i.config,a.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var i=this,e=i.config;e.elem=t(e.elem),e.bindAction=t(e.bindAction),i.file(),i.events()},p.prototype.file=function(){var e=this,i=e.config,n=e.elemFile=t(['"].join("")),a=i.elem.next();(a.hasClass(u)||a.hasClass(c))&&a.remove(),o.ie&&o.ie<10&&i.elem.wrap('
        '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),o.ie&&o.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),o=t(['
        ',"
        "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(o),i.elem.next("."+c).append(function(){var e=[];return layui.each(i.data,function(t,i){i="function"==typeof i?i():i,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var t=this;window.FileReader&&layui.each(t.chooseFiles,function(t,i){var n=new FileReader;n.readAsDataURL(i),n.onload=function(){e&&e(t,i,this.result)}})},p.prototype.upload=function(e,i){var n,a=this,l=a.config,r=a.elemFile[0],u=function(){var i=0,n=0,o=e||a.files||a.chooseFiles||r.files,u=function(){l.multiple&&i+n===a.fileLength&&"function"==typeof l.allDone&&l.allDone({total:a.fileLength,successful:i,aborted:n})};layui.each(o,function(e,o){var r=new FormData;r.append(l.field,o),layui.each(l.data,function(e,t){t="function"==typeof t?t():t,r.append(e,t)});var c={url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(t){i++,d(e,t),u()},error:function(){n++,a.msg("请求上传接口出现异常"),m(e),u()}};"function"==typeof l.progress&&(c.xhr=function(){var e=t.ajaxSettings.xhr();return e.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=Math.floor(e.loaded/e.total*100);l.progress(t,l.item[0],e)}}),e}),t.ajax(c)})},c=function(){var e=t("#"+f);a.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){a.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(a.elemFile.next("."+s).remove(),r.value="","object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(t,e||0,function(e){a.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){a.upload(e)})},h=l.exts,v=function(){var t=[];return layui.each(e||a.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){a.preview(e)},upload:function(e,t){var i={};i[e]=t,a.upload(i)},pushFile:function(){return a.files=a.files||{},layui.each(a.chooseFiles,function(e,t){a.files[e]=t}),a.files},resetFile:function(e,t,i){var n=new File([t],i);a.files=a.files||{},a.files[e]=n}},y=function(){if("choose"!==i&&!l.auto||(l.choose&&l.choose(g),"choose"!==i))return l.before&&l.before(g),o.ie?o.ie>9?u():c():void u()};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return a.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return a.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return a.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,t){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(t))||(n=!0)}),n)return a.msg("选择的图片中包含不支持的格式"),r.value=""}if(a.fileLength=function(){var t=0,i=e||a.files||a.chooseFiles||r.files;return layui.each(i,function(){t++}),t}(),l.number&&a.fileLength>l.number)return a.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(o.ie&&o.ie<10)){var F;if(layui.each(a.chooseFiles,function(e,t){if(t.size>1024*l.size){var i=l.size/1024;i=i>=1?i.toFixed(2)+"MB":l.size+"KB",r.value="",F=i}}),F)return a.msg("文件不能超过"+F)}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,a.config,e),n=e.elem.next();n.attr({name:e.name,accept:e.acceptMime,multiple:e.multiple})},p.prototype.events=function(){var e=this,i=e.config,a=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},l=function(t,n){var o=e.elemFile,a=t.length>1?t.length+"个文件":(t[0]||{}).name||o[0].value.match(/[^\/\\]+\..+/g)||[]||"";o.next().hasClass(s)&&o.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||o.after(''+a+"")};i.elem.off("upload.start").on("upload.start",function(){var o=t(this),a=o.attr("lay-data");if(a)try{a=new Function("return "+a)(),e.config=t.extend({},i,a)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+a)}e.config.item=o,e.elemFile[0].click()}),o.ie&&o.ie<10||i.elem.off("upload.over").on("upload.over",function(){var e=t(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=t(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,o){var r=t(this),u=o.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),a(u),i.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];a(t),i.auto?e.upload():l(t)}),i.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),i.elem.data("haveEvents")||(e.elemFile.on("change",function(){t(this).trigger("upload.change")}),i.elem.on("click",function(){e.isFile()||t(this).trigger("upload.start")}),i.drag&&i.elem.on("dragover",function(e){e.preventDefault(),t(this).trigger("upload.over")}).on("dragleave",function(e){t(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),t(this).trigger("upload.drop",e)}),i.bindAction.on("click",function(){t(this).trigger("upload.action")}),i.elem.data("haveEvents",!0))},a.render=function(e){var t=new p(e);return l.call(t)},e(r,a)});layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
        '+(t.tips?'
        ':"")+'
        '+(t.range?'
        ':"")+"
        ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
        ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
        ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
        f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)});layui.define("jquery",function(e){"use strict";var i=layui.jquery,o={config:{},index:layui.colorpicker?layui.colorpicker.index+1e4:0,set:function(e){var o=this;return o.config=i.extend({},o.config,e),o},on:function(e,i){return layui.onevent.call(this,"colorpicker",e,i)}},r=function(){var e=this,i=e.config;return{config:i}},t="colorpicker",n="layui-show",l="layui-colorpicker",c=".layui-colorpicker-main",a="layui-icon-down",s="layui-icon-close",f="layui-colorpicker-trigger-span",d="layui-colorpicker-trigger-i",u="layui-colorpicker-side",p="layui-colorpicker-side-slider",g="layui-colorpicker-basis",v="layui-colorpicker-alpha-bgcolor",h="layui-colorpicker-alpha-slider",m="layui-colorpicker-basis-cursor",b="layui-colorpicker-main-input",k=function(e){var i={h:0,s:0,b:0},o=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),t=r-o;return i.b=r,i.s=0!=r?255*t/r:0,0!=i.s?e.r==r?i.h=(e.g-e.b)/t:e.g==r?i.h=2+(e.b-e.r)/t:i.h=4+(e.r-e.g)/t:i.h=-1,r==o&&(i.h=0),i.h*=60,i.h<0&&(i.h+=360),i.s*=100/255,i.b*=100/255,i},y=function(e){var e=e.indexOf("#")>-1?e.substring(1):e;if(3==e.length){var i=e.split("");e=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]}e=parseInt(e,16);var o={r:e>>16,g:(65280&e)>>8,b:255&e};return k(o)},x=function(e){var i={},o=e.h,r=255*e.s/100,t=255*e.b/100;if(0==r)i.r=i.g=i.b=t;else{var n=t,l=(255-r)*t/255,c=(n-l)*(o%60)/60;360==o&&(o=0),o<60?(i.r=n,i.b=l,i.g=l+c):o<120?(i.g=n,i.b=l,i.r=n-c):o<180?(i.g=n,i.r=l,i.b=l+c):o<240?(i.b=n,i.r=l,i.g=n-c):o<300?(i.b=n,i.g=l,i.r=l+c):o<360?(i.r=n,i.g=l,i.b=n-c):(i.r=0,i.g=0,i.b=0)}return{r:Math.round(i.r),g:Math.round(i.g),b:Math.round(i.b)}},C=function(e){var o=x(e),r=[o.r.toString(16),o.g.toString(16),o.b.toString(16)];return i.each(r,function(e,i){1==i.length&&(r[e]="0"+i)}),r.join("")},P=function(e){var i=/[0-9]{1,3}/g,o=e.match(i)||[];return{r:o[0],g:o[1],b:o[2]}},B=i(window),w=i(document),D=function(e){var r=this;r.index=++o.index,r.config=i.extend({},r.config,o.config,e),r.render()};D.prototype.config={color:"",size:null,alpha:!1,format:"hex",predefine:!1,colors:["#009688","#5FB878","#1E9FFF","#FF5722","#FFB800","#01AAED","#999","#c00","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgb(0, 186, 189)","rgb(255, 120, 0)","rgb(250, 212, 0)","#393D49","rgba(0,0,0,.5)","rgba(255, 69, 0, 0.68)","rgba(144, 240, 144, 0.5)","rgba(31, 147, 255, 0.73)"]},D.prototype.render=function(){var e=this,o=e.config,r=i(['
        ',"",'3&&(o.alpha&&"rgb"==o.format||(e="#"+C(k(P(o.color))))),"background: "+e):e}()+'">','',"","","
        "].join("")),t=i(o.elem);o.size&&r.addClass("layui-colorpicker-"+o.size),t.addClass("layui-inline").html(e.elemColorBox=r),e.color=e.elemColorBox.find("."+f)[0].style.background,e.events()},D.prototype.renderPicker=function(){var e=this,o=e.config,r=e.elemColorBox[0],t=e.elemPicker=i(['
        ','
        ','
        ','
        ','
        ','
        ',"
        ",'
        ','
        ',"
        ","
        ",'
        ','
        ','
        ',"
        ","
        ",function(){if(o.predefine){var e=['
        '];return layui.each(o.colors,function(i,o){e.push(['
        ','
        ',"
        "].join(""))}),e.push("
        "),e.join("")}return""}(),'
        ','
        ','',"
        ",'
        ','','',"","
        "].join(""));e.elemColorBox.find("."+f)[0];i(c)[0]&&i(c).data("index")==e.index?e.removePicker(D.thisElemInd):(e.removePicker(D.thisElemInd),i("body").append(t)),D.thisElemInd=e.index,D.thisColor=r.style.background,e.position(),e.pickerEvents()},D.prototype.removePicker=function(e){var o=this;o.config;return i("#layui-colorpicker"+(e||o.index)).remove(),o},D.prototype.position=function(){var e=this,i=e.config,o=e.bindElem||e.elemColorBox[0],r=e.elemPicker[0],t=o.getBoundingClientRect(),n=r.offsetWidth,l=r.offsetHeight,c=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},a=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},s=5,f=t.left,d=t.bottom;f-=(n-o.offsetWidth)/2,d+=s,f+n+s>a("width")?f=a("width")-n-s:fa()&&(d=t.top>l?t.top-l:a()-l,d-=2*s),i.position&&(r.style.position=i.position),r.style.left=f+("fixed"===i.position?0:c(1))+"px",r.style.top=d+("fixed"===i.position?0:c())+"px"},D.prototype.val=function(){var e=this,i=(e.config,e.elemColorBox.find("."+f)),o=e.elemPicker.find("."+b),r=i[0],t=r.style.backgroundColor;if(t){var n=k(P(t)),l=i.attr("lay-type");if(e.select(n.h,n.s,n.b),"torgb"===l&&o.find("input").val(t),"rgba"===l){var c=P(t);if(3==(t.match(/[0-9]{1,3}/g)||[]).length)o.find("input").val("rgba("+c.r+", "+c.g+", "+c.b+", 1)"),e.elemPicker.find("."+h).css("left",280);else{o.find("input").val(t);var a=280*t.slice(t.lastIndexOf(",")+1,t.length-1);e.elemPicker.find("."+h).css("left",a)}e.elemPicker.find("."+v)[0].style.background="linear-gradient(to right, rgba("+c.r+", "+c.g+", "+c.b+", 0), rgb("+c.r+", "+c.g+", "+c.b+"))"}}else e.select(0,100,100),o.find("input").val(""),e.elemPicker.find("."+v)[0].style.background="",e.elemPicker.find("."+h).css("left",280)},D.prototype.side=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=r.attr("lay-type"),n=e.elemPicker.find("."+u),l=e.elemPicker.find("."+p),c=e.elemPicker.find("."+g),y=e.elemPicker.find("."+m),C=e.elemPicker.find("."+v),w=e.elemPicker.find("."+h),D=l[0].offsetTop/180*360,E=100-(y[0].offsetTop+3)/180*100,H=(y[0].offsetLeft+3)/260*100,W=Math.round(w[0].offsetLeft/280*100)/100,j=e.elemColorBox.find("."+d),F=e.elemPicker.find(".layui-colorpicker-pre").children("div"),L=function(i,n,l,c){e.select(i,n,l);var f=x({h:i,s:n,b:l});if(j.addClass(a).removeClass(s),r[0].style.background="rgb("+f.r+", "+f.g+", "+f.b+")","torgb"===t&&e.elemPicker.find("."+b).find("input").val("rgb("+f.r+", "+f.g+", "+f.b+")"),"rgba"===t){var d=0;d=280*c,w.css("left",d),e.elemPicker.find("."+b).find("input").val("rgba("+f.r+", "+f.g+", "+f.b+", "+c+")"),r[0].style.background="rgba("+f.r+", "+f.g+", "+f.b+", "+c+")",C[0].style.background="linear-gradient(to right, rgba("+f.r+", "+f.g+", "+f.b+", 0), rgb("+f.r+", "+f.g+", "+f.b+"))"}o.change&&o.change(e.elemPicker.find("."+b).find("input").val())},M=i(['
        t&&(r=t);var l=r/180*360;D=l,L(l,H,E,W),e.preventDefault()};Y(r),e.preventDefault()}),n.on("click",function(e){var o=e.clientY-i(this).offset().top;o<0&&(o=0),o>this.offsetHeight&&(o=this.offsetHeight);var r=o/180*360;D=r,L(r,H,E,W),e.preventDefault()}),y.on("mousedown",function(e){var i=this.offsetTop,o=this.offsetLeft,r=e.clientY,t=e.clientX,n=function(e){var n=i+(e.clientY-r),l=o+(e.clientX-t),a=c[0].offsetHeight-3,s=c[0].offsetWidth-3;n<-3&&(n=-3),n>a&&(n=a),l<-3&&(l=-3),l>s&&(l=s);var f=(l+3)/260*100,d=100-(n+3)/180*100;E=d,H=f,L(D,f,d,W),e.preventDefault()};layui.stope(e),Y(n),e.preventDefault()}),c.on("mousedown",function(e){var o=e.clientY-i(this).offset().top-3+B.scrollTop(),r=e.clientX-i(this).offset().left-3+B.scrollLeft();o<-3&&(o=-3),o>this.offsetHeight-3&&(o=this.offsetHeight-3),r<-3&&(r=-3),r>this.offsetWidth-3&&(r=this.offsetWidth-3);var t=(r+3)/260*100,n=100-(o+3)/180*100;E=n,H=t,L(D,t,n,W),e.preventDefault(),y.trigger(e,"mousedown")}),w.on("mousedown",function(e){var i=this.offsetLeft,o=e.clientX,r=function(e){var r=i+(e.clientX-o),t=C[0].offsetWidth;r<0&&(r=0),r>t&&(r=t);var n=Math.round(r/280*100)/100;W=n,L(D,H,E,n),e.preventDefault()};Y(r),e.preventDefault()}),C.on("click",function(e){var o=e.clientX-i(this).offset().left;o<0&&(o=0),o>this.offsetWidth&&(o=this.offsetWidth);var r=Math.round(o/280*100)/100;W=r,L(D,H,E,r),e.preventDefault()}),F.each(function(){i(this).on("click",function(){i(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e,o=this.style.backgroundColor,r=k(P(o)),t=o.slice(o.lastIndexOf(",")+1,o.length-1);D=r.h,H=r.s,E=r.b,3==(o.match(/[0-9]{1,3}/g)||[]).length&&(t=1),W=t,e=280*t,L(r.h,r.s,r.b,t)})})},D.prototype.select=function(e,i,o,r){var t=this,n=(t.config,C({h:e,s:100,b:100})),l=C({h:e,s:i,b:o}),c=e/360*180,a=180-o/100*180-3,s=i/100*260-3;t.elemPicker.find("."+p).css("top",c),t.elemPicker.find("."+g)[0].style.background="#"+n,t.elemPicker.find("."+m).css({top:a,left:s}),"change"!==r&&t.elemPicker.find("."+b).find("input").val("#"+l)},D.prototype.pickerEvents=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=e.elemPicker.find("."+b+" input"),n={clear:function(i){r[0].style.background="",e.elemColorBox.find("."+d).removeClass(a).addClass(s),e.color="",o.done&&o.done(""),e.removePicker()},confirm:function(i,n){var l=t.val(),c=l,f={};if(l.indexOf(",")>-1){if(f=k(P(l)),e.select(f.h,f.s,f.b),r[0].style.background=c="#"+C(f),(l.match(/[0-9]{1,3}/g)||[]).length>3&&"rgba"===r.attr("lay-type")){var u=280*l.slice(l.lastIndexOf(",")+1,l.length-1);e.elemPicker.find("."+h).css("left",u),r[0].style.background=l,c=l}}else f=y(l),r[0].style.background=c="#"+C(f),e.elemColorBox.find("."+d).removeClass(s).addClass(a);return"change"===n?(e.select(f.h,f.s,f.b,n),void(o.change&&o.change(c))):(e.color=l,o.done&&o.done(l),void e.removePicker())}};e.elemPicker.on("click","*[colorpicker-events]",function(){var e=i(this),o=e.attr("colorpicker-events");n[o]&&n[o].call(this,e)}),t.on("keyup",function(e){var o=i(this);n.confirm.call(this,o,13===e.keyCode?null:"change")})},D.prototype.events=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f);e.elemColorBox.on("click",function(){e.renderPicker(),i(c)[0]&&(e.val(),e.side())}),o.elem[0]&&!e.elemColorBox[0].eventHandler&&(w.on("click",function(o){if(!i(o.target).hasClass(l)&&!i(o.target).parents("."+l)[0]&&!i(o.target).hasClass(c.replace(/\./g,""))&&!i(o.target).parents(c)[0]&&e.elemPicker){if(e.color){var t=k(P(e.color));e.select(t.h,t.s,t.b)}else e.elemColorBox.find("."+d).removeClass(a).addClass(s);r[0].style.background=e.color||"",e.removePicker()}}),B.on("resize",function(){return!(!e.elemPicker||!i(c)[0])&&void e.position()}),e.elemColorBox[0].eventHandler=!0)},o.render=function(e){var i=new D(e);return r.call(i)},e(t,o)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",s="layui-this",o="layui-hide",c="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};u.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},u.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},u.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.val=function(e,i){var a=this,n=t(r+'[lay-filter="'+e+'"]');return n.each(function(e,a){var n=t(this);layui.each(i,function(e,t){var i,a=n.find('[name="'+e+'"]');a[0]&&(i=a[0].type,"checkbox"===i?a[0].checked=t:"radio"===i?a.each(function(){this.value==t&&(this.checked=!0)}):a.val(t))})}),f.render(null,e),a.getValue(e)},u.prototype.getValue=function(e,i){i=i||t(r+'[lay-filter="'+e+'"]').eq(0);var a={},n={},l=i.find("input,select,textarea");return layui.each(l,function(e,t){if(t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name){if(/^.*\[\]$/.test(t.name)){var i=t.name.match(/^(.*)\[\]$/g)[0];a[i]=0|a[i],t.name=t.name.replace(/^(.*)\[\]$/,"$1["+a[i]++ +"]")}/^checkbox|radio$/.test(t.type)&&!t.checked||(n[t.name]=t.value)}}),n},u.prototype.render=function(e,i){var n=this,u=t(r+function(){return i?'[lay-filter="'+i+'"]':""}()),d={select:function(){var e,i="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=u.find("select"),v=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(i,u,f){var y,p=t(this),m=i.find("."+n),k=m.find("input"),g=i.find("dl"),x=g.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=g.outerHeight();b=p[0].selectedIndex,i.addClass(a+"ed"),x.removeClass(o),y=null,x.eq(b).addClass(s).siblings().removeClass(s),e+t>h.height()&&e>=t&&i.addClass(a+"up"),T()},w=function(e){i.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||$(k.val(),function(e){var i=p[0].selectedIndex;e&&(d=t(p[0].options[i]).html(),0===i&&d===k.attr("placeholder")&&(d=""),k.val(d||""))})},T=function(){var e=g.children("dd."+s);if(e[0]){var t=e.position().top,i=g.height(),a=e.height();t>i&&g.scrollTop(t+g.scrollTop()-i+a-5),t<0&&g.scrollTop(t+g.scrollTop()-5)}};m.on("click",function(e){i.hasClass(a+"ed")?w():(v(e,!0),C()),g.find("."+r).remove()}),m.find(".layui-edge").on("click",function(){k.focus()}),k.on("keyup",function(e){var t=e.keyCode;9===t&&C()}).on("keydown",function(e){var t=e.keyCode;9===t&&w();var i=function(t,a){var n,l;e.preventDefault();var r=function(){var e=g.children("dd."+s);if(g.children("dd."+o)[0]&&"next"===t){var i=g.children("dd:not(."+o+",."+c+")"),n=i.eq(0).index();if(n>=0&&n无匹配项

        '):g.find("."+r).remove()},"keyup"),""===t&&g.find("."+r).remove(),void T())};f&&k.on("keyup",q).on("blur",function(i){var a=p[0].selectedIndex;e=k,d=t(p[0].options[a]).html(),0===a&&d===k.attr("placeholder")&&(d=""),setTimeout(function(){$(k.val(),function(e){d||k.val("")},"blur")},200)}),x.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=p.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?k.val(""):(k.val(e.text()),e.addClass(s)),e.siblings().removeClass(s),p.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:p[0],value:a,othis:i}),w(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=t(this),o=r.next("."+a),u=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),v=l.options[0];if("string"==typeof r.attr("lay-ignore"))return r.show();var h="string"==typeof r.attr("lay-search"),p=v?v.value?i:v.innerHTML||i:i,m=t(['
        ','
        ','','
        ','
        ',function(e){var t=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?t.push("
        "+a.label+"
        "):t.push('
        '+a.innerHTML+"
        "):t.push('
        '+(a.innerHTML||i)+"
        ")}),0===t.length&&t.push('
        没有选项
        '),t.join("")}(r.find("*"))+"
        ","
        "].join(""));o[0]&&o.remove(),r.after(m),y.call(this,m,u,h)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},i=u.find("input[type=checkbox]"),a=function(e,i){var a=t(this);e.on("click",function(){var t=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(i[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(i[1]).find("em").text(n[0])),layui.event.call(a[0],l,i[2]+"("+t+")",{elem:a[0],value:a[0].value,othis:e}))})};i.each(function(i,n){var l=t(this),r=l.attr("lay-skin"),s=(l.attr("lay-text")||"").split("|"),o=this.disabled;"switch"===r&&(r="_"+r);var u=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+u[0]),f=t(['
        ",function(){var e=n.title.replace(/\s/g,""),t={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?s[0]:s[1])||"")+""};return t[r]||t.checkbox}(),"
        "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",i=["",""],a=u.find("input[type=radio]"),n=function(a){var n=t(this),s="layui-anim-scaleSpring";a.on("click",function(){var o=n[0].name,c=n.parents(r),u=n.attr("lay-filter"),d=c.find("input[name="+o.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=t(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(i[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(i[0]),layui.event.call(n[0],l,"radio("+u+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=t(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var u=t(['
        ',''+i[l.checked?0:1]+"","
        "+function(){var e=l.title||"";return"string"==typeof r.next().attr("lay-radio")&&(e=r.next().html(),r.next().remove()),e}()+"
        ","
        "].join(""));r.after(u),n.call(this,u)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,t){t()}),n};var d=function(){var e=null,a=f.config.verify,s="layui-form-danger",o={},c=t(this),u=c.parents(r),d=u.find("*[lay-verify]"),v=c.parents("form")[0],h=c.attr("lay-filter");return layui.each(d,function(l,r){var o=t(this),c=o.attr("lay-verify").split("|"),u=o.attr("lay-verType"),d=o.val();if(o.removeClass(s),layui.each(c,function(t,l){var c,f="",v="function"==typeof a[l];if(a[l]){var c=v?f=a[l](d,r):!a[l][0].test(d);if(f=f||a[l][1],"required"===l&&(f=o.attr("lay-reqText")||f),c)return"tips"===u?i.tips(f,function(){return"string"==typeof o.attr("lay-ignore")||"select"!==r.tagName.toLowerCase()&&!/^checkbox|radio$/.test(r.type)?o:o.next()}(),{tips:1}):"alert"===u?i.alert(f,{title:"提示",shadeClose:!0}):i.msg(f,{icon:5,shift:6}),n.android||n.ios||setTimeout(function(){r.focus()},7),o.addClass(s),e=!0}}),e)return e}),!e&&(o=f.getValue(null,u),layui.event.call(this,l,"submit("+h+")",{elem:this,form:v,field:o}))},f=new u,v=t(document),h=t(window);f.render(),v.on("reset",r,function(){var e=t(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)});layui.define("form",function(e){"use strict";var i=layui.$,a=layui.form,n=layui.layer,t="tree",r={config:{},index:layui[t]?layui[t].index+1e4:0,set:function(e){var a=this;return a.config=i.extend({},a.config,e),a},on:function(e,i){return layui.onevent.call(this,t,e,i)}},l=function(){var e=this,i=e.config,a=i.id||e.index;return l.that[a]=e,l.config[a]=i,{config:i,reload:function(i){e.reload.call(e,i)},getChecked:function(){return e.getChecked.call(e)},setChecked:function(i){return e.setChecked.call(e,i)}}},c="layui-hide",d="layui-disabled",s="layui-tree-set",o="layui-tree-iconClick",h="layui-icon-addition",u="layui-icon-subtraction",p="layui-tree-entry",f="layui-tree-main",y="layui-tree-txt",v="layui-tree-pack",C="layui-tree-spread",k="layui-tree-setLineShort",m="layui-tree-showLine",x="layui-tree-lineExtend",b=function(e){var a=this;a.index=++r.index,a.config=i.extend({},a.config,r.config,e),a.render()};b.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"未命名",none:"无数据"}},b.prototype.reload=function(e){var a=this;layui.each(e,function(e,i){i.constructor===Array&&delete a.config[e]}),a.config=i.extend(!0,{},a.config,e),a.render()},b.prototype.render=function(){var e=this,a=e.config;e.checkids=[];var n=i('
        ');e.tree(n);var t=a.elem=i(a.elem);if(t[0]){if(e.key=a.id||e.index,e.elem=n,e.elemNone=i('
        '+a.text.none+"
        "),t.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);a.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=i(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(k),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(k)}),e.events()}},b.prototype.renderForm=function(e){a.render(e,"LAY-tree-"+this.index)},b.prototype.tree=function(e,a){var n=this,t=n.config,r=a||t.data;layui.each(r,function(a,r){var l=r.children&&r.children.length>0,o=i('
        '),h=i(['
        ','
        ','
        ',function(){return t.showLine?l?'':'':''}(),function(){return t.showCheckbox?'':""}(),function(){return t.isJump&&r.href?''+(r.title||r.label||t.text.defaultNodeName)+"":''+(r.title||r.label||t.text.defaultNodeName)+""}(),"
        ",function(){if(!t.edit)return"";var e={add:'',update:'',del:''},i=['
        '];return t.edit===!0&&(t.edit=["update","del"]),"object"==typeof t.edit?(layui.each(t.edit,function(a,n){i.push(e[n]||"")}),i.join("")+"
        "):void 0}(),"
        "].join(""));l&&(h.append(o),n.tree(o,r.children)),e.append(h),h.prev("."+s)[0]&&h.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),l||h.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),n.spread(h,r),t.showCheckbox&&(r.checked&&n.checkids.push(r.id),n.checkClick(h,r)),t.edit&&n.operate(h,r)})},b.prototype.spread=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f),c=r.find("."+o),k=r.find("."+y),m=t.onlyIconControl?c:l,x="";m.on("click",function(i){var a=e.children("."+v),n=m.children(".layui-icon")[0]?m.children(".layui-icon"):m.find(".layui-tree-icon").children(".layui-icon");if(a[0]){if(e.hasClass(C))e.removeClass(C),a.slideUp(200),n.removeClass(u).addClass(h);else if(e.addClass(C),a.slideDown(200),n.addClass(u).removeClass(h),t.accordion){var r=e.siblings("."+s);r.removeClass(C),r.children("."+v).slideUp(200),r.find(".layui-tree-icon").children(".layui-icon").removeClass(u).addClass(h)}}else x="normal"}),k.on("click",function(){var n=i(this);n.hasClass(d)||(x=e.hasClass(C)?t.onlyIconControl?"open":"close":t.onlyIconControl?"close":"open",t.click&&t.click({elem:e,state:x,data:a}))})},b.prototype.setCheckbox=function(e,i,a){var n=this,t=(n.config,a.prop("checked"));if(!a.prop("disabled")){if("object"==typeof i.children||e.find("."+v)[0]){var r=e.find("."+v).find('input[same="layuiTreeCheck"]');r.each(function(){this.disabled||(this.checked=t)})}var l=function(e){if(e.parents("."+s)[0]){var i,a=e.parent("."+v),n=a.parent(),r=a.prev().find('input[same="layuiTreeCheck"]');t?r.prop("checked",t):(a.find('input[same="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||r.prop("checked",!1)),l(n)}};l(e),n.renderForm("checkbox")}},b.prototype.checkClick=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f);l.on("click",'input[same="layuiTreeCheck"]+',function(r){layui.stope(r);var l=i(this).prev(),c=l.prop("checked");l.prop("disabled")||(n.setCheckbox(e,a,l),t.oncheck&&t.oncheck({elem:e,checked:c,data:a}))})},b.prototype.operate=function(e,a){var t=this,r=t.config,l=e.children("."+p),d=l.children("."+f);l.children(".layui-tree-btnGroup").on("click",".layui-icon",function(l){layui.stope(l);var f=i(this).data("type"),b=e.children("."+v),g={data:a,type:f,elem:e};if("add"==f){b[0]||(r.showLine?(d.find("."+o).addClass("layui-tree-icon"),d.find("."+o).children(".layui-icon").addClass(h).removeClass("layui-icon-file")):d.find(".layui-tree-iconArrow").removeClass(c),e.append('
        '));var w=r.operate&&r.operate(g),N={};if(N.title=r.text.defaultNodeName,N.id=w,t.tree(e.children("."+v),[N]),r.showLine)if(b[0])b.hasClass(x)||b.addClass(x),e.find("."+v).each(function(){i(this).children("."+s).last().addClass(k)}),b.children("."+s).last().prev().hasClass(k)?b.children("."+s).last().prev().removeClass(k):b.children("."+s).last().removeClass(k),!e.parent("."+v)[0]&&e.next()[0]&&b.children("."+s).last().removeClass(k);else{var T=e.siblings("."+s),L=1,A=e.parent("."+v);layui.each(T,function(e,a){i(a).children("."+v)[0]||(L=0)}),1==L?(T.children("."+v).addClass(m),T.children("."+v).children("."+s).removeClass(k),e.children("."+v).addClass(m),A.removeClass(x),A.children("."+s).last().children("."+v).children("."+s).last().addClass(k)):e.children("."+v).children("."+s).addClass(k)}if(!r.showCheckbox)return;if(d.find('input[same="layuiTreeCheck"]')[0].checked){var I=e.children("."+v).children("."+s).last();I.find('input[same="layuiTreeCheck"]')[0].checked=!0}t.renderForm("checkbox")}else if("update"==f){var F=d.children("."+y).html();d.children("."+y).html(""),d.append(''),d.children(".layui-tree-editInput").val(F).focus();var j=function(e){var i=e.val().trim();i=i?i:r.text.defaultNodeName,e.remove(),d.children("."+y).html(i),g.data.title=i,r.operate&&r.operate(g)};d.children(".layui-tree-editInput").blur(function(){j(i(this))}),d.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),j(i(this)))})}else n.confirm('确认删除该节点 "'+(a.title||"")+'" 吗?',function(a){if(r.operate&&r.operate(g),g.status="remove",n.close(a),!e.prev("."+s)[0]&&!e.next("."+s)[0]&&!e.parent("."+v)[0])return e.remove(),void t.elem.append(t.elemNone);if(e.siblings("."+s).children("."+p)[0]){if(r.showCheckbox){var l=function(e){if(e.parents("."+s)[0]){var a=e.siblings("."+s).children("."+p),n=e.parent("."+v).prev(),r=n.find('input[same="layuiTreeCheck"]')[0],c=1,d=0;0==r.checked&&(a.each(function(e,a){var n=i(a).find('input[same="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(c=0),n.disabled||(d=1)}),1==c&&1==d&&(r.checked=!0,t.renderForm("checkbox"),l(n.parent("."+s))))}};l(e)}if(r.showLine){var d=e.siblings("."+s),h=1,f=e.parent("."+v);layui.each(d,function(e,a){i(a).children("."+v)[0]||(h=0)}),1==h?(b[0]||(f.removeClass(x),d.children("."+v).addClass(m),d.children("."+v).children("."+s).removeClass(k)),e.next()[0]?f.children("."+s).last().children("."+v).children("."+s).last().addClass(k):e.prev().children("."+v).children("."+s).last().addClass(k),e.next()[0]||e.parents("."+s)[1]||e.parents("."+s).eq(0).next()[0]||e.prev("."+s).addClass(k)):!e.next()[0]&&e.hasClass(k)&&e.prev().addClass(k)}}else{var y=e.parent("."+v).prev();if(r.showLine){y.find("."+o).removeClass("layui-tree-icon"),y.find("."+o).children(".layui-icon").removeClass(u).addClass("layui-icon-file");var w=y.parents("."+v).eq(0);w.addClass(x),w.children("."+s).each(function(){i(this).children("."+v).children("."+s).last().addClass(k)})}else y.find(".layui-tree-iconArrow").addClass(c);e.parents("."+s).eq(0).removeClass(C),e.parent("."+v).remove()}e.remove()})})},b.prototype.events=function(){var e=this,a=e.config;e.elem.find(".layui-tree-checkedFirst");e.setChecked(e.checkids),e.elem.find(".layui-tree-search").on("keyup",function(){var n=i(this),t=n.val(),r=n.nextAll(),l=[];r.find("."+y).each(function(){var e=i(this).parents("."+p);if(i(this).html().indexOf(t)!=-1){l.push(i(this).parent());var a=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+v)[0]&&a(e.parent("."+v).parent("."+s))};a(e.parent("."+s))}}),r.find("."+p).each(function(){var e=i(this).parent("."+s);e.hasClass("layui-tree-searchShow")||e.addClass(c)}),0==r.find(".layui-tree-searchShow").length&&e.elem.append(e.elemNone),a.onsearch&&a.onsearch({elem:l})}),e.elem.find(".layui-tree-search").on("keydown",function(){i(this).nextAll().find("."+p).each(function(){var e=i(this).parent("."+s);e.removeClass("layui-tree-searchShow "+c)}),i(".layui-tree-emptyText")[0]&&i(".layui-tree-emptyText").remove()})},b.prototype.getChecked=function(){var e=this,a=e.config,n=[],t=[];e.elem.find(".layui-form-checked").each(function(){n.push(i(this).prev()[0].value)});var r=function(e,a){layui.each(e,function(e,t){layui.each(n,function(e,n){if(t.id==n){var l=i.extend({},t);return delete l.children,a.push(l),t.children&&(l.children=[],r(t.children,l.children)),!0}})})};return r(i.extend({},a.data),t),t},b.prototype.setChecked=function(e){var a=this;a.config;a.elem.find("."+s).each(function(a,n){var t=i(this).data("id"),r=i(n).children("."+p).find('input[same="layuiTreeCheck"]'),l=r.next();if("number"==typeof e){if(t==e)return r[0].checked||l.click(),!1}else"object"==typeof e&&layui.each(e,function(e,i){if(i==t&&!r[0].checked)return l.click(),!0})})},l.that={},l.config={},r.reload=function(e,i){var a=l.that[e];return a.reload(i),l.call(a)},r.getChecked=function(e){var i=l.that[e];return i.getChecked()},r.setChecked=function(e,i){var a=l.that[e];return a.setChecked(i)},r.render=function(e){var i=new b(e);return l.call(i)},e(t,r)});layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,n=layui.form,i="transfer",l={config:{},index:layui[i]?layui[i].index+1e4:0,set:function(e){var t=this;return t.config=a.extend({},t.config,e),t},on:function(e,a){return layui.onevent.call(this,i,e,a)}},r=function(){var e=this,a=e.config,t=a.id||e.index;return r.that[t]=e,r.config[t]=a,{config:a,reload:function(a){e.reload.call(e,a)},getData:function(){return e.getData.call(e)}}},c="layui-hide",o="layui-btn-disabled",d="layui-none",s="layui-transfer-box",u="layui-transfer-header",h="layui-transfer-search",f="layui-transfer-active",y="layui-transfer-data",p=function(e){return e=e||{},['
        ','
        ','","
        ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
          ',"
          "].join("")},v=['
          ',p({index:0,checkAllName:"layTransferLeftCheckAll"}),'
          ','",'","
          ",p({index:1,checkAllName:"layTransferRightCheckAll"}),"
          "].join(""),x=function(e){var t=this;t.index=++l.index,t.config=a.extend({},t.config,l.config,e),t.render()};x.prototype.config={title:["列表一","列表二"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"无数据",searchNone:"无匹配数据"}},x.prototype.reload=function(e){var t=this;layui.each(e,function(e,a){a.constructor===Array&&delete t.config[e]}),t.config=a.extend(!0,{},t.config,e),t.render()},x.prototype.render=function(){var e=this,n=e.config,i=e.elem=a(t(v).render({data:n,index:e.index})),l=n.elem=a(n.elem);l[0]&&(n.data=n.data||[],n.value=n.value||[],e.key=n.id||e.index,l.html(e.elem),e.layBox=e.elem.find("."+s),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+h),e.layData=i.find("."+y),e.layBtn=i.find("."+f+" .layui-btn"),e.layBox.css({width:n.width,height:n.height}),e.layData.css({height:function(){return n.height-e.layHeader.outerHeight()-e.laySearch.outerHeight()-2}()}),e.renderData(),e.events())},x.prototype.renderData=function(){var e=this,a=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,n=["
        • ",'',"
        • "].join("");a[t].views.push(n),delete e.selected}),e.layData.eq(0).html(a[0].views.join("")),e.layData.eq(1).html(a[1].views.join("")),e.renderCheckBtn()},x.prototype.renderForm=function(e){n.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,n=t.config;e=e||{},t.layBox.each(function(i){var l=a(this),r=l.find("."+y),d=l.find("."+u).find('input[type="checkbox"]'),s=r.find('input[type="checkbox"]'),h=0,f=!1;if(s.each(function(){var e=a(this).data("hide");(this.checked||this.disabled||e)&&h++,this.checked&&!e&&(f=!0)}),d.prop("checked",f&&h===s.length),t.layBtn.eq(i)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":n.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var n=a('

          '+(t||"")+"

          ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(n)},x.prototype.setValue=function(){var e=this,t=e.config,n=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||n.push(this.value)}),t.value=n,e},x.prototype.parseData=function(e){var t=this,n=t.config,i=[];return layui.each(n.data,function(t,l){l=("function"==typeof n.parseData?n.parseData(l):l)||l,i.push(l=a.extend({},l)),layui.each(n.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),n.data=i,t},x.prototype.getData=function(e){var a=this,t=a.config,n=[];return a.setValue(),layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&n.push(t)})}),n},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),n=t[0].checked,i=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&i.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=n)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var n=a(this),i=n.data("index"),l=e.layBox.eq(i),r=[];if(!n.hasClass(o)){e.layBox.eq(i).each(function(t){var n=a(this),i=n.find("."+y);i.children("li").each(function(){var t=a(this),n=t.find('input[type="checkbox"]'),i=n.data("hide");n[0].checked&&!i&&(n[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(n[0].value)),e.setValue()})}),e.renderCheckBtn();var c=l.siblings("."+s).find("."+h+" input");""===c.val()||c.trigger("keyup"),t.onchange&&t.onchange(e.getData(r),i)}}),e.laySearch.find("input").on("keyup",function(){var n=this.value,i=a(this).parents("."+h).eq(0).siblings("."+y),l=i.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),i=t[0].title.indexOf(n)!==-1;e[i?"removeClass":"addClass"](c),t.data("hide",!i)}),e.renderCheckBtn();var r=l.length===i.children("li."+c).length;e.noneView(i,r?t.text.searchNone:"")})},r.that={},r.config={},l.reload=function(e,a){var t=r.that[e];return t.reload(a),r.call(t)},l.getData=function(e){var a=r.that[e];return a.getData()},l.render=function(e){var a=new x(e);return r.call(a)},e(i,l)});layui.define(["laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=(layui.util,layui.hint()),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,y,e,t)}},c=function(){var e=this,t=e.config,i=t.id||t.index;return i&&(c.that[i]=e,c.config[i]=t),{config:t,reload:function(t){e.reload.call(e,t)},setColsWidth:function(){e.setColsWidth.call(e)},resize:function(){e.resize.call(e)}}},s=function(e){var t=c.config[e];return t||o.error("The ID option was not found in the table instance"),t||null},u=function(e,a,l,n){var o=e.templet?function(){return"function"==typeof e.templet?e.templet(l):i(t(e.templet).html()||String(a)).render(l)}():a;return n?t("
          "+o+"
          ").text():o},y="table",h=".layui-table",f="layui-hide",p="layui-none",v="layui-table-view",m=".layui-table-tool",g=".layui-table-box",b=".layui-table-init",x=".layui-table-header",k=".layui-table-body",C=".layui-table-main",w=".layui-table-fixed",T=".layui-table-fixed-l",A=".layui-table-fixed-r",L=".layui-table-total",N=".layui-table-page",S=".layui-table-sort",R="layui-table-edit",W="layui-table-hover",_=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
          ','
          ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
          ","
          "].join("")},E=['',"","
          "].join(""),z=['
          ',"{{# if(d.data.toolbar){ }}",'
          ','
          ','
          ',"
          ","{{# } }}",'
          ',"{{# if(d.data.loading){ }}",'
          ','',"
          ","{{# } }}","{{# var left, right; }}",'
          ',_(),"
          ",'
          ',E,"
          ","{{# if(left){ }}",'
          ','
          ',_({fixed:!0}),"
          ",'
          ',E,"
          ","
          ","{{# }; }}","{{# if(right){ }}",'
          ','
          ',_({fixed:"right"}),'
          ',"
          ",'
          ',E,"
          ","
          ","{{# }; }}","
          ","{{# if(d.data.totalRow){ }}",'
          ','','',"
          ","
          ","{{# } }}","{{# if(d.data.page){ }}",'
          ','
          ',"
          ","{{# } }}","","
          "].join(""),H=t(window),j=t(document),F=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};F.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],autoSort:!0,text:{none:"无数据"}},F.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id")||e.index,a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",totalRowName:"totalRow",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;a.height&&/^full-\d+$/.test(a.height)&&(e.fullHeightGap=a.height.split("-")[1],a.height=H.height()-e.fullHeightGap),e.setInit();var l=a.elem,n=l.next("."+v),o=e.elem=t(i(z).render({VIEW_CLASS:v,data:a,index:e.index}));if(a.index=e.index,e.key=a.id||a.index,n[0]&&n.remove(),l.after(o),e.layTool=o.find(m),e.layBox=o.find(g),e.layHeader=o.find(x),e.layMain=o.find(C),e.layBody=o.find(k),e.layFixed=o.find(w),e.layFixLeft=o.find(T),e.layFixRight=o.find(A),e.layTotal=o.find(L),e.layPage=o.find(N),e.renderToolbar(),e.fullSize(),a.cols.length>1){var r=e.layFixed.find(x).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},F.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},F.prototype.setInit=function(e){var t=this,i=t.config;return i.clientWidth=i.width||function(){var e=function(t){var a,l;t=t||i.elem.parent(),a=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||a&&!l?a:e(t.parent())};return e()}(),"width"===e?i.clientWidth:void layui.each(i.cols,function(e,a){layui.each(a,function(l,n){if(!n)return void a.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(i.cols[e+1],function(t,i){i.HAS_PARENT||o>1&&o==n.colspan||(i.HAS_PARENT=!0,i.parentKey=e+"-"+l,o+=parseInt(i.colspan>1?i.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},F.prototype.renderToolbar=function(){var e=this,a=e.config,l=['
          ','
          ','
          '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===a.toolbar)n.html(l);else if("string"==typeof a.toolbar){var o=t(a.toolbar).html()||"";o&&n.html(i(o).render(a))}var r={filter:{title:"筛选列",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"导出",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"打印",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof a.defaultToolbar&&layui.each(a.defaultToolbar,function(e,t){var i="string"==typeof t?r[t]:t;i&&d.push('
          ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},F.prototype.setParentCol=function(e,t){var i=this,a=i.config,l=i.layHeader.find('th[data-key="'+a.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=a.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](f),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&i.setParentCol(e,d)}},F.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,i){layui.each(i,function(t,i){i.hide&&e.setParentCol(i.hide,i.parentKey)})})},F.prototype.setColsWidth=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||i++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:i+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(i,r){layui.each(r,function(i,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&a&&(l=(o-n)/a)};r(),r(!0),e.autoColNums=a,e.eachCols(function(i,a){var n=a.minWidth||t.cellMinWidth;a.colGroup||a.hide||(0===a.width?e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(a.width)&&e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(parseFloat(a.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-i&&d<=i){var c=function(t){var i;return t=t||e.layHeader.eq(0).find("thead th:last-child"),i=t.data("field"),!i&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var i=t.style.width||s.outerWidth();t.style.width=parseFloat(i)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},F.prototype.resize=function(){var e=this;e.fullSize(),e.setColsWidth(),e.scrollPatch()},F.prototype.reload=function(e){var i=this;e=e||{},delete i.haveInit,e.data&&e.data.constructor===Array&&delete i.config.data,i.config=t.extend(!0,{},i.config,e),i.render()},F.prototype.errorView=function(e){var i=this,a=i.layMain.find("."+p),l=t('
          '+(e||"Error")+"
          ");a[0]&&(i.layNone.remove(),a.remove()),i.layFixed.addClass(f),i.layMain.find("tbody").html(""),i.layMain.append(i.layNone=l),d.cache[i.key]=[]},F.prototype.page=1,F.prototype.pullData=function(e){var i=this,a=i.config,l=a.request,n=a.response,o=function(){"object"==typeof a.initSort&&i.sort(a.initSort.field,a.initSort.type)};if(i.startTime=(new Date).getTime(),a.url){var r={};r[l.pageName]=e,r[l.limitName]=a.limit;var d=t.extend(r,a.where);a.contentType&&0==a.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),i.loading(),t.ajax({type:a.method||"get",url:a.url,contentType:a.contentType,data:d,dataType:"json",headers:a.headers||{},success:function(t){"function"==typeof a.parseData&&(t=a.parseData(t)||t),t[n.statusName]!=n.statusCode?(i.renderForm(),i.errorView(t[n.msgName]||'返回的数据不符合规范,正确的成功状态码应为:"'+n.statusName+'": '+n.statusCode)):(i.renderData(t,e,t[n.countName]),o(),a.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof a.done&&a.done(t,e,t[n.countName])},error:function(e,t){i.errorView("数据接口请求异常:"+t),i.renderForm(),i.setColsWidth()}})}else if(a.data&&a.data.constructor===Array){var c={},s=e*a.limit-a.limit;c[n.dataName]=a.data.concat().splice(s,a.limit),c[n.countName]=a.data.length,"object"==typeof a.totalRow&&(c[n.totalRowName]=t.extend({},a.totalRow)),i.renderData(c,e,c[n.countName]),o(),i.setColsWidth(),"function"==typeof a.done&&a.done(c,e,c[n.countName])}},F.prototype.eachCols=function(e){var t=this;return d.eachCols(null,e,t.config.cols),t},F.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,y=e[s.response.dataName]||[],h=e[s.response.totalRowName],v=[],m=[],g=[],b=function(){var e;return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(y,function(a,l){var o=[],y=[],h=[],p=a+s.limit*(n-1)+1;0!==l.length&&(r||(l[d.config.indexName]=a),c.eachCols(function(n,r){var c=r.field||n,v=s.index+"-"+r.key,m=l[c];if(void 0!==m&&null!==m||(m=""),!r.colGroup){var g=['','
          '+function(){var n=t.extend(!0,{LAY_INDEX:p},l),o=d.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=a),'';case"numbers":return p}return r.toolbar?i(t(r.toolbar).html()||"").render(n):u(r,m,n)}(),"
          "].join("");o.push(g),r.fixed&&"right"!==r.fixed&&y.push(g),"right"===r.fixed&&h.push(g)}}),v.push(''+o.join("")+""),m.push(''+y.join("")+""),g.push(''+h.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+p).remove(),c.layMain.find("tbody").html(v.join("")),c.layFixLeft.find("tbody").html(m.join("")),c.layFixRight.find("tbody").html(g.join("")),c.renderForm(),"number"==typeof e&&c.setThisRowChecked(e),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,l.close(c.tipsIndex),s.HAS_SET_COLS_PATCH||c.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return d.cache[c.key]=y,c.layPage[0==o||0===y.length&&1==n?"addClass":"removeClass"](f),r?b():0===y.length?(c.renderForm(),c.errorView(s.text.none)):(c.layFixed.removeClass(f),b(),c.renderTotal(y,h),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr))}},s.page),s.page.count=o,a.render(s.page))))},F.prototype.renderTotal=function(e,t){var i=this,a=i.config,l={};if(a.totalRow){layui.each(e,function(e,t){0!==t.length&&i.eachCols(function(e,i){var a=i.field||e,n=t[a];i.totalRow&&(l[a]=(l[a]||0)+(parseFloat(n)||0))})}),i.dataTotal={};var n=[];i.eachCols(function(e,o){var r=o.field||e,d=function(){var e=o.totalRowText||"",i=parseFloat(l[r]).toFixed(2),a={};return a[r]=i,i=u(o,i,a),t?t[o.field]||e:o.totalRow?i||e:e}(),c=['','
          '+d,"
          "].join("");o.field&&(i.dataTotal[r]=d),n.push(c)}),i.layTotal.find("tbody").html(""+n.join("")+"")}},F.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},F.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},F.prototype.setThisRowChecked=function(e){var t=this,i=(t.config,"layui-table-click"),a=t.layBody.find('tr[data-index="'+e+'"]');a.addClass(i).siblings("tr").removeClass(i)},F.prototype.sort=function(e,i,a,l){var n,r,c=this,s={},u=c.config,h=u.elem.attr("lay-filter"),f=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field"),p=e.data("key");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var v=c.layHeader.find("th .laytable-cell-"+p).find(S);c.layHeader.find("th").find(S).removeAttr("lay-sort"),v.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},u.autoSort&&("asc"===i?r=layui.sort(f,n):"desc"===i?r=layui.sort(f,n,!0):(r=layui.sort(f,d.config.indexName),delete c.sortKey)),s[u.response.dataName]=r||f,c.renderData(s,c.page,c.count,!0),l&&layui.event.call(e,y,"sort("+h+")",{field:n,type:i})},F.prototype.loading=function(e){var i=this,a=i.config;a.loading&&(e?(i.layInit&&i.layInit.remove(),delete i.layInit,i.layBox.find(b).remove()):(i.layInit=t(['
          ','',"
          "].join("")),i.layBox.append(i.layInit)))},F.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},F.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},F.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(i,a){if(a.selectorText===".laytable-cell-"+e)return t(a),!0})},F.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=H.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),a&&(e=parseFloat(a)-(t.layHeader.outerHeight()||38),i.toolbar&&(e-=t.layTool.outerHeight()||50),i.totalRow&&(e-=t.layTotal.outerHeight()||40),i.page&&(e-=t.layPage.outerHeight()||41),t.layMain.css("height",e-2))},F.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},F.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),i.outerWidth()-e.layMain.width()),o=function(e){if(a&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var i=t('
          ');i.find("div").css({width:a}),e.find("tr").append(i)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(k).css("height",i.height()>=d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](f),e.layFixRight.css("right",a-1)},F.prototype.events=function(){var e,i=this,a=i.config,o=t("body"),c={},s=i.layHeader.find("th"),h=".layui-table-cell",p=a.elem.attr("lay-filter");i.layTool.on("click","*[lay-event]",function(e){var o=t(this),c=o.attr("lay-event"),s=function(e){var l=t(e.list),n=t('
            ');n.html(l),a.height&&n.css("max-height",a.height-(i.layTool.outerHeight()||50)),o.find(".layui-table-tool-panel")[0]||o.append(n),i.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),j.trigger("table.tool.panel.remove"),l.close(i.tipsIndex),c){case"LAYTABLE_COLS":s({list:function(){var e=[];return i.eachCols(function(t,i){i.field&&"normal"==i.type&&e.push('
          • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var l=t(e.elem),n=this.checked,o=l.data("key"),r=l.data("parentkey");layui.each(a.cols,function(e,t){layui.each(t,function(t,l){if(e+"-"+t===o){var d=l.hide;l.hide=!n,i.elem.find('*[data-key="'+a.index+"-"+o+'"]')[n?"removeClass":"addClass"](f),d!=l.hide&&i.setParentCol(!n,r),i.resize()}})})})}});break;case"LAYTABLE_EXPORT":r.ie?l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出",this,{tips:3}):s({list:function(){return['
          • 导出到 Csv 文件
          • ','
          • 导出到 Excel 文件
          • '].join("")}(),done:function(e,l){l.on("click",function(){var e=t(this).data("type");d.exportFile.call(i,a.id,null,e)})}});break;case"LAYTABLE_PRINT":var u=window.open("打印窗口","_blank"),h=[""].join(""),v=t(i.layHeader.html());v.append(i.layMain.find("table").html()),v.append(i.layTotal.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),u.document.write(h+v.prop("outerHTML")),u.document.close(),u.print(),u.close()}layui.event.call(this,y,"toolbar("+p+")",t.extend({event:c,config:a},{}))}),s.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.data("unresize")||c.resizeStart||(c.allowResize=i.width()-l<=10,o.css("cursor",c.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);c.resizeStart||o.css("cursor","")}).on("mousedown",function(e){var l=t(this);if(c.allowResize){var n=l.data("key");e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],i.getCssRule(n,function(e){var t=e.style.width||l.outerWidth();c.rule=e,c.ruleWidth=parseFloat(t),c.minWidth=l.data("minwidth")||a.cellMinWidth})}}),j.on("mousemove",function(t){if(c.resizeStart){if(t.preventDefault(),c.rule){var a=c.ruleWidth+t.clientX-c.offset[0];a');return n[0].value=i.data("content")||l.text(),i.find("."+R)[0]||i.append(n),n.focus(),void layui.stope(e)}}).on("mouseenter","td",function(){b.call(this)}).on("mouseleave","td",function(){b.call(this,"hide")});var g="layui-table-grid-down",b=function(e){var i=t(this),a=i.children(h);if(!i.data("off"))if(e)i.find(".layui-table-grid-down").remove();else if(a.prop("scrollWidth")>a.outerWidth()){if(a.find("."+g)[0])return;i.append('
            ')}};i.layBody.on("click","."+g,function(e){var n=t(this),o=n.parent(),d=o.children(h);i.tipsIndex=l.tips(['
            ',d.html(),"
            ",''].join(""),d[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:i.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}),layui.stope(e)}),i.layBody.on("click","*[lay-event]",function(){var e=t(this),a=e.parents("tr").eq(0).data("index");layui.event.call(this,y,"tool("+p+")",v.call(this,{event:e.attr("lay-event")})),i.setThisRowChecked(a)}),i.layMain.on("scroll",function(){var e=t(this),a=e.scrollLeft(),n=e.scrollTop();i.layHeader.scrollLeft(a),i.layTotal.scrollLeft(a),i.layFixed.find(k).scrollTop(n),l.close(i.tipsIndex)}),H.on("resize",function(){i.resize()})},function(){j.on("click",function(){j.trigger("table.remove.tool.panel")}),j.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()})}(),d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':h+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},c.that={},c.config={},d.eachCols=function(e,i,a){var l=c.config[e]||{},n=[],o=0;a=t.extend(!0,[],a||l.cols),layui.each(a,function(e,t){layui.each(t,function(t,i){if(i.colGroup){var l=0;o++,i.CHILD_COLS=[],layui.each(a[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==i.colspan||(t.PARENT_COL_INDEX=o,i.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}i.PARENT_COL_INDEX||n.push(i)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof i&&i(e,t))})};r()},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},d.exportFile=function(e,t,i){var a=this;t=t||d.clearCacheKey(d.cache[e]),i=i||"csv";var l=c.config[e]||{},n={csv:"text/csv",xls:"application/vnd.ms-excel"}[i],s=document.createElement("a");return r.ie?o.error("IE_NOT_SUPPORT_EXPORTS"):(s.href="data:"+n+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var i=[],l=[],n=[];return layui.each(t,function(t,a){var n=[];"object"==typeof e?(layui.each(e,function(e,a){0==t&&i.push(a||"")}),layui.each(d.clearCacheKey(a),function(e,t){n.push('"'+(t||"")+'"')})):d.eachCols(e,function(e,l){if(l.field&&"normal"==l.type&&!l.hide){var o=a[l.field];void 0!==o&&null!==o||(o=""),0==t&&i.push(l.title||""),n.push('"'+u(l,o,a,"text")+'"')}}),l.push(n.join(","))}),layui.each(a.dataTotal,function(e,t){n.push(t)}),i.join(",")+"\r\n"+l.join("\r\n")+"\r\n"+n.join(",")}()),s.download=(l.title||"table_"+(l.index||""))+"."+i,document.body.appendChild(s),s.click(),void document.body.removeChild(s))},d.resize=function(e){if(e){var t=s(e);if(!t)return;c.that[e].resize()}else layui.each(c.that,function(){this.resize()})},d.reload=function(e,t){var i=s(e);if(i){var a=c.that[e];return a.reload(t),c.call(a)}},d.render=function(e){var t=new F(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(y,d)});layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
              ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
            "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a",u=1;u<=i.length;u++){var r='
          • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
          • ":n+=r}n+=""+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],u=t(['
              ',e.bar1?'
            • '+c[0]+"
            • ":"",e.bar2?'
            • '+c[1]+"
            • ":"",'
            • '+c[2]+"
            • ","
            "].join("")),g=u.find("."+o),s=function(){var t=r.scrollTop();t>=e.showHeight?i||(g.show(),i=1):i&&(g.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&u.css(e.css),l.append(u),s(),u.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var u=setTimeout(function(){n.countdown(e,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,u),l<=0&&clearTimeout(u),u},timeAgo:function(e,t){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>26784e5?(a=new Date(e),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),t||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=18e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(e,n,a){var o=t("body");return a=a||"click",n=i.event[e]=t.extend(!0,i.event[e],n)||{},i.event.UTIL_EVENT_CALLBACK=i.event.UTIL_EVENT_CALLBACK||{},o.off(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),i.event.UTIL_EVENT_CALLBACK[e]=function(){var i=t(this),a=i.attr(e);"function"==typeof n[a]&&n[a].call(this,i)},o.on(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),n}};!function(e,t,i){"$:nomunge";function n(){a=t[l](function(){o.each(function(){var t=e(this),i=t.width(),n=t.height(),a=e.data(this,u);(i!==a.w||n!==a.h)&&t.trigger(c,[a.w=i,a.h=n])}),n()},r[g])}var a,o=e([]),r=e.resize=e.extend(e.resize,{}),l="setTimeout",c="resize",u=c+"-special-event",g="delay",s="throttleWindow";r[g]=250,r[s]=!0,e.event.special[c]={setup:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.add(t),e.data(this,u,{w:t.width(),h:t.height()}),1===o.length&&n()},teardown:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.not(t),t.removeData(u),o.length||clearTimeout(a)},add:function(t){function n(t,n,o){var r=e(this),l=e.data(this,u)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[s]&&this[l])return!1;var a;return e.isFunction(t)?(a=t,n):(a=t.handler,void(t.handler=n))}}}(t,window),e("util",i)});layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),!i&&f.width()&&(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",c=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","face","image"],hideTool:[],height:280}};c.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},c.prototype.on=function(t,e){return layui.onevent(n,t,e)},c.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",c=e("string"==typeof t?"#"+t:t),u="LAY_layedit_"+ ++a.index,d=c.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){C[a]&&!e[a]&&t.push(C[a])}),t.join("")}(),m=e(['
            ','
            '+f+"
            ",'
            ','',"
            ","
            "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

            ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

            "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

            "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

              ','
            • ','','
              ','',"
              ","
            • ",'
            • ','','
              ','",'","
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
          • '+e+'
          • ')}),'
              '+t.join("")+"
            "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
              ','
            • ','','
              ','","
              ","
            • ",'
            • ','','
              ','',"
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)});layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
            1. '+o.replace(/[\r\t\n]+/g,"
            2. ")+"
            "),c.find(">.layui-code-h3")[0]||c.prepend('

            '+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

            ");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); \ No newline at end of file diff --git a/static/public/user/layui-v2.5.6/layui/layui.js b/static/public/user/layui-v2.5.6/layui/layui.js new file mode 100644 index 0000000000000000000000000000000000000000..99dba905ff953277b14dffc41e58bc7f6b07de1e --- /dev/null +++ b/static/public/user/layui-v2.5.6/layui/layui.js @@ -0,0 +1,2 @@ +/** layui-v2.5.6 MIT License By https://www.layui.com */ + ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},r=function(){this.v="2.5.6"},o=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,r=n.length-1,o=r;o>0;o--)if("interactive"===n[o].readyState){e=n[o].src;break}return e||n[r].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};r.prototype.cache=n,r.prototype.define=function(e,t){var r=this,o="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(r,o){e(r,o),n.callback[r]=function(){t(e)}}),this};return o&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?a.call(r):(r.use(e,a),r)},r.prototype.use=function(e,r,l){function c(e,t){var r="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||r.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[d]=t,y.removeChild(h),function o(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void(n.status[d]?s():setTimeout(o,4))}())}function s(){l.push(layui[d]),e.length>1?p.use(e.slice(1),r,l):"function"==typeof r&&r.apply(layui,l)}var p=this,f=n.dir=n.dir?n.dir:o,y=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(p.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var d=e[0],m=0;if(l=l||[],n.host=n.host||(f.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[d]||!layui["layui.all"]&&layui["layui.mobile"]&&u[d])return s(),p;var v=(u[d]?f+"lay/":/^\{\/\}/.test(p.modules[d])?"":n.base||"")+(p.modules[d]||d)+".js";if(v=v.replace(/^\{\/\}/,""),!n.modules[d]&&layui[d]&&(n.modules[d]=v),n.modules[d])!function g(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void("string"==typeof n.modules[d]&&n.status[d]?s():setTimeout(g,4))}();else{var h=t.createElement("script");h.async=!0,h.charset="utf-8",h.src=v+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),y.appendChild(h),!h.attachEvent||h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0||i?h.addEventListener("load",function(e){c(e,v)},!1):h.attachEvent("onreadystatechange",function(e){c(e,v)}),n.modules[d]=v}return p},r.prototype.getStyle=function(t,n){var r=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return r[r.getPropertyValue?"getPropertyValue":"getAttribute"](n)},r.prototype.link=function(e,r,o){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof r&&(o=r);var c=(o||e).replace(/\.|\//g,""),s=u.id="layuicss-"+c,p=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(s)||l.appendChild(u),"function"!=typeof r?i:(function f(){return++p>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(s),"width"))?function(){r()}():setTimeout(f,100))}(),i)},n.callback={},r.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},r.prototype.addcss=function(e,t,r){return layui.link(n.dir+"css/"+e,t,r)},r.prototype.img=function(e,t,n){var r=new Image;return r.src=e,r.complete?t(r):(r.onload=function(){r.onload=null,"function"==typeof t&&t(r)},void(r.onerror=function(e){r.onerror=null,"function"==typeof n&&n(e)}))},r.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},r.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),r.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},r.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),n.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},r.prototype.url=function(e){var t=this,n={pathname:function(){var t=e?function(){var t=(e.match(/\.[^.]+?\/.+/)||[])[0]||"";return t.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return t.replace(/^\//,"").split("/")}(),search:function(){var n={},r=(e?function(){var t=(e.match(/\?.+/)||[])[0]||"";return t.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");return t.each(r,function(e,t){var r=t.indexOf("="),o=function(){return r<0?t.substr(0,t.length):0!==r&&t.substr(0,r)}();o&&(n[o]=r>0?t.substr(r+1):null)}),n}(),hash:t.router(function(){return e?(e.match(/#.+/)||[])[0]||"":location.hash}())};return n},r.prototype.data=function(t,n,r){if(t=t||"layui",r=r||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete r[t];n="object"==typeof n?n:{key:n};try{var o=JSON.parse(r[t])}catch(a){var o={}}return"value"in n&&(o[n.key]=n.value),n.remove&&delete o[n.key],r[t]=JSON.stringify(o),n.key?o[n.key]:o}},r.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},r.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),r=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},o={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:r("micromessenger")};return t&&!o[t]&&(o[t]=r(t)),o.android=/android/.test(n),o.ios="ios"===o.os,o.mobile=!(!o.android&&!o.ios),o},r.prototype.hint=function(){return{error:a}},r.prototype.each=function(e,t){var n,r=this;if("function"!=typeof t)return r;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:o - + @@ -32,9 +32,6 @@
            - @@ -57,25 +54,25 @@
            - +
            - +
            - +
            - +
            @@ -90,50 +87,6 @@
            - - - @@ -153,12 +106,12 @@ - + @@ -151,9 +169,9 @@ var init = new initdata(); //点击按钮开始搜索 $("#queryBtn").click(function () { - let major = $("#major").val(); - let org = $("#org").val(); - let branch = $("#branch").val(); + var major = $("#major").val(); + var org = $("#org").val(); + var branch = $("#branch").val(); alert(org+branch+major); //判断条件是否存在 if (major == "" && org == "" && branch == "") { @@ -365,7 +383,10 @@ }); }) function addFunctionAlty(value,row,index) { - return '' + return '' + + ''+ + '' + + '' } function studyProgress(value,row,index) { diff --git a/templates/analysis/dataTable.html b/templates/analysis/dataTable.html index 8290c29e74e2c5ff17f983d553fd4012b15c33a5..a850c8ae156bb16b5eb10824a99d345e4dad2f7e 100644 --- a/templates/analysis/dataTable.html +++ b/templates/analysis/dataTable.html @@ -5,7 +5,7 @@ 乐码在线智慧平台-数据统计 - +
            -
            +



            萍乡学院学生数据统计表

            学号: 110    姓名: 张三    院系: 萍乡学院 + 导出PDF
            @@ -57,6 +58,24 @@ + + @@ -64,7 +83,7 @@ - + diff --git a/templates/analysis/watchVideoCount.html b/templates/analysis/watchVideoCount.html index 850cade499ddcce367c6989754ebb1e7dc0cfe08..b7e975f3dae0b7b8a515050a591ca27737c1e41f 100644 --- a/templates/analysis/watchVideoCount.html +++ b/templates/analysis/watchVideoCount.html @@ -12,13 +12,13 @@ - + - +
            -
            +
            - + +
            @@ -64,6 +68,42 @@
            + + @@ -71,13 +111,29 @@ - + + + - - + + - + + - + - + + - + + th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js}"> @@ -444,9 +444,9 @@ var result = ""; // console.log(row.id); // console.log(row.name+"--"+index +"--"+value); - result += ""; - result += ""; - result += ""; + result += ""; + result += ""; + result += ""; return result; }; diff --git a/templates/clazz/major.html b/templates/clazz/major.html index 42d9df231c70e76f1ca98780e9cf58ec56841fb9..e59e5a70441edfe94851c2070ce40a1e809898e1 100644 --- a/templates/clazz/major.html +++ b/templates/clazz/major.html @@ -20,11 +20,12 @@ + th:href="@{/static/css//plugins/sweetalert/sweetalert.css}" rel="stylesheet"> - + @@ -70,7 +71,7 @@
            -
            +
            @@ -125,15 +126,15 @@
            - +
            @@ -223,15 +224,15 @@
            - - + + - + + th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js}"> @@ -241,7 +242,8 @@ - + - + \ No newline at end of file diff --git a/templates/clazz/question.html b/templates/clazz/question.html index f17a8e7b0c1322e6dbd7dcacacafe80e0efab7c9..423ad5f185a9c83ae3c2ade3966c3700d88b03f8 100644 --- a/templates/clazz/question.html +++ b/templates/clazz/question.html @@ -20,17 +20,17 @@ + th:href="@{/static/css//plugins/sweetalert/sweetalert.css}" rel="stylesheet"> - + th:href="@{/static/css//plugins/switchery/switchery.css}" rel="stylesheet"> + @@ -176,15 +176,15 @@ - - + + - + + th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js}"> @@ -364,8 +364,8 @@ var result = ""; // console.log(row.id); // console.log(row.name+"--"+index +"--"+value); - result += ""; - result += ""; + result += ""; + result += ""; return result; }; return init; diff --git a/templates/clazz/studyProcess.html b/templates/clazz/studyProcess.html index 629613ac361b4434b168480d84cc9f662290c3c2..3f068fd1c191bf7fad0499b95182631b77f35bf6 100644 --- a/templates/clazz/studyProcess.html +++ b/templates/clazz/studyProcess.html @@ -20,10 +20,10 @@ + th:href="@{/static/css//plugins/sweetalert/sweetalert.css}" rel="stylesheet"> + th:href="@{/static/css//plugins/switchery/switchery.css}" rel="stylesheet"> @@ -81,7 +81,7 @@ 填写考试基本信息
            -
            +
            -
            +
            @@ -99,7 +99,7 @@
            + placeholder="分类" style="border-color:#f8ac59">
            @@ -231,7 +231,7 @@ 填写考试时间安排
            - +
            @@ -242,9 +242,9 @@ name="startTime"/>
            -
            - -
            +
            + +
            +

            考试对象    + 设置参加考试的目标班级或学生

            +
            +
            +
            +
            + +
            +
            +
            + + +
            +
            +
            + +
            +
            +
            + + +
            +
            + +
            @@ -351,66 +384,72 @@
            -
            -
            - -
            - - +
            +
            + +
            + + +
            -
            -
            -
            -
            - -
            - - + +
            +
            +
            + +
            + + +
            -
            -
            -
            -
            - -
            - - +
            + +
            +
            +
            + +
            + + +
            -
            +
            -
            -
            - - - +
            +
            + + + +
            -
            +
            - +
            @@ -427,7 +466,7 @@

            考试记录

            - +

            从以下列表查看和管理考生的答卷记录

            @@ -453,14 +492,15 @@
            -
            -
            +
            +
            - +
            - +
            - -
            + +
            - - - - - - + + + + + +
            -
            -
            - 进度: +
            + 进度:
            @@ -631,9 +673,137 @@
            - - - + + + + + + + + + @@ -1124,65 +1565,177 @@ columns: [{ checkbox: true - },{ - title:"考生", - formatter:examinee - },{ - title:"考生组", - field:"examineeGroup" - },{ - title:"证件号", + }, { + title: "考生", + formatter: examinee + }, { + title: "考生组", + field: "examineeGroup" + }, { + title: "证件号", field: "idNumber" - },{ - title:"考试时间", - formatter:testTime - },{ - title:"考试用时", - formatter:examTime - },{ - title:"批改状态", - formatter:correctingState - },{ - title:"得分", - formatter:score - },{ - title:"来源", - formatter:source - },{ - title:"操作", - formatter:operation_1 + }, { + title: "考试时间", + formatter: testTime + }, { + title: "考试用时", + formatter: examTime + }, { + title: "批改状态", + formatter: correctingState + }, { + title: "得分", + formatter: score + }, { + title: "来源", + formatter: source + }, { + title: "操作", + formatter: operation_1, + events: { + /*删除*/ + 'click button[title=删除]': function (e, value, row, index) { + deleteRecord(e, value, row, index, "", '#tb_departments_1'); + }, /*END--删除*/ + /*批阅试卷*/ + 'click button[title=批阅试卷]': function (e, value, row, index) { + getIframeAjaxData(row); + } + /*END--批阅试卷*/ + } }] }); + + let lackTestRecordsData = [ + { + title: "用户名", + field: "examinee" + }, { + title: "真实姓名", + field: "name" + }, { + title: "证件编号", + field: "idNumber" + }, { + title: "考生组", + field: "examineeGroup" + }, { + title: "职务", + field: "position" + }, { + title: "状态", + formatter: lackTestState + }, { + title: "注册时间", + field: "registrationTime" + }, { + title: "最后登陆时间", + field: "releaseTime" + } + ]; + createTable('#tb_departments_2', "../../static/js/demo/exam/examManagementList.json", "", false, lackTestRecordsData, "get"); + + //创建考试---设置试卷---我的试卷 + let myPaperData = [{ + title: '试卷名称', + formatter: testPaperName + }, { + title: '考试时间', + formatter: citations + }, { + title: '总分', + formatter: totalScore + }, { + title: '创建人', + field: "modifier" + }, { + title: "操作", + formatter: useOrRemove, + events: { + 'click .useOrRemove': function (e, value, row, index) { + useOrRemovePaper = row.testPaperName; + $('.useOrRemove').text("使用").attr('class', 'btn btn-white useOrRemove'); + $(this).text("移除").attr('class', 'btn btn-danger useOrRemove'); + $('#createTestPaper_1 input[name="setTestPaper"]').val(useOrRemovePaper); + } + } + }] + ; + createTable('#tb_departments_5', '../../static/js/demo/exam/testQuestionsListTest.json', "", true, myPaperData, "get"); + //创建考试---设置试卷---我的试卷 + let sharedPaper = [{ + title: '试卷名称', + formatter: testPaperName + }, { + title: '考试时间', + formatter: citations + }, { + title: '总分', + formatter: totalScore + }, { + title: '创建人', + field: "modifier" + }, { + title: "操作", + formatter: useOrRemove, + events: { + 'click .useOrRemove': function (e, value, row, index) { + useOrRemovePaper = row.testPaperName; + $('.useOrRemove').text("使用").attr('class', 'btn btn-white useOrRemove'); + $(this).text("移除").attr('class', 'btn btn-danger useOrRemove'); + $('#createTestPaper_1 input[name="setTestPaper"]').val(useOrRemovePaper); + } + } + }] + ; + createTable('#tb_departments_6', '../../static/js/demo/exam/testQuestionsListTest.json', "", true, sharedPaper, "get"); + /***********************************************参数个性化********************************************/ //考生 - function examinee(value,row,index) { + function examinee(value, row, index) { return '

            ' + row.examinee + '

            ' + row.name + '

            '; } + //考试用时 - function examTime(value,row,index) { - return '' + row.score + '分钟'; + function examTime(value, row, index) { + return '' + row.examTime + '分钟'; } + //批改状态 function correctingState(value, row, index) { - return row.state == 'true' ? ' ' : + return row.correctingState == 'true' ? ' ' : ' ' } + //得分 function score(value, row, index) { return row.score >= 80 ? '' + row.score + '' : row.score >= 60 ? '' + row.score + '' : '' + row.score + ''; } + //来源 - function source(value,row,index) { + function source(value, row, index) { return '  ' + row.source + ''; } - //操作 + + //缺考状态 + function lackTestState(value, row, index) { + return row.state == "正常" ? '' + row.state + '' : + '' + row.state + ''; + + } + //操作 function operation_1(value, row, index) { return '' + ''; } + + function useOrRemove(value, row, index) { + return '' + } + //初始化滑动按钮状态 function switchForTable_1() { let elems = Array.prototype.slice.call($('.js-switch-table-state_1')); @@ -1194,30 +1747,192 @@ } }); } + /******************************************END---参数个性化********************************************/ + + \ No newline at end of file diff --git a/templates/exam/markExamPapersIFrame.html b/templates/exam/markExamPapersIFrame.html new file mode 100644 index 0000000000000000000000000000000000000000..61d7263c2a86ea468bbc96ef4539d0759eed58b5 --- /dev/null +++ b/templates/exam/markExamPapersIFrame.html @@ -0,0 +1,378 @@ + + + + + 考试批阅 + + + + + + + + + + + +
            + +
            +
            +
            +
            + +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            考生账号考生姓名考试试卷考试次数时长总分总得分及格分用时开始时间结束时间
            lisi李四试卷名称1/10600分钟100.06860.013分钟2020-04-06 15:55:33 2020-04-06 16:09:22
            +
            + +
            +

               单选题

            +
            +
            +
            + +
            + +
            +
            +
            +
            +
            +

            考生答案:   

            +

            标准答案:   

            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +
            + ue
            +
            +
            + +
            +
            +
            +
            +
            + + + + + + + + + + + + + + diff --git a/templates/exam/paperManagementList.html b/templates/exam/paperManagementList.html index 8a02ee15fdc19e49ed51d943f144f7ffad77592d..0a54210869564f95206e9f4d6697798b67fbf674 100644 --- a/templates/exam/paperManagementList.html +++ b/templates/exam/paperManagementList.html @@ -22,11 +22,16 @@ - +
            @@ -252,9 +74,9 @@
            @@ -263,8 +85,11 @@
            @@ -277,9 +102,11 @@
            @@ -305,51 +132,52 @@

            创建试题

            -
            - -
            - + + + + +
            - +
            -
            @@ -360,7 +188,15 @@
            - +
            + + + +
            @@ -386,192 +222,166 @@
            -
            +
            -
            +
            + +
            + +
            + +
            -
            + -
            -
            - - -
            - - -
            -
            -
            - -
            + +
            -

            共享题库是由各管理员创建并 共享 给所有管理员使用的题库,您可以使用这些题库创建试卷、组织考试 -

            -

            具备 超级管理员 权限的管理员,可浏览并操作其他管理员的所有题库 -

            +

            共享试题是由各管理员创建并通过 题库共享  ,提供给所有管理员使用的试题 + ,您可以使用这些试题创建试卷、组织考试

            @@ -705,81 +743,16 @@
            - -
            -
            - - -
            +
            +
            - - - + +