ak-order-deliverytime - Version 0.1.0

Version Notes

This is the version of extension

Download this release

Release Info

Developer Anuj
Extension ak-order-deliverytime
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (56) hide show
  1. app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime.php +17 -0
  2. app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit.php +44 -0
  3. app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit/Form.php +17 -0
  4. app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit/Tab/Form.php +84 -0
  5. app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit/Tabs.php +21 -0
  6. app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Grid.php +236 -0
  7. app/code/community/AK/Deliverytime/Block/Onepage.php +26 -0
  8. app/code/community/AK/Deliverytime/Block/Onepage/Deliverytime.php +14 -0
  9. app/code/community/AK/Deliverytime/Block/Order/Info.php +135 -0
  10. app/code/community/AK/Deliverytime/Helper/Data.php +6 -0
  11. app/code/community/AK/Deliverytime/Model/Deliverytime.php +12 -0
  12. app/code/community/AK/Deliverytime/Model/Mysql4/Deliverytime.php +8 -0
  13. app/code/community/AK/Deliverytime/Model/Mysql4/Deliverytime/Collection.php +12 -0
  14. app/code/community/AK/Deliverytime/Model/Mysql4/Timeslot.php +8 -0
  15. app/code/community/AK/Deliverytime/Model/Mysql4/Timeslot/Collection.php +12 -0
  16. app/code/community/AK/Deliverytime/Model/Observer.php +25 -0
  17. app/code/community/AK/Deliverytime/Model/Observer/Timeslot.php +5 -0
  18. app/code/community/AK/Deliverytime/Model/Timeslot.php +12 -0
  19. app/code/community/AK/Deliverytime/Model/Type/Onepage.php +29 -0
  20. app/code/community/AK/Deliverytime/controllers/Adminhtml/DeliverytimeController.php +165 -0
  21. app/code/community/AK/Deliverytime/controllers/OnepageController.php +98 -0
  22. app/code/community/AK/Deliverytime/etc/adminhtml.xml +23 -0
  23. app/code/community/AK/Deliverytime/etc/config.xml +175 -0
  24. app/code/community/AK/Deliverytime/etc/system.xml +42 -0
  25. app/code/community/AK/Deliverytime/sql/deliverytime_setup/mysql4-install-0.1.0.php +46 -0
  26. app/design/adminhtml/default/default/layout/deliverytime.xml +100 -0
  27. app/design/adminhtml/default/default/template/deliverytime/info.phtml +166 -0
  28. app/design/frontend/base/default/layout/deliverytime.xml +16 -0
  29. app/design/frontend/base/default/template/checkout/onepage/agreements.phtml +51 -0
  30. app/design/frontend/base/default/template/checkout/onepage/billing.phtml +216 -0
  31. app/design/frontend/base/default/template/checkout/onepage/deliverytime.phtml +227 -0
  32. app/design/frontend/base/default/template/checkout/onepage/failure.phtml +32 -0
  33. app/design/frontend/base/default/template/checkout/onepage/link.phtml +29 -0
  34. app/design/frontend/base/default/template/checkout/onepage/login.phtml +124 -0
  35. app/design/frontend/base/default/template/checkout/onepage/payment.phtml +73 -0
  36. app/design/frontend/base/default/template/checkout/onepage/payment/info.phtml +29 -0
  37. app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml +73 -0
  38. app/design/frontend/base/default/template/checkout/onepage/progress.phtml +59 -0
  39. app/design/frontend/base/default/template/checkout/onepage/progress/billing.phtml +40 -0
  40. app/design/frontend/base/default/template/checkout/onepage/progress/payment.phtml +41 -0
  41. app/design/frontend/base/default/template/checkout/onepage/progress/shipping.phtml +44 -0
  42. app/design/frontend/base/default/template/checkout/onepage/progress/shipping_method.phtml +57 -0
  43. app/design/frontend/base/default/template/checkout/onepage/review.phtml +29 -0
  44. app/design/frontend/base/default/template/checkout/onepage/review/button.phtml +27 -0
  45. app/design/frontend/base/default/template/checkout/onepage/review/info.phtml +84 -0
  46. app/design/frontend/base/default/template/checkout/onepage/review/item.phtml +240 -0
  47. app/design/frontend/base/default/template/checkout/onepage/review/totals.phtml +47 -0
  48. app/design/frontend/base/default/template/checkout/onepage/shipping.phtml +156 -0
  49. app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml +46 -0
  50. app/design/frontend/base/default/template/checkout/onepage/shipping_method/additional.phtml +29 -0
  51. app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml +101 -0
  52. app/etc/modules/AK_Deliverytime.xml +10 -0
  53. js/timepicker/Default/sprite.png +0 -0
  54. js/timepicker/init.js +33 -0
  55. js/timepicker/jquery.min.js +6 -0
  56. js/timepicker/kendo.all.min.js +33 -0
app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class AK_Deliverytime_Block_Adminhtml_Deliverytime extends Mage_Adminhtml_Block_Widget_Grid_Container{
5
+
6
+ public function __construct()
7
+ {
8
+
9
+ $this->_controller = "adminhtml_deliverytime";
10
+ $this->_blockGroup = "deliverytime";
11
+ $this->_headerText = Mage::helper("deliverytime")->__("Deliverytime Manager");
12
+ $this->_addButtonLabel = Mage::helper("deliverytime")->__("Add New Time Slot");
13
+ parent::__construct();
14
+
15
+ }
16
+
17
+ }
app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Block_Adminhtml_Deliverytime_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+
8
+ parent::__construct();
9
+ $this->_objectId = "deliverytime_id";
10
+ $this->_blockGroup = "deliverytime";
11
+ $this->_controller = "adminhtml_deliverytime";
12
+ $this->_updateButton("save", "label", Mage::helper("deliverytime")->__("Save Time Slot"));
13
+ $this->_updateButton("delete", "label", Mage::helper("deliverytime")->__("Delete Time Slot"));
14
+
15
+ $this->_addButton("saveandcontinue", array(
16
+ "label" => Mage::helper("deliverytime")->__("Save And Continue Edit"),
17
+ "onclick" => "saveAndContinueEdit()",
18
+ "class" => "save",
19
+ ), -100);
20
+
21
+
22
+
23
+ $this->_formScripts[] = "
24
+
25
+ function saveAndContinueEdit(){
26
+ editForm.submit($('edit_form').action+'back/edit/');
27
+ }
28
+ ";
29
+ }
30
+
31
+ public function getHeaderText()
32
+ {
33
+ if( Mage::registry("deliverytime_data") && Mage::registry("deliverytime_data")->getId() ){
34
+
35
+ return Mage::helper("deliverytime")->__("Edit Time Slot '%s'", $this->htmlEscape(Mage::registry("deliverytime_data")->getId()));
36
+
37
+ }
38
+ else{
39
+
40
+ return Mage::helper("deliverytime")->__("Add Time Slot");
41
+
42
+ }
43
+ }
44
+ }
app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Block_Adminhtml_Deliverytime_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ "id" => "edit_form",
8
+ "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
9
+ "method" => "post",
10
+ "enctype" =>"multipart/form-data",
11
+ )
12
+ );
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit/Tab/Form.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Block_Adminhtml_Deliverytime_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset("deliverytime_form", array("legend"=>Mage::helper("deliverytime")->__("Item information")));
10
+
11
+
12
+ $fieldset->addField("title", "text", array(
13
+ "label" => Mage::helper("deliverytime")->__("Title"),
14
+ "class" => "required-entry",
15
+ "required" => true,
16
+ "name" => "title",
17
+ ));
18
+
19
+ $fieldset->addField("deliverytime_start", "text", array(
20
+ "label" => Mage::helper("deliverytime")->__("Start Time"),
21
+ "class" => "required-entry",
22
+ "required" => true,
23
+ "name" => "deliverytime_start",
24
+ ));
25
+
26
+ $fieldset->addField("deliverytime_end", "text", array(
27
+ "label" => Mage::helper("deliverytime")->__("End Time"),
28
+ "class" => "required-entry",
29
+ "required" => true,
30
+ "name" => "deliverytime_end",
31
+ ));
32
+
33
+ $fieldset->addField('mon', 'select', array(
34
+ 'label' => Mage::helper('deliverytime')->__('Monday'),
35
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray3(),
36
+ 'name' => 'mon',
37
+ ));
38
+ $fieldset->addField('tue', 'select', array(
39
+ 'label' => Mage::helper('deliverytime')->__('Tuesday'),
40
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray4(),
41
+ 'name' => 'tue',
42
+ ));
43
+ $fieldset->addField('wed', 'select', array(
44
+ 'label' => Mage::helper('deliverytime')->__('Wednesday'),
45
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray5(),
46
+ 'name' => 'wed',
47
+ ));
48
+ $fieldset->addField('thu', 'select', array(
49
+ 'label' => Mage::helper('deliverytime')->__('Thursday'),
50
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray6(),
51
+ 'name' => 'thu',
52
+ ));
53
+ $fieldset->addField('fri', 'select', array(
54
+ 'label' => Mage::helper('deliverytime')->__('Friday'),
55
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray7(),
56
+ 'name' => 'fri',
57
+ ));
58
+ $fieldset->addField('sat', 'select', array(
59
+ 'label' => Mage::helper('deliverytime')->__('Saturday'),
60
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray8(),
61
+ 'name' => 'sat',
62
+ ));
63
+ $fieldset->addField('sun', 'select', array(
64
+ 'label' => Mage::helper('deliverytime')->__('Sunday'),
65
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray9(),
66
+ 'name' => 'sun',
67
+ ));
68
+ $fieldset->addField('status', 'select', array(
69
+ 'label' => Mage::helper('deliverytime')->__('Status'),
70
+ 'values' => AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getValueArray10(),
71
+ 'name' => 'status',
72
+ ));
73
+
74
+ if (Mage::getSingleton("adminhtml/session")->getDeliverytimeData())
75
+ {
76
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getDeliverytimeData());
77
+ Mage::getSingleton("adminhtml/session")->setDeliverytimeData(null);
78
+ }
79
+ elseif(Mage::registry("deliverytime_data")) {
80
+ $form->setValues(Mage::registry("deliverytime_data")->getData());
81
+ }
82
+ return parent::_prepareForm();
83
+ }
84
+ }
app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Edit/Tabs.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Block_Adminhtml_Deliverytime_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId("deliverytime_tabs");
8
+ $this->setDestElementId("edit_form");
9
+ $this->setTitle(Mage::helper("deliverytime")->__("Item Information"));
10
+ }
11
+ protected function _beforeToHtml()
12
+ {
13
+ $this->addTab("form_section", array(
14
+ "label" => Mage::helper("deliverytime")->__("Item Information"),
15
+ "title" => Mage::helper("deliverytime")->__("Item Information"),
16
+ "content" => $this->getLayout()->createBlock("deliverytime/adminhtml_deliverytime_edit_tab_form")->toHtml(),
17
+ ));
18
+ return parent::_beforeToHtml();
19
+ }
20
+
21
+ }
app/code/community/AK/Deliverytime/Block/Adminhtml/Deliverytime/Grid.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId("deliverytimeGrid");
10
+ $this->setDefaultSort("deliverytime_id");
11
+ $this->setDefaultDir("DESC");
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel("deliverytime/deliverytime")->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn("deliverytime_id", array(
24
+ "header" => Mage::helper("deliverytime")->__("ID"),
25
+ "align" =>"right",
26
+ "width" => "50px",
27
+ "type" => "number",
28
+ "index" => "deliverytime_id",
29
+ ));
30
+
31
+ $this->addColumn("title", array(
32
+ "header" => Mage::helper("deliverytime")->__("Title"),
33
+ "index" => "title",
34
+ ));
35
+ $this->addColumn("deliverytime_start", array(
36
+ "header" => Mage::helper("deliverytime")->__("Start Time"),
37
+ "index" => "deliverytime_start",
38
+ ));
39
+ $this->addColumn("deliverytime_end", array(
40
+ "header" => Mage::helper("deliverytime")->__("End Time"),
41
+ "index" => "deliverytime_end",
42
+ ));
43
+
44
+
45
+ $this->addColumn('status', array(
46
+ 'header' => Mage::helper('deliverytime')->__('Status'),
47
+ 'index' => 'status',
48
+ 'type' => 'options',
49
+ 'options'=>AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray10(),
50
+ ));
51
+
52
+ $this->addColumn('action',array(
53
+ 'header' => Mage::helper('catalog')->__('Action'),
54
+ 'width' => '50px',
55
+ 'type' => 'action',
56
+ 'getter' => 'getId',
57
+ 'actions' => array(
58
+ array(
59
+ 'caption' => Mage::helper('catalog')->__('Edit'),
60
+ 'url' => array(
61
+ 'base'=>'*/adminhtml_deliverytime/edit',
62
+ 'params'=>array('store'=>$this->getRequest()->getParam('store'))
63
+ ),
64
+ 'field' => 'id'
65
+ )
66
+ ),
67
+ 'filter' => false,
68
+ 'sortable' => false,
69
+ 'index' => 'stores',
70
+ ));
71
+
72
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
73
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
74
+
75
+ return parent::_prepareColumns();
76
+ }
77
+
78
+ public function getRowUrl($row)
79
+ {
80
+ return $this->getUrl("*/*/edit", array("id" => $row->getId()));
81
+ }
82
+
83
+
84
+
85
+ protected function _prepareMassaction()
86
+ {
87
+ $this->setMassactionIdField('deliverytime_id');
88
+ $this->getMassactionBlock()->setFormFieldName('deliverytime_ids');
89
+ $this->getMassactionBlock()->setUseSelectAll(true);
90
+ $this->getMassactionBlock()->addItem('remove_deliverytime', array(
91
+ 'label'=> Mage::helper('deliverytime')->__('Remove Deliverytime'),
92
+ 'url' => $this->getUrl('*/adminhtml_deliverytime/massRemove'),
93
+ 'confirm' => Mage::helper('deliverytime')->__('Are you sure?')
94
+ ));
95
+ return $this;
96
+ }
97
+
98
+ static public function getOptionArray3()
99
+ {
100
+ $data_array=array();
101
+ $data_array[0]='No';
102
+ $data_array[1]='Yes';
103
+ return($data_array);
104
+ }
105
+ static public function getValueArray3()
106
+ {
107
+ $data_array=array();
108
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray3() as $k=>$v){
109
+ $data_array[]=array('value'=>$k,'label'=>$v);
110
+ }
111
+ return($data_array);
112
+
113
+ }
114
+
115
+ static public function getOptionArray4()
116
+ {
117
+ $data_array=array();
118
+ $data_array[0]='No';
119
+ $data_array[1]='Yes';
120
+ return($data_array);
121
+ }
122
+ static public function getValueArray4()
123
+ {
124
+ $data_array=array();
125
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray4() as $k=>$v){
126
+ $data_array[]=array('value'=>$k,'label'=>$v);
127
+ }
128
+ return($data_array);
129
+
130
+ }
131
+
132
+ static public function getOptionArray5()
133
+ {
134
+ $data_array=array();
135
+ $data_array[0]='No';
136
+ $data_array[1]='Yes';
137
+ return($data_array);
138
+ }
139
+ static public function getValueArray5()
140
+ {
141
+ $data_array=array();
142
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray5() as $k=>$v){
143
+ $data_array[]=array('value'=>$k,'label'=>$v);
144
+ }
145
+ return($data_array);
146
+
147
+ }
148
+
149
+ static public function getOptionArray6()
150
+ {
151
+ $data_array=array();
152
+ $data_array[0]='No';
153
+ $data_array[1]='Yes';
154
+ return($data_array);
155
+ }
156
+ static public function getValueArray6()
157
+ {
158
+ $data_array=array();
159
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray6() as $k=>$v){
160
+ $data_array[]=array('value'=>$k,'label'=>$v);
161
+ }
162
+ return($data_array);
163
+
164
+ }
165
+
166
+ static public function getOptionArray7()
167
+ {
168
+ $data_array=array();
169
+ $data_array[0]='No';
170
+ $data_array[1]='Yes';
171
+ return($data_array);
172
+ }
173
+ static public function getValueArray7()
174
+ {
175
+ $data_array=array();
176
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray7() as $k=>$v){
177
+ $data_array[]=array('value'=>$k,'label'=>$v);
178
+ }
179
+ return($data_array);
180
+
181
+ }
182
+
183
+ static public function getOptionArray8()
184
+ {
185
+ $data_array=array();
186
+ $data_array[0]='No';
187
+ $data_array[1]='Yes';
188
+ return($data_array);
189
+ }
190
+ static public function getValueArray8()
191
+ {
192
+ $data_array=array();
193
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray8() as $k=>$v){
194
+ $data_array[]=array('value'=>$k,'label'=>$v);
195
+ }
196
+ return($data_array);
197
+
198
+ }
199
+
200
+ static public function getOptionArray9()
201
+ {
202
+ $data_array=array();
203
+ $data_array[0]='No';
204
+ $data_array[1]='Yes';
205
+ return($data_array);
206
+ }
207
+ static public function getValueArray9()
208
+ {
209
+ $data_array=array();
210
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray9() as $k=>$v){
211
+ $data_array[]=array('value'=>$k,'label'=>$v);
212
+ }
213
+ return($data_array);
214
+
215
+ }
216
+
217
+ static public function getOptionArray10()
218
+ {
219
+ /*$data_array=array();
220
+ $data_array[0]='Enable';
221
+ $data_array[1]='Disable';*/
222
+ $data_array=array(''=>'-- Select Status --',1=>'Enable',2=>'Disable');
223
+ return($data_array);
224
+ }
225
+ static public function getValueArray10()
226
+ {
227
+ $data_array=array();
228
+ foreach(AK_Deliverytime_Block_Adminhtml_Deliverytime_Grid::getOptionArray10() as $k=>$v){
229
+ $data_array[]=array('value'=>$k,'label'=>$v);
230
+ }
231
+ return($data_array);
232
+
233
+ }
234
+
235
+
236
+ }
app/code/community/AK/Deliverytime/Block/Onepage.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Block_Onepage extends Mage_Checkout_Block_Onepage
4
+ {
5
+ public function getSteps()
6
+ {
7
+ $steps = array();
8
+
9
+ if (!$this->isCustomerLoggedIn()) {
10
+ $steps['login'] = $this->getCheckout()->getStepData('login');
11
+ }
12
+
13
+ //check that module is enable or not
14
+ if (Mage::getStoreConfig('deliverytime/deliverytime_general/enabled')){
15
+ $stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'deliverytime', 'review');
16
+ }
17
+ else {
18
+ $stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');
19
+ }
20
+ foreach ($stepCodes as $step) {
21
+ $steps[$step] = $this->getCheckout()->getStepData($step);
22
+ }
23
+
24
+ return $steps;
25
+ }
26
+ }
app/code/community/AK/Deliverytime/Block/Onepage/Deliverytime.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Block_Onepage_Deliverytime extends Mage_Checkout_Block_Onepage_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->getCheckout()->setStepData('deliverytime', array(
8
+ 'label' => Mage::helper('checkout')->__('Select Delivery Time'),
9
+ 'is_show' => true
10
+ ));
11
+
12
+ parent::_construct();
13
+ }
14
+ }
app/code/community/AK/Deliverytime/Block/Order/Info.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Invoice view comments form
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Sales
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class AK_Deliverytime_Block_Order_Info extends Mage_Core_Block_Template
36
+ {
37
+ protected $_links = array();
38
+
39
+ protected function _construct()
40
+ {
41
+ parent::_construct();
42
+ if (Mage::getStoreConfig('deliverytime/deliverytime_general/enabled')){
43
+ $this->setTemplate('deliverytime/info.phtml');
44
+ }else{
45
+ $this->setTemplate('sales/order/info.phtml');
46
+ }
47
+ }
48
+
49
+ protected function _prepareLayout()
50
+ {
51
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
52
+ $headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId()));
53
+ }
54
+ $this->setChild(
55
+ 'payment_info',
56
+ $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
57
+ );
58
+ }
59
+
60
+ public function getPaymentInfoHtml()
61
+ {
62
+ return $this->getChildHtml('payment_info');
63
+ }
64
+
65
+ /**
66
+ * Retrieve current order model instance
67
+ *
68
+ * @return Mage_Sales_Model_Order
69
+ */
70
+ public function getOrder()
71
+ {
72
+ return Mage::registry('current_order');
73
+ }
74
+
75
+ public function addLink($name, $path, $label)
76
+ {
77
+ $this->_links[$name] = new Varien_Object(array(
78
+ 'name' => $name,
79
+ 'label' => $label,
80
+ 'url' => empty($path) ? '' : Mage::getUrl($path, array('order_id' => $this->getOrder()->getId()))
81
+ ));
82
+ return $this;
83
+ }
84
+
85
+ public function getLinks()
86
+ {
87
+ $this->checkLinks();
88
+ return $this->_links;
89
+ }
90
+
91
+ private function checkLinks()
92
+ {
93
+ $order = $this->getOrder();
94
+ if (!$order->hasInvoices()) {
95
+ unset($this->_links['invoice']);
96
+ }
97
+ if (!$order->hasShipments()) {
98
+ unset($this->_links['shipment']);
99
+ }
100
+ if (!$order->hasCreditmemos()) {
101
+ unset($this->_links['creditmemo']);
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Get url for reorder action
107
+ *
108
+ * @deprecated after 1.6.0.0, logic moved to new block
109
+ * @param Mage_Sales_Order $order
110
+ * @return string
111
+ */
112
+ public function getReorderUrl($order)
113
+ {
114
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
115
+ return $this->getUrl('sales/guest/reorder', array('order_id' => $order->getId()));
116
+ }
117
+ return $this->getUrl('sales/order/reorder', array('order_id' => $order->getId()));
118
+ }
119
+
120
+ /**
121
+ * Get url for printing order
122
+ *
123
+ * @deprecated after 1.6.0.0, logic moved to new block
124
+ * @param Mage_Sales_Order $order
125
+ * @return string
126
+ */
127
+ public function getPrintUrl($order)
128
+ {
129
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
130
+ return $this->getUrl('sales/guest/print', array('order_id' => $order->getId()));
131
+ }
132
+ return $this->getUrl('sales/order/print', array('order_id' => $order->getId()));
133
+ }
134
+
135
+ }
app/code/community/AK/Deliverytime/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
6
+
app/code/community/AK/Deliverytime/Model/Deliverytime.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Model_Deliverytime extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("deliverytime/deliverytime");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/AK/Deliverytime/Model/Mysql4/Deliverytime.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Model_Mysql4_Deliverytime extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("deliverytime/deliverytime", "deliverytime_id");
7
+ }
8
+ }
app/code/community/AK/Deliverytime/Model/Mysql4/Deliverytime/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Model_Mysql4_Deliverytime_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("deliverytime/deliverytime");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/AK/Deliverytime/Model/Mysql4/Timeslot.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Model_Mysql4_Timeslot extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("deliverytime/timeslot", "id");
7
+ }
8
+ }
app/code/community/AK/Deliverytime/Model/Mysql4/Timeslot/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Model_Mysql4_Timeslot_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("deliverytime/timeslot");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/AK/Deliverytime/Model/Observer.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Model_Observer {
3
+
4
+ const ORDER_ATTRIBUTE_FHC_ID = 'deliverytime';
5
+
6
+ public function hookToOrderSaveEvent() {
7
+ //if (Mage::helper('deliverytime')->isEnabled()) {
8
+ $order = new Mage_Sales_Model_Order ();
9
+ $incrementId = Mage::getSingleton ( 'checkout/session' )->getLastRealOrderId ();
10
+ $order->loadByIncrementId ( $incrementId );
11
+
12
+ // Fetch the data
13
+ $_deliverytime_data = null;
14
+ $_deliverytime_data = Mage::getSingleton ( 'core/session' )->getAkDeliverytime();
15
+ $model = Mage::getModel ( 'deliverytime/timeslot' )->setData ( unserialize ( $_deliverytime_data ) );
16
+ $model->setData ( "order_id",$order["entity_id"] );
17
+ try {
18
+ $insertId = $model->save ()->getId ();
19
+ Mage::log ( "Data successfully inserted. Insert ID: " . $insertId, null, 'mylog.log');
20
+ } catch ( Exception $e ) {
21
+ Mage::log ( "EXCEPTION " . $e->getMessage (), null, 'mylog.log' );
22
+ }
23
+ //}
24
+ }
25
+ }
app/code/community/AK/Deliverytime/Model/Observer/Timeslot.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class AK_Deliverytime_Model_Observer_Timeslot
3
+ {
4
+
5
+ }
app/code/community/AK/Deliverytime/Model/Timeslot.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Model_Timeslot extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("deliverytime/timeslot");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/AK/Deliverytime/Model/Type/Onepage.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
4
+ {
5
+ public function initCheckout()
6
+ {
7
+ $checkout = $this->getCheckout();
8
+ if (is_array($checkout->getStepData())) {
9
+ foreach ($checkout->getStepData() as $step=>$data) {
10
+ if (!($step==='login'
11
+ || Mage::getSingleton('customer/session')->isLoggedIn() && $step==='billing')) {
12
+ $checkout->setStepData($step, 'allow', false);
13
+ }
14
+ }
15
+ }
16
+
17
+ $checkout->setStepData('checkoutstep', 'allow', true);
18
+
19
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
20
+ if ($customer) {
21
+ $this->getQuote()->assignCustomer($customer);
22
+ }
23
+ if ($this->getQuote()->getIsMultiShipping()) {
24
+ $this->getQuote()->setIsMultiShipping(false);
25
+ $this->getQuote()->save();
26
+ }
27
+ return $this;
28
+ }
29
+ }
app/code/community/AK/Deliverytime/controllers/Adminhtml/DeliverytimeController.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class AK_Deliverytime_Adminhtml_DeliverytimeController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected function _initAction()
6
+ {
7
+ $this->loadLayout()->_setActiveMenu("deliverytime/deliverytime")->_addBreadcrumb(Mage::helper("adminhtml")->__("Deliverytime Manager"),Mage::helper("adminhtml")->__("Deliverytime Manager"));
8
+ return $this;
9
+ }
10
+ public function indexAction()
11
+ {
12
+ $this->_title($this->__("Deliverytime"));
13
+ $this->_title($this->__("Manager Deliverytime"));
14
+
15
+ $this->_initAction();
16
+ $this->renderLayout();
17
+ }
18
+ public function editAction()
19
+ {
20
+ $this->_title($this->__("Deliverytime"));
21
+ $this->_title($this->__("Deliverytime"));
22
+ $this->_title($this->__("Edit Item"));
23
+
24
+ $id = $this->getRequest()->getParam("id");
25
+ $model = Mage::getModel("deliverytime/deliverytime")->load($id);
26
+ if ($model->getId()) {
27
+ Mage::register("deliverytime_data", $model);
28
+ $this->loadLayout();
29
+ $this->_setActiveMenu("deliverytime/deliverytime");
30
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Deliverytime Manager"), Mage::helper("adminhtml")->__("Deliverytime Manager"));
31
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Deliverytime Description"), Mage::helper("adminhtml")->__("Deliverytime Description"));
32
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
33
+ $this->_addContent($this->getLayout()->createBlock("deliverytime/adminhtml_deliverytime_edit"))->_addLeft($this->getLayout()->createBlock("deliverytime/adminhtml_deliverytime_edit_tabs"));
34
+ $this->renderLayout();
35
+ }
36
+ else {
37
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("deliverytime")->__("Item does not exist."));
38
+ $this->_redirect("*/*/");
39
+ }
40
+ }
41
+
42
+ public function newAction()
43
+ {
44
+
45
+ $this->_title($this->__("Deliverytime"));
46
+ $this->_title($this->__("Deliverytime"));
47
+ $this->_title($this->__("New Item"));
48
+
49
+ $id = $this->getRequest()->getParam("id");
50
+ $model = Mage::getModel("deliverytime/deliverytime")->load($id);
51
+
52
+ $data = Mage::getSingleton("adminhtml/session")->getFormData(true);
53
+ if (!empty($data)) {
54
+ $model->setData($data);
55
+ }
56
+
57
+ Mage::register("deliverytime_data", $model);
58
+
59
+ $this->loadLayout();
60
+ $this->_setActiveMenu("deliverytime/deliverytime");
61
+
62
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
63
+
64
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Deliverytime Manager"), Mage::helper("adminhtml")->__("Deliverytime Manager"));
65
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Deliverytime Description"), Mage::helper("adminhtml")->__("Deliverytime Description"));
66
+
67
+
68
+ $this->_addContent($this->getLayout()->createBlock("deliverytime/adminhtml_deliverytime_edit"))->_addLeft($this->getLayout()->createBlock("deliverytime/adminhtml_deliverytime_edit_tabs"));
69
+
70
+ $this->renderLayout();
71
+
72
+ }
73
+ public function saveAction()
74
+ {
75
+
76
+ $post_data=$this->getRequest()->getPost();
77
+
78
+
79
+ if ($post_data) {
80
+
81
+ try {
82
+
83
+
84
+
85
+ $model = Mage::getModel("deliverytime/deliverytime")
86
+ ->addData($post_data)
87
+ ->setId($this->getRequest()->getParam("id"))
88
+ ->save();
89
+
90
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Deliverytime was successfully saved"));
91
+ Mage::getSingleton("adminhtml/session")->setDeliverytimeData(false);
92
+
93
+ if ($this->getRequest()->getParam("back")) {
94
+ $this->_redirect("*/*/edit", array("id" => $model->getId()));
95
+ return;
96
+ }
97
+ $this->_redirect("*/*/");
98
+ return;
99
+ }
100
+ catch (Exception $e) {
101
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
102
+ Mage::getSingleton("adminhtml/session")->setDeliverytimeData($this->getRequest()->getPost());
103
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
104
+ return;
105
+ }
106
+
107
+ }
108
+ $this->_redirect("*/*/");
109
+ }
110
+
111
+
112
+
113
+ public function deleteAction()
114
+ {
115
+ if( $this->getRequest()->getParam("id") > 0 ) {
116
+ try {
117
+ $model = Mage::getModel("deliverytime/deliverytime");
118
+ $model->setId($this->getRequest()->getParam("id"))->delete();
119
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
120
+ $this->_redirect("*/*/");
121
+ }
122
+ catch (Exception $e) {
123
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
124
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
125
+ }
126
+ }
127
+ $this->_redirect("*/*/");
128
+ }
129
+
130
+
131
+ public function massRemoveAction()
132
+ {
133
+ try {
134
+ $ids = $this->getRequest()->getPost('deliverytime_ids', array());
135
+ foreach ($ids as $id) {
136
+ $model = Mage::getModel("deliverytime/deliverytime");
137
+ $model->setId($id)->delete();
138
+ }
139
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
140
+ }
141
+ catch (Exception $e) {
142
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
143
+ }
144
+ $this->_redirect('*/*/');
145
+ }
146
+
147
+ /**
148
+ * Export order grid to CSV format
149
+ */
150
+ public function exportCsvAction()
151
+ {
152
+ $fileName = 'deliverytime.csv';
153
+ $grid = $this->getLayout()->createBlock('deliverytime/adminhtml_deliverytime_grid');
154
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
155
+ }
156
+ /**
157
+ * Export order grid to Excel XML format
158
+ */
159
+ public function exportExcelAction()
160
+ {
161
+ $fileName = 'deliverytime.xml';
162
+ $grid = $this->getLayout()->createBlock('deliverytime/adminhtml_deliverytime_grid');
163
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
164
+ }
165
+ }
app/code/community/AK/Deliverytime/controllers/OnepageController.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Checkout/controllers/OnepageController.php';
4
+
5
+ class AK_Deliverytime_OnepageController extends Mage_Checkout_OnepageController
6
+ {
7
+ public function doSomestuffAction()
8
+ {
9
+ if(true) {
10
+ $result['update_section'] = array(
11
+ 'name' => 'payment-method',
12
+ 'html' => $this->_getPaymentMethodsHtml()
13
+ );
14
+ }
15
+ else {
16
+ $result['goto_section'] = 'shipping';
17
+ }
18
+ }
19
+
20
+ public function savePaymentAction()
21
+ {
22
+ $this->_expireAjax();
23
+ if ($this->getRequest()->isPost()) {
24
+ $data = $this->getRequest()->getPost('payment', array());
25
+
26
+ try {
27
+ $result = $this->getOnepage()->savePayment($data);
28
+ }
29
+ catch (Mage_Payment_Exception $e) {
30
+ if ($e->getFields()) {
31
+ $result['fields'] = $e->getFields();
32
+ }
33
+ $result['error'] = $e->getMessage();
34
+ }
35
+ catch (Exception $e) {
36
+ $result['error'] = $e->getMessage();
37
+ }
38
+ $redirectUrl = $this->getOnePage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
39
+ if (empty($result['error']) && !$redirectUrl) {
40
+
41
+ //check the module is enable or not
42
+ if (Mage::getStoreConfig('deliverytime/deliverytime_general/enabled')){
43
+ $this->loadLayout('checkout_onepage_deliverytime');
44
+ $result['goto_section'] = 'deliverytime';
45
+ }
46
+ else {
47
+ $this->loadLayout('checkout_onepage_review');
48
+
49
+ $result['goto_section'] = 'review';
50
+ $result['update_section'] = array(
51
+ 'name' => 'review',
52
+ 'html' => $this->_getReviewHtml()
53
+ );
54
+ }
55
+ }
56
+
57
+ if ($redirectUrl) {
58
+ $result['redirect'] = $redirectUrl;
59
+ }
60
+
61
+ $this->getResponse()->setBody(Zend_Json::encode($result));
62
+ }
63
+ }
64
+
65
+ public function saveDeliverytimeAction()
66
+ {
67
+ $this->_expireAjax();
68
+ if ($this->getRequest()->isPost()) {
69
+
70
+ $timeslot = $this->getRequest()->getPost('timeslot',"");
71
+
72
+
73
+ Mage::getSingleton('core/session')->setAkDeliverytime(serialize(array(
74
+ 'timeslot' =>$timeslot,
75
+ )));
76
+
77
+ $result = array();
78
+
79
+ $redirectUrl = $this->getOnePage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
80
+ if (!$redirectUrl) {
81
+ $this->loadLayout('checkout_onepage_review');
82
+
83
+ $result['goto_section'] = 'review';
84
+ $result['update_section'] = array(
85
+ 'name' => 'review',
86
+ 'html' => $this->_getReviewHtml()
87
+ );
88
+
89
+ }
90
+
91
+ if ($redirectUrl) {
92
+ $result['redirect'] = $redirectUrl;
93
+ }
94
+
95
+ $this->getResponse()->setBody(Zend_Json::encode($result));
96
+ }
97
+ }
98
+ }
app/code/community/AK/Deliverytime/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <deliverytime translate="title" module="deliverytime">
12
+ <title>General Section</title>
13
+ <sort_order>0</sort_order>
14
+ </deliverytime>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/AK/Deliverytime/etc/config.xml ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <AK_Deliverytime>
5
+ <version>0.1.0</version>
6
+ </AK_Deliverytime>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <deliverytime>
11
+ <class>AK_Deliverytime_Helper</class>
12
+ </deliverytime>
13
+ </helpers>
14
+ <blocks>
15
+
16
+ <checkout>
17
+ <rewrite>
18
+ <onepage>AK_Deliverytime_Block_Onepage</onepage>
19
+ </rewrite>
20
+ </checkout>
21
+
22
+ <deliverytime>
23
+ <class>AK_Deliverytime_Block</class>
24
+ </deliverytime>
25
+
26
+ <checkoutsteponepage>
27
+ <class>AK_Deliverytime_Block_Onepage</class>
28
+ </checkoutsteponepage>
29
+
30
+ </blocks>
31
+ <models>
32
+ <deliverytime>
33
+ <class>AK_Deliverytime_Model</class>
34
+ <resourceModel>deliverytime_mysql4</resourceModel>
35
+ </deliverytime>
36
+ <deliverytime_mysql4>
37
+ <class>AK_Deliverytime_Model_Mysql4</class>
38
+ <entities>
39
+ <deliverytime>
40
+ <table>deliverytime</table>
41
+ </deliverytime>
42
+ <timeslot>
43
+ <table>timeslot</table>
44
+ </timeslot>
45
+ </entities>
46
+ </deliverytime_mysql4>
47
+
48
+ <checkout>
49
+ <rewrite>
50
+ <type_onepage>AK_Deliverytime_Model_Type_Onepage</type_onepage>
51
+ </rewrite>
52
+ </checkout>
53
+
54
+ </models>
55
+
56
+ <rewrite>
57
+ <ak_deliverytime_onepage>
58
+ <from><![CDATA[#^/checkout/onepage/#]]></from>
59
+ <to>/deliverytime/onepage/</to>
60
+ </ak_deliverytime_onepage>
61
+ </rewrite>
62
+
63
+ <resources>
64
+
65
+ <deliverytime_setup>
66
+ <setup>
67
+ <module>AK_Deliverytime</module>
68
+ </setup>
69
+ <connection>
70
+ <use>core_setup</use>
71
+ </connection>
72
+ </deliverytime_setup>
73
+ <deliverytime_write>
74
+ <connection>
75
+ <use>core_write</use>
76
+ </connection>
77
+ </deliverytime_write>
78
+ <deliverytime_read>
79
+ <connection>
80
+ <use>core_read</use>
81
+ </connection>
82
+ </deliverytime_read>
83
+
84
+ </resources>
85
+ </global>
86
+
87
+ <frontend>
88
+ <routers>
89
+ <ak_deliverytime>
90
+ <use>standard</use>
91
+ <args>
92
+ <module>AK_Deliverytime</module>
93
+ <frontName>deliverytime</frontName>
94
+ </args>
95
+ </ak_deliverytime>
96
+
97
+ </routers>
98
+
99
+ <events>
100
+ <checkout_onepage_controller_success_action>
101
+ <observers>
102
+ <hooksystem_order_success>
103
+ <type>singleton</type>
104
+ <class>deliverytime/observer</class>
105
+ <method>hookToOrderSaveEvent</method>
106
+ </hooksystem_order_success>
107
+ </observers>
108
+ </checkout_onepage_controller_success_action>
109
+ </events>
110
+
111
+ <layout>
112
+ <updates>
113
+ <deliverytime>
114
+ <file>deliverytime.xml</file>
115
+ </deliverytime>
116
+ </updates>
117
+ </layout>
118
+ </frontend>
119
+
120
+ <admin>
121
+ <routers>
122
+ <deliverytime>
123
+ <use>admin</use>
124
+ <args>
125
+ <module>AK_Deliverytime</module>
126
+ <frontName>admin_deliverytime</frontName>
127
+ </args>
128
+ </deliverytime>
129
+ </routers>
130
+ </admin>
131
+
132
+ <adminhtml>
133
+ <menu>
134
+ <deliverytime module="deliverytime">
135
+ <title>Deliverytime</title>
136
+ <sort_order>100</sort_order>
137
+ <children>
138
+ <deliverytime module="deliverytime">
139
+ <title>Manage Deliverytime</title>
140
+ <sort_order>0</sort_order>
141
+ <action>admin_deliverytime/adminhtml_deliverytime</action>
142
+ </deliverytime>
143
+ </children>
144
+ </deliverytime>
145
+ </menu>
146
+ <acl>
147
+ <resources>
148
+ <all>
149
+ <title>Allow Everything</title>
150
+ </all>
151
+ <admin>
152
+ <children>
153
+ <deliverytime translate="title" module="deliverytime">
154
+ <title>Deliverytime</title>
155
+ <sort_order>1000</sort_order>
156
+ <children>
157
+ <deliverytime translate="title">
158
+ <title>Manage Deliverytime</title>
159
+ <sort_order>0</sort_order>
160
+ </deliverytime>
161
+ </children>
162
+ </deliverytime>
163
+ </children>
164
+ </admin>
165
+ </resources>
166
+ </acl>
167
+ <layout>
168
+ <updates>
169
+ <deliverytime>
170
+ <file>deliverytime.xml</file>
171
+ </deliverytime>
172
+ </updates>
173
+ </layout>
174
+ </adminhtml>
175
+ </config>
app/code/community/AK/Deliverytime/etc/system.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <deliverytime translate="label" module="deliverytime">
5
+ <label>AK Extensions</label>
6
+ <sort_order>400</sort_order>
7
+ </deliverytime>
8
+ </tabs>
9
+ <sections>
10
+ <deliverytime translate="label" module="deliverytime">
11
+ <class>separator-top</class>
12
+ <label>Delivery Time</label>
13
+ <tab>deliverytime</tab>
14
+ <sort_order>130</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <deliverytime_general translate="label">
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enabled translate="label">
28
+ <label>Enabled</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <comment>Select Yes to enable this feature.</comment>
36
+ </enabled>
37
+ </fields>
38
+ </deliverytime_general>
39
+ </groups>
40
+ </deliverytime>
41
+ </sections>
42
+ </config>
app/code/community/AK/Deliverytime/sql/deliverytime_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+ DROP TABLE IF EXISTS {$this->getTable('deliverytime')};
7
+ CREATE TABLE {$this->getTable('deliverytime')} (
8
+ `deliverytime_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
9
+ `title` VARCHAR(255) NOT NULL DEFAULT '',
10
+ `deliverytime_start` VARCHAR(255) NOT NULL DEFAULT '',
11
+ `deliverytime_end` VARCHAR(255) NOT NULL DEFAULT '',
12
+ `mon` INT(1) NOT NULL DEFAULT '0',
13
+ `tue` INT(1) NOT NULL DEFAULT '0',
14
+ `wed` INT(1) NOT NULL DEFAULT '0',
15
+ `thu` INT(1) NOT NULL DEFAULT '0',
16
+ `fri` INT(1) NOT NULL DEFAULT '0',
17
+ `sat` INT(1) NOT NULL DEFAULT '0',
18
+ `sun` INT(1) NOT NULL DEFAULT '0',
19
+ `status` INT(1) NOT NULL DEFAULT '0',
20
+ PRIMARY KEY (`deliverytime_id`)
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
22
+ DROP TABLE IF EXISTS {$installer->getTable('timeslot')};
23
+ CREATE TABLE {$installer->getTable('timeslot')} (
24
+ `id` int(11) unsigned NOT NULL auto_increment,
25
+ `timeslot` varchar(100),
26
+ `order_id` int(11) NOT NULL default '0',
27
+ PRIMARY KEY (`id`)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
29
+ ");
30
+
31
+
32
+ /*$installer->run("
33
+ DROP TABLE IF EXISTS {$installer->getTable('timeslot')};
34
+ CREATE TABLE {$installer->getTable('timeslot')} (
35
+ `id` int(11) unsigned NOT NULL auto_increment,
36
+ `timeslot` varchar(100),
37
+ `order_id` int(11) NOT NULL default '0',
38
+ PRIMARY KEY (`id`)
39
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40
+ ");*/
41
+
42
+ //demo
43
+ //Mage::getModel('core/url_rewrite')->setId(null);
44
+ //demo
45
+ $installer->endSetup();
46
+
app/design/adminhtml/default/default/layout/deliverytime.xml ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <deliverytime_adminhtml_deliverytime_index>
4
+ <reference name="content">
5
+ <block type="deliverytime/adminhtml_deliverytime" name="deliverytime" />
6
+ </reference>
7
+ </deliverytime_adminhtml_deliverytime_index>
8
+
9
+ <adminhtml_sales_order_view>
10
+ <reference name="order_tab_info">
11
+ <action method="setTemplate" ifconfig="deliverytime/deliverytime_general/enabled">
12
+ <template>deliverytime/info.phtml</template>
13
+ </action>
14
+ </reference>
15
+ </adminhtml_sales_order_view>
16
+
17
+
18
+ <deliverytime_adminhtml_deliverytime_new>
19
+ <reference name="head">
20
+
21
+ <action method="addItem">
22
+ <type>js</type>
23
+ <name>timepicker/jquery.min.js</name>
24
+ </action>
25
+
26
+ <action method="addItem">
27
+ <type>js</type>
28
+ <name>timepicker/kendo.all.min.js</name>
29
+ </action>
30
+
31
+ <action method="addItem">
32
+ <type>js</type>
33
+ <name>timepicker/init.js</name>
34
+ </action>
35
+ <!-- CSS -->
36
+ <action method="addItem">
37
+ <type>js_css</type>
38
+ <name>timepicker/kendo.common.min.css</name>
39
+ </action>
40
+
41
+ <action method="addItem">
42
+ <type>js_css</type>
43
+ <name>timepicker/kendo.default.min.css</name>
44
+ </action>
45
+
46
+ <action method="addItem">
47
+ <type>js_css</type>
48
+ <name>timepicker/kendo.dataviz.min.css</name>
49
+ </action>
50
+
51
+ <action method="addItem">
52
+ <type>js_css</type>
53
+ <name>timepicker/kendo.dataviz.default.min.css</name>
54
+ </action>
55
+
56
+ </reference>
57
+ </deliverytime_adminhtml_deliverytime_new>
58
+
59
+ <deliverytime_adminhtml_deliverytime_edit>
60
+ <reference name="head">
61
+
62
+ <action method="addItem">
63
+ <type>js</type>
64
+ <name>jquery/jquery.min.js</name>
65
+ </action>
66
+
67
+ <action method="addItem">
68
+ <type>js</type>
69
+ <name>timepicker/kendo.all.min.js</name>
70
+ </action>
71
+
72
+ <action method="addItem">
73
+ <type>js</type>
74
+ <name>timepicker/init.js</name>
75
+ </action>
76
+ <!-- CSS -->
77
+ <action method="addItem">
78
+ <type>js_css</type>
79
+ <name>timepicker/kendo.common.min.css</name>
80
+ </action>
81
+
82
+ <action method="addItem">
83
+ <type>js_css</type>
84
+ <name>timepicker/kendo.default.min.css</name>
85
+ </action>
86
+
87
+ <action method="addItem">
88
+ <type>js_css</type>
89
+ <name>timepicker/kendo.dataviz.min.css</name>
90
+ </action>
91
+
92
+ <action method="addItem">
93
+ <type>js_css</type>
94
+ <name>timepicker/kendo.dataviz.default.min.css</name>
95
+ </action>
96
+
97
+ </reference>
98
+ </deliverytime_adminhtml_deliverytime_edit>
99
+
100
+ </layout>
app/design/adminhtml/default/default/template/deliverytime/info.phtml ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
28
+ <?php $_order = $this->getOrder() ?>
29
+ <div>
30
+ <div id="order-messages">
31
+ <?php echo $this->getChildHtml('order_messages') ?>
32
+ </div>
33
+ <?php echo $this->getChildHtml('order_info') ?>
34
+ <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
35
+ <?php if ($_order->getIsVirtual()): ?>
36
+ <div class="box-right">
37
+ <?php else: ?>
38
+ <div class="box-left">
39
+ <?php endif; ?>
40
+ <!--Payment Method-->
41
+ <div class="entry-edit">
42
+ <div class="entry-edit-head">
43
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
44
+ </div>
45
+ <fieldset>
46
+ <?php echo $this->getPaymentHtml() ?>
47
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
48
+ </fieldset>
49
+ </div>
50
+ </div>
51
+
52
+ <?php if (!$_order->getIsVirtual()): ?>
53
+ <div class="box-right">
54
+ <!--Shipping Method-->
55
+ <div class="entry-edit">
56
+ <div class="entry-edit-head">
57
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
58
+ </div>
59
+ <fieldset>
60
+ <?php if ($_order->getTracksCollection()->count()) : ?>
61
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->quoteEscape($this->__('Track Order')) ?>"><?php echo $this->__('Track Order') ?></a>
62
+ <br/>
63
+ <?php endif; ?>
64
+ <?php if ($_order->getShippingDescription()): ?>
65
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
66
+
67
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
68
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
69
+ <?php else: ?>
70
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
71
+ <?php endif; ?>
72
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
73
+
74
+ <?php echo $_excl; ?>
75
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
76
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
77
+ <?php endif; ?>
78
+ <?php else: ?>
79
+ <?php echo $this->helper('sales')->__('No shipping information available'); ?>
80
+ <?php endif; ?>
81
+ </fieldset>
82
+ </div>
83
+ </div>
84
+ <?php endif; ?>
85
+ <div class="box-right">
86
+
87
+ <div class="entry-edit">
88
+ <div class="entry-edit-head">
89
+ <h4 class="icon-head head-heared4us"><?php echo Mage::helper('sales')->__('Timeslot') ?></h4>
90
+ </div>
91
+ <fieldset>
92
+ <?php
93
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
94
+ $pf = (string) Mage::getConfig()->getTablePrefix();
95
+ $table = $pf.'timeslot';
96
+ $customerdata = $read->fetchAll("select * from $table where order_id=".$_order->getId()."");
97
+
98
+ $output .="";
99
+ // Get Records from the table
100
+ if (!empty($customerdata)) {
101
+ foreach ($customerdata as $item){
102
+
103
+ $output .=''.$item['timeslot'].'<br/>';
104
+
105
+
106
+ }
107
+ }
108
+
109
+ echo $output;
110
+
111
+ ?>
112
+ </fieldset>
113
+ </div>
114
+ </div>
115
+ <div class="clear"></div>
116
+ <?php echo $this->getGiftOptionsHtml() ?>
117
+ <div class="clear"></div>
118
+ <div class="entry-edit">
119
+ <div class="entry-edit-head">
120
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
121
+ </div>
122
+ </div>
123
+ <?php echo $this->getItemsHtml() ?>
124
+ <div class="clear"></div>
125
+
126
+ <div class="box-left">
127
+ <div class="entry-edit">
128
+ <div class="entry-edit-head">
129
+ <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
130
+ </div>
131
+ <fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
132
+ </div>
133
+ </div>
134
+ <div class="box-right entry-edit">
135
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
136
+ <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
137
+ </div>
138
+ <div class="clear"></div>
139
+ </div>
140
+
141
+ <?php echo $this->getChildHtml('popup_window');?>
142
+ <script type="text/javascript">
143
+ //<![CDATA[
144
+ /**
145
+ * Retrieve gift options tooltip content
146
+ */
147
+ function getGiftOptionsTooltipContent(itemId) {
148
+ var contentLines = [];
149
+ var headerLine = null;
150
+ var contentLine = null;
151
+
152
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
153
+ if (element.down(0)) {
154
+ headerLine = element.down(0).innerHTML;
155
+ contentLine = element.down(0).next().innerHTML;
156
+ if (contentLine.length > 30) {
157
+ contentLine = contentLine.slice(0,30) + '...';
158
+ }
159
+ contentLines.push(headerLine + ' ' + contentLine);
160
+ }
161
+ });
162
+ return contentLines.join('<br/>');
163
+ }
164
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
165
+ //]]>
166
+ </script>
app/design/frontend/base/default/layout/deliverytime.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+ <checkout_onepage_index>
6
+ <reference name="head">
7
+ <action method="addCss"><stylesheet>deliverytime/checkout.css</stylesheet></action>
8
+ <action method="addItem"><type>skin_js</type><name>deliverytime/jquery.min.js</name></action>
9
+ <action method="addItem"><type>skin_js</type><name>deliverytime/timeslot.js</name></action>
10
+ </reference>
11
+ <reference name="checkout.onepage">
12
+ <!-- Extra step added to OnePage Checkout -->
13
+ <block type="deliverytime/onepage_deliverytime" name="checkout.onepage.deliverytime" as="deliverytime" after="checkout.onepage.billing" template="checkout/onepage/deliverytime.phtml"/>
14
+ </reference>
15
+ </checkout_onepage_index>
16
+ </layout>
app/design/frontend/base/default/template/checkout/onepage/agreements.phtml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Checkout_Block_Agreements
30
+ */
31
+ ?>
32
+
33
+ <?php if (!$this->getAgreements()) return; ?>
34
+ <form action="" id="checkout-agreements" onsubmit="return false;">
35
+ <ol class="checkout-agreements">
36
+ <?php foreach ($this->getAgreements() as $_a): ?>
37
+ <li>
38
+ <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
39
+ <?php if ($_a->getIsHtml()):?>
40
+ <?php echo $_a->getContent() ?>
41
+ <?php else:?>
42
+ <?php echo nl2br($this->escapeHtml($_a->getContent())) ?>
43
+ <?php endif; ?>
44
+ </div>
45
+ <p class="agree">
46
+ <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></label>
47
+ </p>
48
+ </li>
49
+ <?php endforeach ?>
50
+ </ol>
51
+ </form>
app/design/frontend/base/default/template/checkout/onepage/billing.phtml ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="co-billing-form" action="">
28
+ <fieldset>
29
+ <ul class="form-list">
30
+ <?php if ($this->customerHasAddresses()): ?>
31
+ <li class="wide">
32
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
33
+ <div class="input-box">
34
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
35
+ </div>
36
+ </li>
37
+ <?php endif; ?>
38
+ <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
39
+ <fieldset>
40
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
41
+ <ul>
42
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
43
+ <li class="fields">
44
+ <div class="field">
45
+ <label for="billing:company"><?php echo $this->__('Company') ?></label>
46
+ <div class="input-box">
47
+ <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Company')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
48
+ </div>
49
+ </div>
50
+ <?php if(!$this->isCustomerLoggedIn()): ?>
51
+ <div class="field">
52
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
53
+ <div class="input-box">
54
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Email Address')) ?>" class="input-text validate-email required-entry" />
55
+ </div>
56
+ </div>
57
+ <?php endif; ?>
58
+ </li>
59
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
60
+ <li class="wide">
61
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
62
+ <div class="input-box">
63
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Street Address')) ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
64
+ </div>
65
+ </li>
66
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
67
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
68
+ <li class="wide">
69
+ <div class="input-box">
70
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Street Address %s', $_i)) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
71
+ </div>
72
+ </li>
73
+ <?php endfor; ?>
74
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
75
+ <li class="wide">
76
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
77
+ <div class="input-box">
78
+ <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('VAT Number')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
79
+ </div>
80
+ </li>
81
+ <?php endif; ?>
82
+ <li class="fields">
83
+ <div class="field">
84
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
85
+ <div class="input-box">
86
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('City')) ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
87
+ </div>
88
+ </div>
89
+ <div class="field">
90
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
91
+ <div class="input-box">
92
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>" class="validate-select" style="display:none;">
93
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
94
+ </select>
95
+ <script type="text/javascript">
96
+ //<![CDATA[
97
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
98
+ //]]>
99
+ </script>
100
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
101
+ </div>
102
+ </div>
103
+ </li>
104
+ <li class="fields">
105
+ <div class="field">
106
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
107
+ <div class="input-box">
108
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Zip/Postal Code')) ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
109
+ </div>
110
+ </div>
111
+ <div class="field">
112
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
113
+ <div class="input-box">
114
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
115
+ </div>
116
+ </div>
117
+ </li>
118
+ <li class="fields">
119
+ <div class="field">
120
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
121
+ <div class="input-box">
122
+ <input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Telephone')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
123
+ </div>
124
+ </div>
125
+ <div class="field">
126
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
127
+ <div class="input-box">
128
+ <input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Fax')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
129
+ </div>
130
+ </div>
131
+ </li>
132
+ <?php if(!$this->isCustomerLoggedIn()): ?>
133
+
134
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
135
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
136
+ <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
137
+ <li class="fields">
138
+ <?php if ($_dob->isEnabled()): ?>
139
+ <div class="field">
140
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
141
+ </div>
142
+ <?php endif; ?>
143
+ <?php if ($_gender->isEnabled()): ?>
144
+ <div class="field">
145
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
146
+ </div>
147
+ <?php endif ?>
148
+ </li>
149
+ <?php endif ?>
150
+
151
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
152
+ <?php if ($_taxvat->isEnabled()): ?>
153
+ <li>
154
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
155
+ </li>
156
+ <?php endif ?>
157
+
158
+ <li class="fields" id="register-customer-password">
159
+ <div class="field">
160
+ <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
161
+ <div class="input-box">
162
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Password')) ?>" class="input-text required-entry validate-password" />
163
+ </div>
164
+ </div>
165
+ <div class="field">
166
+ <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
167
+ <div class="input-box">
168
+ <input type="password" name="billing[confirm_password]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm Password')) ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
169
+ </div>
170
+ </div>
171
+ </li>
172
+ <?php endif; ?>
173
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
174
+ <li class="control">
175
+ <input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Save in address book')) ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
176
+ </li>
177
+ <?php else:?>
178
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
179
+ <?php endif; ?>
180
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
181
+ </ul>
182
+ </fieldset>
183
+ </li>
184
+ <?php /* Extensions placeholder */ ?>
185
+ <?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
186
+ <?php if ($this->canShip()): ?>
187
+ <li class="control">
188
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo Mage::helper('core')->quoteEscape($this->__('Ship to this address')) ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
189
+ <li class="control">
190
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo Mage::helper('core')->quoteEscape($this->__('Ship to different address')) ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
191
+ </li>
192
+ <?php endif; ?>
193
+ </ul>
194
+ <?php if (!$this->canShip()): ?>
195
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
196
+ <?php endif; ?>
197
+ <div class="buttons-set" id="billing-buttons-container">
198
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
199
+ <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Continue')) ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
200
+ <span class="please-wait" id="billing-please-wait" style="display:none;">
201
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
202
+ </span>
203
+ </div>
204
+ </fieldset>
205
+ </form>
206
+ <script type="text/javascript">
207
+ //<![CDATA[
208
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
209
+ var billingForm = new VarienForm('co-billing-form');
210
+
211
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
212
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
213
+
214
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
215
+ //]]>
216
+ </script>
app/design/frontend/base/default/template/checkout/onepage/deliverytime.phtml ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form id="co-deliverytime-form" action="">
2
+ <li id="timeslot-form">
3
+ <fieldset>
4
+ <ul>
5
+ <li class="wide">
6
+ <div class="delivery_modes timeSlotTable">
7
+ <table class="slots_table" width="100%" border="1" bordercolor="#EBEBE9" style="border-collapse:collapse" cellspacing="0" cellpadding="6">
8
+ <tr align="center" class="header">
9
+ <td height="34" style="vertical-align:middle" class="col1" >Day/Date</td>
10
+ <td colspan="6" class="tslot_header"><table border="0" width="100%">
11
+ <tr>
12
+ <td width="346" height="30" style="text-align:center"> Time Slots </td>
13
+ <td width="131" style="text-align:right">
14
+ <a href="javascript:void(0)" id="nextweek" class="delprod"> <span style="font-weight:bold">Next Week</span></a>
15
+ </td>
16
+ </tr>
17
+ </table></td>
18
+ </tr>
19
+ <?php
20
+ // set current date
21
+ $date = date('d-m-Y');
22
+ // parse about any English textual datetime description into a Unix timestamp
23
+ $ts1 = strtotime($date);
24
+ // find the year (ISO-8601 year number) and the current week
25
+ $year = date('o', $ts1);
26
+ $week = date('W', $ts1);
27
+ // print week for the current date
28
+ for($i = 1; $i <= 7; $i++) {
29
+ // timestamp from ISO week date format
30
+ $ts = strtotime($year.'W'.$week.$i);
31
+ ?>
32
+ <tr class="<?php echo $i%2==0?'evenRow':'oddRow' ?>">
33
+ <td class="col1"><?php echo date("d-m-Y D", $ts) ?></td>
34
+ <?php
35
+ $data_array = Mage::getModel('deliverytime/deliverytime')->getCollection()->addFieldToSelect('*')->addFieldToFilter('status',1);
36
+ if(count($data_array)>0):
37
+ foreach($data_array as $key=>$value):
38
+ ?>
39
+ <td style="color:#999999" <?php echo $ts1>$ts?'class="nohover"':''; ?> <?php
40
+ echo (date("D", $ts)=='Mon' && $value->getmon()==0)?'class="nohover"':'';
41
+ echo (date("D", $ts)=='Tue' && $value->gettue()==0)?'class="nohover"':'';
42
+ echo (date("D", $ts)=='Wed' && $value->getwed()==0)?'class="nohover"':'';
43
+ echo (date("D", $ts)=='Thu' && $value->getthu()==0)?'class="nohover"':'';
44
+ echo (date("D", $ts)=='Fri' && $value->getfri()==0)?'class="nohover"':'';
45
+ echo (date("D", $ts)=='Sat' && $value->getsat()==0)?'class="nohover"':'';
46
+ echo (date("D", $ts)=='Sun' && $value->getsun()==0)?'class="nohover"':'';
47
+ ?>><label class="label">
48
+ <input id="exp" type="radio" class="btnradio" name="timeslot" value="<?php echo $value->getdeliverytime_start().' - '.$value->getdeliverytime_end().' '.date("d-m-Y D", $ts);?>" <?php
49
+ echo (date("D", $ts)=='Mon' && $value->getmon()==0)?'disabled="disabled"':'';
50
+ echo (date("D", $ts)=='Tue' && $value->gettue()==0)?'disabled="disabled"':'';
51
+ echo (date("D", $ts)=='Wed' && $value->getwed()==0)?'disabled="disabled"':'';
52
+ echo (date("D", $ts)=='Thu' && $value->getthu()==0)?'disabled="disabled"':'';
53
+ echo (date("D", $ts)=='Fri' && $value->getfri()==0)?'disabled="disabled"':'';
54
+ echo (date("D", $ts)=='Sat' && $value->getsat()==0)?'disabled="disabled"':'';
55
+ echo (date("D", $ts)=='Sun' && $value->getsun()==0)?'disabled="disabled"':'';
56
+ ?> <?php echo $ts1>$ts?'disabled="disabled"':''; ?> />
57
+ <?php echo $value->getdeliverytime_start().' - '.$value->getdeliverytime_end();?></label></td>
58
+
59
+ <?php endforeach; else: ?>
60
+ <td> <h3 style="text-align:center;">No Time Slot Available </h3> </td>
61
+ <?php endif; ?>
62
+
63
+ </tr>
64
+ <?php } ?>
65
+
66
+ <!-- NEW DELIVERY MODE -->
67
+ </table>
68
+ </div>
69
+ <div class="delivery_modes_nextweek timeSlotTable" >
70
+ <table class="slots_table" width="100%" border="1" bordercolor="#EBEBE9" style="border-collapse:collapse" cellspacing="0" cellpadding="6">
71
+ <tr align="center" class="header">
72
+ <td height="34" style="vertical-align:middle" class="col1" >Day/Date</td>
73
+ <td colspan="7" class="tslot_header"><table border="0" width="100%">
74
+ <tr>
75
+ <td width="346" height="30" style="text-align:center"> Time Slots </td>
76
+ <td width="131" style="text-align:right">
77
+ <a href="javascript:void(0)" id="prevweek" class="delprod"><span style="font-weight:bold">Previous Week</span></a>
78
+ </td>
79
+ </tr>
80
+ </table></td>
81
+ </tr>
82
+ <?php
83
+ // set current date
84
+ $date = strtotime(date('d-m-Y'));
85
+ // parse about any English textual datetime description into a Unix timestamp
86
+ $ts = strtotime("+7 day", $date);
87
+ // find the year (ISO-8601 year number) and the current week
88
+ $year = date('o', $ts);
89
+ $week = date('W', $ts);
90
+ // print week for the current date
91
+ for($i = 1; $i <= 7; $i++) {
92
+ // timestamp from ISO week date format
93
+ $ts = strtotime($year.'W'.$week.$i);
94
+ ?>
95
+ <tr class="<?php echo $i%2==0?'evenRow':'oddRow' ?>">
96
+ <td class="col1"><?php echo date("d-m-Y D", $ts) ?></td>
97
+ <?php
98
+
99
+ $data_array = Mage::getModel('deliverytime/deliverytime')->getCollection()->addFieldToSelect('*')->addFieldToFilter('status',1);
100
+ if(count($data_array)>0):
101
+ foreach($data_array as $key=>$value):
102
+ ?>
103
+ <td style="color:#999999" <?php
104
+ echo (date("D", $ts)=='Mon' && $value->getmon()==0)?'class="nohover"':'';
105
+ echo (date("D", $ts)=='Tue' && $value->gettue()==0)?'class="nohover"':'';
106
+ echo (date("D", $ts)=='Wed' && $value->getwed()==0)?'class="nohover"':'';
107
+ echo (date("D", $ts)=='Thu' && $value->getthu()==0)?'class="nohover"':'';
108
+ echo (date("D", $ts)=='Fri' && $value->getfri()==0)?'class="nohover"':'';
109
+ echo (date("D", $ts)=='Sat' && $value->getsat()==0)?'class="nohover"':'';
110
+ echo (date("D", $ts)=='Sun' && $value->getsun()==0)?'class="nohover"':'';
111
+ ?> ><label class="label">
112
+ <input id="exp" type="radio" class="btnradio" name="timeslot" value="<?php echo $value->getdeliverytime_start().' - '.$value->getdeliverytime_end().' '.date("d-m-Y D", $ts);?>" <?php
113
+ echo (date("D", $ts)=='Mon' && $value->getmon()==0)?'disabled="disabled"':'';
114
+ echo (date("D", $ts)=='Tue' && $value->gettue()==0)?'disabled="disabled"':'';
115
+ echo (date("D", $ts)=='Wed' && $value->getwed()==0)?'disabled="disabled"':'';
116
+ echo (date("D", $ts)=='Thu' && $value->getthu()==0)?'disabled="disabled"':'';
117
+ echo (date("D", $ts)=='Fri' && $value->getfri()==0)?'disabled="disabled"':'';
118
+ echo (date("D", $ts)=='Sat' && $value->getsat()==0)?'disabled="disabled"':'';
119
+ echo (date("D", $ts)=='Sun' && $value->getsun()==0)?'disabled="disabled"':'';
120
+ ?> />
121
+ <?php echo $value->getdeliverytime_start().' - '.$value->getdeliverytime_end();?></label></td>
122
+
123
+ <?php endforeach; else: ?>
124
+ <td> <h3 style="text-align:center;">No Time Slot Available </h3> </td>
125
+ <?php endif; ?>
126
+ </tr>
127
+ <?php } ?>
128
+ </table>
129
+ </div>
130
+ </li>
131
+ </ul>
132
+ </fieldset>
133
+ </li>
134
+ </form>
135
+
136
+
137
+ <div class="button-set">
138
+ <div id="deliverytime-buttons-container">
139
+ <button type="button" class="button validation-passed" onclick="deliverytime.save();"><span><?php echo $this->__('Continue') ?></span></button>
140
+ <span id="deliverytime-please-wait" style="display:none;" class="opc-please-wait">
141
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt="" /> &nbsp; <?php echo $this->__('Loading next step...') ?> &nbsp;
142
+ </span>
143
+ </div>
144
+ </div>
145
+
146
+ <script type="text/javascript">
147
+ //<![CDATA[
148
+
149
+ var Deliverytime = Class.create();
150
+ Deliverytime.prototype = {
151
+ initialize: function(form, saveUrl){
152
+ this.form = form;
153
+ if ($(this.form)) {
154
+ $(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
155
+ }
156
+ this.saveUrl = saveUrl;
157
+ this.onSave = this.nextStep.bindAsEventListener(this);
158
+ this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
159
+ },
160
+
161
+ save: function(){
162
+ if (checkout.loadWaiting!=false) return;
163
+
164
+ var validator = new Validation(this.form);
165
+ if (validator.validate()) {
166
+
167
+ checkout.setLoadWaiting('deliverytime');
168
+
169
+
170
+ var request = new Ajax.Request(
171
+ this.saveUrl,
172
+ {
173
+ method: 'post',
174
+ onComplete: this.onComplete,
175
+ onSuccess: this.onSave,
176
+ onFailure: checkout.ajaxFailure.bind(checkout),
177
+ parameters: Form.serialize(this.form)
178
+ }
179
+ );
180
+ }
181
+ },
182
+
183
+ resetLoadWaiting: function(transport){
184
+ checkout.setLoadWaiting(false);
185
+ },
186
+
187
+ nextStep: function(transport){
188
+ if (transport && transport.responseText){
189
+ try{
190
+ response = eval('(' + transport.responseText + ')');
191
+ }
192
+ catch (e) {
193
+ response = {};
194
+ }
195
+ }
196
+
197
+ if (response.error){
198
+ if ((typeof response.message) == 'string') {
199
+ alert(response.message);
200
+ } else {
201
+ if (window.billingRegionUpdater) {
202
+ billingRegionUpdater.update();
203
+ }
204
+
205
+ alert(response.message.join("\n"));
206
+ }
207
+
208
+ return false;
209
+ }
210
+
211
+ checkout.setStepResponse(response);
212
+ }
213
+ }
214
+
215
+ var deliverytime = new Deliverytime('co-deliverytime-form', '<?php echo $this->getUrl('checkout/onepage/saveDeliverytime') ?>');
216
+
217
+ $('shipping:same_as_entrant').observe('click',function(){
218
+ if(this.checked){
219
+ $('shipping:permanent').setValue($('shipping:local_address').value);
220
+ }
221
+ else{
222
+ $('shipping:permanent').setValue('');
223
+ }
224
+ });
225
+
226
+ //]]>
227
+ </script>
app/design/frontend/base/default/template/checkout/onepage/failure.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="page-title">
28
+ <h1><?php echo $this->__('An error occurred in the process of payment') ?></h1>
29
+ </div>
30
+ <?php if ($this->getRealOrderId()) : ?><p><?php echo $this->__('Order #') . $this->getRealOrderId() ?></p><?php endif ?>
31
+ <?php if ($error = $this->getErrorMessage()) : ?><p><?php echo $error ?></p><?php endif ?>
32
+ <p><?php echo $this->__('Click <a href="%s">here</a> to continue shopping.', Mage::helper('core')->quoteEscape($this->getContinueShoppingUrl())) ?></p>
app/design/frontend/base/default/template/checkout/onepage/link.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if ($this->isPossibleOnepageCheckout()):?>
28
+ <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Proceed to Checkout')) ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
29
+ <?php endif?>
app/design/frontend/base/default/template/checkout/onepage/login.phtml ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* Extensions placeholder */ ?>
28
+ <?php echo $this->getChildHtml('checkout.onepage.login.extra')?>
29
+ <div class="col2-set">
30
+ <?php echo $this->getChildHtml('login_before')?>
31
+ <div class="col-1">
32
+ <h3><?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?><?php echo $this->__('Checkout as a Guest or Register') ?><?php else: ?><?php echo $this->__('Register to Create an Account') ?><?php endif; ?></h3>
33
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
34
+ <p><?php echo $this->__('Register with us for future convenience:') ?></p>
35
+ <?php else: ?>
36
+ <p><strong><?php echo $this->__('Register and save time!') ?></strong><br />
37
+ <?php echo $this->__('Register with us for future convenience:') ?></p>
38
+ <ul>
39
+ <li><?php echo $this->__('Fast and easy check out') ?></li>
40
+ <li><?php echo $this->__('Easy access to your order history and status') ?></li>
41
+ </ul>
42
+ <?php endif; ?>
43
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
44
+ <ul class="form-list">
45
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
46
+ <li class="control">
47
+ <input type="radio" name="checkout_method" id="login:guest" value="guest"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked"<?php endif; ?> class="radio" /><label for="login:guest"><?php echo $this->__('Checkout as Guest') ?></label>
48
+ </li>
49
+ <?php endif; ?>
50
+ <li class="control">
51
+ <input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked"<?php endif ?> class="radio" /><label for="login:register"><?php echo $this->__('Register') ?></label>
52
+ </li>
53
+ </ul>
54
+ <h4><?php echo $this->__('Register and save time!') ?></h4>
55
+ <p><?php echo $this->__('Register with us for future convenience:') ?></p>
56
+ <ul class="ul">
57
+ <li><?php echo $this->__('Fast and easy check out') ?></li>
58
+ <li><?php echo $this->__('Easy access to your order history and status') ?></li>
59
+ </ul>
60
+ <?php else: ?>
61
+ <input type="hidden" name="checkout_method" id="login:register" value="register" checked="checked" />
62
+ <?php endif; ?>
63
+ </div>
64
+ <div class="col-2">
65
+ <h3><?php echo $this->__('Login') ?></h3>
66
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
67
+ <form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
68
+ <fieldset>
69
+ <?php echo $this->getBlockHtml('formkey'); ?>
70
+ <h4><?php echo $this->__('Already registered?') ?></h4>
71
+ <p><?php echo $this->__('Please log in below:') ?></p>
72
+ <ul class="form-list">
73
+ <li>
74
+ <label for="login-email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
75
+ <div class="input-box">
76
+ <input type="text" class="input-text required-entry validate-email" id="login-email" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" />
77
+ </div>
78
+ </li>
79
+ <li>
80
+ <label for="login-password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
81
+ <div class="input-box">
82
+ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" />
83
+ </div>
84
+ </li>
85
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
86
+ </ul>
87
+ </fieldset>
88
+ </form>
89
+ </div>
90
+ </div>
91
+ <div class="col2-set">
92
+ <div class="col-1">
93
+ <div class="buttons-set">
94
+ <p class="required">&nbsp;</p>
95
+ <button type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo ($this->getQuote()->isAllowedGuestCheckout() ? $this->__('Continue') : $this->__('Register')) ?></span></span></button>
96
+ </div>
97
+ </div>
98
+ <div class="col-2">
99
+ <div class="buttons-set">
100
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
101
+ <a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>" class="f-left"><?php echo $this->__('Forgot your password?') ?></a>
102
+ <button type="submit" class="button" onclick="onepageLogin(this)"><span><span><?php echo $this->__('Login') ?></span></span></button>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ <script type="text/javascript">
107
+ //<![CDATA[
108
+ var loginForm = new VarienForm('login-form', true);
109
+ $('login-email').observe('keypress', bindLoginPost);
110
+ $('login-password').observe('keypress', bindLoginPost);
111
+ function bindLoginPost(evt){
112
+ if (evt.keyCode == Event.KEY_RETURN) {
113
+ loginForm.submit();
114
+ }
115
+ }
116
+ function onepageLogin(button)
117
+ {
118
+ if(loginForm.validator && loginForm.validator.validate()){
119
+ button.disabled = true;
120
+ loginForm.submit();
121
+ }
122
+ }
123
+ //]]>
124
+ </script>
app/design/frontend/base/default/template/checkout/onepage/payment.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ var quoteBaseGrandTotal = <?php echo (float)$this->getQuoteBaseGrandTotal(); ?>;
30
+ var checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
31
+ var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');
32
+ var lastPrice;
33
+ //]]>
34
+ </script>
35
+ <form action="" id="co-payment-form">
36
+ <fieldset>
37
+ <?php echo $this->getChildHtml('methods') ?>
38
+ </fieldset>
39
+ </form>
40
+ <div class="tool-tip" id="payment-tool-tip" style="display:none;">
41
+ <div class="btn-close"><a href="#" id="payment-tool-tip-close" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Close')) ?>"><?php echo $this->__('Close') ?></a></div>
42
+ <div class="tool-tip-content"><img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Card Verification Number Visual Reference')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Card Verification Number Visual Reference')) ?>" /></div>
43
+ </div>
44
+ <div class="buttons-set" id="payment-buttons-container">
45
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
46
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
47
+ <button type="button" class="button" onclick="payment.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
48
+ <span class="please-wait" id="payment-please-wait" style="display:none;">
49
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
50
+ </span>
51
+ </div>
52
+ <script type="text/javascript">
53
+ //<![CDATA[
54
+ function toggleToolTip(event){
55
+ if($('payment-tool-tip')){
56
+ $('payment-tool-tip').setStyle({
57
+ top: (Event.pointerY(event)-560)+'px'//,
58
+ //left: (Event.pointerX(event)+100)+'px'
59
+ })
60
+ $('payment-tool-tip').toggle();
61
+ }
62
+ Event.stop(event);
63
+ }
64
+ if($('payment-tool-tip-close')){
65
+ Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
66
+ }
67
+ //]]>
68
+ </script>
69
+ <script type="text/javascript">
70
+ //<![CDATA[
71
+ payment.currentMethod = "<?php echo $this->getChild('methods')->getSelectedMethodCode() ?>";
72
+ //]]>
73
+ </script>
app/design/frontend/base/default/template/checkout/onepage/payment/info.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <dl class="sp-methods" id="checkout-payment-method-load">
28
+ <!-- Content dynamically loaded. Content from the methods.phtml is loaded during the ajax call -->
29
+ </dl>
app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @var $this Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+ <?php
36
+ $methods = $this->getMethods();
37
+ $oneMethod = count($methods) <= 1;
38
+ ?>
39
+ <?php if (empty($methods)): ?>
40
+ <dt>
41
+ <?php echo $this->__('No Payment Methods') ?>
42
+ </dt>
43
+ <?php else:
44
+ foreach ($methods as $_method):
45
+ $_code = $_method->getCode();
46
+ ?>
47
+ <dt id="dt_method_<?php echo $_code ?>">
48
+ <?php if(!$oneMethod): ?>
49
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
50
+ <?php else: ?>
51
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
52
+ <?php $oneMethod = $_code; ?>
53
+ <?php endif; ?>
54
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
55
+ </dt>
56
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
57
+ <dd id="dd_method_<?php echo $_code ?>">
58
+ <?php echo $html; ?>
59
+ </dd>
60
+ <?php endif; ?>
61
+ <?php endforeach;
62
+ endif;
63
+ ?>
64
+ <?php echo $this->getChildChildHtml('additional'); ?>
65
+ <script type="text/javascript">
66
+ //<![CDATA[
67
+ <?php echo $this->getChildChildHtml('scripts'); ?>
68
+ payment.init();
69
+ <?php if (is_string($oneMethod)): ?>
70
+ payment.switchMethod('<?php echo $oneMethod ?>');
71
+ <?php endif; ?>
72
+ //]]>
73
+ </script>
app/design/frontend/base/default/template/checkout/onepage/progress.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="block block-progress opc-block-progress">
28
+ <div class="block-title">
29
+ <strong><span><?php echo $this->__('Your Checkout Progress') ?></span></strong>
30
+ </div>
31
+ <div class="block-content">
32
+ <dl>
33
+ <?php if ($this->getCheckout()->getStepData('billing', 'is_show')): ?>
34
+ <div id="billing-progress-opcheckout">
35
+ <?php echo $this->getChildHtml('billing.progress') ?>
36
+ </div>
37
+ <?php endif; ?>
38
+
39
+ <?php if ($this->getCheckout()->getStepData('shipping', 'is_show')): ?>
40
+ <div id="shipping-progress-opcheckout">
41
+ <?php echo $this->getChildHtml('shipping.progress') ?>
42
+ </div>
43
+ <?php endif; ?>
44
+
45
+ <?php if ($this->getCheckout()->getStepData('shipping_method', 'is_show')): ?>
46
+ <div id="shipping_method-progress-opcheckout">
47
+ <?php echo $this->getChildHtml('shippingmethod.progress') ?>
48
+ </div>
49
+ <?php endif; ?>
50
+
51
+ <?php if ($this->getCheckout()->getStepData('payment', 'is_show')): ?>
52
+ <div id="payment-progress-opcheckout">
53
+ <?php echo $this->getChildHtml('payment.progress') ?>
54
+ </div>
55
+ <?php endif; ?>
56
+ </dl>
57
+ </div>
58
+ </div>
59
+
app/design/frontend/base/default/template/checkout/onepage/progress/billing.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if ($this->getCheckout()->getStepData('billing', 'complete')): ?>
28
+ <dt class="complete">
29
+ <?php echo $this->__('Billing Address') ?><span class="changelink"> <span class="separator">|</span> <a
30
+ href="#billing"
31
+ onclick="checkout.changeSection('opc-billing'); return false;"><?php echo $this->__('Change') ?></a></span>
32
+ </dt>
33
+ <dd class="complete">
34
+ <address><?php echo $this->getBilling()->format('html') ?></address>
35
+ </dd>
36
+ <?php else: ?>
37
+ <dt>
38
+ <?php echo $this->__('Billing Address') ?>
39
+ </dt>
40
+ <?php endif; ?>
app/design/frontend/base/default/template/checkout/onepage/progress/payment.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if ($this->getCheckout()->getStepData('payment', 'complete')): ?>
28
+ <dt class="complete">
29
+ <?php echo $this->__('Payment Method') ?><span class="changelink"> <span class="separator">|</span> <a
30
+ href="#payment"
31
+ onclick="checkout.changeSection('opc-payment'); return false;"><?php echo $this->__('Change') ?></a></span>
32
+ </dt>
33
+ <dd class="complete">
34
+ <?php echo $this->getPaymentHtml() ?>
35
+ </dd>
36
+ <?php else: ?>
37
+ <dt>
38
+ <?php echo $this->__('Payment Method') ?>
39
+ </dt>
40
+ <?php endif; ?>
41
+
app/design/frontend/base/default/template/checkout/onepage/progress/shipping.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if ($this->getCheckout()->getStepData('shipping', 'complete')): ?>
28
+ <?php $completeClass = $this->getCheckout()->getStepData('shipping', 'complete') ? 'complete' : ''; ?>
29
+ <dt class="<?php echo $completeClass ?>">
30
+ <?php echo $this->__('Shipping Address') ?> <span class="changelink"><span class="separator">|</span> <a
31
+ href="#payment"
32
+ onclick="checkout.changeSection('opc-shipping');return false;"><?php echo $this->__('Change') ?></a></span>
33
+ </dt>
34
+ <dd class="<?php echo $completeClass ?>">
35
+ <?php if ($this->getCheckout()->getStepData('shipping', 'complete')): ?>
36
+ <address><?php echo $this->getShipping()->format('html') ?></address>
37
+ <?php endif; ?>
38
+ </dd>
39
+ <?php else: ?>
40
+ <dt>
41
+ <?php echo $this->__('Shipping Address') ?>
42
+ </dt>
43
+ <?php endif; ?>
44
+
app/design/frontend/base/default/template/checkout/onepage/progress/shipping_method.phtml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if ($this->getCheckout()->getStepData('shipping_method', 'complete')): ?>
28
+ <dt class="complete">
29
+ <?php echo $this->__('Shipping Method') ?> <span class="changelink"><span class="separator">|</span> <a
30
+ href="#shipping_method"
31
+ onclick="checkout.changeSection('opc-shipping_method'); return false;"><?php echo $this->__('Change') ?></a></span>
32
+ </dt>
33
+ <dd class="complete">
34
+ <?php if ($this->getShippingMethod()): ?>
35
+ <?php echo $this->getShippingDescription() ?>
36
+
37
+ <?php $_excl = $this->getShippingPriceExclTax(); ?>
38
+ <?php $_incl = $this->getShippingPriceInclTax(); ?>
39
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
40
+ <?php echo $_incl; ?>
41
+ <?php else: ?>
42
+ <?php echo $_excl; ?>
43
+ <?php endif; ?>
44
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
45
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
46
+ <?php endif; ?>
47
+
48
+ <?php else: ?>
49
+ <?php echo $this->__('Shipping method has not been selected yet') ?>
50
+ <?php endif; ?>
51
+ </dd>
52
+ <?php else: ?>
53
+ <dt>
54
+ <?php echo $this->__('Shipping Method') ?>
55
+ </dt>
56
+ <?php endif; ?>
57
+
app/design/frontend/base/default/template/checkout/onepage/review.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="order-review" id="checkout-review-load">
28
+ <!-- Content loaded dynamically -->
29
+ </div>
app/design/frontend/base/default/template/checkout/onepage/review/button.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Place Order')) ?>" class="button btn-checkout" onclick="review.save();"><span><span><?php echo $this->__('Place Order') ?></span></span></button>
app/design/frontend/base/default/template/checkout/onepage/review/info.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->getChildHtml('items_before'); ?>
28
+ <div id="checkout-review-table-wrapper">
29
+ <table class="data-table" id="checkout-review-table">
30
+ <?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
31
+ <col />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <col width="1" />
35
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
36
+ <col width="1" />
37
+ <col width="1" />
38
+ <?php endif; ?>
39
+ <thead>
40
+ <tr>
41
+ <th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
42
+ <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
43
+ <th rowspan="<?php echo $rowspan ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
44
+ <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Subtotal') ?></th>
45
+ </tr>
46
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
47
+ <tr>
48
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
49
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
50
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
51
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
52
+ </tr>
53
+ <?php endif; ?>
54
+ </thead>
55
+ <?php echo $this->getChildHtml('totals'); ?>
56
+ <tbody>
57
+ <?php foreach($this->getItems() as $_item): ?>
58
+ <?php echo $this->getItemHtml($_item)?>
59
+ <?php endforeach ?>
60
+ </tbody>
61
+ </table>
62
+ </div>
63
+ <?php echo $this->getChildHtml('items_after'); ?>
64
+ <script type="text/javascript">
65
+ //<![CDATA[
66
+ decorateTable('checkout-review-table');
67
+ truncateOptions();
68
+ //]]>
69
+ </script>
70
+ <div id="checkout-review-submit">
71
+ <?php echo $this->getChildHtml('agreements') ?>
72
+ <div class="buttons-set" id="review-buttons-container">
73
+ <p class="f-left"><?php echo $this->__('Forgot an Item?') ?> <a href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Edit Your Cart') ?></a></p>
74
+ <?php echo $this->getChildHtml('button') ?>
75
+ <span class="please-wait" id="review-please-wait" style="display:none;">
76
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Submitting order information...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Submitting order information...')) ?>" class="v-middle" /> <?php echo $this->__('Submitting order information...') ?>
77
+ </span>
78
+ </div>
79
+ <script type="text/javascript">
80
+ //<![CDATA[
81
+ review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
82
+ //]]>
83
+ </script>
84
+ </div>
app/design/frontend/base/default/template/checkout/onepage/review/item.phtml ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem()?>
28
+ <tr>
29
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($this->getProductName()) ?></h3>
30
+ <?php if ($_options = $this->getOptionList()):?>
31
+ <dl class="item-options">
32
+ <?php foreach ($_options as $_option) : ?>
33
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
34
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
35
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
36
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
37
+ <div class="truncated_full_value">
38
+ <dl class="item-options">
39
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
40
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
41
+ </dl>
42
+ </div>
43
+ <?php endif; ?>
44
+ </dd>
45
+ <?php endforeach; ?>
46
+ </dl>
47
+ <?php endif;?>
48
+ <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
49
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
50
+ <?php endif;?>
51
+ </td>
52
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
53
+ <td class="a-right">
54
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
55
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
56
+ <?php else: ?>
57
+ <span class="cart-price">
58
+ <?php endif; ?>
59
+
60
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
61
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
62
+ <?php else: ?>
63
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
64
+ <?php endif; ?>
65
+
66
+ </span>
67
+
68
+
69
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
70
+
71
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
72
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
73
+ <small>
74
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
75
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
76
+ <?php endforeach; ?>
77
+ </small>
78
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
79
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
80
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></small></span><br />
81
+ <?php endforeach; ?>
82
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
83
+ <small>
84
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
85
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
86
+ <?php endforeach; ?>
87
+ </small>
88
+ <?php endif; ?>
89
+ </div>
90
+
91
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
92
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
93
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
94
+ </div>
95
+ <?php endif; ?>
96
+ <?php endif; ?>
97
+ </td>
98
+ <?php endif; ?>
99
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
100
+ <td>
101
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
102
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
103
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
104
+ <?php else: ?>
105
+ <span class="cart-price">
106
+ <?php endif; ?>
107
+
108
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
109
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
110
+ <?php else: ?>
111
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
112
+ <?php endif; ?>
113
+
114
+ </span>
115
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
116
+
117
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
118
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
119
+ <small>
120
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
121
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
122
+ <?php endforeach; ?>
123
+ </small>
124
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
125
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
126
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
127
+ <?php endforeach; ?>
128
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
129
+ <small>
130
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
131
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
132
+ <?php endforeach; ?>
133
+ </small>
134
+ <?php endif; ?>
135
+ </div>
136
+
137
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
138
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
139
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
140
+ </div>
141
+ <?php endif; ?>
142
+ <?php endif; ?>
143
+ </td>
144
+ <?php endif; ?>
145
+ <td class="a-center"><?php echo $_item->getQty() ?></td>
146
+ <!-- sub total starts here -->
147
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
148
+ <td class="a-right">
149
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
150
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
151
+ <?php else: ?>
152
+ <span class="cart-price">
153
+ <?php endif; ?>
154
+
155
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
156
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
157
+ <?php else: ?>
158
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
159
+ <?php endif; ?>
160
+
161
+ </span>
162
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
163
+
164
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
165
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
166
+ <small>
167
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
168
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
169
+ <?php endforeach; ?>
170
+ </small>
171
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
172
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
173
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
174
+ <?php endforeach; ?>
175
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
176
+ <small>
177
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
178
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
179
+ <?php endforeach; ?>
180
+ </small>
181
+ <?php endif; ?>
182
+ </div>
183
+
184
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
185
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
186
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
187
+ </div>
188
+ <?php endif; ?>
189
+ <?php endif; ?>
190
+ </td>
191
+ <?php endif; ?>
192
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
193
+ <td>
194
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
195
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
196
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
197
+ <?php else: ?>
198
+ <span class="cart-price">
199
+ <?php endif; ?>
200
+
201
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
202
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
203
+ <?php else: ?>
204
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
205
+ <?php endif; ?>
206
+
207
+ </span>
208
+
209
+
210
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
211
+
212
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
213
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
214
+ <small>
215
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
216
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
217
+ <?php endforeach; ?>
218
+ </small>
219
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
220
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
221
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
222
+ <?php endforeach; ?>
223
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
224
+ <small>
225
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
226
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
227
+ <?php endforeach; ?>
228
+ </small>
229
+ <?php endif; ?>
230
+ </div>
231
+
232
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
233
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
234
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
235
+ </div>
236
+ <?php endif; ?>
237
+ <?php endif; ?>
238
+ </td>
239
+ <?php endif; ?>
240
+ </tr>
app/design/frontend/base/default/template/checkout/onepage/review/totals.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * @see Mage_Checkout_Block_Cart_Totals
29
+ */
30
+ ?>
31
+ <?php if ($this->getTotals()): ?>
32
+ <tfoot>
33
+ <?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 5 : 3; ?>
34
+ <?php echo $this->renderTotals(null, $_colspan); ?>
35
+ <?php echo $this->renderTotals('footer', $_colspan); ?>
36
+ <?php if ($this->needDisplayBaseGrandtotal()):?>
37
+ <tr>
38
+ <td class="a-right" colspan="<?php echo $_colspan; ?>">
39
+ <small><?php echo $this->helper('sales')->__('Your credit card will be charged for') ?></small>
40
+ </td>
41
+ <td class="a-right">
42
+ <small><?php echo $this->displayBaseGrandtotal() ?></small>
43
+ </td>
44
+ </tr>
45
+ <?php endif?>
46
+ </tfoot>
47
+ <?php endif; ?>
app/design/frontend/base/default/template/checkout/onepage/shipping.phtml ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form action="" id="co-shipping-form">
28
+ <ul class="form-list">
29
+ <?php if ($this->customerHasAddresses()): ?>
30
+ <li class="wide">
31
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
32
+ <div class="input-box">
33
+ <?php echo $this->getAddressesHtmlSelect('shipping') ?>
34
+ </div>
35
+ </li>
36
+ <?php endif ?>
37
+ <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
38
+ <fieldset>
39
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
40
+ <ul>
41
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?></li>
42
+ <li class="fields">
43
+ <div class="fields">
44
+ <label for="shipping:company"><?php echo $this->__('Company') ?></label>
45
+ <div class="input-box">
46
+ <input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Company')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" onchange="shipping.setSameAsBilling(false);" />
47
+ </div>
48
+ </div>
49
+ </li>
50
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
51
+ <li class="wide">
52
+ <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
53
+ <div class="input-box">
54
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Street Address')) ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
55
+ </div>
56
+ </li>
57
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
58
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
59
+ <li class="wide">
60
+ <div class="input-box">
61
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Street Address %s', $_i)) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
62
+ </div>
63
+ </li>
64
+ <?php endfor; ?>
65
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
66
+ <li class="wide">
67
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
68
+ <div class="input-box">
69
+ <input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('VAT Number')); ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
70
+ </div>
71
+ </li>
72
+ <?php endif; ?>
73
+ <li class="fields">
74
+ <div class="field">
75
+ <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
76
+ <div class="input-box">
77
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('City')) ?>" name="shipping[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="shipping:city" onchange="shipping.setSameAsBilling(false);" />
78
+ </div>
79
+ </div>
80
+ <div class="field">
81
+ <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
82
+ <div class="input-box">
83
+ <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>" class="validate-select" style="display:none;">
84
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
85
+ </select>
86
+ <script type="text/javascript">
87
+ //<![CDATA[
88
+ $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
89
+ //]]>
90
+ </script>
91
+ <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
92
+ </div>
93
+ </div>
94
+ </li>
95
+ <li class="fields">
96
+ <div class="field">
97
+ <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
98
+ <div class="input-box">
99
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Zip/Postal Code')) ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" onchange="shipping.setSameAsBilling(false);" />
100
+ </div>
101
+ </div>
102
+ <div class="field">
103
+ <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
104
+ <div class="input-box">
105
+ <?php echo $this->getCountryHtmlSelect('shipping') ?>
106
+ </div>
107
+ </div>
108
+ </li>
109
+ <li class="fields">
110
+ <div class="field">
111
+ <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
112
+ <div class="input-box">
113
+ <input type="text" name="shipping[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Telephone')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
114
+ </div>
115
+ </div>
116
+ <div class="field">
117
+ <label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
118
+ <div class="input-box">
119
+ <input type="text" name="shipping[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Fax')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" />
120
+ </div>
121
+ </div>
122
+ </li>
123
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
124
+ <li class="control">
125
+ <input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Save in address book')) ?>" id="shipping:save_in_address_book" onchange="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
126
+ <?php else:?>
127
+ <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
128
+ <?php endif;?>
129
+ </ul>
130
+ </fieldset>
131
+ </li>
132
+ <li class="control">
133
+ <input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1"<?php if($this->getAddress()->getSameAsBilling()): ?> checked="checked"<?php endif; ?> title="<?php echo $this->__('Use Billing Address') ?>" onclick="shipping.setSameAsBilling(this.checked)" class="checkbox" /><label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
134
+ </li>
135
+ </ul>
136
+ <div class="buttons-set" id="shipping-buttons-container">
137
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
138
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
139
+ <button type="button" class="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Continue')) ?>" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
140
+ <span id="shipping-please-wait" class="please-wait" style="display:none;">
141
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
142
+ </span>
143
+ </div>
144
+ </form>
145
+ <script type="text/javascript">
146
+ //<![CDATA[
147
+ var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
148
+ '<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
149
+ var shippingForm = new VarienForm('co-shipping-form');
150
+ shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
151
+ //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Select State/Province...')) ?>');
152
+ $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
153
+
154
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
155
+ //]]>
156
+ </script>
app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="co-shipping-method-form" action="">
28
+ <div id="checkout-shipping-method-load">
29
+ <!-- Content loaded dynamically -->
30
+ </div>
31
+ <script type="text/javascript">
32
+ //<![CDATA[
33
+ var shippingMethod = new ShippingMethod('co-shipping-method-form', "<?php echo $this->getUrl('checkout/onepage/saveShippingMethod') ?>");
34
+ //]]>
35
+ </script>
36
+ <div id="onepage-checkout-shipping-method-additional-load">
37
+ <?php echo $this->getChildHtml('additional') ?>
38
+ </div>
39
+ <div class="buttons-set" id="shipping-method-buttons-container">
40
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
41
+ <button type="button" class="button" onclick="shippingMethod.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
42
+ <span id="shipping-method-please-wait" class="please-wait" style="display:none;">
43
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
44
+ </span>
45
+ </div>
46
+ </form>
app/design/frontend/base/default/template/checkout/onepage/shipping_method/additional.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if (!$this->getQuote()->isVirtual()): ?>
28
+ <?php echo $this->helper('giftmessage/message')->getInline('onepage_checkout', $this->getQuote(), $this->getDontDisplayContainer()) ?>
29
+ <?php endif; ?>
app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Checkout_Block_Onepage_Shipping_Method_Available */ ?>
28
+ <?php $_shippingRateGroups = $this->getShippingRates(); ?>
29
+ <?php if (!$_shippingRateGroups): ?>
30
+ <p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
31
+ <?php else: ?>
32
+ <dl class="sp-methods">
33
+ <?php $shippingCodePrice = array(); ?>
34
+ <?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
35
+ <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
36
+ <dd>
37
+ <ul>
38
+ <?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
39
+ <?php $shippingCodePrice[] = "'".$_rate->getCode()."':".(float)$_rate->getPrice(); ?>
40
+ <li>
41
+ <?php if ($_rate->getErrorMessage()): ?>
42
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
43
+ <?php else: ?>
44
+ <?php if ($_sole) : ?>
45
+ <span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
46
+ <?php else: ?>
47
+ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
48
+
49
+ <?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
50
+ <script type="text/javascript">
51
+ //<![CDATA[
52
+ lastPrice = <?php echo (float)$_rate->getPrice(); ?>;
53
+ //]]>
54
+ </script>
55
+ <?php endif; ?>
56
+
57
+ <?php endif; ?>
58
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
59
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
60
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
61
+ <?php echo $_excl; ?>
62
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
63
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
64
+ <?php endif; ?>
65
+ </label>
66
+ <?php endif ?>
67
+ </li>
68
+ <?php endforeach; ?>
69
+ </ul>
70
+ </dd>
71
+ <?php endforeach; ?>
72
+ </dl>
73
+ <script type="text/javascript">
74
+ //<![CDATA[
75
+ <?php if (!empty($shippingCodePrice)): ?>
76
+ var shippingCodePrice = {<?php echo implode(',',$shippingCodePrice); ?>};
77
+ <?php endif; ?>
78
+
79
+ $$('input[type="radio"][name="shipping_method"]').each(function(el){
80
+ Event.observe(el, 'click', function(){
81
+ if (el.checked == true) {
82
+ var getShippingCode = el.getValue();
83
+ <?php if (!empty($shippingCodePrice)): ?>
84
+ var newPrice = shippingCodePrice[getShippingCode];
85
+ if (!lastPrice) {
86
+ lastPrice = newPrice;
87
+ quoteBaseGrandTotal += newPrice;
88
+ }
89
+ if (newPrice != lastPrice) {
90
+ quoteBaseGrandTotal += (newPrice-lastPrice);
91
+ lastPrice = newPrice;
92
+ }
93
+ <?php endif; ?>
94
+ checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
95
+ return false;
96
+ }
97
+ });
98
+ });
99
+ //]]>
100
+ </script>
101
+ <?php endif; ?>
app/etc/modules/AK_Deliverytime.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <AK_Deliverytime>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.1.0</version>
8
+ </AK_Deliverytime>
9
+ </modules>
10
+ </config>
js/timepicker/Default/sprite.png ADDED
Binary file
js/timepicker/init.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ function startChange() {
3
+ var startTime = start.value();
4
+
5
+ if (startTime) {
6
+ startTime = new Date(startTime);
7
+
8
+ end.max(startTime);
9
+
10
+ startTime.setMinutes(startTime.getMinutes() + this.options.interval);
11
+
12
+ end.min(startTime);
13
+ end.value(startTime);
14
+ }
15
+ }
16
+
17
+ //init start timepicker
18
+ var start = jQuery("#deliverytime_start").kendoTimePicker({
19
+ change: startChange
20
+ }).data("kendoTimePicker");
21
+
22
+ //init end timepicker
23
+ var end = jQuery("#deliverytime_end").kendoTimePicker().data("kendoTimePicker");
24
+
25
+ //define min/max range
26
+ start.min("8:00 AM");
27
+ start.max("11:00 PM");
28
+
29
+ //define min/max range
30
+ end.min("8:00 AM");
31
+ end.max("7:30 AM");
32
+ });
33
+
js/timepicker/jquery.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery.min.map
3
+ */(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,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 b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
4
+ return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},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)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.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+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===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]||st.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]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(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){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.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===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
5
+ }b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.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){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
6
+ jQuery.noConflict();
js/timepicker/kendo.all.min.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui)
3
+ * Copyright 2014 Telerik AD. All rights reserved.
4
+ *
5
+ * Kendo UI commercial licenses may be obtained at
6
+ * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
7
+ * If you do not own a commercial license, this file shall be governed by the trial license terms.
8
+ */
9
+ (function(f,define){define([],f)})(function(){"bundle all";!function(e,t,n){function i(){}function r(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var n=e.charAt(0),i=e.substring(1);return"="===n?"+("+i+")+":":"===n?"+e("+i+")+":";"+e+";o+="}function o(e,t,n){return e+="",t=t||2,n=t-e.length,n?O[t].substring(0,n)+e:e}function a(e){var t=e.css(gt.support.transitions.css+"box-shadow")||e.css("box-shadow"),n=t?t.match(Tt)||[0,0,0,0,0]:[0,0,0,0,0],i=bt.max(+n[3],+(n[4]||0));return{left:-n[1]+i,right:+n[1]+i,bottom:+n[2]+i}}function s(t,n){var i,r,o,s,l,c,d,u,h=xt.browser,p="rtl"==t.css("direction");return t.parent().hasClass("k-animation-container")?(d=t.parent(".k-animation-container"),u=d[0].style,d.is(":hidden")&&d.show(),i=Ct.test(u.width)||Ct.test(u.height),i||d.css({width:t.outerWidth(),height:t.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})):(r=a(t),o=t[0].style.width,s=t[0].style.height,l=Ct.test(o),c=Ct.test(s),h.opera&&(r.left=r.right=r.bottom=5),i=l||c,!l&&(!n||n&&o)&&(o=t.outerWidth()),!c&&(!n||n&&s)&&(s=t.outerHeight()),t.wrap(e("<div/>").addClass("k-animation-container").css({width:o,height:s,marginLeft:r.left*(p?1:-1),paddingLeft:r.left,paddingRight:r.right,paddingBottom:r.bottom})),i&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})),h.msie&&bt.floor(h.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function l(e){var t=1,n=arguments.length;for(t=1;n>t;t++)c(e,arguments[t]);return e}function c(e,t){var n,i,r,o,a,s=gt.data.ObservableArray,l=gt.data.LazyObservableArray,d=gt.data.DataSource,u=gt.data.HierarchicalDataSource;for(n in t)i=t[n],r=typeof i,o=r===Pt&&null!==i?i.constructor:null,o&&o!==Array&&o!==s&&o!==l&&o!==d&&o!==u?i instanceof Date?e[n]=new Date(i.getTime()):I(i.clone)?e[n]=i.clone():(a=e[n],e[n]=typeof a===Pt?a||{}:{},c(e[n],i)):r!==zt&&(e[n]=i);return e}function d(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&t[r].test(e))return r;return i!==n?i:e}function u(e){return e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})}function h(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function p(t,n){var i,r={};return document.defaultView&&document.defaultView.getComputedStyle?(i=document.defaultView.getComputedStyle(t,""),n&&e.each(n,function(e,t){r[t]=i.getPropertyValue(t)})):(i=t.currentStyle,n&&e.each(n,function(e,t){r[t]=i[h(t)]})),gt.size(r)||(r=i),r}function f(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&"toJSON"!=t&&n++;return n}function g(e,n,i){n||(n="offset");var r=e[n]();return xt.browser.msie&&(xt.pointers||xt.msPointers)&&!i&&(r.top-=t.pageYOffset-document.documentElement.scrollTop,r.left-=t.pageXOffset-document.documentElement.scrollLeft),r}function m(e){var t={};return vt("string"==typeof e?e.split(" "):e,function(e){t[e]=this}),t}function v(e){return new gt.effects.Element(e)}function _(e,t,n,i){return typeof e===Et&&(I(t)&&(i=t,t=400,n=!1),I(n)&&(i=n,n=!1),typeof t===Ft&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:i}),mt({effects:{},duration:400,reverse:!1,init:yt,teardown:yt,hide:!1},e,{completeCallback:e.complete,complete:yt})}function w(t,n,i,r,o){for(var a,s=0,l=t.length;l>s;s++)a=e(t[s]),a.queue(function(){U.promise(a,_(n,i,r,o))});return t}function y(e,t,n,i){return t&&(t=t.split(" "),vt(t,function(t,n){e.toggleClass(n,i)})),e}function b(e){return(""+e).replace(W,"&amp;").replace(j,"&lt;").replace($,"&gt;").replace(q,"&quot;").replace(G,"&#39;")}function k(e,t){var i;return 0===t.indexOf("data")&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(nt,"-$1"),i=e.getAttribute("data-"+gt.ns+t),null===i?i=n:"null"===i?i=null:"true"===i?i=!0:"false"===i?i=!1:Dt.test(i)?i=parseFloat(i):et.test(i)&&!tt.test(i)&&(i=Function("return ("+i+")")()),i}function x(t,i){var r,o,a={};for(r in i)o=k(t,r),o!==n&&(J.test(r)&&(o=gt.template(e("#"+o).html())),a[r]=o);return a}function C(t,n){return e.contains(t,n)?-1:1}function S(){var t=e(this);return e.inArray(t.attr("data-"+gt.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function T(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&D(e)}function D(t){return!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")||e.expr.filters.hidden(this)}).length}function A(e,t){return new A.fn.init(e,t)}var E,I,P,M,F,z,R,B,H,L,N,O,V,U,W,j,q,G,$,Y,Q,K,X,Z,J,et,tt,nt,it,rt,ot,at,st,lt,ct,dt,ut,ht,pt,ft,gt=t.kendo=t.kendo||{cultures:{}},mt=e.extend,vt=e.each,_t=e.isArray,wt=e.proxy,yt=e.noop,bt=Math,kt=t.JSON||{},xt={},Ct=/%/,St=/\{(\d+)(:[^\}]+)?\}/g,Tt=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,Dt=/^(\+|-?)\d+(\.?)\d*$/,At="function",Et="string",It="number",Pt="object",Mt="null",Ft="boolean",zt="undefined",Rt={},Bt={},Ht=[].slice,Lt=t.Globalize;gt.version="2014.3.1119",i.extend=function(e){var t,n,i=function(){},r=this,o=e&&e.init?e.init:function(){r.apply(this,arguments)};i.prototype=r.prototype,n=o.fn=o.prototype=new i;for(t in e)n[t]=null!=e[t]&&e[t].constructor===Object?mt(!0,{},i.prototype[t],e[t]):e[t];return n.constructor=o,o.extend=r.extend,o},i.prototype._initOptions=function(e){this.options=l({},this.options,e)},I=gt.isFunction=function(e){return"function"==typeof e},P=function(){this._defaultPrevented=!0},M=function(){return this._defaultPrevented===!0},F=i.extend({init:function(){this._events={}},bind:function(e,t,i){var r,o,a,s,l,c=this,d=typeof e===Et?[e]:e,u=typeof t===At;if(t===n){for(r in e)c.bind(r,e[r]);return c}for(r=0,o=d.length;o>r;r++)e=d[r],s=u?t:t[e],s&&(i&&(a=s,s=function(){c.unbind(e,s),a.apply(c,arguments)},s.original=a),l=c._events[e]=c._events[e]||[],l.push(s));return c},one:function(e,t){return this.bind(e,t,!0)},first:function(e,t){var n,i,r,o,a=this,s=typeof e===Et?[e]:e,l=typeof t===At;for(n=0,i=s.length;i>n;n++)e=s[n],r=l?t:t[e],r&&(o=a._events[e]=a._events[e]||[],o.unshift(r));return a},trigger:function(e,t){var n,i,r=this,o=r._events[e];if(o){for(t=t||{},t.sender=r,t._defaultPrevented=!1,t.preventDefault=P,t.isDefaultPrevented=M,o=o.slice(),n=0,i=o.length;i>n;n++)o[n].call(r,t);return t._defaultPrevented===!0}return!1},unbind:function(e,t){var i,r=this,o=r._events[e];if(e===n)r._events={};else if(o)if(t)for(i=o.length-1;i>=0;i--)(o[i]===t||o[i].original===t)&&o.splice(i,1);else r._events[e]=[];return r}}),z=/^\w+/,R=/\$\{([^}]*)\}/g,B=/\\\}/g,H=/__CURLY__/g,L=/\\#/g,N=/__SHARP__/g,O=["","0","00","000","0000"],E={paramName:"data",useWithBlock:!0,render:function(e,t){var n,i,r="";for(n=0,i=t.length;i>n;n++)r+=e(t[n]);return r},compile:function(e,t){var n,i,o,a=mt({},this,t),s=a.paramName,l=s.match(z)[0],c=a.useWithBlock,d="var o,e=kendo.htmlEncode;";if(I(e))return e;for(d+=c?"with("+s+"){":"",d+="o=",i=e.replace(B,"__CURLY__").replace(R,"#=e($1)#").replace(H,"}").replace(L,"__SHARP__").split("#"),o=0;i.length>o;o++)d+=r(i[o],o%2===0);d+=c?";}":";",d+="return o;",d=d.replace(N,"#");try{return n=Function(l,d),n._slotCount=Math.floor(i.length/2),n}catch(u){throw Error(gt.format("Invalid template:'{0}' Generated code:'{1}'",e,d))}}},function(){function e(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=s[e];return typeof t===Et?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function t(o,a){var s,c,d,u,h,p,f=n,g=a[o];if(g&&typeof g===Pt&&typeof g.toJSON===At&&(g=g.toJSON(o)),typeof r===At&&(g=r.call(a,o,g)),p=typeof g,p===Et)return e(g);if(p===It)return isFinite(g)?g+"":Mt;if(p===Ft||p===Mt)return g+"";if(p===Pt){if(!g)return Mt;if(n+=i,h=[],"[object Array]"===l.apply(g)){for(u=g.length,s=0;u>s;s++)h[s]=t(s,g)||Mt;return d=0===h.length?"[]":n?"[\n"+n+h.join(",\n"+n)+"\n"+f+"]":"["+h.join(",")+"]",n=f,d}if(r&&typeof r===Pt)for(u=r.length,s=0;u>s;s++)typeof r[s]===Et&&(c=r[s],d=t(c,g),d&&h.push(e(c)+(n?": ":":")+d));else for(c in g)Object.hasOwnProperty.call(g,c)&&(d=t(c,g),d&&h.push(e(c)+(n?": ":":")+d));return d=0===h.length?"{}":n?"{\n"+n+h.join(",\n"+n)+"\n"+f+"}":"{"+h.join(",")+"}",n=f,d}}var n,i,r,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l={}.toString;typeof Date.prototype.toJSON!==At&&(Date.prototype.toJSON=function(){var e=this;return isFinite(e.valueOf())?o(e.getUTCFullYear(),4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}),typeof kt.stringify!==At&&(kt.stringify=function(e,o,a){var s;if(n="",i="",typeof a===It)for(s=0;a>s;s+=1)i+=" ";else typeof a===Et&&(i=a);if(r=o,o&&typeof o!==At&&(typeof o!==Pt||typeof o.length!==It))throw Error("JSON.stringify");return t("",{"":e})})}(),function(){function t(e){if(e){if(e.numberFormat)return e;if(typeof e===Et){var t=gt.cultures;return t[e]||t[e.split("-")[0]]||null}return null}return null}function i(e){return e&&(e=t(e)),e||gt.cultures.current}function r(e){e.groupSizes=e.groupSize,e.percent.groupSizes=e.percent.groupSize,e.currency.groupSizes=e.currency.groupSize}function a(e,t,r){r=i(r);var a=r.calendars.standard,s=a.days,l=a.months;return t=a.patterns[t]||t,t.replace(d,function(t){var i,r,c;return"d"===t?r=e.getDate():"dd"===t?r=o(e.getDate()):"ddd"===t?r=s.namesAbbr[e.getDay()]:"dddd"===t?r=s.names[e.getDay()]:"M"===t?r=e.getMonth()+1:"MM"===t?r=o(e.getMonth()+1):"MMM"===t?r=l.namesAbbr[e.getMonth()]:"MMMM"===t?r=l.names[e.getMonth()]:"yy"===t?r=o(e.getFullYear()%100):"yyyy"===t?r=o(e.getFullYear(),4):"h"===t?r=e.getHours()%12||12:"hh"===t?r=o(e.getHours()%12||12):"H"===t?r=e.getHours():"HH"===t?r=o(e.getHours()):"m"===t?r=e.getMinutes():"mm"===t?r=o(e.getMinutes()):"s"===t?r=e.getSeconds():"ss"===t?r=o(e.getSeconds()):"f"===t?r=bt.floor(e.getMilliseconds()/100):"ff"===t?(r=e.getMilliseconds(),r>99&&(r=bt.floor(r/10)),r=o(r)):"fff"===t?r=o(e.getMilliseconds(),3):"tt"===t?r=e.getHours()<12?a.AM[0]:a.PM[0]:"zzz"===t?(i=e.getTimezoneOffset(),c=0>i,r=(""+bt.abs(i/60)).split(".")[0],i=bt.abs(i)-60*r,r=(c?"+":"-")+o(r),r+=":"+o(i)):("zz"===t||"z"===t)&&(r=e.getTimezoneOffset()/60,c=0>r,r=(""+bt.abs(r)).split(".")[0],r=(c?"+":"-")+("zz"===t?o(r):r)),r!==n?r:t.slice(1,t.length-1)})}function s(e,t,r){r=i(r);var o,a,s,c,d,y,b,k,x,C,S,T,D,A,E,I,P,M,F,z,R,B,H,L=r.numberFormat,N=L.groupSize[0],O=L[m],V=L[g],U=L.decimals,W=L.pattern[0],j=[],q=0>e,G=f,$=f,Y=-1;if(e===n)return f;if(!isFinite(e))return e;if(!t)return r.name.length?e.toLocaleString():""+e;if(d=u.exec(t)){if(t=d[1].toLowerCase(),a="c"===t,s="p"===t,(a||s)&&(L=a?L.currency:L.percent,N=L.groupSize[0],O=L[m],V=L[g],U=L.decimals,o=L.symbol,W=L.pattern[q?0:1]),c=d[2],c&&(U=+c),"e"===t)return c?e.toExponential(U):e.toExponential();if(s&&(e*=100),e=l(e,U),q=0>e,e=e.split(g),y=e[0],b=e[1],q&&(y=y.substring(1)),$=y,k=y.length,k>=N)for($=f,C=0;k>C;C++)C>0&&(k-C)%N===0&&($+=O),$+=y.charAt(C);if(b&&($+=V+b),"n"===t&&!q)return $;for(e=f,C=0,S=W.length;S>C;C++)T=W.charAt(C),e+="n"===T?$:"$"===T||"%"===T?o:T;return e}if(q&&(e=-e),(t.indexOf("'")>-1||t.indexOf('"')>-1||t.indexOf("\\")>-1)&&(t=t.replace(h,function(e){var t=e.charAt(0).replace("\\",""),n=e.slice(1).replace(t,"");return j.push(n),w})),t=t.split(";"),q&&t[1])t=t[1],A=!0;else if(0===e){if(t=t[2]||t[0],-1==t.indexOf(v)&&-1==t.indexOf(_))return t}else t=t[0];if(z=t.indexOf("%"),R=t.indexOf("$"),s=-1!=z,a=-1!=R,s&&(e*=100),a&&"\\"===t[R-1]&&(t=t.split("\\").join(""),a=!1),(a||s)&&(L=a?L.currency:L.percent,N=L.groupSize[0],O=L[m],V=L[g],U=L.decimals,o=L.symbol),D=t.indexOf(m)>-1,D&&(t=t.replace(p,f)),E=t.indexOf(g),S=t.length,-1!=E?(b=(""+e).split("e"),b=b[1]?l(e,Math.abs(b[1])):b[0],b=b.split(g)[1]||f,P=t.lastIndexOf(_)-E,I=t.lastIndexOf(v)-E,M=P>-1,F=I>-1,C=b.length,M||F||(t=t.substring(0,E)+t.substring(E+1),S=t.length,E=-1,C=0),M&&P>I?C=P:I>P&&(F&&C>I?C=I:M&&P>C&&(C=P)),C>-1&&(e=l(e,C))):e=l(e),I=t.indexOf(v),B=P=t.indexOf(_),Y=-1==I&&-1!=P?P:-1!=I&&-1==P?I:I>P?P:I,I=t.lastIndexOf(v),P=t.lastIndexOf(_),H=-1==I&&-1!=P?P:-1!=I&&-1==P?I:I>P?I:P,Y==S&&(H=Y),-1!=Y){if($=(""+e).split(g),y=$[0],b=$[1]||f,k=y.length,x=b.length,q&&-1*e>=0&&(q=!1),D)if(k===N&&E-B>k)y=O+y;else if(k>N){for($=f,C=0;k>C;C++)C>0&&(k-C)%N===0&&($+=O),$+=y.charAt(C);y=$}for(e=t.substring(0,Y),q&&!A&&(e+="-"),C=Y;S>C;C++){if(T=t.charAt(C),-1==E){if(k>H-C){e+=y;break}}else if(-1!=P&&C>P&&(G=f),k>=E-C&&E-C>-1&&(e+=y,C=E),E===C){e+=(b?V:f)+b,C+=H-E+1;continue}T===_?(e+=T,G=T):T===v&&(e+=G)}if(H>=Y&&(e+=t.substring(H+1)),a||s){for($=f,C=0,S=e.length;S>C;C++)T=e.charAt(C),$+="$"===T||"%"===T?o:T;e=$}if(S=j.length)for(C=0;S>C;C++)e=e.replace(w,j[C])}return e}var l,c,d=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|zzz|zz|z|"[^"]*"|'[^']*'/g,u=/^(n|c|p|e)(\d*)$/i,h=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,p=/\,/g,f="",g=".",m=",",v="#",_="0",w="??",y="en-US",b={}.toString;gt.cultures["en-US"]={name:y,numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December"],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"MMMM dd",M:"MMMM dd",s:"yyyy'-'MM'-'ddTHH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0,twoDigitYearMax:2029}}},gt.culture=function(e){var i,o=gt.cultures;return e===n?o.current:(i=t(e)||o[y],i.calendar=i.calendars.standard,o.current=i,Lt&&!Lt.load&&r(i.numberFormat),n)},gt.findCulture=t,gt.getCulture=i,gt.culture(y),l=function(e,t){return t=t||0,e=(""+e).split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t))),e=(""+e).split("e"),e=+(e[0]+"e"+(e[1]?+e[1]-t:-t)),e.toFixed(t)},c=function(e,t,i){if(t){if("[object Date]"===b.call(e))return a(e,t,i);if(typeof e===It)return s(e,t,i)}return e!==n?e:""},Lt&&!Lt.load&&(c=function(t,n,i){return e.isPlainObject(i)&&(i=i.name),Lt.format(t,n,i)}),gt.format=function(e){var t=arguments;return e.replace(St,function(e,n,i){var r=t[parseInt(n,10)+1];return c(r,i?i.substring(1):"")})},gt._extractFormat=function(e){return"{0:"===e.slice(0,3)&&(e=e.slice(3,e.length-1)),e},gt._activeElement=function(){try{return document.activeElement}catch(e){return document.documentElement.activeElement}},gt._round=l,gt.toString=c}(),function(){function t(e,t,n){return!(e>=t&&n>=e)}function i(e){return e.charAt(0)}function r(t){return e.map(t,i)}function o(e,t){t||23!==e.getHours()||e.setHours(e.getHours()+2)}function a(e){for(var t=0,n=e.length,i=[];n>t;t++)i[t]=(e[t]+"").toLowerCase();return i}function s(e){var t,n={};for(t in e)n[t]=a(e[t]);return n}function l(e,i,a){if(!e)return null;var l,c,d,u,f,g,m,_,w,y,b,k,x,C=function(e){for(var t=0;i[B]===e;)t++,B++;return t>0&&(B-=1),t},S=function(t){var n=v[t]||RegExp("^\\d{1,"+t+"}"),i=e.substr(H,t).match(n);return i?(i=i[0],H+=i.length,parseInt(i,10)):null},T=function(t,n){for(var i,r,o,a=0,s=t.length;s>a;a++)if(i=t[a],r=i.length,o=e.substr(H,r),n&&(o=o.toLowerCase()),o==i)return H+=r,a+1;return null},D=function(){var t=!1;return e.charAt(H)===i[B]&&(H++,t=!0),t},A=a.calendars.standard,E=null,I=null,P=null,M=null,F=null,z=null,R=null,B=0,H=0,L=!1,N=new Date,O=A.twoDigitYearMax||2029,V=N.getFullYear();for(i||(i="d"),u=A.patterns[i],u&&(i=u),i=i.split(""),d=i.length;d>B;B++)if(l=i[B],L)"'"===l?L=!1:D();else if("d"===l){if(c=C("d"),A._lowerDays||(A._lowerDays=s(A.days)),P=3>c?S(2):T(A._lowerDays[3==c?"namesAbbr":"names"],!0),null===P||t(P,1,31))return null}else if("M"===l){if(c=C("M"),A._lowerMonths||(A._lowerMonths=s(A.months)),I=3>c?S(2):T(A._lowerMonths[3==c?"namesAbbr":"names"],!0),null===I||t(I,1,12))return null;I-=1}else if("y"===l){if(c=C("y"),E=S(c),null===E)return null;2==c&&("string"==typeof O&&(O=V+parseInt(O,10)),E=V-V%100+E,E>O&&(E-=100))}else if("h"===l){if(C("h"),M=S(2),12==M&&(M=0),null===M||t(M,0,11))return null}else if("H"===l){if(C("H"),M=S(2),null===M||t(M,0,23))return null}else if("m"===l){if(C("m"),F=S(2),null===F||t(F,0,59))return null}else if("s"===l){if(C("s"),z=S(2),null===z||t(z,0,59))return null}else if("f"===l){if(c=C("f"),x=e.substr(H,c).match(v[3]),R=S(c),null!==R&&(x=x[0].length,3>x&&(R*=Math.pow(10,3-x)),c>3&&(R=parseInt((""+R).substring(0,3),10))),null===R||t(R,0,999))return null}else if("t"===l){if(c=C("t"),_=A.AM,w=A.PM,1===c&&(_=r(_),w=r(w)),f=T(w),!f&&!T(_))return null}else if("z"===l){if(g=!0,c=C("z"),"Z"===e.substr(H,1)){D();continue}if(m=e.substr(H,6).match(c>2?p:h),!m)return null;if(m=m[0].split(":"),y=m[0],b=m[1],!b&&y.length>3&&(H=y.length-2,b=y.substring(H),y=y.substring(0,H)),y=parseInt(y,10),t(y,-12,13))return null;if(c>2&&(b=parseInt(b,10),isNaN(b)||t(b,0,59)))return null}else if("'"===l)L=!0,D();else if(!D())return null;return k=null!==M||null!==F||z||null,null===E&&null===I&&null===P&&k?(E=V,I=N.getMonth(),P=N.getDate()):(null===E&&(E=V),null===P&&(P=1)),f&&12>M&&(M+=12),g?(y&&(M+=-y),b&&(F+=-b),e=new Date(Date.UTC(E,I,P,M,F,z,R))):(e=new Date(E,I,P,M,F,z,R),o(e,M)),100>E&&e.setFullYear(E),e.getDate()!==P&&g===n?null:e}function c(e){var t="-"===e.substr(0,1)?-1:1;return e=e.substring(1),e=60*parseInt(e.substr(0,2),10)+parseInt(e.substring(2),10),t*e}var d=/\u00A0/g,u=/[eE][\-+]?[0-9]+/,h=/[+|\-]\d{1,2}/,p=/[+|\-]\d{1,2}:?\d{2}/,f=/^\/Date\((.*?)\)\/$/,g=/[+-]\d*/,m=["G","g","d","F","D","y","m","T","t"],v={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},_={}.toString;gt.parseDate=function(e,t,n){var i,r,o,a,s;if("[object Date]"===_.call(e))return e;if(i=0,r=null,e&&0===e.indexOf("/D")&&(r=f.exec(e)))return r=r[1],s=g.exec(r.substring(1)),r=new Date(parseInt(r,10)),s&&(s=c(s[0]),r=gt.timezone.apply(r,0),r=gt.timezone.convert(r,0,-1*s)),r;if(n=gt.getCulture(n),!t){for(t=[],a=n.calendar.patterns,o=m.length;o>i;i++)t[i]=a[m[i]];i=0,t=["yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","yyyy/MM/dd","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd","HH:mm:ss","HH:mm"].concat(t)}for(t=_t(t)?t:[t],o=t.length;o>i;i++)if(r=l(e,t[i],n))return r;return r},gt.parseInt=function(e,t){var n=gt.parseFloat(e,t);return n&&(n=0|n),n},gt.parseFloat=function(e,t,n){if(!e&&0!==e)return null;if(typeof e===It)return e;e=""+e,t=gt.getCulture(t);var i,r,o=t.numberFormat,a=o.percent,s=o.currency,l=s.symbol,c=a.symbol,h=e.indexOf("-");return u.test(e)?(e=parseFloat(e.replace(o["."],".")),isNaN(e)&&(e=null),e):h>0?null:(h=h>-1,e.indexOf(l)>-1||n&&n.toLowerCase().indexOf("c")>-1?(o=s,i=o.pattern[0].replace("$",l).split("n"),e.indexOf(i[0])>-1&&e.indexOf(i[1])>-1&&(e=e.replace(i[0],"").replace(i[1],""),h=!0)):e.indexOf(c)>-1&&(r=!0,o=a,l=c),e=e.replace("-","").replace(l,"").replace(d," ").split(o[","].replace(d," ")).join("").replace(o["."],"."),e=parseFloat(e),isNaN(e)?e=null:h&&(e*=-1),e&&r&&(e/=100),e)},Lt&&!Lt.load&&(gt.parseDate=function(e,t,n){return"[object Date]"===_.call(e)?e:Lt.parseDate(e,t,n)},gt.parseFloat=function(t,i){return typeof t===It?t:t===n||null===t?null:(e.isPlainObject(i)&&(i=i.name),t=Lt.parseFloat(t,i),isNaN(t)?null:t)})}(),function(){var i,r,o,a,s,l,c;xt._scrollbar=n,xt.scrollbar=function(e){if(isNaN(xt._scrollbar)||e){var t,n=document.createElement("div");return n.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",n.innerHTML="&nbsp;",document.body.appendChild(n),xt._scrollbar=t=n.offsetWidth-n.scrollWidth,document.body.removeChild(n),t}return xt._scrollbar},xt.isRtl=function(t){return e(t).closest(".k-rtl").length>0},i=document.createElement("table");try{i.innerHTML="<tr><td></td></tr>",xt.tbodyInnerHtml=!0}catch(u){xt.tbodyInnerHtml=!1}xt.touch="ontouchstart"in t,xt.msPointers=t.MSPointerEvent,xt.pointers=t.PointerEvent,r=xt.transitions=!1,o=xt.transforms=!1,a="HTMLElement"in t?HTMLElement.prototype:[],xt.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style,vt(["Moz","webkit","O","ms"],function(){var e,t=""+this,a=typeof i.style[t+"Transition"]===Et;return a||typeof i.style[t+"Transform"]===Et?(e=t.toLowerCase(),o={css:"ms"!=e?"-"+e+"-":"",prefix:t,event:"o"===e||"webkit"===e?e:""},a&&(r=o,r.event=r.event?r.event+"TransitionEnd":"transitionend"),!1):n}),i=null,xt.transforms=o,xt.transitions=r,xt.devicePixelRatio=t.devicePixelRatio===n?1:t.devicePixelRatio;try{xt.screenWidth=t.outerWidth||t.screen?t.screen.availWidth:t.innerWidth,xt.screenHeight=t.outerHeight||t.screen?t.screen.availHeight:t.innerHeight}catch(u){xt.screenWidth=t.screen.availWidth,xt.screenHeight=t.screen.availHeight}xt.detectOS=function(e){var n,i,r=!1,o=[],a=!/mobile safari/i.test(e),s={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},l={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},c={tablet:/playbook|ipad|fire/i},u={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i};for(i in s)if(s.hasOwnProperty(i)&&(o=e.match(s[i]))){if("windows"==i&&"plugins"in navigator)return!1;r={},r.device=i,r.tablet=d(i,c,!1),r.browser=d(e,u,"default"),r.name=d(i,l),r[r.name]=!0,r.majorVersion=o[2],r.minorVersion=o[3].replace("_","."),n=r.minorVersion.replace(".","").substr(0,2),r.flatVersion=r.majorVersion+n+Array(3-(3>n.length?n.length:2)).join("0"),r.cordova=typeof t.PhoneGap!==zt||typeof t.cordova!==zt,r.appMode=t.navigator.standalone||/file|local|wmapp/.test(t.location.protocol)||r.cordova,r.android&&(1.5>xt.devicePixelRatio&&400>r.flatVersion||a)&&(xt.screenWidth>800||xt.screenHeight>800)&&(r.tablet=i);break}return r},s=xt.mobileOS=xt.detectOS(navigator.userAgent),xt.wpDevicePixelRatio=s.wp?screen.width/320:0,xt.kineticScrollNeeded=s&&(xt.touch||xt.msPointers||xt.pointers),xt.hasNativeScrolling=!1,(s.ios||s.android&&s.majorVersion>2||s.wp)&&(xt.hasNativeScrolling=s),xt.mouseAndTouchPresent=xt.touch&&!(xt.mobileOS.ios||xt.mobileOS.android),xt.detectBrowser=function(e){var t,n=!1,i=[],r={webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(t in r)if(r.hasOwnProperty(t)&&(i=e.match(r[t]))){n={},n[t]=!0,n[i[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,n.version=parseInt(document.documentMode||i[2],10);break}return n},xt.browser=xt.detectBrowser(navigator.userAgent),xt.zoomLevel=function(){try{return xt.touch?document.documentElement.clientWidth/t.innerWidth:xt.browser.msie&&xt.browser.version>=10?(top||t).document.documentElement.offsetWidth/(top||t).innerWidth:1}catch(e){return 1}},xt.cssBorderSpacing=n!==document.documentElement.style.borderSpacing&&!(xt.browser.msie&&8>xt.browser.version),function(t){var n="",i=e(document.documentElement),r=parseInt(t.version,10);t.msie?n="ie":t.mozilla?n="ff":t.safari?n="safari":t.webkit?n="webkit":t.opera&&(n="opera"),n&&(n="k-"+n+" k-"+n+r),xt.mobileOS&&(n+=" k-mobile"),i.addClass(n)}(xt.browser),xt.eventCapture=document.documentElement.addEventListener,l=document.createElement("input"),xt.placeholder="placeholder"in l,xt.propertyChangeEvent="onpropertychange"in l,xt.input=function(){for(var e,t=["number","date","time","month","week","datetime","datetime-local"],n=t.length,i="test",r={},o=0;n>o;o++)e=t[o],l.setAttribute("type",e),l.value=i,r[e.replace("-","")]="text"!==l.type&&l.value!==i;return r}(),l.style.cssText="float:left;",xt.cssFloat=!!l.style.cssFloat,l=null,xt.stableSort=function(){var e,t=513,n=[{index:0,field:"b"}];for(e=1;t>e;e++)n.push({index:e,field:"a"});return n.sort(function(e,t){return e.field>t.field?1:t.field>e.field?-1:0}),1===n[0].index}(),xt.matchesSelector=a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.matchesSelector||a.matches||function(t){for(var n=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:e(t),i=n.length;i--;)if(n[i]==this)return!0;return!1},xt.pushState=t.history&&t.history.pushState,c=document.documentMode,xt.hashChange="onhashchange"in t&&!(xt.browser.msie&&(!c||8>=c))}(),V={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}},U={},e.extend(U,{enabled:!0,Element:function(t){this.element=e(t)},promise:function(e,t){e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.hide&&e.data("olddisplay",e.css("display")).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}}),U.promiseShim=U.promise,"kendoAnimate"in e.fn||mt(e.fn,{kendoStop:function(e,t){return this.stop(e,t)},kendoAnimate:function(e,t,n,i){return w(this,e,t,n,i)},kendoAddClass:function(e,t){return gt.toggleClass(this,e,t,!0)},kendoRemoveClass:function(e,t){return gt.toggleClass(this,e,t,!1)},kendoToggleClass:function(e,t,n){return gt.toggleClass(this,e,t,n)}}),W=/&/g,j=/</g,q=/"/g,G=/'/g,$=/>/g,Y=function(e){return e.target},xt.touch&&(Y=function(e){var t="originalEvent"in e?e.originalEvent.changedTouches:"changedTouches"in e?e.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target},vt(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,n){e.fn[n]=function(e){return this.bind(n,e)}})),xt.touch?xt.mobileOS?(xt.mousedown="touchstart",xt.mouseup="touchend",xt.mousemove="touchmove",xt.mousecancel="touchcancel",xt.click="touchend",xt.resize="orientationchange"):(xt.mousedown="mousedown touchstart",xt.mouseup="mouseup touchend",xt.mousemove="mousemove touchmove",xt.mousecancel="mouseleave touchcancel",xt.click="click",xt.resize="resize"):xt.pointers?(xt.mousemove="pointermove",xt.mousedown="pointerdown",xt.mouseup="pointerup",xt.mousecancel="pointercancel",xt.click="pointerup",xt.resize="orientationchange resize"):xt.msPointers?(xt.mousemove="MSPointerMove",xt.mousedown="MSPointerDown",xt.mouseup="MSPointerUp",xt.mousecancel="MSPointerCancel",xt.click="MSPointerUp",xt.resize="orientationchange resize"):(xt.mousemove="mousemove",xt.mousedown="mousedown",xt.mouseup="mouseup",xt.mousecancel="mouseleave",xt.click="click",xt.resize="resize"),Q=function(e,t){var n,i,r,o,a=t||"d",s=1;for(i=0,r=e.length;r>i;i++)o=e[i],""!==o&&(n=o.indexOf("["),0!==n&&(-1==n?o="."+o:(s++,o="."+o.substring(0,n)+" || {})"+o.substring(n))),s++,a+=o+(r-1>i?" || {})":")"));return Array(s).join("(")+a},K=/^([a-z]+:)?\/\//i,mt(gt,{ui:gt.ui||{},fx:gt.fx||v,effects:gt.effects||U,mobile:gt.mobile||{},data:gt.data||{},dataviz:gt.dataviz||{},keys:{INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},support:gt.support||xt,animate:gt.animate||w,ns:"",attr:function(e){return"data-"+gt.ns+e},getShadows:a,wrap:s,deepExtend:l,getComputedStyles:p,size:f,toCamelCase:h,toHyphens:u,getOffset:gt.getOffset||g,parseEffects:gt.parseEffects||m,toggleClass:gt.toggleClass||y,directions:gt.directions||V,Observable:F,Class:i,Template:E,template:wt(E.compile,E),render:wt(E.render,E),stringify:wt(kt.stringify,kt),eventTarget:Y,htmlEncode:b,isLocalUrl:function(e){return e&&!K.test(e)},expr:function(e,t,n){return e=e||"",typeof t==Et&&(n=t,t=!1),n=n||"d",e&&"["!==e.charAt(0)&&(e="."+e),e=t?Q(e.split("."),n):n+e},getter:function(e,t){var n=e+t;return Rt[n]=Rt[n]||Function("d","return "+gt.expr(e,t))},setter:function(e){return Bt[e]=Bt[e]||Function("d,value",gt.expr(e)+"=value")},accessor:function(e){return{get:gt.getter(e),set:gt.setter(e)}},guid:function(){var e,t,n="";for(e=0;32>e;e++)t=16*bt.random()|0,(8==e||12==e||16==e||20==e)&&(n+="-"),n+=(12==e?4:16==e?3&t|8:t).toString(16);return n},roleSelector:function(e){return e.replace(/(\S+)/g,"["+gt.attr("role")+"=$1],").slice(0,-1)},directiveSelector:function(e){var t,n=e.split(" ");if(n)for(t=0;n.length>t;t++)"view"!=n[t]&&(n[t]=n[t].replace(/(\w*)(view|bar|strip|over)$/,"$1-$2"));return n.join(" ").replace(/(\S+)/g,"kendo-mobile-$1,").slice(0,-1)},triggeredByInput:function(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)},logToConsole:function(e){var i=t.console;!gt.suppressLog&&n!==i&&i.log&&i.log(e)}}),X=F.extend({init:function(e,t){var n,i=this;i.element=gt.jQuery(e).handler(i),i.angular("init",t),F.fn.init.call(i),n=t?t.dataSource:null,n&&(t=mt({},t,{dataSource:{}})),t=i.options=mt(!0,{},i.options,t),n&&(t.dataSource=n),i.element.attr(gt.attr("role"))||i.element.attr(gt.attr("role"),(t.name||"").toLowerCase()),i.element.data("kendo"+t.prefix+t.name,i),i.bind(i.events,t)},events:[],options:{prefix:""},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(e){e=e||this.wrapper;var t=this.element,n="tabindex",i=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(i)?0:i)},setOptions:function(t){this._setEvents(t),e.extend(this.options,t)},_setEvents:function(e){for(var t,n=this,i=0,r=n.events.length;r>i;i++)t=n.events[i],n.options[t]&&e[t]&&n.unbind(t,n.options[t]);n.bind(n.events,e)},resize:function(e){var t=this.getSize(),n=this._size;(e||!n||t.width!==n.width||t.height!==n.height)&&(this._size=t,this._resize(t),this.trigger("resize",t))},getSize:function(){return gt.dimensions(this.element)},size:function(e){return e?(this.setSize(e),n):this.getSize()},setSize:e.noop,_resize:e.noop,destroy:function(){var e=this;e.element.removeData("kendo"+e.options.prefix+e.options.name),e.element.removeData("handler"),e.unbind()},angular:function(){}}),Z=X.extend({dataItems:function(){return this.dataSource.flatView()},_angularItems:function(t){var n=this;n.angular(t,function(){return{elements:n.items(),data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})}}),gt.dimensions=function(e,t){var n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}},gt.notify=yt,J=/template$/i,et=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,tt=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,nt=/([A-Z])/g,gt.initWidget=function(i,r,o){var a,s,l,c,d,u,h,p,f,g,m,v,_;if(o?o.roles&&(o=o.roles):o=gt.ui.roles,i=i.nodeType?i:i[0],u=i.getAttribute("data-"+gt.ns+"role")){f=-1===u.indexOf("."),l=f?o[u]:gt.getter(u)(t),m=e(i).data(),v=l?"kendo"+l.fn.options.prefix+l.fn.options.name:"",g=f?RegExp("^kendo.*"+u+"$","i"):RegExp("^"+v+"$","i");
10
+ for(_ in m)if(_.match(g)){if(_!==v)return m[_];a=m[_]}if(l){for(p=k(i,"dataSource"),r=e.extend({},x(i,l.fn.options),r),p&&(r.dataSource=typeof p===Et?gt.getter(p)(t):p),c=0,d=l.fn.events.length;d>c;c++)s=l.fn.events[c],h=k(i,s),h!==n&&(r[s]=gt.getter(h)(t));return a?e.isEmptyObject(r)||a.setOptions(r):a=new l(i,r),a}}},gt.rolesFromNamespaces=function(e){var t,n,i=[];for(e[0]||(e=[gt.ui,gt.dataviz.ui]),t=0,n=e.length;n>t;t++)i[t]=e[t].roles;return mt.apply(null,[{}].concat(i.reverse()))},gt.init=function(t){var n=gt.rolesFromNamespaces(Ht.call(arguments,1));e(t).find("[data-"+gt.ns+"role]").addBack().each(function(){gt.initWidget(this,{},n)})},gt.destroy=function(t){e(t).find("[data-"+gt.ns+"role]").addBack().each(function(){var t,n=e(this).data();for(t in n)0===t.indexOf("kendo")&&typeof n[t].destroy===At&&n[t].destroy()})},gt.resize=function(t,n){var i,r=e(t).find("[data-"+gt.ns+"role]").addBack().filter(S);r.length&&(i=e.makeArray(r),i.sort(C),e.each(i,function(){var t=gt.widgetInstance(e(this));t&&t.resize(n)}))},gt.parseOptions=x,mt(gt.ui,{Widget:X,DataBoundWidget:Z,roles:{},progress:function(t,n){var i,r,o,a,s=t.find(".k-loading-mask"),l=gt.support,c=l.browser;n?s.length||(i=l.isRtl(t),r=i?"right":"left",a=t.scrollLeft(),o=c.webkit&&i?t[0].scrollWidth-t.width()-2*a:0,s=e("<div class='k-loading-mask'><span class='k-loading-text'>Loading...</span><div class='k-loading-image'/><div class='k-loading-color'/></div>").width("100%").height("100%").css("top",t.scrollTop()).css(r,Math.abs(a)+o).prependTo(t)):s&&s.remove()},plugin:function(t,i,r){var o,a=t.fn.options.name;i=i||gt.ui,r=r||"",i[a]=t,i.roles[a.toLowerCase()]=t,o="getKendo"+r+a,a="kendo"+r+a,e.fn[a]=function(i){var r,o=this;return typeof i===Et?(r=Ht.call(arguments,1),this.each(function(){var t,s,l=e.data(this,a);if(!l)throw Error(gt.format("Cannot call method '{0}' of {1} before it is initialized",i,a));if(t=l[i],typeof t!==At)throw Error(gt.format("Cannot find method '{0}' of {1}",i,a));return s=t.apply(l,r),s!==n?(o=s,!1):n})):this.each(function(){new t(this,i)}),o},e.fn[a].widget=t,e.fn[o]=function(){return this.data(a)}}}),it={bind:function(){return this},nullObject:!0,options:{}},rt=X.extend({init:function(e,t){X.fn.init.call(this,e,t),this.element.autoApplyNS(),this.wrapper=this.element,this.element.addClass("km-widget")},destroy:function(){X.fn.destroy.call(this),this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var e=this.element.closest(gt.roleSelector("view splitview modalview drawer"));return gt.widgetInstance(e,gt.mobile.ui)||it},viewHasNativeScrolling:function(){var e=this.view();return e&&e.options.useNativeScrolling},container:function(){var e=this.element.closest(gt.roleSelector("view layout modalview drawer splitview"));return gt.widgetInstance(e.eq(0),gt.mobile.ui)||it}}),mt(gt.mobile,{init:function(e){gt.init(e,gt.mobile.ui,gt.ui,gt.dataviz.ui)},appLevelNativeScrolling:function(){return gt.mobile.application&&gt.mobile.application.options&&gt.mobile.application.options.useNativeScrolling},roles:{},ui:{Widget:rt,DataBoundWidget:Z.extend(rt.prototype),roles:{},plugin:function(e){gt.ui.plugin(e,gt.mobile.ui,"Mobile")}}}),l(gt.dataviz,{init:function(e){gt.init(e,gt.dataviz.ui)},ui:{roles:{},themes:{},views:[],plugin:function(e){gt.ui.plugin(e,gt.dataviz.ui)}},roles:{}}),gt.touchScroller=function(t,n){return e(t).map(function(t,i){return i=e(i),xt.kineticScrollNeeded&&gt.mobile.ui.Scroller&&!i.data("kendoMobileScroller")?(i.kendoMobileScroller(n),i.data("kendoMobileScroller")):!1})[0]},gt.preventDefault=function(e){e.preventDefault()},gt.widgetInstance=function(e,n){var i,r,o,a,s=e.data(gt.ns+"role"),l=[];if(s){if("content"===s&&(s="scroller"),n)if(n[0])for(i=0,r=n.length;r>i;i++)l.push(n[i].roles[s]);else l.push(n.roles[s]);else l=[gt.ui.roles[s],gt.dataviz.ui.roles[s],gt.mobile.ui.roles[s]];for(s.indexOf(".")>=0&&(l=[gt.getter(s)(t)]),i=0,r=l.length;r>i;i++)if(o=l[i],o&&(a=e.data("kendo"+o.fn.options.prefix+o.fn.options.name)))return a}},gt.onResize=function(n){var i=n;return xt.mobileOS.android&&(i=function(){setTimeout(n,600)}),e(t).on(xt.resize,i),i},gt.unbindResize=function(n){e(t).off(xt.resize,n)},gt.attrValue=function(e,t){return e.data(gt.ns+t)},gt.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},e.extend(e.expr[":"],{kendoFocusable:function(t){var n=e.attr(t,"tabindex");return T(t,!isNaN(n)&&n>-1)}}),ot=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],at="label, input, [data-rel=external]",st={setupMouseMute:function(){var t,n=0,i=ot.length,r=document.documentElement;if(!st.mouseTrap&&xt.eventCapture)for(st.mouseTrap=!0,st.bustClick=!1,st.captureMouse=!1,t=function(t){st.captureMouse&&("click"===t.type?st.bustClick&&!e(t.target).is(at)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};i>n;n++)r.addEventListener(ot[n],t,!0)},muteMouse:function(e){st.captureMouse=!0,e.data.bustClick&&(st.bustClick=!0),clearTimeout(st.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(st.mouseTrapTimeoutID),st.mouseTrapTimeoutID=setTimeout(function(){st.captureMouse=!1,st.bustClick=!1},400)}},lt={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"},xt.touch&&(xt.mobileOS.ios||xt.mobileOS.android)?lt={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:xt.pointers?lt={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:xt.msPointers&&(lt={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"}),!xt.msPointers||"onmspointerenter"in t||e.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,n){e.event.special[t]={delegateType:n,bindType:n,handle:function(t){var i,r=this,o=t.relatedTarget,a=t.handleObj;return(!o||o!==r&&!e.contains(r,o))&&(t.type=a.origType,i=a.handler.apply(this,arguments),t.type=n),i}}}),ct=function(e){return lt[e]||e},dt=/([^ ]+)/g,gt.applyEventMap=function(e,t){return e=e.replace(dt,ct),t&&(e=e.replace(dt,"$1."+t)),e},ut=e.fn.on,mt(!0,A,e),A.fn=A.prototype=new e,A.fn.constructor=A,A.fn.init=function(t,n){return n&&n instanceof e&&!(n instanceof A)&&(n=A(n)),e.fn.init.call(this,t,n,ht)},A.fn.init.prototype=A.fn,ht=A(document),mt(A.fn,{handler:function(e){return this.data("handler",e),this},autoApplyNS:function(e){return this.data("kendoNS",e||gt.guid()),this},on:function(){var e,t,n,i,r,o,a=this,s=a.data("kendoNS");return 1===arguments.length?ut.call(a,arguments[0]):(e=a,t=Ht.call(arguments),typeof t[t.length-1]===zt&&t.pop(),n=t[t.length-1],i=gt.applyEventMap(t[0],s),xt.mouseAndTouchPresent&&i.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(st.setupMouseMute(),r=2===t.length?null:t[1],o=i.indexOf("click")>-1&&i.indexOf("touchend")>-1,ut.call(this,{touchstart:st.muteMouse,touchend:st.unMuteMouse},r,{bustClick:o})),typeof n===Et&&(e=a.data("handler"),n=e[n],t[t.length-1]=function(t){n.call(e,t)}),t[0]=i,ut.apply(a,t),a)},kendoDestroy:function(e){return e=e||this.data("kendoNS"),e&&this.off("."+e),this}}),gt.jQuery=A,gt.eventMap=lt,gt.timezone=function(){function e(e,t){var n,i,r,o=t[3],a=t[4],s=t[5],l=t[8];return l||(t[8]=l={}),l[e]?l[e]:(isNaN(a)?0===a.indexOf("last")?(n=new Date(Date.UTC(e,d[o]+1,1,s[0]-24,s[1],s[2],0)),i=u[a.substr(4,3)],r=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+i-r-(i>r?7:0))):a.indexOf(">=")>=0&&(n=new Date(Date.UTC(e,d[o],a.substr(5),s[0],s[1],s[2],0)),i=u[a.substr(0,3)],r=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+i-r+(r>i?7:0))):n=new Date(Date.UTC(e,d[o],a,s[0],s[1],s[2],0)),l[e]=n)}function t(t,n,i){var r,o,a,s;return(n=n[i])?(a=new Date(t).getUTCFullYear(),n=jQuery.grep(n,function(e){var t=e[0],n=e[1];return a>=t&&(n>=a||t==a&&"only"==n||"max"==n)}),n.push(t),n.sort(function(t,n){return"number"!=typeof t&&(t=+e(a,t)),"number"!=typeof n&&(n=+e(a,n)),t-n}),s=n[jQuery.inArray(t,n)-1]||n[n.length-1],isNaN(s)?s:null):(r=i.split(":"),o=0,r.length>1&&(o=60*r[0]+ +r[1]),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"])}function n(e,t,n){var i,r,o,a=t[n];if("string"==typeof a&&(a=t[a]),!a)throw Error('Timezone "'+n+'" is either incorrect, or kendo.timezones.min.js is not included.');for(i=a.length-1;i>=0&&(r=a[i][3],!(r&&e>r));i--);if(o=a[i+1],!o)throw Error('Timezone "'+n+'" not found on '+e+".");return o}function i(e,i,r,o){typeof e!=It&&(e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));var a=n(e,i,o);return{zone:a,rule:t(e,r,a[1])}}function r(e,t){var n,r,o;return"Etc/UTC"==t||"Etc/GMT"==t?0:(n=i(e,this.zones,this.rules,t),r=n.zone,o=n.rule,gt.parseFloat(o?r[0]-o[6]:r[0]))}function o(e,t){var n=i(e,this.zones,this.rules,t),r=n.zone,o=n.rule,a=r[2];return a.indexOf("/")>=0?a.split("/")[o&&+o[6]?1:0]:a.indexOf("%s")>=0?a.replace("%s",o&&"-"!=o[7]?o[7]:""):a}function a(e,t,n){var i,r;return typeof t==Et&&(t=this.offset(e,t)),typeof n==Et&&(n=this.offset(e,n)),i=e.getTimezoneOffset(),e=new Date(e.getTime()+6e4*(t-n)),r=e.getTimezoneOffset(),new Date(e.getTime()+6e4*(r-i))}function s(e,t){return this.convert(e,e.getTimezoneOffset(),t)}function l(e,t){return this.convert(e,t,e.getTimezoneOffset())}function c(e){return this.apply(new Date(e),"Etc/UTC")}var d={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},u={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:r,convert:a,apply:s,remove:l,abbr:o,toLocalDate:c}}(),gt.date=function(){function e(e,t){return 0===t&&23===e.getHours()?(e.setHours(e.getHours()+2),!0):!1}function t(t,n,i){var r=t.getHours();i=i||1,n=(n-t.getDay()+7*i)%7,t.setDate(t.getDate()+n),e(t,r)}function n(e,n,i){return e=new Date(e),t(e,n,i),e}function i(e){return new Date(e.getFullYear(),e.getMonth(),1)}function r(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),n=i(e),r=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return r&&t.setHours(n.getHours()+r/60),t}function o(t){return t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e(t,0),t}function a(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function s(e){return e.getTime()-o(e)}function l(e,t,n){var i,r=s(t),o=s(n);return e&&r!=o?(t>=n&&(n+=m),i=s(e),r>i&&(i+=m),r>o&&(o+=m),i>=r&&o>=i):!0}function c(e,t,n){var i,r=t.getTime(),o=n.getTime();return r>=o&&(o+=m),i=e.getTime(),i>=r&&o>=i}function d(t,n){var i=t.getHours();return t=new Date(t),u(t,n*m),e(t,i),t}function u(e,t,n){var i,r=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-r,e.setTime(e.getTime()+i*g))}function h(){return o(new Date)}function p(e){return o(e).getTime()==h().getTime()}function f(e){var t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}var g=6e4,m=864e5;return{adjustDST:e,dayOfWeek:n,setDayOfWeek:t,getDate:o,isInDateRange:c,isInTimeRange:l,isToday:p,nextDay:function(e){return d(e,1)},previousDay:function(e){return d(e,-1)},toUtcTime:a,MS_PER_DAY:m,MS_PER_HOUR:60*g,MS_PER_MINUTE:g,setTime:u,addDays:d,today:h,toInvariantTime:f,firstDayOfMonth:i,lastDayOfMonth:r,getMilliseconds:s}}(),gt.stripWhitespace=function(e){var t,n,i;if(document.createNodeIterator)for(t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(n=0;e.childNodes.length>n;n++)i=e.childNodes[n],3!=i.nodeType||/\S/.test(i.nodeValue)||(e.removeChild(i),n--),1==i.nodeType&&gt.stripWhitespace(i)},pt=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},gt.animationFrame=function(e){pt.call(t,e)},ft=[],gt.queueAnimation=function(e){ft[ft.length]=e,1===ft.length&&gt.runNextAnimation()},gt.runNextAnimation=function(){gt.animationFrame(function(){ft[0]&&(ft.shift()(),ft[0]&&gt.runNextAnimation())})},gt.parseQueryStringParams=function(e){for(var t=e.split("?")[1]||"",n={},i=t.split(/&|=/),r=i.length,o=0;r>o;o+=2)""!==i[o]&&(n[decodeURIComponent(i[o])]=decodeURIComponent(i[o+1]));return n},gt.elementUnderCursor=function(e){return document.elementFromPoint(e.x.client,e.y.client)},gt.wheelDeltaY=function(e){var t,i=e.originalEvent,r=i.wheelDeltaY;return i.wheelDelta?(r===n||r)&&(t=i.wheelDelta):i.detail&&i.axis===i.VERTICAL_AXIS&&(t=10*-i.detail),t},gt.throttle=function(e,t){var i,r=0;return!t||0>=t?e:function(){function o(){e.apply(a,l),r=+new Date}var a=this,s=+new Date-r,l=arguments;return r?(i&&clearTimeout(i),s>t?o():i=setTimeout(o,t-s),n):o()}},gt.caret=function(t,i,r){var o,a,s,l,c=i!==n;if(r===n&&(r=i),t[0]&&(t=t[0]),!c||!t.disabled){try{t.selectionStart!==n?c?(t.focus(),t.setSelectionRange(i,r)):i=[t.selectionStart,t.selectionEnd]:document.selection&&(e(t).is(":visible")&&t.focus(),o=t.createTextRange(),c?(o.collapse(!0),o.moveStart("character",i),o.moveEnd("character",r-i),o.select()):(a=o.duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),a.setEndPoint("EndToStart",o),s=a.text.length,l=s+o.text.length,i=[s,l]))}catch(d){i=[]}return i}},gt.compileMobileDirective=function(e,n){var i=t.angular;return e.attr("data-"+gt.ns+"role",e[0].tagName.toLowerCase().replace("kendo-mobile-","").replace("-","")),i.element(e).injector().invoke(["$compile",function(t){var r=i.element(e).scope();n&&n(r),t(e)(r),r.$digest()}]),gt.widgetInstance(e,gt.mobile.ui)},function(){function n(t,n,i){var r=e("<form>").attr({action:i,method:"POST"}),o=t.split(";base64,");e("<input>").attr({value:o[0].replace("data:",""),name:"contentType",type:"hidden"}).appendTo(r),e("<input>").attr({value:o[1],name:"base64",type:"hidden"}).appendTo(r),e("<input>").attr({value:n,name:"fileName",type:"hidden"}).appendTo(r),r.appendTo("body").submit().remove()}function i(e,t){var n,i,r,o,a,s=e;if("string"==typeof e){for(n=e.split(";base64,"),i=n[0],r=atob(n[1]),o=new Uint8Array(r.length),a=0;r.length>a;a++)o[a]=r.charCodeAt(a);s=new Blob([o.buffer],{type:i})}navigator.msSaveBlob(s,t)}function r(e,n){t.Blob&&e instanceof Blob&&(e=URL.createObjectURL(e)),o.download=n,o.href=e;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(i)}var o=document.createElement("a"),a="download"in o;gt.saveAs=function(e){var t=n;e.forceProxy||(a?t=r:navigator.msSaveBlob&&(t=i)),t(e.dataURI,e.fileName,e.proxyURL)}}()}(jQuery,window),function(e,t){function n(e,t){if(!t)return e;e+"/"===t&&(e=t);var n=RegExp("^"+t,"i");return n.test(e)||(e=t+"/"+e),p.protocol+"//"+(p.host+"/"+e).replace(/\/\/+/g,"/")}function i(e){return e?"#!":"#"}function r(e){var t=p.href;return"#!"===e&&t.indexOf("#")>-1&&t.indexOf("#!")<0?null:t.split(e)[1]||""}function o(e,t){return 0===t.indexOf(e)?t.substr(e.length).replace(/\/\//g,"/"):t}function a(e){return e.replace(/^(#)?/,"#")}function s(e){return e.replace(/^(#(!)?)?/,"#!")}var l=window.kendo,c="change",d="back",u="same",h=l.support,p=window.location,f=window.history,g=50,m=l.support.browser.msie,v=/^#*/,_=window.document,w=l.Class.extend({back:function(){m?setTimeout(function(){f.back()}):f.back()},forward:function(){m?setTimeout(function(){f.forward()}):f.forward()},length:function(){return f.length},replaceLocation:function(e){p.replace(e)}}),y=w.extend({init:function(e){this.root=e},navigate:function(e){f.pushState({},_.title,n(e,this.root))},replace:function(e){f.replaceState({},_.title,n(e,this.root))},normalize:function(e){return o(this.root,e)},current:function(){var e=p.pathname;return p.search&&(e+=p.search),o(this.root,e)},change:function(t){e(window).bind("popstate.kendo",t)},stop:function(){e(window).unbind("popstate.kendo")},normalizeCurrent:function(e){var t,o=e.root,a=p.pathname,s=r(i(e.hashBang));o===a+"/"&&(t=o),o===a&&s&&(t=n(s.replace(v,""),o)),t&&f.pushState({},_.title,t)}}),b=w.extend({init:function(e){this._id=l.guid(),this.prefix=i(e),this.fix=e?s:a},navigate:function(e){p.hash=this.fix(e)},replace:function(e){this.replaceLocation(this.fix(e))},normalize:function(e){return e.indexOf(this.prefix)<0?e:e.split(this.prefix)[1]},change:function(t){h.hashChange?e(window).on("hashchange."+this._id,t):this._interval=setInterval(t,g)},stop:function(){e(window).off("hashchange."+this._id),clearInterval(this._interval)},current:function(){return r(this.prefix)},normalizeCurrent:function(e){var t=p.pathname,n=e.root;return e.pushState&&n!==t?(this.replaceLocation(n+this.prefix+o(n,t)),!0):!1}}),k=l.Observable.extend({start:function(t){if(t=t||{},this.bind([c,d,u],t),!this._started){this._started=!0,t.root=t.root||"/";var n,i=this.createAdapter(t);i.normalizeCurrent(t)||(n=i.current(),e.extend(this,{adapter:i,root:t.root,historyLength:i.length(),current:n,locations:[n]}),i.change(e.proxy(this,"_checkUrl")))}},createAdapter:function(e){return h.pushState&&e.pushState?new y(e.root):new b(e.hashBang)},stop:function(){this._started&&(this.adapter.stop(),this.unbind(c),this._started=!1)},change:function(e){this.bind(c,e)},replace:function(e,t){this._navigate(e,t,function(t){t.replace(e),this.locations[this.locations.length-1]=this.current})},navigate:function(e,n){return"#:back"===e?(this.backCalled=!0,this.adapter.back(),t):(this._navigate(e,n,function(t){t.navigate(e),this.locations.push(this.current)}),t)},_navigate:function(e,n,i){var r=this.adapter;return e=r.normalize(e),this.current===e||this.current===decodeURIComponent(e)?(this.trigger(u),t):((n||!this.trigger(c,{url:e}))&&(this.current=e,i.call(this,r),this.historyLength=r.length()),t)},_checkUrl:function(){var e=this.adapter,n=e.current(),i=e.length(),r=this.historyLength===i,o=n===this.locations[this.locations.length-2]&&r,a=this.backCalled,s=this.current;return null===n||this.current===n||this.current===decodeURIComponent(n)?!0:(this.historyLength=i,this.backCalled=!1,this.current=n,o&&this.trigger("back",{url:s,to:n})?(e.forward(),this.current=s,t):this.trigger(c,{url:n,backButtonPressed:!a})?(o?e.forward():(e.back(),this.historyLength--),this.current=s,t):(o?this.locations.pop():this.locations.push(n),t))}});l.History=k,l.History.HistoryAdapter=w,l.History.HashAdapter=b,l.History.PushStateAdapter=y,l.absoluteURL=n,l.history=new k}(window.kendo.jQuery),function(){function e(e,t){return t?e:"([^/]+)"}function t(t,n){return RegExp("^"+t.replace(f,"\\$&").replace(u,"(?:$1)?").replace(h,e).replace(p,"(.*?)")+"$",n?"i":"")}function n(e){return e.replace(/(\?.*)|(#.*)/g,"")}var i=window.kendo,r=i.history,o=i.Observable,a="init",s="routeMissing",l="change",c="back",d="same",u=/\((.*?)\)/g,h=/(\(\?)?:\w+/g,p=/\*\w+/g,f=/[\-{}\[\]+?.,\\\^$|#\s]/g,g=i.Class.extend({init:function(e,n,i){e instanceof RegExp||(e=t(e,i)),this.route=e,this._callback=n},callback:function(e){var t,r,o=0,a=i.parseQueryStringParams(e);for(e=n(e),t=this.route.exec(e).slice(1),r=t.length;r>o;o++)void 0!==t[o]&&(t[o]=decodeURIComponent(t[o]));t.push(a),this._callback.apply(null,t)},worksWith:function(e){return this.route.test(n(e))?(this.callback(e),!0):!1}}),m=o.extend({init:function(e){e||(e={}),o.fn.init.call(this),this.routes=[],this.pushState=e.pushState,this.hashBang=e.hashBang,this.root=e.root,this.ignoreCase=e.ignoreCase!==!1,this.bind([a,s,l,d],e)},destroy:function(){r.unbind(l,this._urlChangedProxy),r.unbind(d,this._sameProxy),r.unbind(c,this._backProxy),this.unbind()},start:function(){var e,t=this,n=function(){t._same()},i=function(e){t._back(e)},o=function(e){t._urlChanged(e)};r.start({same:n,change:o,back:i,pushState:t.pushState,hashBang:t.hashBang,root:t.root}),e={url:r.current||"/",preventDefault:$.noop},t.trigger(a,e)||t._urlChanged(e),this._urlChangedProxy=o,this._backProxy=i},route:function(e,t){this.routes.push(new g(e,t,this.ignoreCase))},navigate:function(e,t){i.history.navigate(e,t)},replace:function(e,t){i.history.replace(e,t)},_back:function(e){this.trigger(c,{url:e.url,to:e.to})&&e.preventDefault()},_same:function(){this.trigger(d)},_urlChanged:function(e){var t,n,r,o,a=e.url;if(a||(a="/"),this.trigger(l,{url:e.url,params:i.parseQueryStringParams(e.url),backButtonPressed:e.backButtonPressed}))return void e.preventDefault();for(t=0,n=this.routes,o=n.length;o>t;t++)if(r=n[t],r.worksWith(a))return;this.trigger(s,{url:a,params:i.parseQueryStringParams(a),backButtonPressed:e.backButtonPressed})&&e.preventDefault()}});i.Router=m}(),function(e,t){function n(r,s){var l,c,d,u,h,p,f,g,m=[],v=r.logic||"and",_=r.filters;for(l=0,c=_.length;c>l;l++)r=_[l],d=r.field,f=r.value,p=r.operator,r.filters?r=n(r,s):(g=r.ignoreCase,d=d.replace(/\./g,"/"),r=o[p],s&&(r=a[p]),r&&f!==t&&(u=e.type(f),"string"===u?(h="'{1}'",f=f.replace(/'/g,"''"),g===!0&&(d="tolower("+d+")")):h="date"===u?s?"{1:yyyy-MM-ddTHH:mm:ss+00:00}":"datetime'{1:yyyy-MM-ddTHH:mm:ss}'":"{1}",r.length>3?"substringof"!==r?h="{0}({2},"+h+")":(h="{0}("+h+",{2})","doesnotcontain"===p&&(s?(h="{0}({2},'{1}') eq -1",r="indexof"):h+=" eq false")):h="{2} {0} "+h,r=i.format(h,r,f,d))),m.push(r);return r=m.join(" "+v+" "),m.length>1&&(r="("+r+")"),r}var i=window.kendo,r=e.extend,o={eq:"eq",neq:"ne",gt:"gt",gte:"ge",lt:"lt",lte:"le",contains:"substringof",doesnotcontain:"substringof",endswith:"endswith",startswith:"startswith"},a=r({},o,{contains:"contains"}),s={pageSize:e.noop,page:e.noop,filter:function(e,t,i){t&&(e.$filter=n(t,i))},sort:function(t,n){var i=e.map(n,function(e){var t=e.field.replace(/\./g,"/");return"desc"===e.dir&&(t+=" desc"),t}).join(",");i&&(t.$orderby=i)},skip:function(e,t){t&&(e.$skip=t)},take:function(e,t){t&&(e.$top=t)}},l={read:{dataType:"jsonp"}};r(!0,i.data,{schemas:{odata:{type:"json",data:function(e){return e.d.results||[e.d]},total:"d.__count"}},transports:{odata:{read:{cache:!0,dataType:"jsonp",jsonp:"$callback"},update:{cache:!0,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t,n){var r,o,a,c;if(e=e||{},t=t||"read",c=(this.options||l)[t],c=c?c.dataType:"json","read"===t){r={$inlinecount:"allpages"},"json"!=c&&(r.$format="json");for(a in e)s[a]?s[a](r,e[a],n):r[a]=e[a]}else{if("json"!==c)throw Error("Only json dataType can be used for "+t+" operation.");if("destroy"!==t){for(a in e)o=e[a],"number"==typeof o&&(e[a]=o+"");r=i.stringify(e)}}return r}}}}),r(!0,i.data,{schemas:{"odata-v4":{type:"json",data:function(e){return e.value?e.value:(delete e["odata.metadata"],[e])},total:function(e){return e["@odata.count"]}}},transports:{"odata-v4":{read:{cache:!0,dataType:"json"},update:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t){var n=i.data.transports.odata.parameterMap(e,t,!0);return"read"==t&&(n.$count=!0,delete n.$inlinecount),n}}}})}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.isArray,r=e.isPlainObject,o=e.map,a=e.each,s=e.extend,l=n.getter,c=n.Class,d=c.extend({init:function(e){var t,l,c,d,u=this,h=e.total,p=e.model,f=e.parse,g=e.errors,m=e.serialize,v=e.data;p&&(r(p)&&(t=e.modelBase||n.data.Model,p.fields&&a(p.fields,function(e,t){t=r(t)&&t.field?s(t,{field:u.getter(t.field)}):{field:u.getter(t)},p.fields[e]=t}),l=p.id,l&&(c={},c[u.xpathToMember(l,!0)]={field:u.getter(l)},p.fields=s(c,p.fields),p.id=u.xpathToMember(l)),p=t.define(p)),u.model=p),h&&("string"==typeof h?(h=u.getter(h),u.total=function(e){return parseInt(h(e),10)}):"function"==typeof h&&(u.total=h)),g&&("string"==typeof g?(g=u.getter(g),u.errors=function(e){return g(e)||null}):"function"==typeof g&&(u.errors=g)),v&&("string"==typeof v?(v=u.xpathToMember(v),u.data=function(e){var t,n=u.evaluate(e,v);return n=i(n)?n:[n],u.model&&p.fields?(t=new u.model,o(n,function(e){if(e){var n,i={};for(n in p.fields)i[n]=t._parse(n,p.fields[n].field(e));return i}})):n}):"function"==typeof v&&(u.data=v)),"function"==typeof f&&(d=u.parse,u.parse=function(e){var t=f.call(u,e);return d.call(u,t)}),"function"==typeof m&&(u.serialize=m)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,r,o,a,s,l,c,d={},u=e.attributes,h=u.length;for(c=0;h>c;c++)l=u[c],d["@"+l.nodeName]=l.nodeValue;for(r=e.firstChild;r;r=r.nextSibling)o=r.nodeType,3===o||4===o?d["#text"]=r.nodeValue:1===o&&(n=this.parseDOM(r),a=r.nodeName,s=d[a],i(s)?s.push(n):s=s!==t?[s,n]:n,d[a]=s);return d},evaluate:function(e,t){for(var n,r,o,a,s,l=t.split(".");n=l.shift();)if(e=e[n],i(e)){for(r=[],t=l.join("."),s=0,o=e.length;o>s;s++)a=this.evaluate(e[s],t),a=i(a)?a:[a],r.push.apply(r,a);return r}return e},parse:function(t){var n,i,r={};return n=t.documentElement||e.parseXML(t).documentElement,i=this.parseDOM(n),r[n.nodeName]=i,r},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return l(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:d,readers:{xml:d}})}(window.kendo.jQuery),function(e,t){function n(e,t,n,i){return function(r){var o,a={};for(o in r)a[o]=r[o];a.field=i?n+"."+r.field:n,t==yt&&e._notifyChange&&e._notifyChange(a),e.trigger(t,a)}}function i(t,n){if(t===n)return!0;var r,o=e.type(t),a=e.type(n);if(o!==a)return!1;if("date"===o)return t.getTime()===n.getTime();if("object"!==o&&"array"!==o)return!1;for(r in t)if(!i(t[r],n[r]))return!1;return!0}function r(e,t){var n,i;for(i in e){if(n=e[i],it(n)&&n.field&&n.field===t)return n;if(n===t)return n}return null}function o(e){this.data=e||[]}function a(e,n){if(e){var i=typeof e===ft?{field:e,dir:n}:e,r=ot(i)?i:i!==t?[i]:[];return at(r,function(e){return!!e.dir})}}function s(e){var t,n,i,r,o=e.filters;if(o)for(t=0,n=o.length;n>t;t++)i=o[t],r=i.operator,r&&typeof r===ft&&(i.operator=W[r.toLowerCase()]||r),s(i)}function l(e){return e&&!rt(e)?((ot(e)||!e.filters)&&(e={logic:"and",filters:ot(e)?e:[e]}),s(e),e):t}function c(e){return ot(e)?e:[e]}function d(e,n){var i=typeof e===ft?{field:e,dir:n}:e,r=ot(i)?i:i!==t?[i]:[];return N(r,function(e){return{field:e.field,dir:e.dir||"asc",aggregates:e.aggregates}})}function u(e,t){return e&&e.getTime&&t&&t.getTime?e.getTime()===t.getTime():e===t}function h(e,t,n,i,r,o){var a,s,l,c,d;for(t=t||[],c=t.length,a=0;c>a;a++)s=t[a],l=s.aggregate,d=s.field,e[d]=e[d]||{},o[d]=o[d]||{},o[d][l]=o[d][l]||{},e[d][l]=j[l.toLowerCase()](e[d][l],n,dt.accessor(d),i,r,o[d][l])}function p(e){return"number"==typeof e&&!isNaN(e)}function f(e){return e&&e.getTime}function g(e){var t,n=e.length,i=Array(n);for(t=0;n>t;t++)i[t]=e[t].toJSON();return i}function m(e,t,n,i,r){var o,a,s,l,c;for(l=0,c=e.length;c>l;l++){o=e[l];for(a in t)s=r[a],s&&s!==a&&(o[s]=t[a](o),delete o[a])}}function v(e,t,n,i,r){var o,a,s,l,c;for(l=0,c=e.length;c>l;l++){o=e[l];for(a in t)o[a]=n._parse(a,t[a](o)),s=r[a],s&&s!==a&&delete o[s]}}function _(e,t,n,i,r){var o,a,s,l;for(a=0,l=e.length;l>a;a++)o=e[a],s=i[o.field],s&&s!=o.field&&(o.field=s),o.value=n._parse(o.field,o.value),o.hasSubgroups?_(o.items,t,n,i,r):v(o.items,t,n,i,r)}function w(e,t,n,i,r,o){return function(a){return a=e(a),a&&!rt(i)&&("[object Array]"===Nt.call(a)||a instanceof jt||(a=[a]),n(a,i,new t,r,o)),a||[]}}function y(e,t,n,i){for(var r,o,a,s=0;t.length&&i&&(r=t[s],o=r.items,a=o.length,e&&e.field===r.field&&e.value===r.value?(e.hasSubgroups&&e.items.length?y(e.items[e.items.length-1],r.items,n,i):(o=o.slice(n,n+i),e.items=e.items.concat(o)),t.splice(s--,1)):r.hasSubgroups&&o.length?y(r,o,n,i):(o=o.slice(n,n+i),r.items=o,r.items.length||t.splice(s--,1)),0===o.length?n-=a:(n=0,i-=o.length),!(++s>=t.length)););t.length>s&&t.splice(s,t.length-s)}function b(e){var t,n,i,r,o,a=[];for(t=0,n=e.length;n>t;t++)if(o=e.at(t),o.hasSubgroups)a=a.concat(b(o.items));else for(i=o.items,r=0;i.length>r;r++)a.push(i.at(r));return a}function k(e,t){var n,i,r;if(t)for(n=0,i=e.length;i>n;n++)r=e.at(n),r.hasSubgroups?k(r.items,t):r.items=new qt(r.items,t)}function x(e,t){for(var n=0,i=e.length;i>n;n++)if(e[n].hasSubgroups){if(x(e[n].items,t))return!0}else if(t(e[n].items,e[n]))return!0}function C(e,t,n,i){for(var r=0;e.length>r&&e[r].data!==t&&!S(e[r].data,n,i);r++);}function S(e,t,n){for(var i=0,r=e.length;r>i;i++){if(e[i]&&e[i].hasSubgroups)return S(e[i].items,t,n);if(e[i]===t||e[i]===n)return e[i]=n,!0}}function T(e,n,i,r){var o,a,s,l;for(o=0,a=e.length;a>o;o++)if(s=e[o],s&&!(s instanceof r))if(s.hasSubgroups!==t)T(s.items,n,i,r);else for(l=0;n.length>l;l++)if(n[l]===s){e[o]=n.at(l),C(i,n,s,e[o]);break}}function D(e,t){var n,i,r;for(n=0,i=e.length;i>n;n++)if(r=e.at(n),r.uid==t.uid)return e.splice(n,1),r}function A(e,t){var n,i,r,o;for(r=e.length-1,o=0;r>=o;r--)i=e[r],n={value:t.get(i.field),field:i.field,items:n?[n]:[t],hasSubgroups:!!n,aggregates:{}};return n}function E(e,t){return t?P(e,function(e){return e.uid?e.uid==t.uid:e[t.idField]===t.id}):-1}function I(e,t){return t?P(e,function(e){return e.uid==t.uid}):-1}function P(e,t){var n,i;for(n=0,i=e.length;i>n;n++)if(t(e[n]))return n;return-1}function M(e,t){var n,i;return e&&!rt(e)?(n=e[t],i=it(n)?n.from||n.field||t:e[t]||t,ut(i)?t:i):t}function F(e,t){var n,i,r,o={};for(r in e)"filters"!==r&&(o[r]=e[r]);if(e.filters)for(o.filters=[],n=0,i=e.filters.length;i>n;n++)o.filters[n]=F(e.filters[n],t);else o.field=M(t.fields,o.field);return o}function z(e,t){var n,i,r,o,a,s=[];for(n=0,i=e.length;i>n;n++){r={},o=e[n];for(a in o)r[a]=o[a];r.field=M(t.fields,r.field),r.aggregates&&ot(r.aggregates)&&(r.aggregates=z(r.aggregates,t)),s.push(r)}return s}function R(t,n){var i,r,o,a,s,l=e(t)[0].children,c=[],d=n[0],u=n[1];for(i=0,r=l.length;r>i;i++)o={},s=l[i],s.disabled||(o[d.field]=s.text,a=s.attributes.value,a=a&&a.specified?s.value:s.text,o[u.field]=a,c.push(o));return c}function B(t,n){var i,r,o,a,s,l,c,d=e(t)[0].tBodies[0],u=d?d.rows:[],h=n.length,p=[];for(i=0,r=u.length;r>i;i++){for(s={},c=!0,a=u[i].cells,o=0;h>o;o++)l=a[o],"th"!==l.nodeName.toLowerCase()&&(c=!1,s[n[o].field]=l.innerHTML);c||p.push(s)}return p}function H(e){return function(){var t=this._data,n=Q.fn[e].apply(this,Ht.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),n}}function L(t,n){function i(e,t){return e.filter(t).add(e.find(t))}var r,o,a,s,l,c,d,u,h=e(t).children(),p=[],f=n[0].field,g=n[1]&&n[1].field,m=n[2]&&n[2].field,v=n[3]&&n[3].field;for(r=0,o=h.length;o>r;r++)a={_loaded:!0},s=h.eq(r),c=s[0].firstChild,u=s.children(),t=u.filter("ul"),u=u.filter(":not(ul)"),l=s.attr("data-id"),l&&(a.id=l),c&&(a[f]=3==c.nodeType?c.nodeValue:u.text()),g&&(a[g]=i(u,"a").attr("href")),v&&(a[v]=i(u,"img").attr("src")),m&&(d=i(u,".k-sprite").prop("className"),a[m]=d&&e.trim(d.replace("k-sprite",""))),t.length&&(a.items=L(t.eq(0),n)),"true"==s.attr("data-hasChildren")&&(a.hasChildren=!0),p.push(a);return p}var N,O,V,U,W,j,q,G,$,Y,Q,K,X,Z,J,et,tt=e.extend,nt=e.proxy,it=e.isPlainObject,rt=e.isEmptyObject,ot=e.isArray,at=e.grep,st=e.ajax,lt=e.each,ct=e.noop,dt=window.kendo,ut=dt.isFunction,ht=dt.Observable,pt=dt.Class,ft="string",gt="function",mt="create",vt="read",_t="update",wt="destroy",yt="change",bt="sync",kt="get",xt="error",Ct="requestStart",St="progress",Tt="requestEnd",Dt=[mt,vt,_t,wt],At=function(e){return e},Et=dt.getter,It=dt.stringify,Pt=Math,Mt=[].push,Ft=[].join,zt=[].pop,Rt=[].splice,Bt=[].shift,Ht=[].slice,Lt=[].unshift,Nt={}.toString,Ot=dt.support.stableSort,Vt=/^\/Date\((.*?)\)\/$/,Ut=/(\r+|\n+)/g,Wt=/(?=['\\])/g,jt=ht.extend({init:function(e,t){var n=this;n.type=t||Gt,ht.fn.init.call(n),n.length=e.length,n.wrapAll(e,n)},at:function(e){return this[e]},toJSON:function(){var e,t,n=this.length,i=Array(n);
11
+ for(e=0;n>e;e++)t=this[e],t instanceof Gt&&(t=t.toJSON()),i[e]=t;return i},parent:ct,wrapAll:function(e,t){var n,i,r=this,o=function(){return r};for(t=t||[],n=0,i=e.length;i>n;n++)t[n]=r.wrap(e[n],o);return t},wrap:function(e,t){var n,i=this;return null!==e&&"[object Object]"===Nt.call(e)&&(n=e instanceof i.type||e instanceof Qt,n||(e=e instanceof Gt?e.toJSON():e,e=new i.type(e)),e.parent=t,e.bind(yt,function(e){i.trigger(yt,{field:e.field,node:e.node,index:e.index,items:e.items||[this],action:e.node?e.action||"itemchange":"itemchange"})})),e},push:function(){var e,t=this.length,n=this.wrapAll(arguments);return e=Mt.apply(this,n),this.trigger(yt,{action:"add",index:t,items:n}),e},slice:Ht,sort:[].sort,join:Ft,pop:function(){var e=this.length,t=zt.apply(this);return e&&this.trigger(yt,{action:"remove",index:e-1,items:[t]}),t},splice:function(e,t,n){var i,r,o,a=this.wrapAll(Ht.call(arguments,2));if(i=Rt.apply(this,[e,t].concat(a)),i.length)for(this.trigger(yt,{action:"remove",index:e,items:i}),r=0,o=i.length;o>r;r++)i[r].children&&i[r].unbind(yt);return n&&this.trigger(yt,{action:"add",index:e,items:a}),i},shift:function(){var e=this.length,t=Bt.apply(this);return e&&this.trigger(yt,{action:"remove",index:0,items:[t]}),t},unshift:function(){var e,t=this.wrapAll(arguments);return e=Lt.apply(this,t),this.trigger(yt,{action:"add",index:0,items:t}),e},indexOf:function(e){var t,n,i=this;for(t=0,n=i.length;n>t;t++)if(i[t]===e)return t;return-1},forEach:function(e){for(var t=0,n=this.length;n>t;t++)e(this[t],t,this)},map:function(e){for(var t=0,n=[],i=this.length;i>t;t++)n[t]=e(this[t],t,this);return n},filter:function(e){for(var t,n=0,i=[],r=this.length;r>n;n++)t=this[n],e(t,n,this)&&(i[i.length]=t);return i},find:function(e){for(var t,n=0,i=this.length;i>n;n++)if(t=this[n],e(t,n,this))return t},every:function(e){for(var t,n=0,i=this.length;i>n;n++)if(t=this[n],!e(t,n,this))return!1;return!0},some:function(e){for(var t,n=0,i=this.length;i>n;n++)if(t=this[n],e(t,n,this))return!0;return!1},remove:function(e){var t=this.indexOf(e);-1!==t&&this.splice(t,1)},empty:function(){this.splice(0,this.length)}}),qt=jt.extend({init:function(e,t){ht.fn.init.call(this),this.type=t||Gt;for(var n=0;e.length>n;n++)this[n]=e[n];this.length=n,this._parent=nt(function(){return this},this)},at:function(e){var t=this[e];return t instanceof this.type?t.parent=this._parent:t=this[e]=this.wrap(t,this._parent),t}}),Gt=ht.extend({init:function(e){var t,n,i=this,r=function(){return i};ht.fn.init.call(this);for(n in e)t=e[n],"object"==typeof t&&t&&!t.getTime&&"_"!=n.charAt(0)&&(t=i.wrap(t,n,r)),i[n]=t;i.uid=dt.guid()},shouldSerialize:function(e){return this.hasOwnProperty(e)&&"_events"!==e&&typeof this[e]!==gt&&"uid"!==e},forEach:function(e){for(var t in this)this.shouldSerialize(t)&&e(this[t],t)},toJSON:function(){var e,t,n={};for(t in this)this.shouldSerialize(t)&&(e=this[t],(e instanceof Gt||e instanceof jt)&&(e=e.toJSON()),n[t]=e);return n},get:function(e){var t,n=this;return n.trigger(kt,{field:e}),t="this"===e?n:dt.getter(e,!0)(n)},_set:function(e,t){var n,i,r,o=this,a=e.indexOf(".")>=0;if(a)for(n=e.split("."),i="";n.length>1;){if(i+=n.shift(),r=dt.getter(i,!0)(o),r instanceof Gt)return r.set(n.join("."),t),a;i+="."}return dt.setter(e)(o,t),a},set:function(e,t){var n=this,i=e.indexOf(".")>=0,r=dt.getter(e,!0)(n);r!==t&&(n.trigger("set",{field:e,value:t})||(i||(t=n.wrap(t,e,function(){return n})),(!n._set(e,t)||e.indexOf("(")>=0||e.indexOf("[")>=0)&&n.trigger(yt,{field:e})))},parent:ct,wrap:function(e,t,i){var r,o,a=this,s=Nt.call(e);return null==e||"[object Object]"!==s&&"[object Array]"!==s||(r=e instanceof jt,o=e instanceof Q,"[object Object]"!==s||o||r?("[object Array]"===s||r||o)&&(r||o||(e=new jt(e)),e.parent()!=i()&&e.bind(yt,n(a,yt,t,!1))):(e instanceof Gt||(e=new Gt(e)),e.parent()!=i()&&(e.bind(kt,n(a,kt,t,!0)),e.bind(yt,n(a,yt,t,!0)))),e.parent=i),e}}),$t={number:function(e){return dt.parseFloat(e)},date:function(e){return dt.parseDate(e)},"boolean":function(e){return typeof e===ft?"true"===e.toLowerCase():null!=e?!!e:e},string:function(e){return null!=e?e+"":e},"default":function(e){return e}},Yt={string:"",number:0,date:new Date,"boolean":!1,"default":""},Qt=Gt.extend({init:function(n){var i,r,o=this;if((!n||e.isEmptyObject(n))&&(n=e.extend({},o.defaults,n),o._initializers))for(i=0;o._initializers.length>i;i++)r=o._initializers[i],n[r]=o.defaults[r]();Gt.fn.init.call(o,n),o.dirty=!1,o.idField&&(o.id=o.get(o.idField),o.id===t&&(o.id=o._defaultId))},shouldSerialize:function(e){return Gt.fn.shouldSerialize.call(this,e)&&"uid"!==e&&!("id"!==this.idField&&"id"===e)&&"dirty"!==e&&"_accessors"!==e},_parse:function(e,t){var n,i=this,o=e,a=i.fields||{};return e=a[e],e||(e=r(a,o)),e&&(n=e.parse,!n&&e.type&&(n=$t[e.type.toLowerCase()])),n?n(t):t},_notifyChange:function(e){var t=e.action;("add"==t||"remove"==t)&&(this.dirty=!0)},editable:function(e){return e=(this.fields||{})[e],e?e.editable!==!1:!0},set:function(e,t,n){var r=this;r.editable(e)&&(t=r._parse(e,t),i(t,r.get(e))||(r.dirty=!0,Gt.fn.set.call(r,e,t,n)))},accept:function(e){var t,n,i=this,r=function(){return i};for(t in e)n=e[t],"_"!=t.charAt(0)&&(n=i.wrap(e[t],t,r)),i._set(t,n);i.idField&&(i.id=i.get(i.idField)),i.dirty=!1},isNew:function(){return this.id===this._defaultId}});Qt.define=function(e,n){n===t&&(n=e,e=Qt);var i,r,o,a,s,l,c,d,u=tt({defaults:{}},n),h={},p=u.id,f=[];if(p&&(u.idField=p),u.id&&delete u.id,p&&(u.defaults[p]=u._defaultId=""),"[object Array]"===Nt.call(u.fields)){for(l=0,c=u.fields.length;c>l;l++)o=u.fields[l],typeof o===ft?h[o]={}:o.field&&(h[o.field]=o);u.fields=h}for(r in u.fields)o=u.fields[r],a=o.type||"default",s=null,d=r,r=typeof o.field===ft?o.field:r,o.nullable||(s=u.defaults[d!==r?d:r]=o.defaultValue!==t?o.defaultValue:Yt[a.toLowerCase()],"function"==typeof s&&f.push(r)),n.id===r&&(u._defaultId=s),u.defaults[d!==r?d:r]=s,o.parse=o.parse||$t[a];return f.length>0&&(u._initializers=f),i=e.extend(u),i.define=function(e){return Qt.define(i,e)},u.fields&&(i.fields=u.fields,i.idField=u.idField),i},O={selector:function(e){return ut(e)?e:Et(e)},compare:function(e){var t=this.selector(e);return function(e,n){return e=t(e),n=t(n),null==e&&null==n?0:null==e?-1:null==n?1:e.localeCompare?e.localeCompare(n):e>n?1:n>e?-1:0}},create:function(e){var t=e.compare||this.compare(e.field);return"desc"==e.dir?function(e,n){return t(n,e,!0)}:t},combine:function(e){return function(t,n){var i,r,o=e[0](t,n);for(i=1,r=e.length;r>i;i++)o=o||e[i](t,n);return o}}},V=tt({},O,{asc:function(e){var t=this.selector(e);return function(e,n){var i=t(e),r=t(n);return i&&i.getTime&&r&&r.getTime&&(i=i.getTime(),r=r.getTime()),i===r?e.__position-n.__position:null==i?-1:null==r?1:i.localeCompare?i.localeCompare(r):i>r?1:-1}},desc:function(e){var t=this.selector(e);return function(e,n){var i=t(e),r=t(n);return i&&i.getTime&&r&&r.getTime&&(i=i.getTime(),r=r.getTime()),i===r?e.__position-n.__position:null==i?1:null==r?-1:r.localeCompare?r.localeCompare(i):r>i?1:-1}},create:function(e){return this[e.dir](e.field)}}),N=function(e,t){var n,i=e.length,r=Array(i);for(n=0;i>n;n++)r[n]=t(e[n],n,e);return r},U=function(){function e(e){return e.replace(Wt,"\\").replace(Ut,"")}function t(t,n,i,r){var o;return null!=i&&(typeof i===ft&&(i=e(i),o=Vt.exec(i),o?i=new Date(+o[1]):r?(i="'"+i.toLowerCase()+"'",n="("+n+" || '').toLowerCase()"):i="'"+i+"'"),i.getTime&&(n="("+n+"?"+n+".getTime():"+n+")",i=i.getTime())),n+" "+t+" "+i}return{eq:function(e,n,i){return t("==",e,n,i)},neq:function(e,n,i){return t("!=",e,n,i)},gt:function(e,n,i){return t(">",e,n,i)},gte:function(e,n,i){return t(">=",e,n,i)},lt:function(e,n,i){return t("<",e,n,i)},lte:function(e,n,i){return t("<=",e,n,i)},startswith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".lastIndexOf('"+n+"', 0) == 0"},endswith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"', "+t+".length - "+(n||"").length+") >= 0"},contains:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') >= 0"},doesnotcontain:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') == -1"}}}(),o.filterExpr=function(e){var n,i,r,a,s,l,c=[],d={and:" && ",or:" || "},u=[],h=[],p=e.filters;for(n=0,i=p.length;i>n;n++)r=p[n],s=r.field,l=r.operator,r.filters?(a=o.filterExpr(r),r=a.expression.replace(/__o\[(\d+)\]/g,function(e,t){return t=+t,"__o["+(h.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(e,t){return t=+t,"__f["+(u.length+t)+"]"}),h.push.apply(h,a.operators),u.push.apply(u,a.fields)):(typeof s===gt?(a="__f["+u.length+"](d)",u.push(s)):a=dt.expr(s),typeof l===gt?(r="__o["+h.length+"]("+a+", "+r.value+")",h.push(l)):r=U[(l||"eq").toLowerCase()](a,r.value,r.ignoreCase!==t?r.ignoreCase:!0)),c.push(r);return{expression:"("+c.join(d[e.logic])+")",fields:u,operators:h}},W={"==":"eq",equals:"eq",isequalto:"eq",equalto:"eq",equal:"eq","!=":"neq",ne:"neq",notequals:"neq",isnotequalto:"neq",notequalto:"neq",notequal:"neq","<":"lt",islessthan:"lt",lessthan:"lt",less:"lt","<=":"lte",le:"lte",islessthanorequalto:"lte",lessthanequal:"lte",">":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain"},o.normalizeFilter=l,o.prototype={toArray:function(){return this.data},range:function(e,t){return new o(this.data.slice(e,e+t))},skip:function(e){return new o(this.data.slice(e))},take:function(e){return new o(this.data.slice(0,e))},select:function(e){return new o(N(this.data,e))},order:function(e,t){var n={dir:t};return e&&(e.compare?n.compare=e.compare:n.field=e),new o(this.data.slice(0).sort(O.create(n)))},orderBy:function(e){return this.order(e,"asc")},orderByDescending:function(e){return this.order(e,"desc")},sort:function(e,t,n){var i,r,o=a(e,t),s=[];if(n=n||O,o.length){for(i=0,r=o.length;r>i;i++)s.push(n.create(o[i]));return this.orderBy({compare:n.combine(s)})}return this},filter:function(e){var t,n,i,r,a,s,c,d,u=this.data,h=[];if(e=l(e),!e||0===e.filters.length)return this;for(r=o.filterExpr(e),s=r.fields,c=r.operators,a=d=Function("d, __f, __o","return "+r.expression),(s.length||c.length)&&(d=function(e){return a(e,s,c)}),t=0,i=u.length;i>t;t++)n=u[t],d(n)&&h.push(n);return new o(h)},group:function(e,t){e=d(e||[]),t=t||this.data;var n,i=this,r=new o(i.data);return e.length>0&&(n=e[0],r=r.groupBy(n).select(function(i){var r=new o(t).filter([{field:i.field,operator:"eq",value:i.value,ignoreCase:!1}]);return{field:i.field,value:i.value,items:e.length>1?new o(i.items).group(e.slice(1),r.toArray()).toArray():i.items,hasSubgroups:e.length>1,aggregates:r.aggregate(n.aggregates)}})),r},groupBy:function(e){if(rt(e)||!this.data.length)return new o([]);var t,n,i,r,a=e.field,s=this._sortForGrouping(a,e.dir||"asc"),l=dt.accessor(a),c=l.get(s[0],a),d={field:a,value:c,items:[]},h=[d];for(i=0,r=s.length;r>i;i++)t=s[i],n=l.get(t,a),u(c,n)||(c=n,d={field:a,value:c,items:[]},h.push(d)),d.items.push(t);return new o(h)},_sortForGrouping:function(e,t){var n,i,r=this.data;if(!Ot){for(n=0,i=r.length;i>n;n++)r[n].__position=n;for(r=new o(r).sort(e,t,V).toArray(),n=0,i=r.length;i>n;n++)delete r[n].__position;return r}return this.sort(e,t).toArray()},aggregate:function(e){var t,n,i={},r={};if(e&&e.length)for(t=0,n=this.data.length;n>t;t++)h(i,e,this.data[t],t,n,r);return i}},j={sum:function(e,t,n){var i=n.get(t);return p(e)?p(i)&&(e+=i):e=i,e},count:function(e){return(e||0)+1},average:function(e,n,i,r,o,a){var s=i.get(n);return a.count===t&&(a.count=0),p(e)?p(s)&&(e+=s):e=s,p(s)&&a.count++,r==o-1&&p(e)&&(e/=a.count),e},max:function(e,t,n){var i=n.get(t);return p(e)||f(e)||(e=i),i>e&&(p(i)||f(i))&&(e=i),e},min:function(e,t,n){var i=n.get(t);return p(e)||f(e)||(e=i),e>i&&(p(i)||f(i))&&(e=i),e}},o.process=function(e,n){n=n||{};var i,r=new o(e),s=n.group,l=d(s||[]).concat(a(n.sort||[])),c=n.filterCallback,u=n.filter,h=n.skip,p=n.take;return u&&(r=r.filter(u),c&&(r=c(r)),i=r.toArray().length),l&&(r=r.sort(l),s&&(e=r.toArray())),h!==t&&p!==t&&(r=r.range(h,p)),s&&(r=r.group(s,e)),{total:i,data:r.toArray()}},q=pt.extend({init:function(e){this.data=e.data},read:function(e){e.success(this.data)},update:function(e){e.success(e.data)},create:function(e){e.success(e.data)},destroy:function(e){e.success(e.data)}}),G=pt.extend({init:function(e){var t,n=this;e=n.options=tt({},n.options,e),lt(Dt,function(t,n){typeof e[n]===ft&&(e[n]={url:e[n]})}),n.cache=e.cache?$.create(e.cache):{find:ct,add:ct},t=e.parameterMap,ut(e.push)&&(n.push=e.push),n.push||(n.push=At),n.parameterMap=ut(t)?t:function(e){var n={};return lt(e,function(e,i){e in t&&(e=t[e],it(e)&&(i=e.value(i),e=e.key)),n[e]=i}),n}},options:{parameterMap:At},create:function(e){return st(this.setup(e,mt))},read:function(n){var i,r,o,a=this,s=a.cache;n=a.setup(n,vt),i=n.success||ct,r=n.error||ct,o=s.find(n.data),o!==t?i(o):(n.success=function(e){s.add(n.data,e),i(e)},e.ajax(n))},update:function(e){return st(this.setup(e,_t))},destroy:function(e){return st(this.setup(e,wt))},setup:function(e,t){e=e||{};var n,i=this,r=i.options[t],o=ut(r.data)?r.data(e.data):r.data;return e=tt(!0,{},r,e),n=tt(!0,{},o,e.data),e.data=i.parameterMap(n,t),ut(e.url)&&(e.url=e.url(n)),e}}),$=pt.extend({init:function(){this._store={}},add:function(e,n){e!==t&&(this._store[It(e)]=n)},find:function(e){return this._store[It(e)]},clear:function(){this._store={}},remove:function(e){delete this._store[It(e)]}}),$.create=function(e){var t={inmemory:function(){return new $}};return it(e)&&ut(e.find)?e:e===!0?new $:t[e]()},Y=pt.extend({init:function(e){var t,n,i,r,o,a,s,l,c,d,u,h,p,f=this;e=e||{};for(t in e)n=e[t],f[t]=typeof n===ft?Et(n):n;r=e.modelBase||Qt,it(f.model)&&(f.model=i=r.define(f.model)),o=nt(f.data,f),f._dataAccessFunction=o,f.model&&(a=nt(f.groups,f),s=nt(f.serialize,f),l={},c={},d={},u={},h=!1,i=f.model,i.fields&&(lt(i.fields,function(e,t){var n;p=e,it(t)&&t.field?p=t.field:typeof t===ft&&(p=t),it(t)&&t.from&&(n=t.from),h=h||n&&n!==e||p!==e,c[e]=Et(n||p),d[e]=Et(e),l[n||p]=e,u[e]=n||p}),!e.serialize&&h&&(f.serialize=w(s,i,m,d,l,u))),f._dataAccessFunction=o,f.data=w(o,i,v,c,l,u),f.groups=w(a,i,_,c,l,u))},errors:function(e){return e?e.errors:null},parse:At,data:At,total:function(e){return e.length},groups:At,aggregates:function(){return{}},serialize:function(e){return e}}),Q=ht.extend({init:function(e){var n,i,r,o=this;e&&(i=e.data),e=o.options=tt({},o.options,e),o._map={},o._prefetch={},o._data=[],o._pristineData=[],o._ranges=[],o._view=[],o._pristineTotal=0,o._destroyed=[],o._pageSize=e.pageSize,o._page=e.page||(e.pageSize?1:t),o._sort=a(e.sort),o._filter=l(e.filter),o._group=d(e.group),o._aggregate=e.aggregate,o._total=e.total,o._shouldDetachObservableParents=!0,ht.fn.init.call(o),o.transport=K.create(e,i),ut(o.transport.push)&&o.transport.push({pushCreate:nt(o._pushCreate,o),pushUpdate:nt(o._pushUpdate,o),pushDestroy:nt(o._pushDestroy,o)}),null!=e.offlineStorage&&("string"==typeof e.offlineStorage?(r=e.offlineStorage,o._storage={getItem:function(){return JSON.parse(localStorage.getItem(r))},setItem:function(e){localStorage.setItem(r,It(e))}}):o._storage=e.offlineStorage),o.reader=new dt.data.readers[e.schema.type||"json"](e.schema),n=o.reader.model||{},o._detachObservableParents(),o._data=o._observe(o._data),o._online=!0,o.bind(["push",xt,yt,Ct,bt,Tt,St],e)},options:{data:null,schema:{modelBase:Qt},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},online:function(e){return e===t?this._online:(this._online!=e&&(this._online=e,e&&this.sync()),t)},offlineData:function(e){return null==this.options.offlineStorage?null:e!==t?this._storage.setItem(e):this._storage.getItem()||{}},_isServerGrouped:function(){var e=this.group()||[];return this.options.serverGrouping&&e.length},_pushCreate:function(e){this._push(e,"pushCreate")},_pushUpdate:function(e){this._push(e,"pushUpdate")},_pushDestroy:function(e){this._push(e,"pushDestroy")},_push:function(e,t){var n=this._readData(e);n||(n=e),this[t](n)},_flatData:function(e,t){if(e){if(this._isServerGrouped())return b(e);if(!t)for(var n=0;e.length>n;n++)e.at(n)}return e},parent:ct,get:function(e){var t,n,i=this._flatData(this._data);for(t=0,n=i.length;n>t;t++)if(i[t].id==e)return i[t]},getByUid:function(e){var t,n,i=this._flatData(this._data);if(i)for(t=0,n=i.length;n>t;t++)if(i[t].uid==e)return i[t]},indexOf:function(e){return I(this._data,e)},at:function(e){return this._data.at(e)},data:function(e){var n,i=this;if(e===t){if(i._data)for(n=0;i._data.length>n;n++)i._data.at(n);return i._data}i._detachObservableParents(),i._data=this._observe(e),i._pristineData=e.slice(0),i._storeData(),i._ranges=[],i.trigger("reset"),i._addRange(i._data),i._total=i._data.length,i._pristineTotal=i._total,i._process(i._data)},view:function(e){return e===t?this._view:(this._view=this._observeView(e),t)},_observeView:function(e){return T(e,this._data,this._ranges,this.reader.model||Gt),new qt(e,this.reader.model)},flatView:function(){var e=this.group()||[];return e.length?b(this._view):this._view},add:function(e){return this.insert(this._data.length,e)},_createNewModel:function(e){return this.reader.model?new this.reader.model(e):e instanceof Gt?e:new Gt(e)},insert:function(e,t){return t||(t=e,e=0),t instanceof Qt||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(e,0,A(this.group(),t)):this._data.splice(e,0,t),t},pushCreate:function(e){var t,n,i,r,o,a;ot(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(i=0;e.length>i;i++)r=e[i],o=this.add(r),t.push(o),a=o.toJSON(),this._isServerGrouped()&&(a=A(this.group(),a)),this._pristineData.push(a)}finally{this.options.autoSync=n}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(e){var t,n,i,r,o;for(ot(e)||(e=[e]),t=[],n=0;e.length>n;n++)i=e[n],r=this._createNewModel(i),o=this.get(r.id),o?(t.push(o),o.accept(i),o.trigger("change"),this._updatePristineForModel(o,i)):this.pushCreate(i);t.length&&this.trigger("push",{type:"update",items:t})},pushDestroy:function(e){var t=this._removeItems(e);t.length&&this.trigger("push",{type:"destroy",items:t})},_removeItems:function(e){var t,n,i,r,o,a;ot(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(i=0;e.length>i;i++)r=e[i],o=this._createNewModel(r),a=!1,this._eachItem(this._data,function(e){var n,i;for(n=0;e.length>n;n++)if(i=e.at(n),i.id===o.id){t.push(i),e.splice(n,1),a=!0;break}}),a&&(this._removePristineForModel(o),this._destroyed.pop())}finally{this.options.autoSync=n}return t},remove:function(e){var n,i=this,r=i._isServerGrouped();return this._eachItem(i._data,function(o){return n=D(o,e),n&&r?(n.isNew&&n.isNew()||i._destroyed.push(n),!0):t}),this._removeModelFromRanges(e),this._updateRangesLength(),e},sync:function(){var t,n,i,r,o=this,a=[],s=[],l=o._destroyed,c=o._flatData(o._data);if(o.online()){if(!o.reader.model)return;for(t=0,n=c.length;n>t;t++)c[t].isNew()?a.push(c[t]):c[t].dirty&&s.push(c[t]);r=[],r.push.apply(r,o._send("create",a)),r.push.apply(r,o._send("update",s)),r.push.apply(r,o._send("destroy",l)),i=e.when.apply(null,r).then(function(){var e,t;for(e=0,t=arguments.length;t>e;e++)o._accept(arguments[e]);o._storeData(!0),o._change({action:"sync"}),o.trigger(bt)})}else o._storeData(!0),o._change({action:"sync"}),i=e.Deferred().resolve().promise();return i},cancelChanges:function(e){var t=this;e instanceof dt.data.Model?t._cancelModel(e):(t._destroyed=[],t._detachObservableParents(),t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._change())},hasChanges:function(){var e,t,n=this._data;if(this._destroyed.length)return!0;for(e=0,t=n.length;t>e;e++)if(n[e].isNew()||n[e].dirty)return!0;return!1},_accept:function(t){var n,i=this,r=t.models,o=t.response,a=0,s=i._isServerGrouped(),l=i._pristineData,c=t.type;if(i.trigger(Tt,{response:o,type:c}),o&&!rt(o)){if(o=i.reader.parse(o),i._handleCustomErrors(o))return;o=i.reader.data(o),ot(o)||(o=[o])}else o=e.map(r,function(e){return e.toJSON()});for("destroy"===c&&(i._destroyed=[]),a=0,n=r.length;n>a;a++)"destroy"!==c?(r[a].accept(o[a]),"create"===c?l.push(s?A(i.group(),r[a]):o[a]):"update"===c&&i._updatePristineForModel(r[a],o[a])):i._removePristineForModel(r[a])},_updatePristineForModel:function(e,t){this._executeOnPristineForModel(e,function(e,n){dt.deepExtend(n[e],t)})},_executeOnPristineForModel:function(e,n){this._eachPristineItem(function(i){var r=E(i,e);return r>-1?(n(r,i),!0):t})},_removePristineForModel:function(e){this._executeOnPristineForModel(e,function(e,t){t.splice(e,1)})},_readData:function(e){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t.call(this.reader,e)},_eachPristineItem:function(e){this._eachItem(this._pristineData,e)},_eachItem:function(e,t){e&&e.length&&(this._isServerGrouped()?x(e,t):t(e))},_pristineForModel:function(e){var n,i,r=function(r){return i=E(r,e),i>-1?(n=r[i],!0):t};return this._eachPristineItem(r),n},_cancelModel:function(e){var t=this._pristineForModel(e);this._eachItem(this._data,function(n){var i=I(n,e);i>=0&&(!t||e.isNew()&&!t.__state__?n.splice(i,1):n[i].accept(t))})},_promise:function(t,n,i){var r=this;return e.Deferred(function(e){r.trigger(Ct,{type:i}),r.transport[i].call(r.transport,tt({success:function(t){e.resolve({response:t,models:n,type:i})},error:function(t,n,i){e.reject(t),r.error(t,n,i)}},t))}).promise()},_send:function(e,t){var n,i,r=this,o=[],a=r.reader.serialize(g(t));if(r.options.batch)t.length&&o.push(r._promise({data:{models:a}},t,e));else for(n=0,i=t.length;i>n;n++)o.push(r._promise({data:a[n]},[t[n]],e));return o},read:function(t){var n=this,i=n._params(t),r=e.Deferred();return n._queueRequest(i,function(){n.trigger(Ct,{type:"read"})?(n._dequeueRequest(),r.resolve()):(n.trigger(St),n._ranges=[],n.trigger("reset"),n.online()?n.transport.read({data:i,success:function(e){n.success(e),r.resolve()},error:function(){var e=Ht.call(arguments);n.error.apply(n,e),r.reject.apply(r,e)}}):null!=n.options.offlineStorage&&(n.success(n.offlineData()),r.resolve()))}),r.promise()},_readAggregates:function(e){return this.reader.aggregates(e)},success:function(e){var n,i,r,o,a=this,s=a.options;if(a.trigger(Tt,{response:e,type:"read"}),a.online()){if(e=a.reader.parse(e),a._handleCustomErrors(e))return a._dequeueRequest(),t;a._total=a.reader.total(e),a._aggregate&&s.serverAggregates&&(a._aggregateResult=a._readAggregates(e)),e=a._readData(e)}else{for(e=a._readData(e),n=[],i=0;e.length>i;i++)r=e[i],o=r.__state__,"destroy"==o?this._destroyed.push(this._createNewModel(r)):n.push(r);e=n,a._total=e.length}a._pristineTotal=a._total,a._pristineData=e.slice(0),a._detachObservableParents(),a._data=a._observe(e),null!=a.options.offlineStorage&&a._eachItem(a._data,function(e){var t,n;for(t=0;e.length>t;t++)n=e.at(t),"update"==n.__state__&&(n.dirty=!0)}),a._storeData(),a._addRange(a._data),a._process(a._data),a._dequeueRequest()},_detachObservableParents:function(){if(this._data&&this._shouldDetachObservableParents)for(var e=0;this._data.length>e;e++)this._data[e].parent&&(this._data[e].parent=ct)},_storeData:function(e){function t(e){var n,i,r,s=[];for(n=0;e.length>n;n++)i=e.at(n),r=i.toJSON(),o&&i.items?r.items=t(i.items):(r.uid=i.uid,a&&(i.isNew()?r.__state__="create":i.dirty&&(r.__state__="update"))),s.push(r);return s}var n,i,r,o=this._isServerGrouped(),a=this.reader.model;if(null!=this.options.offlineStorage){for(n=t(this._data),i=0;this._destroyed.length>i;i++)r=this._destroyed[i].toJSON(),r.__state__="destroy",n.push(r);this.offlineData(n),e&&(this._pristineData=n)}},_addRange:function(e){var t=this,n=t._skip||0,i=n+t._flatData(e,!0).length;t._ranges.push({start:n,end:i,data:e}),t._ranges.sort(function(e,t){return e.start-t.start})},error:function(e,t,n){this._dequeueRequest(),this.trigger(Tt,{}),this.trigger(xt,{xhr:e,status:t,errorThrown:n})},_params:function(e){var t=this,n=tt({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},e);return t.options.serverPaging||(delete n.take,delete n.skip,delete n.page,delete n.pageSize),t.options.serverGrouping?t.reader.model&&n.group&&(n.group=z(n.group,t.reader.model)):delete n.group,t.options.serverFiltering?t.reader.model&&n.filter&&(n.filter=F(n.filter,t.reader.model)):delete n.filter,t.options.serverSorting?t.reader.model&&n.sort&&(n.sort=z(n.sort,t.reader.model)):delete n.sort,t.options.serverAggregates?t.reader.model&&n.aggregate&&(n.aggregate=z(n.aggregate,t.reader.model)):delete n.aggregate,n},_queueRequest:function(e,n){var i=this;i._requestInProgress?i._pending={callback:nt(n,i),options:e}:(i._requestInProgress=!0,i._pending=t,n())},_dequeueRequest:function(){var e=this;e._requestInProgress=!1,e._pending&&e._queueRequest(e._pending.options,e._pending.callback)},_handleCustomErrors:function(e){if(this.reader.errors){var t=this.reader.errors(e);if(t)return this.trigger(xt,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_observe:function(e){var t,n=this,i=n.reader.model,r=!1;return n._shouldDetachObservableParents=!0,i&&e.length&&(r=!(e[0]instanceof i)),e instanceof jt?(n._shouldDetachObservableParents=!1,r&&(e.type=n.reader.model,e.wrapAll(e,e))):(t=n.pageSize()?qt:jt,e=new t(e,n.reader.model),e.parent=function(){return n.parent()}),n._isServerGrouped()&&k(e,i),n._changeHandler&&n._data&&n._data instanceof jt?n._data.unbind(yt,n._changeHandler):n._changeHandler=nt(n._change,n),e.bind(yt,n._changeHandler)},_change:function(e){var t,n,i,r=this,o=e?e.action:"";if("remove"===o)for(t=0,n=e.items.length;n>t;t++)e.items[t].isNew&&e.items[t].isNew()||r._destroyed.push(e.items[t]);!r.options.autoSync||"add"!==o&&"remove"!==o&&"itemchange"!==o?(i=parseInt(r._total,10),p(r._total)||(i=parseInt(r._pristineTotal,10)),"add"===o?i+=e.items.length:"remove"===o?i-=e.items.length:"itemchange"===o||"sync"===o||r.options.serverPaging?"sync"===o&&(i=r._pristineTotal=parseInt(r._total,10)):i=r._pristineTotal,r._total=i,r._process(r._data,e)):r.sync()},_calculateAggregates:function(e,t){t=t||{};var n=new o(e),i=t.aggregate,r=t.filter;return r&&(n=n.filter(r)),n.aggregate(i)},_process:function(e,n){var i,r=this,o={};r.options.serverPaging!==!0&&(o.skip=r._skip,o.take=r._take||r._pageSize,o.skip===t&&r._page!==t&&r._pageSize!==t&&(o.skip=(r._page-1)*r._pageSize)),r.options.serverSorting!==!0&&(o.sort=r._sort),r.options.serverFiltering!==!0&&(o.filter=r._filter),r.options.serverGrouping!==!0&&(o.group=r._group),r.options.serverAggregates!==!0&&(o.aggregate=r._aggregate,r._aggregateResult=r._calculateAggregates(e,o)),i=r._queryProcess(e,o),r.view(i.data),i.total===t||r.options.serverFiltering||(r._total=i.total),n=n||{},n.items=n.items||r._view,r.trigger(yt,n)},_queryProcess:function(e,t){return o.process(e,t)},_mergeState:function(e){var n=this;return e!==t&&(n._pageSize=e.pageSize,n._page=e.page,n._sort=e.sort,n._filter=e.filter,n._group=e.group,n._aggregate=e.aggregate,n._skip=e.skip,n._take=e.take,n._skip===t&&(n._skip=n.skip(),e.skip=n.skip()),n._take===t&&n._pageSize!==t&&(n._take=n._pageSize,e.take=n._take),e.sort&&(n._sort=e.sort=a(e.sort)),e.filter&&(n._filter=e.filter=l(e.filter)),e.group&&(n._group=e.group=d(e.group)),e.aggregate&&(n._aggregate=e.aggregate=c(e.aggregate))),e},query:function(n){var i,r=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates;return r||(this._data===t||0===this._data.length)&&!this._destroyed.length?this.read(this._mergeState(n)):(this.trigger(Ct,{type:"read"})||(this.trigger(St),i=this._queryProcess(this._data,this._mergeState(n)),this.options.serverFiltering||(this._total=i.total!==t?i.total:this._data.length),this._aggregateResult=this._calculateAggregates(this._data,n),this.view(i.data),this.trigger(Tt,{}),this.trigger(yt,{items:i.data})),e.Deferred().resolve().promise())},fetch:function(e){return this._query().then(nt(e,this))},_query:function(e){var t=this;return t.query(tt({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},e))},next:function(e){var n=this,i=n.page(),r=n.total();return e=e||{},!i||r&&i+1>n.totalPages()?t:(n._skip=i*n.take(),i+=1,e.page=i,n._query(e),i)},prev:function(e){var n=this,i=n.page();return e=e||{},i&&1!==i?(n._skip=n._skip-n.take(),i-=1,e.page=i,n._query(e),i):t},page:function(e){var n,i=this;return e!==t?(e=Pt.max(Pt.min(Pt.max(e,1),i.totalPages()),1),i._query({page:e}),t):(n=i.skip(),n!==t?Pt.round((n||0)/(i.take()||1))+1:t)},pageSize:function(e){var n=this;return e!==t?(n._query({pageSize:e,page:1}),t):n.take()},sort:function(e){var n=this;return e!==t?(n._query({sort:e}),t):n._sort},filter:function(e){var n=this;return e===t?n._filter:(n._query({filter:e,page:1}),t)},group:function(e){var n=this;return e!==t?(n._query({group:e}),t):n._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(e){var n=this;return e!==t?(n._query({aggregate:e}),t):n._aggregate},aggregates:function(){return this._aggregateResult},totalPages:function(){var e=this,t=e.pageSize()||e.total();return Pt.ceil((e.total()||0)/t)},inRange:function(e,t){var n=this,i=Pt.min(e+t,n.total());return!n.options.serverPaging&&n._data.length>0?!0:n._findRange(e,i).length>0},lastRange:function(){var e=this._ranges;return e[e.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var e=this._ranges;return e.length&&e[0].data.length&&e[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=!1},range:function(e,n){var i,r,o,a,s,l,c,d;if(e=Pt.min(e||0,this.total()),i=this,r=Pt.max(Pt.floor(e/n),0)*n,o=Pt.min(r+n,i.total()),i._skipRequestsInProgress=!1,a=i._findRange(e,Pt.min(e+n,i.total())),a.length){i._skipRequestsInProgress=!0,i._pending=t,i._skip=e>i.skip()?Pt.min(o,(i.totalPages()-1)*i.take()):r,i._take=n,s=i.options.serverPaging,l=i.options.serverSorting,c=i.options.serverFiltering,d=i.options.serverAggregates;try{i.options.serverPaging=!0,i._isServerGrouped()||i.group()&&i.group().length||(i.options.serverSorting=!0),i.options.serverFiltering=!0,i.options.serverPaging=!0,i.options.serverAggregates=!0,s&&(i._detachObservableParents(),i._data=a=i._observe(a)),i._process(a)}finally{i.options.serverPaging=s,i.options.serverSorting=l,i.options.serverFiltering=c,i.options.serverAggregates=d}}else n!==t&&(i._rangeExists(r,o)?e>r&&i.prefetch(o,n,function(){i.range(e,n)}):i.prefetch(r,n,function(){e>r&&o<i.total()&&!i._rangeExists(o,Pt.min(o+n,i.total()))?i.prefetch(o,n,function(){i.range(e,n)}):i.range(e,n)}))},_findRange:function(e,n){var i,r,o,s,l,c,u,h,p,f,g,m,v=this,_=v._ranges,w=[],y=v.options,b=y.serverSorting||y.serverPaging||y.serverFiltering||y.serverGrouping||y.serverAggregates;for(r=0,g=_.length;g>r;r++)if(i=_[r],e>=i.start&&i.end>=e){for(f=0,o=r;g>o;o++)if(i=_[o],p=v._flatData(i.data,!0),p.length&&e+f>=i.start&&(c=i.data,u=i.end,b||(m=d(v.group()||[]).concat(a(v.sort()||[])),h=v._queryProcess(i.data,{sort:m,filter:v.filter()}),p=c=h.data,h.total!==t&&(u=h.total)),s=0,e+f>i.start&&(s=e+f-i.start),l=p.length,u>n&&(l-=u-n),f+=l-s,w=v._mergeGroups(w,c,s,l),i.end>=n&&f==n-e))return w;break}return[]},_mergeGroups:function(e,t,n,i){if(this._isServerGrouped()){var r,o=t.toJSON();return e.length&&(r=e[e.length-1]),y(r,o,n,i),e.concat(o)}return e.concat(t.slice(n,i))},skip:function(){var e=this;return e._skip===t?e._page!==t?(e._page-1)*(e.take()||1):t:e._skip},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(e,t,n){var i=this;return function(r){var o,a,s,l=!1,c={start:e,end:t,data:[]};if(i._dequeueRequest(),i.trigger(Tt,{response:r,type:"read"}),r=i.reader.parse(r),s=i._readData(r),s.length){for(o=0,a=i._ranges.length;a>o;o++)if(i._ranges[o].start===e){l=!0,c=i._ranges[o];
12
+ break}l||i._ranges.push(c)}c.data=i._observe(s),c.end=c.start+i._flatData(c.data,!0).length,i._ranges.sort(function(e,t){return e.start-t.start}),i._total=i.reader.total(r),i._skipRequestsInProgress||(n&&s.length?n():i.trigger(yt,{}))}},prefetch:function(e,t,n){var i=this,r=Pt.min(e+t,i.total()),o={take:t,skip:e,page:e/t+1,pageSize:t,sort:i._sort,filter:i._filter,group:i._group,aggregate:i._aggregate};i._rangeExists(e,r)?n&&n():(clearTimeout(i._timeout),i._timeout=setTimeout(function(){i._queueRequest(o,function(){i.trigger(Ct,{type:"read"})?i._dequeueRequest():i.transport.read({data:i._params(o),success:i._prefetchSuccessHandler(e,r,n)})})},100))},_rangeExists:function(e,t){var n,i,r=this,o=r._ranges;for(n=0,i=o.length;i>n;n++)if(e>=o[n].start&&o[n].end>=t)return!0;return!1},_removeModelFromRanges:function(e){var t,n,i,r,o;for(r=0,o=this._ranges.length;o>r&&(i=this._ranges[r],this._eachItem(i.data,function(i){t=D(i,e),t&&(n=!0)}),!n);r++);},_updateRangesLength:function(){var e,t,n,i,r=0;for(n=0,i=this._ranges.length;i>n;n++)e=this._ranges[n],e.start=e.start-r,t=this._flatData(e.data,!0).length,r=e.end-t,e.end=e.start+t}}),K={},K.create=function(e,t){var n,i=e.transport;return i?(i.read=typeof i.read===ft?{url:i.read}:i.read,e.type&&(dt.data.transports=dt.data.transports||{},dt.data.schemas=dt.data.schemas||{},dt.data.transports[e.type]&&!it(dt.data.transports[e.type])?n=new dt.data.transports[e.type](tt(i,{data:t})):i=tt(!0,{},dt.data.transports[e.type],i),e.schema=tt(!0,{},dt.data.schemas[e.type],e.schema)),n||(n=ut(i.read)?i:new G(i))):n=new q({data:e.data||[]}),n},Q.create=function(e){(ot(e)||e instanceof jt)&&(e={data:e});var t,n,i,r=e||{},o=r.data,a=r.fields,s=r.table,l=r.select,c={};if(o||!a||r.transport||(s?o=B(s,a):l&&(o=R(l,a))),dt.data.Model&&a&&(!r.schema||!r.schema.model)){for(t=0,n=a.length;n>t;t++)i=a[t],i.type&&(c[i.field]=i);rt(c)||(r.schema=tt(!0,r.schema,{model:{fields:c}}))}return r.data=o,s=null,r.table=null,r instanceof Q?r:new Q(r)},X=Qt.define({id:"id",init:function(e){var t=this,n=t.hasChildren||e&&e.hasChildren,i="items",r={};dt.data.Model.fn.init.call(t,e),typeof t.children===ft&&(i=t.children),r={schema:{data:i,model:{hasChildren:n,id:t.idField,fields:t.fields}}},typeof t.children!==ft&&tt(r,t.children),r.data=e,n||(n=r.schema.data),typeof n===ft&&(n=dt.getter(n)),ut(n)&&(t.hasChildren=!!n.call(t,t)),t._childrenOptions=r,t.hasChildren&&t._initChildren(),t._loaded=!(!e||!e[i]&&!e._loaded)},_initChildren:function(){var e,t,n,i=this;i.children instanceof Z||(e=i.children=new Z(i._childrenOptions),t=e.transport,n=t.parameterMap,t.parameterMap=function(e,t){return e[i.idField||"id"]=i.id,n&&(e=n(e,t)),e},e.parent=function(){return i},e.bind(yt,function(e){e.node=e.node||i,i.trigger(yt,e)}),e.bind(xt,function(e){var t=i.parent();t&&(e.node=e.node||i,t.trigger(xt,e))}),i._updateChildrenField())},append:function(e){this._initChildren(),this.loaded(!0),this.children.add(e)},hasChildren:!1,level:function(){for(var e=this.parentNode(),t=0;e&&e.parentNode;)t++,e=e.parentNode?e.parentNode():null;return t},_updateChildrenField:function(){var e=this._childrenOptions.schema.data;this[e||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0,this._updateChildrenField()},load:function(){var e,n={},i="_query";this.hasChildren?(this._initChildren(),e=this.children,n[this.idField||"id"]=this.id,this._loaded||(e._data=t,i="read"),e.one(yt,nt(this._childrenLoaded,this)),e[i](n)):this.loaded(!0)},parentNode:function(){var e=this.parent();return e.parent()},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return Qt.fn.shouldSerialize.call(this,e)&&"children"!==e&&"_loaded"!==e&&"hasChildren"!==e&&"_childrenOptions"!==e}}),Z=Q.extend({init:function(e){var t=X.define({children:e});Q.fn.init.call(this,tt(!0,{},{schema:{modelBase:t,model:t}},e)),this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var e=this;e._data.bind(xt,function(t){e.trigger(xt,t)})},remove:function(e){var t,n=e.parentNode(),i=this;return n&&n._initChildren&&(i=n.children),t=Q.fn.remove.call(i,e),n&&!i.data().length&&(n.hasChildren=!1),t},success:H("success"),data:H("data"),insert:function(e,t){var n=this.parent();return n&&n._initChildren&&(n.hasChildren=!0,n._initChildren()),Q.fn.insert.call(this,e,t)},_find:function(e,t){var n,i,r,o,a;if(r=Q.fn[e].call(this,t))return r;if(o=this._flatData(this._data))for(n=0,i=o.length;i>n;n++)if(a=o[n].children,a instanceof Z&&(r=a[e](t)))return r},get:function(e){return this._find("get",e)},getByUid:function(e){return this._find("getByUid",e)}}),Z.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data,i=t.fields,r=t.list;return n&&n._dataSource?n._dataSource:(n||!i||t.transport||r&&(n=L(r,i)),t.data=n,t instanceof Z?t:new Z(t))},J=dt.Observable.extend({init:function(e,t,n){dt.Observable.fn.init.call(this),this._prefetching=!1,this.dataSource=e,this.prefetch=!n;var i=this;e.bind("change",function(){i._change()}),e.bind("reset",function(){i._reset()}),this._syncWithDataSource(),this.setViewSize(t)},setViewSize:function(e){this.viewSize=e,this._recalculate()},at:function(e){var n=this.pageSize,i=!0;return e>=this.total()?(this.trigger("endreached",{index:e}),t):this.useRanges?this.useRanges?((this.dataOffset>e||e>=this.skip+n)&&(i=this.range(Math.floor(e/n)*n)),e===this.prefetchThreshold&&this._prefetch(),e===this.midPageThreshold?this.range(this.nextMidRange,!0):e===this.nextPageThreshold?this.range(this.nextFullRange):e===this.pullBackThreshold&&this.range(this.offset===this.skip?this.previousMidRange:this.previousFullRange),i?this.dataSource.at(e-this.dataOffset):(this.trigger("endreached",{index:e}),null)):t:this.dataSource.view()[e]},indexOf:function(e){return this.dataSource.data().indexOf(e)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var e=this,t=e.pageSize,n=e.skip-e.viewSize+t,i=Pt.max(Pt.floor(n/t),0)*t;this.offset=n,this.dataSource.prefetch(i,t,function(){e._goToRange(n,!0)})},range:function(e,t){if(this.offset===e)return!0;var n=this,i=this.pageSize,r=Pt.max(Pt.floor(e/i),0)*i,o=this.dataSource;return t&&(r+=i),o.inRange(e,i)?(this.offset=e,this._recalculate(),this._goToRange(e),!0):this.prefetch?(o.prefetch(r,i,function(){n.offset=e,n._recalculate(),n._goToRange(e,!0)}),!1):!0},syncDataSource:function(){var e=this.offset;this.offset=null,this.range(e)},destroy:function(){this.unbind()},_prefetch:function(){var e=this,t=this.pageSize,n=this.skip+t,i=this.dataSource;i.inRange(n,t)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:n,take:t}),i.prefetch(n,t,function(){e._prefetching=!1,e.trigger("prefetched",{skip:n,take:t})}))},_goToRange:function(e,t){this.offset===e&&(this.dataOffset=e,this._expanding=t,this.dataSource.range(e,this.pageSize),this.dataSource.enableRequestsInProgress())},_reset:function(){this._syncPending=!0},_change:function(){var e=this.dataSource;this.length=this.useRanges?e.lastRange().end:e.view().length,this._syncPending&&(this._syncWithDataSource(),this._recalculate(),this._syncPending=!1,this.trigger("reset",{offset:this.offset})),this.trigger("resize"),this._expanding&&this.trigger("expand"),delete this._expanding},_syncWithDataSource:function(){var e=this.dataSource;this._firstItemUid=e.firstItemUid(),this.dataOffset=this.offset=e.skip()||0,this.pageSize=e.pageSize(),this.useRanges=e.options.serverPaging},_recalculate:function(){var e=this.pageSize,t=this.offset,n=this.viewSize,i=Math.ceil(t/e)*e;this.skip=i,this.midPageThreshold=i+e-1,this.nextPageThreshold=i+n-1,this.prefetchThreshold=i+Math.floor(e/3*2),this.pullBackThreshold=this.offset-1,this.nextMidRange=i+e-n,this.nextFullRange=i,this.previousMidRange=t-n,this.previousFullRange=i-e}}),et=dt.Observable.extend({init:function(e,t){var n=this;dt.Observable.fn.init.call(n),this.dataSource=e,this.batchSize=t,this._total=0,this.buffer=new J(e,3*t),this.buffer.bind({endreached:function(e){n.trigger("endreached",{index:e.index})},prefetching:function(e){n.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){n.trigger("prefetched",{skip:e.skip,take:e.take})},reset:function(){n._total=0,n.trigger("reset")},resize:function(){n._total=Math.ceil(this.length/n.batchSize),n.trigger("resize",{total:n.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(e){var n,i,r=this.buffer,o=e*this.batchSize,a=this.batchSize,s=[];for(r.offset>o&&r.at(r.offset-1),i=0;a>i&&(n=r.at(o+i),n!==t);i++)s.push(n);return s},total:function(){return this._total},destroy:function(){this.buffer.destroy(),this.unbind()}}),tt(!0,dt.data,{readers:{json:Y},Query:o,DataSource:Q,HierarchicalDataSource:Z,Node:X,ObservableObject:Gt,ObservableArray:jt,LazyObservableArray:qt,LocalTransport:q,RemoteTransport:G,Cache:$,DataReader:Y,Model:Qt,Buffer:J,BatchBuffer:et})}(window.kendo.jQuery),function(e,t){function n(t,n,i){return v.extend({init:function(e,t,n){var i=this;v.fn.init.call(i,e.element[0],t,n),i.widget=e,i._dataBinding=I(i.dataBinding,i),i._dataBound=I(i.dataBound,i),i._itemChange=I(i.itemChange,i)},itemChange:function(e){a(e.item[0],e.data,this._ns(e.ns),[e.data].concat(this.bindings[t]._parents()))},dataBinding:function(e){var t,n,i=this.widget,r=e.removedItems||i.items();for(t=0,n=r.length;n>t;t++)c(r[t])},_ns:function(t){t=t||x.ui;var n=[x.ui,x.dataviz.ui,x.mobile.ui];return n.splice(e.inArray(t,n),1),n.unshift(t),x.rolesFromNamespaces(n)},dataBound:function(e){{var i,r,o,s,l=this.widget,c=e.addedItems||l.items(),d=l[n];d.group()||[]}if(c.length)for(o=e.addedDataItems||d.flatView(),s=this.bindings[t]._parents(),i=0,r=o.length;r>i;i++)a(c[i],o[i],this._ns(e.ns),[o[i]].concat(s))},refresh:function(e){var r,o=this,a=o.widget;e=e||{},e.action||(o.destroy(),a.bind("dataBinding",o._dataBinding),a.bind("dataBound",o._dataBound),a.bind("itemChange",o._itemChange),r=o.bindings[t].get(),a[n]instanceof x.data.DataSource&&a[n]!=r&&(r instanceof x.data.DataSource?a[i](r):r&&r._dataSource?a[i](r._dataSource):a[n].data(r)))},destroy:function(){var e=this.widget;e.unbind("dataBinding",this._dataBinding),e.unbind("dataBound",this._dataBound),e.unbind("itemChange",this._itemChange)}})}function i(e,n){var i=x.initWidget(e,{},n);return i?new y(i):t}function r(e){var t,n,i,o,a,s,l,c={};for(l=e.match(b),t=0,n=l.length;n>t;t++)i=l[t],o=i.indexOf(":"),a=i.substring(0,o),s=i.substring(o+1),"{"==s.charAt(0)&&(s=r(s)),c[a]=s;return c}function o(e,t,n){var i,r={};for(i in e)r[i]=new n(t,e[i]);return r}function a(e,t,n,s){var c,d,u,h=e.getAttribute("data-"+x.ns+"role"),p=e.getAttribute("data-"+x.ns+"bind"),v=e.children,_=[],y=!0,b={};if(s=s||[t],(h||p)&&l(e),h&&(u=i(e,n)),p&&(p=r(p.replace(k,"")),u||(b=x.parseOptions(e,{textField:"",valueField:"",template:"",valueUpdate:B,valuePrimitive:!1,autoBind:!0}),b.roles=n,u=new w(e,b)),u.source=t,d=o(p,s,f),b.template&&(d.template=new m(s,"",b.template)),d.click&&(p.events=p.events||{},p.events.click=p.click,d.click.destroy(),delete d.click),d.source&&(y=!1),p.attr&&(d.attr=o(p.attr,s,f)),p.style&&(d.style=o(p.style,s,f)),p.events&&(d.events=o(p.events,s,g)),u.bind(d)),u&&(e.kendoBindingTarget=u),y&&v){for(c=0;v.length>c;c++)_[c]=v[c];for(c=0;_.length>c;c++)a(_[c],t,n,s)}}function s(t,n){var i,r,o,s=x.rolesFromNamespaces([].slice.call(arguments,2));for(n=x.observable(n),t=e(t),i=0,r=t.length;r>i;i++)o=t[i],1===o.nodeType&&a(o,n,s)}function l(e){var t=e.kendoBindingTarget;t&&(t.destroy(),R?delete e.kendoBindingTarget:e.removeAttribute?e.removeAttribute("kendoBindingTarget"):e.kendoBindingTarget=null)}function c(e){l(e),d(e)}function d(e){var t,n,i=e.children;if(i)for(t=0,n=i.length;n>t;t++)c(i[t])}function u(t){var n,i;for(t=e(t),n=0,i=t.length;i>n;n++)c(t[n])}function h(e,t){var n=e.element,i=n[0].kendoBindingTarget;i&&s(n,i.source,t)}var p,f,g,m,v,_,w,y,b,k,x=window.kendo,C=x.Observable,S=x.data.ObservableObject,T=x.data.ObservableArray,D={}.toString,A={},E=x.Class,I=e.proxy,P="value",M="source",F="events",z="checked",R=!0,B="change";!function(){var e=document.createElement("a");e.innerText!==t?p="innerText":e.textContent!==t&&(p="textContent");try{delete e.test}catch(n){R=!1}}(),f=C.extend({init:function(e,t){var n=this;C.fn.init.call(n),n.source=e[0],n.parents=e,n.path=t,n.dependencies={},n.dependencies[t]=!0,n.observable=n.source instanceof C,n._access=function(e){n.dependencies[e.field]=!0},n.observable&&(n._change=function(e){n.change(e)},n.source.bind(B,n._change))},_parents:function(){var t,n=this.parents,i=this.get();return i&&"function"==typeof i.parent&&(t=i.parent(),e.inArray(t,n)<0&&(n=[t].concat(n))),n},change:function(e){var t,n,i=e.field,r=this;if("this"===r.path)r.trigger(B,e);else for(t in r.dependencies)if(0===t.indexOf(i)&&(n=t.charAt(i.length),!n||"."===n||"["===n)){r.trigger(B,e);break}},start:function(e){e.bind("get",this._access)},stop:function(e){e.unbind("get",this._access)},get:function(){var e=this,n=e.source,i=0,r=e.path,o=n;if(!e.observable)return o;for(e.start(e.source),o=n.get(r);o===t&&n;)n=e.parents[++i],n instanceof S&&(o=n.get(r));if(o===t)for(n=e.source;o===t&&n;)n=n.parent(),n instanceof S&&(o=n.get(r));return"function"==typeof o&&(i=r.lastIndexOf("."),i>0&&(n=n.get(r.substring(0,i))),e.start(n),o=n!==e.source?o.call(n,e.source):o.call(n),e.stop(n)),n&&n!==e.source&&(e.currentSource=n,n.unbind(B,e._change).bind(B,e._change)),e.stop(e.source),o},set:function(e){var t=this.currentSource||this.source,n=x.getter(this.path)(t);"function"==typeof n?t!==this.source?n.call(t,this.source,e):n.call(t,e):t.set(this.path,e)},destroy:function(){this.observable&&(this.source.unbind(B,this._change),this.currentSource&&this.currentSource.unbind(B,this._change)),this.unbind()}}),g=f.extend({get:function(){var e,t=this.source,n=this.path,i=0;for(e=t.get(n);!e&&t;)t=this.parents[++i],t instanceof S&&(e=t.get(n));return I(e,t)}}),m=f.extend({init:function(e,t,n){var i=this;f.fn.init.call(i,e,t),i.template=n},render:function(e){var t;return this.start(this.source),t=x.render(this.template,e),this.stop(this.source),t}}),v=E.extend({init:function(e,t,n){this.element=e,this.bindings=t,this.options=n},bind:function(e,t){var n=this;e=t?e[t]:e,e.bind(B,function(e){n.refresh(t||e)}),n.refresh(t)},destroy:function(){}}),A.attr=v.extend({refresh:function(e){this.element.setAttribute(e,this.bindings.attr[e].get())}}),A.style=v.extend({refresh:function(e){this.element.style[e]=this.bindings.style[e].get()||""}}),A.enabled=v.extend({refresh:function(){this.bindings.enabled.get()?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}}),A.readonly=v.extend({refresh:function(){this.bindings.readonly.get()?this.element.setAttribute("readonly","readonly"):this.element.removeAttribute("readonly")}}),A.disabled=v.extend({refresh:function(){this.bindings.disabled.get()?this.element.setAttribute("disabled","disabled"):this.element.removeAttribute("disabled")}}),A.events=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n),this.handlers={}},refresh:function(t){var n=e(this.element),i=this.bindings.events[t],r=this.handlers[t];r&&n.off(t,r),r=this.handlers[t]=i.get(),n.on(t,i.source,r)},destroy:function(){var t,n=e(this.element);for(t in this.handlers)n.off(t,this.handlers[t])}}),A.text=v.extend({refresh:function(){var e=this.bindings.text.get();null==e&&(e=""),this.element[p]=e}}),A.visible=v.extend({refresh:function(){this.element.style.display=this.bindings.visible.get()?"":"none"}}),A.invisible=v.extend({refresh:function(){this.element.style.display=this.bindings.invisible.get()?"none":""}}),A.html=v.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}}),A.value=v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=I(this.change,this),this.eventName=i.valueUpdate||B,e(this.element).on(this.eventName,this._change),this._initChange=!1},change:function(){var e,t;this._initChange=this.eventName!=B,e=this.element.value,t=this.element.type,"date"==t?e=x.parseDate(e,"yyyy-MM-dd"):"datetime-local"==t?e=x.parseDate(e,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"]):"number"==t&&(e=x.parseFloat(e)),this.bindings[P].set(e),this._initChange=!1},refresh:function(){var e,t;this._initChange||(e=this.bindings[P].get(),null==e&&(e=""),t=this.element.type,"date"==t?e=x.toString(e,"yyyy-MM-dd"):"datetime-local"==t&&(e=x.toString(e,"yyyy-MM-ddTHH:mm:ss")),this.element.value=e),this._initChange=!1},destroy:function(){e(this.element).off(this.eventName,this._change)}}),A.source=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n);var i=this.bindings.source.get();i instanceof x.data.DataSource&&n.autoBind!==!1&&i.fetch()},refresh:function(e){var t=this,n=t.bindings.source.get();n instanceof T||n instanceof x.data.DataSource?(e=e||{},"add"==e.action?t.add(e.index,e.items):"remove"==e.action?t.remove(e.index,e.items):"itemchange"!=e.action&&t.render()):t.render()},container:function(){var e=this.element;return"table"==e.nodeName.toLowerCase()&&(e.tBodies[0]||e.appendChild(document.createElement("tbody")),e=e.tBodies[0]),e},template:function(){var e=this.options,t=e.template,n=this.container().nodeName.toLowerCase();return t||(t="select"==n?e.valueField||e.textField?x.format('<option value="#:{0}#">#:{1}#</option>',e.valueField||e.textField,e.textField||e.valueField):"<option>#:data#</option>":"tbody"==n?"<tr><td>#:data#</td></tr>":"ul"==n||"ol"==n?"<li>#:data#</li>":"#:data#",t=x.template(t)),t},add:function(t,n){var i,r,o,s,l=this.container(),c=l.cloneNode(!1),d=l.children[t];if(e(c).html(x.render(this.template(),n)),c.children.length)for(i=this.bindings.source._parents(),r=0,o=n.length;o>r;r++)s=c.children[0],l.insertBefore(s,d||null),a(s,n[r],this.options.roles,[n[r]].concat(i))},remove:function(e,t){var n,i,r=this.container();for(n=0;t.length>n;n++)i=r.children[e],c(i),r.removeChild(i)},render:function(){var t,n,i,r=this.bindings.source.get(),o=this.container(),s=this.template();if(r instanceof x.data.DataSource&&(r=r.view()),r instanceof T||"[object Array]"===D.call(r)||(r=[r]),this.bindings.template){if(d(o),e(o).html(this.bindings.template.render(r)),o.children.length)for(t=this.bindings.source._parents(),n=0,i=r.length;i>n;n++)a(o.children[n],r[n],this.options.roles,[r[n]].concat(t))}else e(o).html(x.render(s,r))}}),A.input={checked:v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=I(this.change,this),e(this.element).change(this._change)},change:function(){var e,t,n=this.element,i=this.value();"radio"==n.type?this.bindings[z].set(i):"checkbox"==n.type&&(e=this.bindings[z].get(),e instanceof T?(i=this.element.value,"on"!==i&&"off"!==i&&(t=e.indexOf(i),t>-1?e.splice(t,1):e.push(i))):this.bindings[z].set(i))},refresh:function(){var e=this.bindings[z].get(),t=e,n=this.element;"checkbox"==n.type?(t instanceof T&&(e=this.element.value,t.indexOf(e)>=0&&(e=!0)),n.checked=e===!0):"radio"==n.type&&null!=e&&n.value===""+e&&(n.checked=!0)},value:function(){var e=this.element,t=e.value;return"checkbox"==e.type&&(t=e.checked),t},destroy:function(){e(this.element).off(B,this._change)}})},A.select={value:v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=I(this.change,this),e(this.element).change(this._change)},change:function(){var e,n,i,r,o,a,s=[],l=this.element,c=this.options.valueField||this.options.textField,d=this.options.valuePrimitive;for(o=0,a=l.options.length;a>o;o++)n=l.options[o],n.selected&&(r=n.attributes.value,r=r&&r.specified?n.value:n.text,s.push(r));if(c)for(e=this.bindings.source.get(),e instanceof x.data.DataSource&&(e=e.view()),i=0;s.length>i;i++)for(o=0,a=e.length;a>o;o++)if(e[o].get(c)==s[i]){s[i]=e[o];break}r=this.bindings[P].get(),r instanceof T?r.splice.apply(r,[0,r.length].concat(s)):this.bindings[P].set(d||!(r instanceof S||null===r||r===t)&&c?s[0].get(c):s[0])},refresh:function(){var e,t,n,i=this.element,r=i.options,o=this.bindings[P].get(),a=o,s=this.options.valueField||this.options.textField,l=!1;for(a instanceof T||(a=new T([o])),i.selectedIndex=-1,n=0;a.length>n;n++)for(o=a[n],s&&o instanceof S&&(o=o.get(s)),e=0;r.length>e;e++)t=r[e].value,""===t&&""!==o&&(t=r[e].text),t==o&&(r[e].selected=!0,l=!0)},destroy:function(){e(this.element).off(B,this._change)}})},A.widget={events:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this.handlers={}},refresh:function(e){var t=this.bindings.events[e],n=this.handlers[e];n&&this.widget.unbind(e,n),n=t.get(),this.handlers[e]=function(e){e.data=t.source,n(e),e.data===t.source&&delete e.data},this.widget.bind(e,this.handlers[e])},destroy:function(){var e;for(e in this.handlers)this.widget.unbind(e,this.handlers[e])}}),checked:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this._change=I(this.change,this),this.widget.bind(B,this._change)},change:function(){this.bindings[z].set(this.value())},refresh:function(){this.widget.check(this.bindings[z].get()===!0)},value:function(){var e=this.element,t=e.value;return("on"==t||"off"==t)&&(t=e.checked),t},destroy:function(){this.widget.unbind(B,this._change)}}),visible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.visible.get();this.widget.wrapper[0].style.display=e?"":"none"}}),invisible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.invisible.get();this.widget.wrapper[0].style.display=e?"none":""}}),enabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(this.bindings.enabled.get())}}),disabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(!this.bindings.disabled.get())}}),source:n("source","dataSource","setDataSource"),value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(B,this._change);var r=this.bindings.value.get();this._valueIsObservableObject=!i.valuePrimitive&&(null==r||r instanceof S),this._valueIsObservableArray=r instanceof T,this._initChange=!1},change:function(){var e,t,n,i,r,o,a,s=this.widget.value(),l=this.options.dataValueField||this.options.dataTextField,c="[object Array]"===D.call(s),d=this._valueIsObservableObject,u=[];if(this._initChange=!0,l)if(this.bindings.source&&(a=this.bindings.source.get()),""===s&&(d||this.options.valuePrimitive))s=null;else{for((!a||a instanceof x.data.DataSource)&&(a=this.widget.dataSource.view()),c&&(t=s.length,u=s.slice(0)),r=0,o=a.length;o>r;r++)if(n=a[r],i=n.get(l),c){for(e=0;t>e;e++)if(i==u[e]){u[e]=n;break}}else if(i==s){s=d?n:i;break}u[0]&&(s=this._valueIsObservableArray?u:d||!l?u[0]:u[0].get(l))}this.bindings.value.set(s),this._initChange=!1},refresh:function(){if(!this._initChange){var e,n=this.options.dataValueField||this.options.dataTextField,i=this.bindings.value.get(),r=0,o=[];if(i===t&&(i=null),n)if(i instanceof T){for(e=i.length;e>r;r++)o[r]=i[r].get(n);i=o}else i instanceof S&&(i=i.get(n));this.widget.value(i)}this._initChange=!1},destroy:function(){this.widget.unbind(B,this._change)}}),gantt:{dependencies:n("dependencies","dependencies","setDependenciesDataSource")},multiselect:{value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(B,this._change),this._initChange=!1},change:function(){var e,t,n,i,r,o,a,s,l,c=this,d=c.bindings[P].get(),u=c.options.valuePrimitive,h=u?c.widget.value():c.widget.dataItems(),p=this.options.dataValueField||this.options.dataTextField;if(h=h.slice(0),c._initChange=!0,d instanceof T){for(e=[],t=h.length,n=0,i=0,r=d[n],o=!1;r;){for(l=!1,i=0;t>i;i++)if(u?o=h[i]==r:(s=h[i],s=s.get?s.get(p):s,o=s==(r.get?r.get(p):r)),o){h.splice(i,1),t-=1,l=!0;break}l?n+=1:(e.push(r),_(d,n,1),a=n),r=d[n]}_(d,d.length,0,h),e.length&&d.trigger("change",{action:"remove",items:e,index:a}),h.length&&d.trigger("change",{action:"add",items:h,index:d.length-1})}else c.bindings[P].set(h);c._initChange=!1},refresh:function(){if(!this._initChange){var e,n,i=this.options.dataValueField||this.options.dataTextField,r=this.bindings.value.get(),o=0,a=[];if(r===t&&(r=null),i)if(r instanceof T){for(e=r.length;e>o;o++)n=r[o],a[o]=n.get?n.get(i):n;r=a}else r instanceof S&&(r=r.get(i));this.widget.value(r)}},destroy:function(){this.widget.unbind(B,this._change)}})},scheduler:{source:n("source","dataSource","setDataSource").extend({dataBound:function(e){{var t,n,i,r,o=this.widget,s=o.view(),l=e.addedItems||o.items(),c=o.dataSource;c.group()||[]}if(l.length)for(i=e.addedDataItems||c.expand(s.startDate(),s.endDate()),r=this.bindings.source._parents(),t=0,n=i.length;n>t;t++)a(l[t],i[t],this._ns(e.ns),[i[t]].concat(r))}})}},_=function(e,t,n,i){var r,o,a,s,l;if(i=i||[],n=n||0,r=i.length,o=e.length,a=[].slice.call(e,t+n),s=a.length,r){for(r=t+r,l=0;r>t;t++)e[t]=i[l],l++;e.length=r}else if(n)for(e.length=t,n+=t;n>t;)delete e[--n];if(s){for(s=t+s,l=0;s>t;t++)e[t]=a[l],l++;e.length=s}for(t=e.length;o>t;)delete e[t],t++},w=E.extend({init:function(e,t){this.target=e,this.options=t,this.toDestroy=[]},bind:function(e){var t,n,i,r,o=this.target.nodeName.toLowerCase(),a=A[o]||{};for(t in e)t==P?n=!0:t==M?i=!0:t==F?r=!0:this.applyBinding(t,e,a);i&&this.applyBinding(M,e,a),n&&this.applyBinding(P,e,a),r&&this.applyBinding(F,e,a)},applyBinding:function(e,t,n){var i,r=n[e]||A[e],o=this.toDestroy,a=t[e];if(r)if(r=new r(this.target,t,this.options),o.push(r),a instanceof f)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i]);else if("template"!==e)throw Error("The "+e+" binding is not supported by the "+this.target.nodeName.toLowerCase()+" element")},destroy:function(){var e,t,n=this.toDestroy;for(e=0,t=n.length;t>e;e++)n[e].destroy()}}),y=w.extend({bind:function(e){var t,n=this,i=!1,r=!1,o=A.widget[n.target.options.name.toLowerCase()]||{};for(t in e)t==P?i=!0:t==M?r=!0:n.applyBinding(t,e,o);r&&n.applyBinding(M,e,o),i&&n.applyBinding(P,e,o)},applyBinding:function(e,t,n){var i,r=n[e]||A.widget[e],o=this.toDestroy,a=t[e];if(!r)throw Error("The "+e+" binding is not supported by the "+this.target.options.name+" widget");if(r=new r(this.target,t,this.target.options),o.push(r),a instanceof f)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i])}}),b=/[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g,k=/\s/g,x.unbind=u,x.bind=s,x.data.binders=A,x.data.Binder=v,x.notify=h,x.observable=function(e){return e instanceof S||(e=new S(e)),e},x.observableHierarchy=function(e){function t(e){var n,i;for(n=0;e.length>n;n++)e[n]._initChildren(),i=e[n].children,i.fetch(),e[n].items=i.data(),t(e[n].items)}var n=x.data.HierarchicalDataSource.create(e);return n.fetch(),t(n.data()),n._data._dataSource=n,n._data}}(window.kendo.jQuery),function(e,t){function n(e){return parseInt(e,10)}function i(e,t){return n(e.css(t))}function r(e){var t,n=[];for(t in e)n.push(t);return n}function o(e){for(var t in e)-1!=U.indexOf(t)&&-1==W.indexOf(t)&&delete e[t];return e}function a(e,t){var n,i,r,o,a=[],s={};for(i in t)n=i.toLowerCase(),o=P&&-1!=U.indexOf(n),!E.hasHW3D&&o&&-1==W.indexOf(n)?delete t[i]:(r=t[i],o?a.push(i+"("+r+")"):s[i]=r);return a.length&&(s[st]=a.join(" ")),s}function s(e,t){var i,r,o;return P?(i=e.css(st),i==Q?"scale"==t?1:0:(r=i.match(RegExp(t+"\\s*\\(([\\d\\w\\.]+)")),o=0,r?o=n(r[1]):(r=i.match(B)||[0,0,0,0,0],t=t.toLowerCase(),L.test(t)?o=parseFloat(r[3]/r[2]):"translatey"==t?o=parseFloat(r[4]/r[2]):"scale"==t?o=parseFloat(r[2]):"rotate"==t&&(o=parseFloat(Math.atan2(r[2],r[1])))),o)):parseFloat(e.css(t))}function l(e){return e.charAt(0).toUpperCase()+e.substring(1)}function c(e,t){var n=f.extend(t),i=n.prototype.directions;S[l(e)]=n,S.Element.prototype[e]=function(e,t,i,r){return new n(this.element,e,t,i,r)},T(i,function(t,i){S.Element.prototype[e+l(i)]=function(e,t,r){return new n(this.element,i,e,t,r)}})}function d(e,n,i,r){c(e,{directions:m,startValue:function(e){return this._startValue=e,this},endValue:function(e){return this._endValue=e,this},shouldHide:function(){return this._shouldHide},prepare:function(e,o){var a,s,l=this,c="out"===this._direction,d=l.element.data(n),u=!(isNaN(d)||d==i);a=u?d:t!==this._startValue?this._startValue:c?i:r,s=t!==this._endValue?this._endValue:c?r:i,this._reverse?(e[n]=s,o[n]=a):(e[n]=a,o[n]=s),l._shouldHide=o[n]===r}})}function u(e,t){var n=C.directions[t].vertical,i=e[n?Z:X]()/2+"px";return _[t].replace("$size",i)}var h,p,f,g,m,v,_,w,y,b,k,x,C=window.kendo,S=C.effects,T=e.each,D=e.extend,A=e.proxy,E=C.support,I=E.browser,P=E.transforms,M=E.transitions,F={scale:0,scalex:0,scaley:0,scale3d:0},z={translate:0,translatex:0,translatey:0,translate3d:0},R=t!==document.documentElement.style.zoom&&!P,B=/matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,H=/^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,L=/translatex?$/i,N=/(zoom|fade|expand)(\w+)/,O=/(zoom|fade|expand)/,V=/[xy]$/i,U=["perspective","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","matrix","matrix3d"],W=["rotate","scale","scalex","scaley","skew","skewx","skewy","translate","translatex","translatey","matrix"],j={rotate:"deg",scale:"",skew:"px",translate:"px"},q=P.css,G=Math.round,$="",Y="px",Q="none",K="auto",X="width",Z="height",J="hidden",et="origin",tt="abortId",nt="overflow",it="translate",rt="position",ot="completeCallback",at=q+"transition",st=q+"transform",lt=q+"backface-visibility",ct=q+"perspective",dt="1500px",ut="perspective("+dt+")",ht={left:{reverse:"right",property:"left",transition:"translatex",vertical:!1,modifier:-1},right:{reverse:"left",property:"left",transition:"translatex",vertical:!1,modifier:1},down:{reverse:"up",property:"top",transition:"translatey",vertical:!0,modifier:1},up:{reverse:"down",property:"top",transition:"translatey",vertical:!0,modifier:-1},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out",modifier:-1},out:{reverse:"in",modifier:1},vertical:{reverse:"vertical"},horizontal:{reverse:"horizontal"}};C.directions=ht,D(e.fn,{kendoStop:function(e,t){return M?S.stopQueue(this,e||!1,t||!1):this.stop(e,t)}}),P&&!M&&(T(W,function(n,i){e.fn[i]=function(n){if(t===n)return s(this,i);var r=e(this)[0],o=i+"("+n+j[i.replace(V,"")]+")";return-1==r.style.cssText.indexOf(st)?e(this).css(st,o):r.style.cssText=r.style.cssText.replace(RegExp(i+"\\(.*?\\)","i"),o),this},e.fx.step[i]=function(t){e(t.elem)[i](t.now)}}),h=e.fx.prototype.cur,e.fx.prototype.cur=function(){return-1!=W.indexOf(this.prop)?parseFloat(e(this.elem)[this.prop]()):h.apply(this,arguments)}),C.toggleClass=function(e,t,n,i){return t&&(t=t.split(" "),M&&(n=D({exclusive:"all",duration:400,ease:"ease-out"},n),e.css(at,n.exclusive+" "+n.duration+"ms "+n.ease),setTimeout(function(){e.css(at,"").css(Z)},n.duration)),T(t,function(t,n){e.toggleClass(n,i)})),e},C.parseEffects=function(e,t){var n={};return"string"==typeof e?T(e.split(" "),function(e,i){var r=!O.test(i),o=i.replace(N,function(e,t,n){return t+":"+n.toLowerCase()}),a=o.split(":"),s=a[1],l={};a.length>1&&(l.direction=t&&r?ht[s].reverse:s),n[a[0]]=l}):T(e,function(e){var i=this.direction;i&&t&&!O.test(e)&&(this.direction=ht[i].reverse),n[e]=this}),n},M&&D(S,{transition:function(t,n,i){var o,s,l,c,d=0,u=t.data("keys")||[];i=D({duration:200,ease:"ease-out",complete:null,exclusive:"all"},i),l=!1,c=function(){l||(l=!0,s&&(clearTimeout(s),s=null),t.removeData(tt).dequeue().css(at,"").css(at),i.complete.call(t))},i.duration=e.fx?e.fx.speeds[i.duration]||i.duration:i.duration,o=a(t,n),e.merge(u,r(o)),t.data("keys",e.unique(u)).height(),t.css(at,i.exclusive+" "+i.duration+"ms "+i.ease).css(at),t.css(o).css(st),M.event&&(t.one(M.event,c),0!==i.duration&&(d=500)),s=setTimeout(c,i.duration+d),t.data(tt,s),t.data(ot,c)
13
+ },stopQueue:function(e,t,n){var i,r=e.data("keys"),o=!n&&r,a=e.data(ot);return o&&(i=C.getComputedStyles(e[0],r)),a&&a(),o&&e.css(i),e.removeData("keys").stop(t)}}),p=C.Class.extend({init:function(e,t){var n=this;n.element=e,n.effects=[],n.options=t,n.restore=[]},run:function(t){var n,i,r,s,l,c,d,u=this,h=t.length,p=u.element,f=u.options,g=e.Deferred(),m={},v={};for(u.effects=t,g.then(e.proxy(u,"complete")),p.data("animating",!0),i=0;h>i;i++)for(n=t[i],n.setReverse(f.reverse),n.setOptions(f),u.addRestoreProperties(n.restore),n.prepare(m,v),l=n.children(),r=0,c=l.length;c>r;r++)l[r].duration(f.duration).run();for(d in f.effects)D(v,f.effects[d].properties);for(p.is(":visible")||D(m,{display:p.data("olddisplay")||"block"}),P&&!f.reset&&(s=p.data("targetTransform"),s&&(m=D(s,m))),m=a(p,m),P&&!M&&(m=o(m)),p.css(m).css(st),i=0;h>i;i++)t[i].setup();return f.init&&f.init(),p.data("targetTransform",v),S.animate(p,v,D({},f,{complete:g.resolve})),g.promise()},stop:function(){e(this.element).kendoStop(!0,!0)},addRestoreProperties:function(e){for(var t,n=this.element,i=0,r=e.length;r>i;i++)t=e[i],this.restore.push(t),n.data(t)||n.data(t,n.css(t))},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;t>e;e++)n=this.restore[e],i.css(n,i.data(n))},complete:function(){var t=this,n=0,i=t.element,r=t.options,o=t.effects,a=o.length;for(i.removeData("animating").dequeue(),r.hide&&i.data("olddisplay",i.css("display")).hide(),this.restoreCallback(),R&&!P&&setTimeout(e.proxy(this,"restoreCallback"),0);a>n;n++)o[n].teardown();r.completeCallback&&r.completeCallback(i)}}),S.promise=function(e,t){var n,i,r,o=[],a=new p(e,t),s=C.parseEffects(t.effects);t.effects=s;for(r in s)n=S[l(r)],n&&(i=new n(e,s[r].direction),o.push(i));o[0]?a.run(o):(e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.init&&t.init(),e.dequeue(),a.complete())},D(S,{animate:function(n,r,a){var s=a.transition!==!1;delete a.transition,M&&"transition"in S&&s?S.transition(n,r,a):P?n.animate(o(r),{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete}):n.each(function(){var n=e(this),o={};T(U,function(e,a){var s,l,c,d,u,h,p,f=r?r[a]+" ":null;f&&(l=r,a in F&&r[a]!==t?(s=f.match(H),P&&D(l,{scale:+s[0]})):a in z&&r[a]!==t&&(c=n.css(rt),d="absolute"==c||"fixed"==c,n.data(it)||(d?n.data(it,{top:i(n,"top")||0,left:i(n,"left")||0,bottom:i(n,"bottom"),right:i(n,"right")}):n.data(it,{top:i(n,"marginTop")||0,left:i(n,"marginLeft")||0})),u=n.data(it),s=f.match(H),s&&(h=a==it+"y"?0:+s[1],p=a==it+"y"?+s[1]:+s[2],d?(isNaN(u.right)?isNaN(h)||D(l,{left:u.left+h}):isNaN(h)||D(l,{right:u.right-h}),isNaN(u.bottom)?isNaN(p)||D(l,{top:u.top+p}):isNaN(p)||D(l,{bottom:u.bottom-p})):(isNaN(h)||D(l,{marginLeft:u.left+h}),isNaN(p)||D(l,{marginTop:u.top+p})))),!P&&"scale"!=a&&a in l&&delete l[a],l&&D(o,l))}),I.msie&&delete o.scale,n.animate(o,{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete})})}}),S.animatedPromise=S.promise,f=C.Class.extend({init:function(e,t){var n=this;n.element=e,n._direction=t,n.options={},n._additionalEffects=[],n.restore||(n.restore=[])},reverse:function(){return this._reverse=!0,this.run()},play:function(){return this._reverse=!1,this.run()},add:function(e){return this._additionalEffects.push(e),this},direction:function(e){return this._direction=e,this},duration:function(e){return this._duration=e,this},compositeRun:function(){var e=this,t=new p(e.element,{reverse:e._reverse,duration:e._duration}),n=e._additionalEffects.concat([e]);return t.run(n)},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n,i=this,r=i.element,s=0,l=i.restore,c=l.length,d=e.Deferred(),u={},h={},p=i.children(),f=p.length;for(d.then(e.proxy(i,"_complete")),r.data("animating",!0),s=0;c>s;s++)t=l[s],r.data(t)||r.data(t,r.css(t));for(s=0;f>s;s++)p[s].duration(i._duration).run();return i.prepare(u,h),r.is(":visible")||D(u,{display:r.data("olddisplay")||"block"}),P&&(n=r.data("targetTransform"),n&&(u=D(n,u))),u=a(r,u),P&&!M&&(u=o(u)),r.css(u).css(st),i.setup(),r.data("targetTransform",h),S.animate(r,h,{duration:i._duration,complete:d.resolve}),d.promise()},stop:function(){var t=0,n=this.children(),i=n.length;for(t=0;i>t;t++)n[t].stop();return e(this.element).kendoStop(!0,!0),this},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;t>e;e++)n=this.restore[e],i.css(n,i.data(n))},_complete:function(){var t=this,n=t.element;n.removeData("animating").dequeue(),t.restoreCallback(),t.shouldHide()&&n.data("olddisplay",n.css("display")).hide(),R&&!P&&setTimeout(e.proxy(t,"restoreCallback"),0),t.teardown()},setOptions:function(e){D(!0,this.options,e)},children:function(){return[]},shouldHide:e.noop,setup:e.noop,prepare:e.noop,teardown:e.noop,directions:[],setReverse:function(e){return this._reverse=e,this}}),g=["left","right","up","down"],m=["in","out"],c("slideIn",{directions:g,divisor:function(e){return this.options.divisor=e,this},prepare:function(e,t){var n,i=this,r=i.element,o=ht[i._direction],a=-o.modifier*(o.vertical?r.outerHeight():r.outerWidth()),s=a/(i.options&&i.options.divisor||1)+Y,l="0px";i._reverse&&(n=e,e=t,t=n),P?(e[o.transition]=s,t[o.transition]=l):(e[o.property]=s,t[o.property]=l)}}),c("tile",{directions:g,init:function(e,t,n){f.prototype.init.call(this,e,t),this.options={previous:n}},previousDivisor:function(e){return this.options.previousDivisor=e,this},children:function(){var e=this,t=e._reverse,n=e.options.previous,i=e.options.previousDivisor||1,r=e._direction,o=[C.fx(e.element).slideIn(r).setReverse(t)];return n&&o.push(C.fx(n).slideIn(ht[r].reverse).divisor(i).setReverse(!t)),o}}),d("fade","opacity",1,0),d("zoom","scale",1,.01),c("slideMargin",{prepare:function(e,t){var n,i=this,r=i.element,o=i.options,a=r.data(et),s=o.offset,l=i._reverse;l||null!==a||r.data(et,parseFloat(r.css("margin-"+o.axis))),n=r.data(et)||0,t["margin-"+o.axis]=l?n:n+s}}),c("slideTo",{prepare:function(e,t){var n=this,i=n.element,r=n.options,o=r.offset.split(","),a=n._reverse;P?(t.translatex=a?0:o[0],t.translatey=a?0:o[1]):(t.left=a?0:o[0],t.top=a?0:o[1]),i.css("left")}}),c("expand",{directions:["horizontal","vertical"],restore:[nt],prepare:function(e,n){var i=this,r=i.element,o=i.options,a=i._reverse,s="vertical"===i._direction?Z:X,l=r[0].style[s],c=r.data(s),d=parseFloat(c||l),u=G(r.css(s,K)[s]());e.overflow=J,d=o&&o.reset?u||d:d||u,n[s]=(a?0:d)+Y,e[s]=(a?d:0)+Y,c===t&&r.data(s,l)},shouldHide:function(){return this._reverse},teardown:function(){var e=this,t=e.element,n="vertical"===e._direction?Z:X,i=t.data(n);(i==K||i===$)&&setTimeout(function(){t.css(n,K).css(n)},0)}}),v={position:"absolute",marginLeft:0,marginTop:0,scale:1},c("transfer",{init:function(e,t){this.element=e,this.options={target:t},this.restore=[]},setup:function(){this.element.appendTo(document.body)},prepare:function(e,t){var n=this,i=n.element,r=S.box(i),o=S.box(n.options.target),a=s(i,"scale"),l=S.fillScale(o,r),c=S.transformOrigin(o,r);D(e,v),t.scale=1,i.css(st,"scale(1)").css(st),i.css(st,"scale("+a+")"),e.top=r.top,e.left=r.left,e.transformOrigin=c.x+Y+" "+c.y+Y,n._reverse?e.scale=l:t.scale=l}}),_={top:"rect(auto auto $size auto)",bottom:"rect($size auto auto auto)",left:"rect(auto $size auto auto)",right:"rect(auto auto auto $size)"},w={top:{start:"rotatex(0deg)",end:"rotatex(180deg)"},bottom:{start:"rotatex(-180deg)",end:"rotatex(0deg)"},left:{start:"rotatey(0deg)",end:"rotatey(-180deg)"},right:{start:"rotatey(180deg)",end:"rotatey(0deg)"}},c("turningPage",{directions:g,init:function(e,t,n){f.prototype.init.call(this,e,t),this._container=n},prepare:function(e,t){var n=this,i=n._reverse,r=i?ht[n._direction].reverse:n._direction,o=w[r];e.zIndex=1,n._clipInHalf&&(e.clip=u(n._container,C.directions[r].reverse)),e[lt]=J,t[st]=ut+(i?o.start:o.end),e[st]=ut+(i?o.end:o.start)},setup:function(){this._container.append(this.element)},face:function(e){return this._face=e,this},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},clipInHalf:function(e){return this._clipInHalf=e,this},temporary:function(){return this.element.addClass("temp-page"),this}}),c("staticPage",{directions:g,init:function(e,t,n){f.prototype.init.call(this,e,t),this._container=n},restore:["clip"],prepare:function(e,t){var n=this,i=n._reverse?ht[n._direction].reverse:n._direction;e.clip=u(n._container,i),e.opacity=.999,t.opacity=1},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},face:function(e){return this._face=e,this}}),c("pageturn",{directions:["horizontal","vertical"],init:function(e,t,n,i){f.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=C.directions[i].reverse,o=t._reverse,a=n.face.clone(!0).removeAttr("id"),s=n.back.clone(!0).removeAttr("id"),l=t.element;return o&&(e=i,i=r,r=e),[C.fx(n.face).staticPage(i,l).face(!0).setReverse(o),C.fx(n.back).staticPage(r,l).setReverse(o),C.fx(a).turningPage(i,l).face(!0).clipInHalf(!0).temporary().setReverse(o),C.fx(s).turningPage(r,l).clipInHalf(!0).temporary().setReverse(o)]},prepare:function(e,t){e[ct]=dt,e.transformStyle="preserve-3d",e.opacity=.999,t.opacity=1},teardown:function(){this.element.find(".temp-page").remove()}}),c("flip",{directions:["horizontal","vertical"],init:function(e,t,n,i){f.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=C.directions[i].reverse,o=t._reverse,a=t.element;return o&&(e=i,i=r,r=e),[C.fx(n.face).turningPage(i,a).face(!0).setReverse(o),C.fx(n.back).turningPage(r,a).setReverse(o)]},prepare:function(e){e[ct]=dt,e.transformStyle="preserve-3d"}}),y=!E.mobileOS.android,b=".km-touch-scrollbar, .km-actionsheet-wrapper",c("replace",{_before:e.noop,_after:e.noop,init:function(t,n,i){f.prototype.init.call(this,t),this._previous=e(n),this._transitionClass=i},duration:function(){throw Error("The replace effect does not support duration setting; the effect duration may be customized through the transition class rule")},beforeTransition:function(e){return this._before=e,this},afterTransition:function(e){return this._after=e,this},_both:function(){return e().add(this._element).add(this._previous)},_containerClass:function(){var e=this._direction,t="k-fx k-fx-start k-fx-"+this._transitionClass;return e&&(t+=" k-fx-"+e),this._reverse&&(t+=" k-fx-reverse"),t},complete:function(t){if(!(!this.deferred||t&&e(t.target).is(b))){var n=this.container;n.removeClass("k-fx-end").removeClass(this._containerClass()).off(M.event,this.completeProxy),this._previous.hide().removeClass("k-fx-current"),this.element.removeClass("k-fx-next"),y&&n.css(nt,""),this.isAbsolute||this._both().css(rt,""),this.deferred.resolve(),delete this.deferred}},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n=this,i=n.element,r=n._previous,o=i.parents().filter(r.parents()).first(),a=n._both(),s=e.Deferred(),l=i.css(rt);return o.length||(o=i.parent()),this.container=o,this.deferred=s,this.isAbsolute="absolute"==l,this.isAbsolute||a.css(rt,"absolute"),y&&(t=o.css(nt),o.css(nt,"hidden")),M?(i.addClass("k-fx-hidden"),o.addClass(this._containerClass()),this.completeProxy=e.proxy(this,"complete"),o.on(M.event,this.completeProxy),C.animationFrame(function(){i.removeClass("k-fx-hidden").addClass("k-fx-next"),r.css("display","").addClass("k-fx-current"),n._before(r,i),C.animationFrame(function(){o.removeClass("k-fx-start").addClass("k-fx-end"),n._after(r,i)})})):this.complete(),s.promise()},stop:function(){this.complete()}}),k=C.Class.extend({init:function(){var e=this;e._tickProxy=A(e._tick,e),e._started=!1},tick:e.noop,done:e.noop,onEnd:e.noop,onCancel:e.noop,start:function(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,C.animationFrame(this._tickProxy)))},enabled:function(){return!0},cancel:function(){this._started=!1,this.onCancel()},_tick:function(){var e=this;e._started&&(e.tick(),e.done()?(e._started=!1,e.onEnd()):C.animationFrame(e._tickProxy))}}),x=k.extend({init:function(e){var t=this;D(t,e),k.fn.init.call(t)},done:function(){return this.timePassed()>=this.duration},timePassed:function(){return Math.min(this.duration,new Date-this.startDate)},moveTo:function(e){var t=this,n=t.movable;t.initial=n[t.axis],t.delta=e.location-t.initial,t.duration="number"==typeof e.duration?e.duration:300,t.tick=t._easeProxy(e.ease),t.startDate=new Date,t.start()},_easeProxy:function(e){var t=this;return function(){t.movable.moveAxis(t.axis,e(t.timePassed(),t.initial,t.delta,t.duration))}}}),D(x,{easeOutExpo:function(e,t,n,i){return e==i?t+n:n*(-Math.pow(2,-10*e/i)+1)+t},easeOutBack:function(e,t,n,i,r){return r=1.70158,n*((e=e/i-1)*e*((r+1)*e+r)+1)+t}}),S.Animation=k,S.Transition=x,S.createEffect=c,S.box=function(t){t=e(t);var n=t.offset();return n.width=t.outerWidth(),n.height=t.outerHeight(),n},S.transformOrigin=function(e,t){var n=(e.left-t.left)*t.width/(t.width-e.width),i=(e.top-t.top)*t.height/(t.height-e.height);return{x:isNaN(n)?0:n,y:isNaN(i)?0:i}},S.fillScale=function(e,t){return Math.min(e.width/t.width,e.height/t.height)},S.fitScale=function(e,t){return Math.max(e.width/t.width,e.height/t.height)}}(window.kendo.jQuery),function(e){function t(e){if(!e)return{};var t=e.match(v)||[];return{type:t[1],direction:t[3],reverse:"reverse"===t[5]}}var n=window.kendo,i=n.Observable,r="SCRIPT",o="init",a="show",s="hide",l="transitionStart",c="transitionEnd",d="attach",u="detach",h=/unrecognized expression/,p=i.extend({init:function(e,t){var r=this;t=t||{},i.fn.init.call(r),r.content=e,r.id=n.guid(),r.tagName=t.tagName||"div",r.model=t.model,r._wrap=t.wrap!==!1,this._evalTemplate=t.evalTemplate||!1,r._fragments={},r.bind([o,a,s,l,c],t)},render:function(t){var i=this,r=!i.element;return r&&(i.element=i._createElement()),t&&e(t).append(i.element),r&&(n.bind(i.element,i.model),i.trigger(o)),t&&(i._eachFragment(d),i.trigger(a)),i.element},clone:function(){return new f(this)},triggerBeforeShow:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideStart:function(){},hideEnd:function(){this.hide()},beforeTransition:function(e){this.trigger(l,{type:e})},afterTransition:function(e){this.trigger(c,{type:e})},hide:function(){this._eachFragment(u),this.element.detach(),this.trigger(s)},destroy:function(){var e=this.element;e&&(n.unbind(e),n.destroy(e),e.remove())},fragments:function(t){e.extend(this._fragments,t)},_eachFragment:function(e){for(var t in this._fragments)this._fragments[t][e](this,t)},_createElement:function(){var t,i,o=this,a="<"+o.tagName+" />";try{i=e(document.getElementById(o.content)||o.content),i[0].tagName===r&&(i=i.html())}catch(s){h.test(s.message)&&(i=o.content)}return"string"==typeof i?(i=i.replace(/^\s+|\s+$/g,""),o._evalTemplate&&(i=n.template(i)(o.model||{})),t=e(a).append(i),o._wrap||(t=t.contents())):(t=i,o._wrap&&(t=t.wrapAll(a).parent())),t}}),f=n.Class.extend({init:function(t){e.extend(this,{element:t.element.clone(!0),transition:t.transition,id:t.id}),t.element.parent().append(this.element)},hideStart:e.noop,hideEnd:function(){this.element.remove()},beforeTransition:e.noop,afterTransition:e.noop}),g=p.extend({init:function(e,t){p.fn.init.call(this,e,t),this.containers={}},container:function(e){var t=this.containers[e];return t||(t=this._createContainer(e),this.containers[e]=t),t},showIn:function(e,t,n){this.container(e).show(t,n)},_createContainer:function(e){var t,n=this.render(),i=n.find(e);if(!i.length&&n.is(e)){if(!n.is(e))throw Error("can't find a container with the specified "+e+" selector");i=n}return t=new _(i),t.bind("accepted",function(e){e.view.render(i)}),t}}),m=p.extend({attach:function(e,t){e.element.find(t).replaceWith(this.render())},detach:function(){}}),v=/^(\w+)(:(\w+))?( (\w+))?$/,_=i.extend({init:function(e){i.fn.init.call(this),this.container=e,this.history=[],this.view=null,this.running=!1},after:function(){this.running=!1,this.trigger("complete",{view:this.view}),this.trigger("after")},end:function(){this.view.showEnd(),this.previous.hideEnd(),this.after()},show:function(e,i,r){if(!e.triggerBeforeShow())return this.trigger("after"),!1;r=r||e.id;var o=this,a=e===o.view?e.clone():o.view,s=o.history,l=s[s.length-2]||{},c=l.id===r,d=i||(c?s[s.length-1].transition:e.transition),u=t(d);return o.running&&o.effect.stop(),"none"===d&&(d=null),o.trigger("accepted",{view:e}),o.view=e,o.previous=a,o.running=!0,c?s.pop():s.push({id:r,transition:d}),a?(a.hideStart(),d&&n.effects.enabled?(e.element.addClass("k-fx-hidden"),e.showStart(),c&&!i&&(u.reverse=!u.reverse),o.effect=n.fx(e.element).replace(a.element,u.type).beforeTransition(function(){e.beforeTransition("show"),a.beforeTransition("hide")}).afterTransition(function(){e.afterTransition("show"),a.afterTransition("hide")}).direction(u.direction).setReverse(u.reverse),o.effect.run().then(function(){o.end()})):(e.showStart(),o.end()),!0):(e.showStart(),e.showEnd(),o.after(),!0)}});n.ViewContainer=_,n.Fragment=m,n.Layout=g,n.View=p,n.ViewClone=f}(window.kendo.jQuery),function(e){function t(){this.node=null}function n(e,t,n){this.nodeName=e,this.attr=t||{},this.cssText=null,this.children=n||[]}function i(e){this.nodeValue=e}function r(e){this.html=e}function o(e){return new r(e)}function a(e,t,i){return new n(e,t,i)}function s(e){return new i(e)}function l(e){this.root=e,this.children=[]}t.prototype={remove:function(){this.node.parentNode.removeChild(this.node)}},n.prototype=new t,n.prototype.render=function(e,t){var n,i,r,o,a,s,l,c,d=this.children,u=d.length;if(t&&t.nodeName===this.nodeName){if(n=t.node,r=t.children,Math.abs(r.length-u)>2)return void this.render({appendChild:function(n){e.replaceChild(n,t.node)}},null);for(i=0;u>i;i++)d[i].render(n,r[i]);for(i=u,u=r.length;u>i;i++)r[i].remove()}else{for(t&&(t.remove(),t=null),n=document.createElement(this.nodeName),i=0;u>i;i++)d[i].render(n,null);e.appendChild(n)}o=this.attr;for(a in o)if(!t||o[a]!==t.attr[a])if(void 0!==n[a])if("style"!==a)n[a]=o[a];else{s="",l=o[a];for(c in l)s+=c,s+=":",s+=l[c],s+=";";t&&t.cssText===s||(n.style.cssText=s),this.cssText=s}else n.setAttribute(a,o[a]);if(t)for(a in t.attr)void 0===o[a]&&(void 0!==n[a]?"style"===a?n.style.cssText="":"className"===a?n[a]="":n.removeAttribute(a):n.removeAttribute(a));this.node=n},i.prototype=new t,i.prototype.nodeName="#text",i.prototype.render=function(e,t){var n;t&&t.nodeName===this.nodeName?(n=t.node,this.nodeValue!==t.nodeValue&&(n.nodeValue=this.nodeValue)):(t&&t.remove(),n=document.createTextNode(this.nodeValue),e.appendChild(n)),this.node=n},r.prototype={nodeName:"#html",remove:function(){for(var e=0;this.nodes.length>e;e++)this.nodes[e].parentNode.removeChild(this.nodes[e])},render:function(e,t){var n,i;if(t&&t.nodeName===this.nodeName&&t.html===this.html)this.nodes=t.nodes.slice(0);else for(t&&t.remove(),n=e.lastChild,e.insertAdjacentHTML("beforeend",this.html),this.nodes=[],i=n?n.nextSibling:e.firstChild;i;i=i.nextSibling)this.nodes.push(i)}},l.prototype={html:o,element:a,text:s,render:function(e){var t,n,i=this.children;for(t=0,n=e.length;n>t;t++)e[t].render(this.root,i[t]);for(t=n;i.length>t;t++)i[t].remove();this.children=e}},e.dom={html:o,text:s,element:a,Tree:l}}(window.kendo),function(e){function t(e){var n=Math.floor(e/26)-1;return(n>=0?t(n):"")+String.fromCharCode(65+e%26)}function n(e,n){return t(n)+(e+1)}function i(e){return 6>e.length&&(e=e.replace(/(\w)/g,function(e,t){return t+t})),e=e.substring(1).toUpperCase(),8>e.length&&(e="FF"+e),e}var r='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',o=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${creator}</dc:creator><cp:lastModifiedBy>${lastModifiedBy}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${created}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${modified}</dcterms:modified></cp:coreProperties>'),a=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>${sheets.length}</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="${sheets.length}" baseType="lpstr"># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<vt:lpstr>${sheets[idx].options.title}</vt:lpstr># } else { #<vt:lpstr>Sheet${idx+1}</vt:lpstr># } ## } #</vt:vector></TitlesOfParts><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>14.0300</AppVersion></Properties>'),s=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/># for (var idx = 1; idx <= count; idx++) { #<Override PartName="/xl/worksheets/sheet${idx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /># } #<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'),l=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" /><workbookPr defaultThemeVersion="124226" /><bookViews><workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" /></bookViews><sheets># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<sheet name="${sheets[idx].options.title}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } else { #<sheet name="Sheet${idx+1}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } ## } #</sheets><calcPr calcId="145621" /></workbook>'),c=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"><dimension ref="A1" /><sheetViews><sheetView tabSelected="1" workbookViewId="0"># if (freezePane) { #<pane state="frozen"# if (freezePane.colSplit) { # xSplit="${freezePane.colSplit}"# } ## if (freezePane.rowSplit) { # ySplit="${freezePane.rowSplit}"# } # topLeftCell="${String.fromCharCode(65 + (freezePane.colSplit || 0))}${(freezePane.rowSplit || 0)+1}"/># } #</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25" /># if (columns) { #<cols># for (var ci = 0; ci < columns.length; ci++) { ## var column = columns[ci]; ## if (column.width) { #<col min="${ci+1}" max="${ci+1}" customWidth="1"# if (column.autoWidth) { # width="${((column.width*7+5)/7*256)/256}" bestFit="1"# } else { # width="${(((column.width)/7)*100+0.5)/100}" # } #/># } ## } #</cols># } #<sheetData># for (var ri = 0; ri < data.length; ri++) { ## var row = data[ri]; #<row r="${ri + 1}"># for (var ci = 0; ci < row.data.length; ci++) { ## var cell = row.data[ci];#<c r="${cell.ref}"# if (cell.style) { # s="${cell.style}" # } ## if (cell.type) { # t="${cell.type}"# } #># if (cell.value != null) { #<v>${cell.value}</v># } #</c># } #</row># } #</sheetData># if (filter) { #<autoFilter ref="${filter.from}:${filter.to}"/># } ## if (mergeCells.length) { #<mergeCells count="${mergeCells.length}"># for (var ci = 0; ci < mergeCells.length; ci++) { #<mergeCell ref="${mergeCells[ci]}"/># } #</mergeCells># } #<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" /></worksheet>'),d=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"># for (var idx = 1; idx <= count; idx++) { #<Relationship Id="rId${idx}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${idx}.xml" /># } #<Relationship Id="rId${count+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" /><Relationship Id="rId${count+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" /></Relationships>'),u=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${count}" uniqueCount="${uniqueCount}"># for (var index in indexes) { #<si><t>${index.substring(1)}</t></si># } #</sst>'),h=e.template('<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="${formats.length}"># for (var fi = 0; fi < formats.length; fi++) { ## var format = formats[fi]; #<numFmt formatCode="${format.format}" numFmtId="${165+fi}" /># } #</numFmts><fonts count="${fonts.length+1}" x14ac:knownFonts="1"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font># for (var fi = 0; fi < fonts.length; fi++) { ## var font = fonts[fi]; #<font># if (font.bold) { #<b/># } ## if (font.italic) { #<i/># } ## if (font.underline) { #<u/># } ## if (font.color) { #<color rgb="${font.color}" /># } else { #<color theme="1" /># } ## if (font.fontSize) { #<sz val="${font.fontSize}" /># } else { #<sz val="11" /># } ## if (font.fontName) { #<name val="${font.fontName}" /># } else { #<name val="Calibri" /><scheme val="minor" /># } #<family val="2" /></font># } #</fonts><fills count="${fills.length+1}"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill># for (var fi = 0; fi < fills.length; fi++) { ## var fill = fills[fi]; ## if (fill.background) { #<fill><patternFill patternType="solid"><fgColor rgb="${fill.background}"/></patternFill></fill># } ## } #</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellXfs count="${styles.length+1}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/># for (var si = 0; si < styles.length; si++) { ## var style = styles[si]; #<xf xfid="0"# if (style.fontId) { # fontId="${style.fontId}" applyFont="1"# } ## if (style.fillId) { # fillId="${style.fillId}" applyFill="1"# } ## if (style.numFmtId) { # numFmtId="${style.numFmtId}" applyNumberFormat="1"# } ## if (style.hAlign || style.vAlign) { # applyAlignment="1"# } #># if (style.hAlign || style.vAlign) { #<alignment# if (style.hAlign) { # horizontal="${style.hAlign}"# } ## if (style.vAlign) { # vertical="${style.vAlign}"# } #/># } #</xf># } #</cellXfs><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" /></styleSheet>'),p=e.Class.extend({init:function(e,t,n){this.options=e,this._strings=t,this._styles=n,this._mergeCells=[]},toXML:function(){var e=this.options.rows||[],t=this.options.filter;return c({freezePane:this.options.freezePane,columns:this.options.columns,data:$.map(e,$.proxy(this._row,this,e)),mergeCells:this._mergeCells,filter:t?{from:n(0,t.from),to:n(0,t.to)}:null})},_row:function(e,t,n){return this._cellIndex=0,{data:$.map(t.cells,$.proxy(this._cell,this,e,n))}},_lookupString:function(e){var t="$"+e,n=this._strings.indexes[t];return void 0!==n?e=n:(e=this._strings.indexes[t]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,e},_lookupStyle:function(t){var n,i=e.stringify(t);return"{}"==i?0:(n=$.inArray(i,this._styles),0>n&&(n=this._styles.push(i)-1),n+1)},_cell:function(t,i,r){var o,a,s,l,c,d,u,h,p,f,g;if(!r)return void this._cellIndex++;if(o=r.value,a={bold:r.bold,color:r.color,background:r.background,italic:r.italic,underline:r.underline,fontName:r.fontName,fontSize:r.fontSize,format:r.format,hAlign:r.hAlign,vAlign:r.vAlign},s=this.options.columns||[],l=s[this._cellIndex],l&&l.autoWidth&&(l.width=Math.max(l.width||0,(""+o).length)),c=typeof o,"string"===c?(o=this._lookupString(o),c="s"):"number"===c?c="n":"boolean"===c?(c="b",o=+o):o&&o.getTime?(c="d",o=e.timezone.remove(o,"Etc/UTC").toJSON(),a.format||(a.format="mm-dd-yy")):(c=null,o=""),a=this._lookupStyle(a),d={value:o,type:c,style:a,ref:n(i,this._cellIndex)},u=r.colSpan||1,h=r.rowSpan||1,u>1||h>1){for(p=[d],f=1;u>f;f++)this._cellIndex++,p[f]={ref:n(i,this._cellIndex)};for(g=1;h>g;g++)t[i+g]&&t[i+g].cells.splice(this._cellIndex,0,{});this._mergeCells.push(d.ref+":"+n(i+h-1,this._cellIndex)),d=p}return this._cellIndex++,d}}),f={General:0,0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70},g=e.Class.extend({init:function(e){this.options=e||{},this._strings={indexes:{},count:0,uniqueCount:0},this._styles=[],this._sheets=$.map(this.options.sheets||[],$.proxy(function(e){return new p(e,this._strings,this._styles)},this))},toDataURL:function(){var t,n,c,p,g,m,v,_,w,y,b,k,x;if("undefined"==typeof JSZip)throw Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");for(t=new JSZip,n=t.folder("docProps"),n.file("core.xml",o({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()})),c=this._sheets.length,n.file("app.xml",a({sheets:this._sheets})),p=t.folder("_rels"),p.file(".rels",r),g=t.folder("xl"),m=g.folder("_rels"),m.file("workbook.xml.rels",d({count:c})),g.file("workbook.xml",l({sheets:this._sheets})),v=g.folder("worksheets"),_=0;c>_;_++)v.file(e.format("sheet{0}.xml",_+1),this._sheets[_].toXML());
14
+ return w=$.map(this._styles,$.parseJSON),y=function(e){return e.underline||e.bold||e.italic||e.color||e.fontName||e.fontSize},b=$.map(w,function(e){return e.color&&(e.color=i(e.color)),y(e)?e:void 0}),k=$.map(w,function(e){return e.format&&void 0===f[e.format]?e:void 0}),x=$.map(w,function(e){return e.background?(e.background=i(e.background),e):void 0}),g.file("styles.xml",h({fonts:b,fills:x,formats:k,styles:$.map(w,function(e){var t={};return y(e)&&(t.fontId=$.inArray(e,b)+1),e.background&&(t.fillId=$.inArray(e,x)+2),t.hAlign=e.hAlign,t.vAlign=e.vAlign,e.format&&(t.numFmtId=void 0!==f[e.format]?f[e.format]:165+$.inArray(e,k)),t})})),g.file("sharedStrings.xml",u(this._strings)),t.file("[Content_Types].xml",s({count:c})),"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+t.generate({compression:"DEFLATE"})}});e.ooxml={Workbook:g,Worksheet:p}}(kendo),function(e,t){t.ExcelExporter=t.Class.extend({init:function(n){n.columns=this._trimColumns(n.columns||[]),this.columns=e.map(this._leafColumns(n.columns||[]),this._prepareColumn),this.options=n;var i=n.dataSource;this.dataSource=i instanceof t.data.DataSource?new i.constructor(e.extend({},i.options,{page:n.allPages?0:i.page(),filter:i.filter(),pageSize:n.allPages?i.total():i.pageSize(),sort:i.sort(),group:i.group(),aggregate:i.aggregate()})):t.data.DataSource.create(i),i instanceof t.data.TreeListDataSource&&this.dataSource.data(i.view().toJSON())},_trimColumns:function(t){var n=this;return e.grep(t,function(e){var t=!(!e.field||e.hidden);return!t&&e.columns&&(t=n._trimColumns(e.columns).length>0),t})},_leafColumns:function(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(this._leafColumns(e[t].columns)):n.push(e[t]);return n},workbook:function(){var t=this.dataSource.fetch();return t.then(e.proxy(function(){return{sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:this._filter()}]}},this))},_prepareColumn:function(n){return n.field&&!n.hidden?e.extend({},n,{groupHeaderTemplate:t.template(n.groupHeaderTemplate||"${title}: ${value}"),groupFooterTemplate:n.groupFooterTemplate?t.template(n.groupFooterTemplate):null,footerTemplate:n.footerTemplate?t.template(n.footerTemplate):null}):void 0},_filter:function(){if(!this.options.filterable)return null;var e=this._depth();return{from:e,to:e+this.columns.length-1}},_dataRows:function(t,n){var i=this._depth(),r=e.map(t,e.proxy(function(t){var r,o,a,s,l,c,d,u;return this._hierarchical()&&(n=this.dataSource.level(t)+1),r=e.map(Array(n),function(){return{background:"#dfdfdf",color:"#333"}}),i&&t.items?(o=e.grep(this.columns,function(e){return e.field==t.field})[0],a=o&&o.title?o.title:t.field,s=o?o.groupHeaderTemplate:null,l=a+": "+t.value,c=e.extend({title:a,field:t.field,value:t.value,aggregates:t.aggregates},t.aggregates[t.field]),s&&(l=s(c)),r.push({value:l,background:"#dfdfdf",color:"#333",colSpan:this.columns.length+i-n}),d=this._dataRows(t.items,n+1),d.unshift({type:"group-header",cells:r}),d.concat(this._footer(t,n+1))):(u=e.map(this.columns,e.proxy(this._cell,this,t)),this._hierarchical()&&(u[0].colSpan=i-n+1),{type:"data",cells:r.concat(u)})},this));return r},_footer:function(t,n){var i=[],r=!1,o=e.map(this.columns,function(e){return e.groupFooterTemplate?(r=!0,{background:"#dfdfdf",color:"#333",value:e.groupFooterTemplate(t.aggregates[e.field])}):{background:"#dfdfdf",color:"#333"}});return r&&i.push({type:"group-footer",cells:e.map(Array(n),function(){return{background:"#dfdfdf",color:"#333"}}).concat(o)}),i},_isColumnVisible:function(e){return this._visibleColumns([e]).length>0&&(e.field||e.columns)},_visibleColumns:function(t){var n=this;return e.grep(t,function(e){var t=!e.hidden;return t&&e.columns&&(t=n._visibleColumns(e.columns).length>0),t})},_headerRow:function(t,n){var i=e.map(t.cells,function(e){return{background:"#7a7a7a",color:"#fff",value:e.title,colSpan:e.colSpan>1?e.colSpan:1,rowSpan:t.rowSpan>1&&!e.colSpan?t.rowSpan:1}});return this._hierarchical()&&(i[0].colSpan=this._depth()+1),{type:"header",cells:e.map(Array(n.length),function(){return{background:"#7a7a7a",color:"#fff"}}).concat(i)}},_prependHeaderRows:function(e){var t,n=this.dataSource.group(),i=[{rowSpan:1,cells:[],index:0}];for(this._prepareHeaderRows(i,this.options.columns),t=i.length-1;t>=0;t--)e.unshift(this._headerRow(i[t],n))},_prepareHeaderRows:function(e,t,n,i){var r,o,a,s=i||e[e.length-1],l=e[s.index+1],c=0;for(a=0;t.length>a;a++)r=t[a],this._isColumnVisible(r)&&(o={title:r.title||r.field,colSpan:0},s.cells.push(o),r.columns&&r.columns.length&&(l||(l={rowSpan:0,cells:[],index:e.length},e.push(l)),o.colSpan=this._trimColumns(this._visibleColumns(r.columns)).length,this._prepareHeaderRows(e,r.columns,o,l),c+=o.colSpan-1,s.rowSpan=e.length-s.index));n&&(n.colSpan+=c)},_rows:function(){var t,n,i=this.dataSource.group(),r=this._dataRows(this.dataSource.view(),0);return this.columns.length&&(this._prependHeaderRows(r),t=!1,n=e.map(this.columns,e.proxy(function(e){return e.footerTemplate?(t=!0,{background:"#dfdfdf",color:"#333",value:e.footerTemplate(this.dataSource.aggregates()[e.field])}):{background:"#dfdfdf",color:"#333"}},this)),t&&r.push({type:"footer",cells:e.map(Array(i.length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(n)})),r},_headerDepth:function(e){var t,n,i=1,r=0;for(t=0;e.length>t;t++)e[t].columns&&(n=this._headerDepth(e[t].columns),n>r&&(r=n));return i+r},_freezePane:function(){var t=this._visibleColumns(this.options.columns||[]),n=this._trimColumns(this._leafColumns(e.grep(t,function(e){return e.locked}))).length;return{rowSplit:this._headerDepth(t),colSplit:n?n+this.dataSource.group().length:0}},_cell:function(e,t){return t.field?{value:e.get(t.field)}:void 0},_hierarchical:function(){return this.options.hierarchy&&this.dataSource.level},_depth:function(){var e,t,n,i=this.dataSource,r=0;if(this._hierarchical()){for(e=i.view(),t=0;e.length>t;t++)n=i.level(e[t]),n>r&&(r=n);r++}else r=i.group().length;return r},_columns:function(){var t=this._depth(),n=e.map(Array(t),function(){return{width:20}});return n.concat(e.map(this.columns,function(e){return{width:parseInt(e.width,10),autoWidth:e.width?!1:!0}}))}}),t.ExcelMixin={extend:function(t){t.events.push("excelExport"),t.options.excel=e.extend(t.options.excel,this.options),t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",allPages:!1,filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var n=this.options.excel||{},i=new t.ExcelExporter({columns:this.columns,dataSource:this.dataSource,allPages:n.allPages,filterable:n.filterable,hierarchy:n.hierarchy});i.workbook().then(e.proxy(function(e){if(!this.trigger("excelExport",{workbook:e})){var i=new t.ooxml.Workbook(e);t.saveAs({dataURI:i.toDataURL(),fileName:e.fileName||n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy})}},this))}}}(kendo.jQuery,kendo),function(){kendo.data.transports.signalr=kendo.data.RemoteTransport.extend({init:function(e){var t,n=e&&e.signalr?e.signalr:{},i=n.promise;if(!i)throw Error('The "promise" option must be set.');if("function"!=typeof i.done||"function"!=typeof i.fail)throw Error('The "promise" option must be a Promise.');if(this.promise=i,t=n.hub,!t)throw Error('The "hub" option must be set.');if("function"!=typeof t.on||"function"!=typeof t.invoke)throw Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=t,kendo.data.RemoteTransport.fn.init.call(this,e)},push:function(e){var t=this.options.signalr.client||{};t.create&&this.hub.on(t.create,e.pushCreate),t.update&&this.hub.on(t.update,e.pushUpdate),t.destroy&&this.hub.on(t.destroy,e.pushDestroy)},_crud:function(e,t){var n,i,r=this.hub,o=this.options.signalr.server;if(!o||!o[t])throw Error(kendo.format('The "server.{0}" option must be set.',t));n=[o[t]],i=this.parameterMap(e.data,t),$.isEmptyObject(i)||n.push(i),this.promise.done(function(){r.invoke.apply(r,n).done(e.success).fail(e.error)})},read:function(e){this._crud(e,"read")},create:function(e){this._crud(e,"create")},update:function(e){this._crud(e,"update")},destroy:function(e){this._crud(e,"destroy")}})}(),function(e,t,n){function i(e,r){var a,d;if(null==e||"none"==e)return null;if(e instanceof s)return e;if(e=e.toLowerCase(),a=o.exec(e))return e="transparent"==a[1]?new l(1,1,1,0):i(u.namedColors[a[1]],r),e.match=[a[1]],e;if((a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(e))?d=new c(n(a[1],16),n(a[2],16),n(a[3],16),1):(a=/^#?([0-9a-f])([0-9a-f])([0-9a-f])/i.exec(e))?d=new c(n(a[1]+a[1],16),n(a[2]+a[2],16),n(a[3]+a[3],16),1):(a=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(e))?d=new c(n(a[1],10),n(a[2],10),n(a[3],10),1):(a=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(e))?d=new c(n(a[1],10),n(a[2],10),n(a[3],10),t(a[4])):(a=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(e))?d=new l(t(a[1])/100,t(a[2])/100,t(a[3])/100,1):(a=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(e))&&(d=new l(t(a[1])/100,t(a[2])/100,t(a[3])/100,t(a[4]))),d)d.match=a;else if(!r)throw Error("Cannot parse color: "+e);return d}function r(e,t,n){for(n||(n="0"),e=e.toString(16);t>e.length;)e="0"+e;return e}var o,a,s,l,c,d,u=function(e){var t,n,i,r,o,a=this,s=u.formats;if(1===arguments.length)for(e=a.resolveColor(e),r=0;s.length>r;r++)t=s[r].re,n=s[r].process,i=t.exec(e),i&&(o=n(i),a.r=o[0],a.g=o[1],a.b=o[2]);else a.r=arguments[0],a.g=arguments[1],a.b=arguments[2];a.r=a.normalizeByte(a.r),a.g=a.normalizeByte(a.g),a.b=a.normalizeByte(a.b)};u.prototype={toHex:function(){var e=this,t=e.padDigit,n=e.r.toString(16),i=e.g.toString(16),r=e.b.toString(16);return"#"+t(n)+t(i)+t(r)},resolveColor:function(e){return e=e||"black","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=u.namedColors[e]||e},normalizeByte:function(e){return 0>e||isNaN(e)?0:e>255?255:e},padDigit:function(e){return 1===e.length?"0"+e:e},brightness:function(e){var t=this,n=Math.round;return t.r=n(t.normalizeByte(t.r*e)),t.g=n(t.normalizeByte(t.g*e)),t.b=n(t.normalizeByte(t.b*e)),t},percBrightness:function(){var e=this;return Math.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)}},u.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[n(e[1],10),n(e[2],10),n(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[n(e[1],16),n(e[2],16),n(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[n(e[1]+e[1],16),n(e[2]+e[2],16),n(e[3]+e[3],16)]}}],u.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},o=["transparent"];for(a in u.namedColors)u.namedColors.hasOwnProperty(a)&&o.push(a);o=RegExp("^("+o.join("|")+")(\\W|$)","i"),s=kendo.Class.extend({toHSV:function(){return this},toRGB:function(){return this},toHex:function(){return this.toBytes().toHex()},toBytes:function(){return this},toCss:function(){return"#"+this.toHex()},toCssRgba:function(){var e=this.toBytes();return"rgba("+e.r+", "+e.g+", "+e.b+", "+t((+this.a).toFixed(3))+")"},toDisplay:function(){return kendo.support.browser.msie&&9>kendo.support.browser.version?this.toCss():this.toCssRgba()},equals:function(e){return e===this||null!==e&&this.toCssRgba()==i(e).toCssRgba()},diff:function(e){if(null==e)return 0/0;var t=this.toBytes();return e=e.toBytes(),Math.sqrt(Math.pow(.3*(t.r-e.r),2)+Math.pow(.59*(t.g-e.g),2)+Math.pow(.11*(t.b-e.b),2))},clone:function(){var e=this.toBytes();return e===this&&(e=new c(e.r,e.g,e.b,e.a)),e}}),l=s.extend({init:function(e,t,n,i){this.r=e,this.g=t,this.b=n,this.a=i},toHSV:function(){var e,t,n=this.r,i=this.g,r=this.b,o=Math.min(n,i,r),a=Math.max(n,i,r),s=a,l=a-o;return 0===l?new d(0,0,s,this.a):(0!==a?(t=l/a,e=n==a?(i-r)/l:i==a?2+(r-n)/l:4+(n-i)/l,e*=60,0>e&&(e+=360)):(t=0,e=-1),new d(e,t,s,this.a))},toBytes:function(){return new c(255*this.r,255*this.g,255*this.b,this.a)}}),c=l.extend({init:function(e,t,n,i){this.r=Math.round(e),this.g=Math.round(t),this.b=Math.round(n),this.a=i},toRGB:function(){return new l(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHex:function(){return r(this.r,2)+r(this.g,2)+r(this.b,2)},toBytes:function(){return this}}),d=s.extend({init:function(e,t,n,i){this.h=e,this.s=t,this.v=n,this.a=i},toRGB:function(){var e,t,n,i,r,o,a,s,c=this.h,d=this.s,u=this.v;if(0===d)t=n=i=u;else switch(c/=60,e=Math.floor(c),r=c-e,o=u*(1-d),a=u*(1-d*r),s=u*(1-d*(1-r)),e){case 0:t=u,n=s,i=o;break;case 1:t=a,n=u,i=o;break;case 2:t=o,n=u,i=s;break;case 3:t=o,n=a,i=u;break;case 4:t=s,n=o,i=u;break;default:t=u,n=o,i=a}return new l(t,n,i,this.a)},toBytes:function(){return this.toRGB().toBytes()}}),u.fromBytes=function(e,t,n,i){return new c(e,t,n,null!=i?i:1)},u.fromRGB=function(e,t,n,i){return new l(e,t,n,null!=i?i:1)},u.fromHSV=function(e,t,n,i){return new d(e,t,n,null!=i?i:1)},kendo.Color=u,kendo.parseColor=i}(window.kendo.jQuery,parseFloat,parseInt),function(e){function t(e){return typeof e!==z}function n(e,t){var n=i(t);return A.round(e*n)/n}function i(e){return e?A.pow(10,e):1}function r(e,t,n){return A.max(A.min(e,n),t)}function o(e){return e*P}function a(e){return e/P}function s(e){return"number"==typeof e&&!isNaN(e)}function l(e,n){return t(e)?e:n}function c(e){return e*e}function d(e){var t,n=[];for(t in e)n.push(t+e[t]);return n.sort().join("")}function u(e){var t,n=2166136261;for(t=0;e.length>t;++t)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=e.charCodeAt(t);return n>>>0}function h(e){return u(d(e))}function p(e){var t,n=e.length,i=M,r=F;for(t=0;n>t;t++)r=A.max(r,e[t]),i=A.min(i,e[t]);return{min:i,max:r}}function f(e){return p(e).min}function g(e){return p(e).max}function m(e){return _(e).min}function v(e){return _(e).max}function _(e){var t,n,i,r=M,o=F;for(t=0,n=e.length;n>t;t++)i=e[t],null!==i&&isFinite(i)&&(r=A.min(r,i),o=A.max(o,i));return{min:r===M?void 0:r,max:o===F?void 0:o}}function w(e){return e?e[e.length-1]:void 0}function y(e,t){return e.push.apply(e,t),e}function b(e){return E.template(e,{useWithBlock:!1,paramName:"d"})}function k(e,n){return t(n)&&null!==n?" "+e+"='"+n+"' ":""}function x(e){var t,n="";for(t=0;e.length>t;t++)n+=k(e[t][0],e[t][1]);return n}function C(e){var n,i,r="";for(n=0;e.length>n;n++)i=e[n][1],t(i)&&(r+=e[n][0]+":"+i+";");return""!==r?r:void 0}function S(e){return"string"!=typeof e&&(e+="px"),e}function T(e){var t,n,i=[];if(e)for(t=E.toHyphens(e).split("-"),n=0;t.length>n;n++)i.push("k-pos-"+t[n]);return i.join(" ")}function D(e){return""===e||null===e||"none"===e||"transparent"===e||!t(e)}var A=Math,E=window.kendo,I=E.deepExtend,P=A.PI/180,M=Number.MAX_VALUE,F=-Number.MAX_VALUE,z="undefined",R=Date.now;R||(R=function(){return(new Date).getTime()}),I(E,{util:{MAX_NUM:M,MIN_NUM:F,append:y,arrayLimits:p,arrayMin:f,arrayMax:g,defined:t,deg:a,hashKey:u,hashObject:h,isNumber:s,isTransparent:D,last:w,limitValue:r,now:R,objectKey:d,round:n,rad:o,renderAttr:k,renderAllAttr:x,renderPos:T,renderSize:S,renderStyle:C,renderTemplate:b,sparseArrayLimits:_,sparseArrayMin:m,sparseArrayMax:v,sqr:c,valueOrDefault:l}}),E.dataviz.util=E.util}(window.kendo.jQuery),function(){function e(e){var n,i,r,a,s,l,c,d="",u=0;for(e=t(e);e.length>u;)n=e.charCodeAt(u++),i=e.charCodeAt(u++),r=e.charCodeAt(u++),a=n>>2,s=(3&n)<<4|i>>4,l=(15&i)<<2|r>>6,c=63&r,isNaN(i)?l=c=64:isNaN(r)&&(c=64),d=d+o.charAt(a)+o.charAt(s)+o.charAt(l)+o.charAt(c);return d}function t(e){var t,n,i;for(e=e.replace(/\r\n/g,"\n"),t="",n=0;e.length>n;n++)i=e.charCodeAt(n),128>i?t+=r(i):2048>i?(t+=r(192|i>>>6),t+=r(128|63&i)):65536>i&&(t+=r(224|i>>>12),t+=r(128|i>>>6&63),t+=r(128|63&i));return t}var n=window.kendo,i=n.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(n.util,{encodeBase64:e,encodeUTF8:t})}(window.kendo.jQuery),function(e){var t=Math,n=window.kendo,i=n.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),n=r(e,t);return-1!=n&&t.splice(n,1),this},trigger:function(e,t){var n,i,r=this._observers;if(r&&!this._suspended)for(i=0;r.length>i;i++)n=r[i],n[e]&&n[e](t);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};i(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),function(e){function t(e){return null===e?null:e instanceof m?e:new m(e)}function n(e){return e&&w.isFunction(e.matrix)?e.matrix():e}function i(e,t,n,i){var r=0,o=0;return i&&(r=v.atan2(i.c*n,i.a*t),0!==i.b&&(o=v.atan2(i.d*n,i.b*t))),{x:r,y:o}}function r(e,t){for(;t>e;)e+=90;return e}function o(e,t){var n,i,r;for(n=0;t.length>n;n++)i=t[n],r=i.charAt(0).toUpperCase()+i.substring(1,i.length),e["set"+r]=a(i),e["get"+r]=s(i)}function a(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function s(e){return function(){return this[e]}}function l(e,t,n){e>t&&(t+=360);var i=v.abs(t-e);return n||(i=360-i),i}function c(e,t,n,i,r,o){var a=D((r-e)/n,3),s=D((o-t)/i,3);return D(T(v.atan2(s,a)))}function d(e,t,n,i,r,o,a,s){var d,u,h,p,f,g,m,w,y,b,k,x,C,S,T,D,A,E;if(t!==i)y=n-e,b=i-t,k=_(r,2),x=_(o,2),C=(x*y*(e+n)+k*b*(t+i))/(2*k*b),S=C-i,T=-(y*x)/(k*b),f=1/k+_(T,2)/x,g=2*(T*S/x-n/k),m=_(n,2)/k+_(S,2)/x-1,w=v.sqrt(_(g,2)-4*f*m),d=(-g-w)/(2*f),u=C+T*d,h=(-g+w)/(2*f),p=C+T*h;else{if(e===n)return!1;g=-2*i,m=_((n-e)*o/(2*r),2)+_(i,2)-_(o,2),w=v.sqrt(_(g,2)-4*m),d=h=(e+n)/2,u=(-g-w)/2,p=(-g+w)/2}return D=c(d,u,r,o,e,t),A=c(d,u,r,o,n,i),E=l(D,A,s),(a&&180>=E||!a&&E>180)&&(d=h,u=p,D=c(d,u,r,o,e,t),A=c(d,u,r,o,n,i)),{center:new P(d,u),startAngle:D,endAngle:A}}var u,h,p,f,g,m,v=Math,_=v.pow,w=window.kendo,y=w.Class,b=w.deepExtend,k=w.mixins.ObserversMixin,x=w.util,C=x.defined,S=x.rad,T=x.deg,D=x.round,A=v.PI/2,E=x.MIN_NUM,I=x.MAX_NUM,P=y.extend({init:function(e,t){this.x=e||0,this.y=t||0},equals:function(e){return e&&e.x===this.x&&e.y===this.y},clone:function(){return new P(this.x,this.y)},rotate:function(e,n){return this.transform(t().rotate(e,n))},translate:function(e,t){return this.x+=e,this.y+=t,this.geometryChange(),this},translateWith:function(e){return this.translate(e.x,e.y)},move:function(e,t){return this.x=this.y=0,this.translate(e,t)},scale:function(e,t){return C(t)||(t=e),this.x*=e,this.y*=t,this.geometryChange(),this},scaleCopy:function(e,t){return this.clone().scale(e,t)},transform:function(e){var t=n(e),i=this.x,r=this.y;return this.x=t.a*i+t.c*r+t.e,this.y=t.b*i+t.d*r+t.f,this.geometryChange(),this},transformCopy:function(e){var t=this.clone();return e&&t.transform(e),t},distanceTo:function(e){var t=this.x-e.x,n=this.y-e.y;return v.sqrt(t*t+n*n)},round:function(e){return this.x=D(this.x,e),this.y=D(this.y,e),this.geometryChange(),this},toArray:function(e){var t=C(e),n=t?D(this.x,e):this.x,i=t?D(this.y,e):this.y;return[n,i]}});o(P.fn,["x","y"]),b(P.fn,k),P.fn.toString=function(e,t){var n=this.x,i=this.y;return C(e)&&(n=D(n,e),i=D(i,e)),t=t||" ",n+t+i},P.create=function(e,t){return C(e)?e instanceof P?e:1===arguments.length&&2===e.length?new P(e[0],e[1]):new P(e,t):void 0},P.min=function(){var e,t,n=x.MAX_NUM,i=x.MAX_NUM;for(e=0;arguments.length>e;e++)t=arguments[e],n=v.min(t.x,n),i=v.min(t.y,i);return new P(n,i)},P.max=function(){var e,t,n=x.MIN_NUM,i=x.MIN_NUM;for(e=0;arguments.length>e;e++)t=arguments[e],n=v.max(t.x,n),i=v.max(t.y,i);return new P(n,i)},P.minPoint=function(){return new P(E,E)},P.maxPoint=function(){return new P(I,I)},P.ZERO=new P(0,0),u=y.extend({init:function(e,t){this.width=e||0,this.height=t||0},equals:function(e){return e&&e.width===this.width&&e.height===this.height},clone:function(){return new u(this.width,this.height)},toArray:function(e){var t=C(e),n=t?D(this.width,e):this.width,i=t?D(this.height,e):this.height;return[n,i]}}),o(u.fn,["width","height"]),b(u.fn,k),u.create=function(e,t){return C(e)?e instanceof u?e:1===arguments.length&&2===e.length?new u(e[0],e[1]):new u(e,t):void 0},u.ZERO=new u(0,0),h=y.extend({init:function(e,t){this.setOrigin(e||new P),this.setSize(t||new u)},clone:function(){return new h(this.origin.clone(),this.size.clone())},equals:function(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)},setOrigin:function(e){return this._observerField("origin",P.create(e)),this.geometryChange(),this},getOrigin:function(){return this.origin},setSize:function(e){return this._observerField("size",u.create(e)),this.geometryChange(),this},getSize:function(){return this.size},width:function(){return this.size.width},height:function(){return this.size.height},topLeft:function(){return this.origin.clone()},bottomRight:function(){return this.origin.clone().translate(this.width(),this.height())},topRight:function(){return this.origin.clone().translate(this.width(),0)},bottomLeft:function(){return this.origin.clone().translate(0,this.height())},center:function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},bbox:function(e){var t=this.topLeft().transformCopy(e),n=this.topRight().transformCopy(e),i=this.bottomRight().transformCopy(e),r=this.bottomLeft().transformCopy(e);return h.fromPoints(t,n,i,r)}}),b(h.fn,k),h.fromPoints=function(){var e=P.min.apply(this,arguments),t=P.max.apply(this,arguments),n=new u(t.x-e.x,t.y-e.y);return new h(e,n)},h.union=function(e,t){return h.fromPoints(P.min(e.topLeft(),t.topLeft()),P.max(e.bottomRight(),t.bottomRight()))},h.intersect=function(e,t){return e={left:e.topLeft().x,top:e.topLeft().y,right:e.bottomRight().x,bottom:e.bottomRight().y},t={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},t.right>=e.left&&e.right>=t.left&&t.bottom>=e.top&&e.bottom>=t.top?h.fromPoints(new P(v.max(e.left,t.left),v.max(e.top,t.top)),new P(v.min(e.right,t.right),v.min(e.bottom,t.bottom))):void 0},p=y.extend({init:function(e,t){this.setCenter(e||new P),this.setRadius(t||0)},setCenter:function(e){return this._observerField("center",P.create(e)),this.geometryChange(),this},getCenter:function(){return this.center},equals:function(e){return e&&e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return new p(this.center.clone(),this.radius)},pointAt:function(e){return this._pointAt(S(e))},bbox:function(e){var t,n,r,o,a=P.maxPoint(),s=P.minPoint(),l=i(this.center,this.radius,this.radius,e);for(t=0;4>t;t++)n=this._pointAt(l.x+t*A).transformCopy(e),r=this._pointAt(l.y+t*A).transformCopy(e),o=new P(n.x,r.y),a=P.min(a,o),s=P.max(s,o);return h.fromPoints(a,s)},_pointAt:function(e){var t=this.center,n=this.radius;return new P(t.x-n*v.cos(e),t.y-n*v.sin(e))}}),o(p.fn,["radius"]),b(p.fn,k),f=y.extend({init:function(e,t){this.setCenter(e||new P),t=t||{},this.radiusX=t.radiusX,this.radiusY=t.radiusY||t.radiusX,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.anticlockwise=t.anticlockwise||!1},clone:function(){return new f(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},setCenter:function(e){return this._observerField("center",P.create(e)),this.geometryChange(),this},getCenter:function(){return this.center},MAX_INTERVAL:45,pointAt:function(e){var t=this.center,n=S(e);return new P(t.x+this.radiusX*v.cos(n),t.y+this.radiusY*v.sin(n))},curvePoints:function(){var e,t,n,i=this.startAngle,r=this.anticlockwise?-1:1,o=[this.pointAt(i)],a=i,s=this._arcInterval(),l=s.endAngle-s.startAngle,c=v.ceil(l/this.MAX_INTERVAL),d=l/c;for(e=1;c>=e;e++)t=a+r*d,n=this._intervalCurvePoints(a,t),o.push(n.cp1,n.cp2,n.p2),a=t;return o},bbox:function(e){for(var t,n,o=this,a=o._arcInterval(),s=a.startAngle,l=a.endAngle,c=i(this.center,this.radiusX,this.radiusY,e),d=T(c.x),u=T(c.y),p=o.pointAt(s).transformCopy(e),f=o.pointAt(l).transformCopy(e),g=P.min(p,f),m=P.max(p,f),v=r(d,s),_=r(u,s);l>v||l>_;)l>v&&(t=o.pointAt(v).transformCopy(e),v+=90),l>_&&(n=o.pointAt(_).transformCopy(e),_+=90),p=new P(t.x,n.y),g=P.min(g,p),m=P.max(m,p);return h.fromPoints(g,m)},_arcInterval:function(){var e,t=this.startAngle,n=this.endAngle,i=this.anticlockwise;return i&&(e=t,t=n,n=e),(t>n||i&&t===n)&&(n+=360),{startAngle:t,endAngle:n}},_intervalCurvePoints:function(e,t){var n=this,i=n.pointAt(e),r=n.pointAt(t),o=n._derivativeAt(e),a=n._derivativeAt(t),s=(S(t)-S(e))/3,l=new P(i.x+s*o.x,i.y+s*o.y),c=new P(r.x-s*a.x,r.y-s*a.y);return{p1:i,cp1:l,cp2:c,p2:r}},_derivativeAt:function(e){var t=this,n=S(e);return new P(-t.radiusX*v.sin(n),t.radiusY*v.cos(n))}}),o(f.fn,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]),b(f.fn,k),f.fromPoints=function(e,t,n,i,r,o){var a=d(e.x,e.y,t.x,t.y,n,i,r,o);return new f(a.center,{startAngle:a.startAngle,endAngle:a.endAngle,radiusX:n,radiusY:i,anticlockwise:0===o})},g=y.extend({init:function(e,t,n,i,r,o){this.a=e||0,this.b=t||0,this.c=n||0,this.d=i||0,this.e=r||0,this.f=o||0},multiplyCopy:function(e){return new g(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f)},clone:function(){return new g(this.a,this.b,this.c,this.d,this.e,this.f)},equals:function(e){return e?this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f:!1},round:function(e){return this.a=D(this.a,e),this.b=D(this.b,e),this.c=D(this.c,e),this.d=D(this.d,e),this.e=D(this.e,e),this.f=D(this.f,e),this},toArray:function(e){var t,n=[this.a,this.b,this.c,this.d,this.e,this.f];if(C(e))for(t=0;n.length>t;t++)n[t]=D(n[t],e);return n}}),g.fn.toString=function(e,t){return this.toArray(e).join(t||",")},g.translate=function(e,t){return new g(1,0,0,1,e,t)},g.unit=function(){return new g(1,0,0,1,0,0)},g.rotate=function(e,t,n){var i=new g;return i.a=v.cos(S(e)),i.b=v.sin(S(e)),i.c=-i.b,i.d=i.a,i.e=t-t*i.a+n*i.b||0,i.f=n-n*i.a-t*i.b||0,i},g.scale=function(e,t){return new g(e,0,0,t,0,0)},g.IDENTITY=g.unit(),m=y.extend({init:function(e){this._matrix=e||g.unit()},clone:function(){return new m(this._matrix.clone())},equals:function(e){return e&&e._matrix.equals(this._matrix)},_optionsChange:function(){this.optionsChange({field:"transform",value:this})},translate:function(e,t){return this._matrix=this._matrix.multiplyCopy(g.translate(e,t)),this._optionsChange(),this},scale:function(e,t,n){return C(t)||(t=e),n&&(n=P.create(n),this._matrix=this._matrix.multiplyCopy(g.translate(n.x,n.y))),this._matrix=this._matrix.multiplyCopy(g.scale(e,t)),n&&(this._matrix=this._matrix.multiplyCopy(g.translate(-n.x,-n.y))),this._optionsChange(),this},rotate:function(e,t){return t=P.create(t)||P.ZERO,this._matrix=this._matrix.multiplyCopy(g.rotate(e,t.x,t.y)),this._optionsChange(),this},multiply:function(e){var t=n(e);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this},matrix:function(){return this._matrix}}),b(m.fn,k),b(w,{geometry:{Arc:f,Circle:p,Matrix:g,Point:P,Rect:h,Size:u,Transformation:m,transform:t,toMatrix:n}}),w.dataviz.geometry=w.geometry}(window.kendo.jQuery),function(e){var t,n,i,r=e.noop,o=Object.prototype.toString,a=window.kendo,s=a.Class,l=a.ui.Widget,c=a.deepExtend,d=a.util,u=d.defined,h=a.Observable.extend({init:function(t,n){a.Observable.fn.init.call(this),this.options=c({},this.options,n),this.bind(this.events,this.options),this._click=this._handler("click"),this._mouseenter=this._handler("mouseenter"),this._mouseleave=this._handler("mouseleave"),this.element=e(t),this.options.width&&this.element.css("width",this.options.width),this.options.height&&this.element.css("height",this.options.height)},options:{},events:["click","mouseenter","mouseleave","resize"],draw:r,clear:r,destroy:r,resize:l.fn.resize,size:l.fn.size,getSize:function(){return{width:this.element.width(),height:this.element.height()}},setSize:function(e){this.element.css({width:e.width,height:e.height}),this._size=e,this._resize()},eventTarget:function(t){for(var n,i=e(t.touch?t.touch.initialTouch:t.target);!n&&i.length>0&&(n=i[0]._kendoNode,!i.is(this.element)&&0!==i.length);)i=i.parent();return n?n.srcElement:void 0},_resize:r,_handler:function(e){var t=this;return function(n){var i=t.eventTarget(n);i&&t.trigger(e,{element:i,originalEvent:n})}}});h.create=function(e,t){return i.current.create(e,t)},t=s.extend({init:function(e){this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())},destroy:function(){var e,t;for(this.srcElement&&this.srcElement.removeObserver(this),e=this.childNodes,t=0;e.length>t;t++)this.childNodes[t].destroy();this.parent=null},load:r,observe:function(){this.srcElement&&this.srcElement.addObserver(this)},append:function(e){this.childNodes.push(e),e.parent=this},insertAt:function(e,t){this.childNodes.splice(t,0,e),e.parent=this},remove:function(e,t){var n,i=e+t;for(n=e;i>n;n++)this.childNodes[n].removeSelf();this.childNodes.splice(e,t)},removeSelf:function(){this.clear(),this.destroy()},clear:function(){this.remove(0,this.childNodes.length)},invalidate:function(){this.parent&&this.parent.invalidate()},geometryChange:function(){this.invalidate()},optionsChange:function(){this.invalidate()},childrenChange:function(e){"add"===e.action?this.load(e.items,e.index):"remove"===e.action&&this.remove(e.index,e.items.length),this.invalidate()}}),n=s.extend({init:function(e,t){var n,i;this.prefix=t||"";for(n in e)i=e[n],i=this._wrap(i,n),this[n]=i},get:function(e){return a.getter(e,!0)(this)},set:function(e,t){var n,i=a.getter(e,!0)(this);i!==t&&(n=this._set(e,this._wrap(t,e)),n||this.optionsChange({field:this.prefix+e,value:t}))},_set:function(e,t){var i,r,o,s=e.indexOf(".")>=0;if(s)for(i=e.split("."),r="";i.length>1;){if(r+=i.shift(),o=a.getter(r,!0)(this),o||(o=new n({},r+"."),o.addObserver(this),this[r]=o),o instanceof n)return o.set(i.join("."),t),s;r+="."}return this._clear(e),a.setter(e)(this,t),s},_clear:function(e){var t=a.getter(e,!0)(this);t&&t.removeObserver&&t.removeObserver(this)},_wrap:function(e,t){var i=o.call(e);return null!==e&&u(e)&&"[object Object]"===i&&(e instanceof n||e instanceof s||(e=new n(e,this.prefix+t+".")),e.addObserver(this)),e}}),c(n.fn,a.mixins.ObserversMixin),i=function(){this._items=[]},i.prototype={register:function(e,t,n){var i=this._items,r=i[0],o={name:e,type:t,order:n};!r||r.order>n?i.unshift(o):i.push(o)},create:function(e,t){var n,i,r=this._items,o=r[0];if(t&&t.type)for(n=t.type.toLowerCase(),i=0;r.length>i;i++)if(r[i].name===n){o=r[i];break}return o?new o.type(e,t):void a.logToConsole("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG, VML and Canvas. User agent: "+navigator.userAgent+"\n- The Kendo UI scripts are not fully loaded")}},i.current=new i,c(a,{drawing:{DASH_ARRAYS:{dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Color:a.Color,BaseNode:t,OptionsStore:n,Surface:h,SurfaceFactory:i}}),a.dataviz.drawing=a.drawing
15
+ }(window.kendo.jQuery),function(){var e=window.kendo,t=e.deepExtend,n=e.util.defined,i="gradient",r={extend:function(e){e.fill=this.fill,e.stroke=this.stroke},fill:function(e,t){var r,o=this.options;return n(e)?(e&&e.nodeType!=i?(r={color:e},n(t)&&(r.opacity=t),o.set("fill",r)):o.set("fill",e),this):o.get("fill")},stroke:function(e,t,i){return n(e)?(this.options.set("stroke.color",e),n(t)&&this.options.set("stroke.width",t),n(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")}},o={extend:function(e,t){e.traverse=function(e){var n,i,r=this[t];for(n=0;r.length>n;n++)i=r[n],i.traverse?i.traverse(e):e(i);return this}}};t(e.drawing,{mixins:{Paintable:r,Traversable:o}})}(window.kendo.jQuery),function(e){function t(e,t){return d.current.measure(e,t)}var n=document,i=window.kendo,r=i.Class,o=i.deepExtend,a=i.util,s=a.defined,l=1,c=r.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var n=this,i=n._map,r={key:e,value:t};i[e]=r,n._head?(n._tail.newer=r,r.older=n._tail,n._tail=r):n._head=n._tail=r,n._length>=n._size?(i[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(e){var t=this,n=t._map[e];return n?(n===t._head&&n!==t._tail&&(t._head=n.newer,t._head.older=null),n!==t._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=t._tail,n.newer=null,t._tail.newer=n,t._tail=n),n.value):void 0}}),d=r.extend({init:function(){this._cache=new c(1e3)},measure:function(e,t){var i,r,o,c,d,u=a.objectKey(t),h=a.hashKey(e+u),p=this._cache.get(h);if(p)return p;i={width:0,height:0,baseline:0},r=this._measureBox,o=this._baselineMarker.cloneNode(!1);for(c in t)d=t[c],s(d)&&(r.style[c]=d);return r.innerHTML=e,r.appendChild(o),n.body.appendChild(r),(e+"").length&&(i.width=r.offsetWidth-l,i.height=r.offsetHeight,i.baseline=o.offsetTop+l),this._cache.put(h,i),r.parentNode.removeChild(r),i}});d.fn._baselineMarker=e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+l+"px; height: "+l+"px;overflow: hidden;' />")[0],d.fn._measureBox=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space:nowrap !important;' />")[0],d.current=new d,o(i.drawing,{util:{TextMetrics:d,LRUCache:c,measureText:t}})}(window.kendo.jQuery),function(e){function t(e,t,n){var i,r,o,a;for(r=0;e.length>r;r++)o=e[r],o.visible()&&(a=t?o.bbox(n):o.rawBBox(),a&&(i=i?I.union(i,a):a));return i}function n(e,t,n){var i,r,o,a;for(r=0;e.length>r;r++)o=e[r],o.visible()&&(a=t?o.clippedBBox(n):o.rawBBox(),a&&(i=i?I.union(i,a):a));return i}function i(e,t){e.origin.x-=t,e.origin.y-=t,e.size.width+=2*t,e.size.height+=2*t}function r(e,t){for(var n=0;t.length>n;n++)e[t[n]]=o(t[n])}function o(e){var t="_"+e;return function(e){return V(e)?(this._observerField(t,e),this.geometryChange(),this):this[t]}}function a(e,t){for(var n=0;t.length>n;n++)e[t[n]]=s(t[n])}function s(e){var t="_"+e;return function(e){return V(e)?(this._observerField(t,E.create(e)),this.geometryChange(),this):this[t]}}function l(e,t){for(var n=0;t.length>n;n++)e[t[n]]=c(t[n])}function c(e){return function(t){return V(t)?(this.options.set(e,t),this):this.options.get(e)}}var d,u,h,p,f,g,m,v,_,w,y,b,k,x,C,S=window.kendo,T=S.Class,D=S.deepExtend,A=S.geometry,E=A.Point,I=A.Rect,P=A.Size,M=A.Matrix,F=A.toMatrix,z=S.drawing,R=z.OptionsStore,B=Math,H=B.pow,L=S.util,N=L.append,O=L.arrayLimits,V=L.defined,U=L.last,W=L.valueOrDefault,j=S.mixins.ObserversMixin,q=e.inArray,G=[].push,$=[].pop,Y=[].splice,Q=[].shift,K=[].slice,X=[].unshift,Z=T.extend({nodeType:"Element",init:function(e){this._initOptions(e)},_initOptions:function(e){var t,n;e=e||{},t=e.transform,n=e.clip,t&&(e.transform=A.transform(t)),n&&!n.id&&(n.id=S.guid()),this.options=new R(e),this.options.addObserver(this)},transform:function(e){return V(e)?void this.options.set("transform",A.transform(e)):this.options.get("transform")},parentTransform:function(){for(var e,t,n=this;n.parent;)n=n.parent,e=n.transform(),e&&(t=e.matrix().multiplyCopy(t||M.unit()));return t?A.transform(t):void 0},currentTransform:function(e){var t,n,i=this.transform(),r=F(i);return V(e)||(e=this.parentTransform()),t=F(e),n=r&&t?t.multiplyCopy(r):r||t,n?A.transform(n):void 0},visible:function(e){return V(e)?(this.options.set("visible",e),this):this.options.get("visible")!==!1},clip:function(e){var t=this.options;return V(e)?(e&&!e.id&&(e.id=S.guid()),t.set("clip",e),this):t.get("clip")},opacity:function(e){return V(e)?(this.options.set("opacity",e),this):W(this.options.get("opacity"),1)},clippedBBox:function(e){var t,n=this._clippedBBox(e);return n?(t=this.clip(),t?I.intersect(n,t.bbox(e)):n):void 0},_clippedBBox:function(e){return this.bbox(e)}});D(Z.fn,j),d=T.extend({init:function(e){e=e||[],this.length=0,this._splice(0,e.length,e)},elements:function(e){return e?(this._splice(0,this.length,e),this._change(),this):this.slice(0)},push:function(){var e=arguments,t=G.apply(this,e);return this._add(e),t},slice:K,pop:function(){var e=this.length,t=$.apply(this);return e&&this._remove([t]),t},splice:function(e,t){var n=K.call(arguments,2),i=this._splice(e,t,n);return this._change(),i},shift:function(){var e=this.length,t=Q.apply(this);return e&&this._remove([t]),t},unshift:function(){var e=arguments,t=X.apply(this,e);return this._add(e),t},indexOf:function(e){var t,n,i=this;for(t=0,n=i.length;n>t;t++)if(i[t]===e)return t;return-1},_splice:function(e,t,n){var i=Y.apply(this,[e,t].concat(n));return this._clearObserver(i),this._setObserver(n),i},_add:function(e){this._setObserver(e),this._change()},_remove:function(e){this._clearObserver(e),this._change()},_setObserver:function(e){for(var t=0;e.length>t;t++)e[t].addObserver(this)},_clearObserver:function(e){for(var t=0;e.length>t;t++)e[t].removeObserver(this)},_change:function(){}}),D(d.fn,j),u=Z.extend({nodeType:"Group",init:function(e){Z.fn.init.call(this,e),this.children=[]},childrenChange:function(e,t,n){this.trigger("childrenChange",{action:e,items:t,index:n})},append:function(){return N(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},insertAt:function(e,t){return this.children.splice(t,0,e),e.parent=this,this.childrenChange("add",[e],t),this},remove:function(e){var t=q(e,this.children);return t>=0&&(this.children.splice(t,1),e.parent=null,this.childrenChange("remove",[e],t)),this},removeAt:function(e){if(e>=0&&this.children.length>e){var t=this.children[e];this.children.splice(e,1),t.parent=null,this.childrenChange("remove",[t],e)}return this},clear:function(){var e=this.children;return this.children=[],this._reparent(e,null),this.childrenChange("remove",e,0),this},bbox:function(e){return t(this.children,!0,this.currentTransform(e))},rawBBox:function(){return t(this.children,!1)},_clippedBBox:function(e){return n(this.children,this.currentTransform(e))},currentTransform:function(e){return Z.fn.currentTransform.call(this,e)||null},_reparent:function(e,t){var n,i,r;for(n=0;e.length>n;n++)i=e[n],r=i.parent,r&&r!=this&&r.remove&&r.remove(i),i.parent=t}}),z.mixins.Traversable.extend(u.fn,"children"),h=Z.extend({nodeType:"Text",init:function(e,t,n){Z.fn.init.call(this,n),this.content(e),this.position(t||new A.Point),this.options.font||(this.options.font="12px sans-serif"),V(this.options.fill)||this.fill("#000")},content:function(e){return V(e)?(this.options.set("content",e),this):this.options.get("content")},measure:function(){var e=z.util.measureText(this.content(),{font:this.options.get("font")});return e},rect:function(){var e=this.measure(),t=this.position().clone();return new A.Rect(t,[e.width,e.height])},bbox:function(e){var t=F(this.currentTransform(e));return this.rect().bbox(t)},rawBBox:function(){return this.rect().bbox()}}),z.mixins.Paintable.extend(h.fn),a(h.fn,["position"]),p=Z.extend({nodeType:"Circle",init:function(e,t){Z.fn.init.call(this,t),this.geometry(e||new A.Circle),V(this.options.stroke)||this.stroke("#000")},bbox:function(e){var t=F(this.currentTransform(e)),n=this._geometry.bbox(t),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._geometry.bbox()}}),z.mixins.Paintable.extend(p.fn),r(p.fn,["geometry"]),f=Z.extend({nodeType:"Arc",init:function(e,t){Z.fn.init.call(this,t),this.geometry(e||new A.Arc),V(this.options.stroke)||this.stroke("#000")},bbox:function(e){var t=F(this.currentTransform(e)),n=this.geometry().bbox(t),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this.geometry().bbox()},toPath:function(){var e,t=new v,n=this.geometry().curvePoints();if(n.length>0)for(t.moveTo(n[0].x,n[0].y),e=1;n.length>e;e+=3)t.curveTo(n[e],n[e+1],n[e+2]);return t}}),z.mixins.Paintable.extend(f.fn),r(f.fn,["geometry"]),g=d.extend({_change:function(){this.geometryChange()}}),m=T.extend({init:function(e,t,n){this.anchor(e||new E),this.controlIn(t),this.controlOut(n)},bboxTo:function(e,t){var n,i=this.anchor().transformCopy(t),r=e.anchor().transformCopy(t);return n=this.controlOut()&&e.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(t),e.controlIn().transformCopy(t),r):this._lineBoundingBox(i,r)},_lineBoundingBox:function(e,t){return I.fromPoints(e,t)},_curveBoundingBox:function(e,t,n,i){var r=[e,t,n,i],o=this._curveExtremesFor(r,"x"),a=this._curveExtremesFor(r,"y"),s=O([o.min,o.max,e.x,i.x]),l=O([a.min,a.max,e.y,i.y]);return I.fromPoints(new E(s.min,l.min),new E(s.max,l.max))},_curveExtremesFor:function(e,t){var n=this._curveExtremes(e[0][t],e[1][t],e[2][t],e[3][t]);return{min:this._calculateCurveAt(n.min,t,e),max:this._calculateCurveAt(n.max,t,e)}},_calculateCurveAt:function(e,t,n){var i=1-e;return H(i,3)*n[0][t]+3*H(i,2)*e*n[1][t]+3*H(e,2)*i*n[2][t]+H(e,3)*n[3][t]},_curveExtremes:function(e,t,n,i){var r,o,a=e-3*t+3*n-i,s=-2*(e-2*t+n),l=e-t,c=B.sqrt(s*s-4*a*l),d=0,u=1;return 0===a?0!==s&&(d=u=-l/s):isNaN(c)||(d=(-s+c)/(2*a),u=(-s-c)/(2*a)),r=B.max(B.min(d,u),0),(0>r||r>1)&&(r=0),o=B.min(B.max(d,u),1),(o>1||0>o)&&(o=1),{min:r,max:o}}}),a(m.fn,["anchor","controlIn","controlOut"]),D(m.fn,j),v=Z.extend({nodeType:"Path",init:function(e){Z.fn.init.call(this,e),this.segments=new g,this.segments.addObserver(this),V(this.options.stroke)||(this.stroke("#000"),V(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))},moveTo:function(e,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(e,t),this},lineTo:function(e,t){var n=V(t)?new E(e,t):e,i=new m(n);return this.segments.push(i),this},curveTo:function(e,t,n){var i,r;return this.segments.length>0&&(i=U(this.segments),r=new m(n,t),this.suspend(),i.controlOut(e),this.resume(),this.segments.push(r)),this},arc:function(e,t,n,i,r){var o,a,s,l,c;return this.segments.length>0&&(o=U(this.segments),a=o.anchor(),s=L.rad(e),l=new E(a.x-n*B.cos(s),a.y-i*B.sin(s)),c=new A.Arc(l,{startAngle:e,endAngle:t,radiusX:n,radiusY:i,anticlockwise:r}),this._addArcSegments(c)),this},arcTo:function(e,t,n,i,r){var o,a,s;return this.segments.length>0&&(o=U(this.segments),a=o.anchor(),s=A.Arc.fromPoints(a,e,t,n,i,r),this._addArcSegments(s)),this},_addArcSegments:function(e){var t,n;for(this.suspend(),t=e.curvePoints(),n=1;t.length>n;n+=3)this.curveTo(t[n],t[n+1],t[n+2]);this.resume(),this.geometryChange()},close:function(){return this.options.closed=!0,this.geometryChange(),this},bbox:function(e){var t=F(this.currentTransform(e)),n=this._bbox(t),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._bbox()},_bbox:function(e){var t,n,i,r,o=this.segments,a=o.length;if(1===a)n=o[0].anchor().transformCopy(e),t=new I(n,P.ZERO);else if(a>0)for(i=1;a>i;i++)r=o[i-1].bboxTo(o[i],e),t=t?I.union(t,r):r;return t}}),z.mixins.Paintable.extend(v.fn),v.fromRect=function(e,t){return new v(t).moveTo(e.topLeft()).lineTo(e.topRight()).lineTo(e.bottomRight()).lineTo(e.bottomLeft()).close()},v.fromPoints=function(e,t){var n,i,r;if(e){for(n=new v(t),i=0;e.length>i;i++)r=E.create(e[i]),r&&(0===i?n.moveTo(r):n.lineTo(r));return n}},v.fromArc=function(e,t){var n=new v(t),i=e.startAngle,r=e.pointAt(i);return n.moveTo(r.x,r.y),n.arc(i,e.endAngle,e.radiusX,e.radiusY,e.anticlockwise),n},_=Z.extend({nodeType:"MultiPath",init:function(e){Z.fn.init.call(this,e),this.paths=new g,this.paths.addObserver(this),V(this.options.stroke)||this.stroke("#000")},moveTo:function(e,t){var n=new v;return n.moveTo(e,t),this.paths.push(n),this},lineTo:function(e,t){return this.paths.length>0&&U(this.paths).lineTo(e,t),this},curveTo:function(e,t,n){return this.paths.length>0&&U(this.paths).curveTo(e,t,n),this},arc:function(e,t,n,i,r){return this.paths.length>0&&U(this.paths).arc(e,t,n,i,r),this},arcTo:function(e,t,n,i,r){return this.paths.length>0&&U(this.paths).arcTo(e,t,n,i,r),this},close:function(){return this.paths.length>0&&U(this.paths).close(),this},bbox:function(e){return t(this.paths,!0,this.currentTransform(e))},rawBBox:function(){return t(this.paths,!1)},_clippedBBox:function(e){return n(this.paths,this.currentTransform(e))}}),z.mixins.Paintable.extend(_.fn),w=Z.extend({nodeType:"Image",init:function(e,t,n){Z.fn.init.call(this,n),this.src(e),this.rect(t||new A.Rect)},src:function(e){return V(e)?(this.options.set("src",e),this):this.options.get("src")},bbox:function(e){var t=F(this.currentTransform(e));return this._rect.bbox(t)},rawBBox:function(){return this._rect.bbox()}}),r(w.fn,["rect"]),y=T.extend({init:function(e,t,n){this.options=new R({offset:e,color:t,opacity:V(n)?n:1}),this.options.addObserver(this)}}),l(y.fn,["offset","color","opacity"]),D(y.fn,j),y.create=function(e){if(V(e)){var t;return t=e instanceof y?e:e.length>1?new y(e[0],e[1],e[2]):new y(e.offset,e.color,e.opacity)}},b=d.extend({_change:function(){this.optionsChange({field:"stops"})}}),k=T.extend({nodeType:"gradient",init:function(e){this.stops=new b(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=S.guid()},userSpace:function(e){return V(e)?(this._userSpace=e,this.optionsChange(),this):this._userSpace},_createStops:function(e){var t,n=[];for(e=e||[],t=0;e.length>t;t++)n.push(y.create(e[t]));return n},addStop:function(e,t,n){this.stops.push(new y(e,t,n))},removeStop:function(e){var t=this.stops.indexOf(e);t>=0&&this.stops.splice(t,1)}}),D(k.fn,j,{optionsChange:function(e){this.trigger("optionsChange",{field:"gradient"+(e?"."+e.field:""),value:this})},geometryChange:function(){this.optionsChange()}}),x=k.extend({init:function(e){e=e||{},k.fn.init.call(this,e),this.start(e.start||new E),this.end(e.end||new E(1,0))}}),a(x.fn,["start","end"]),C=k.extend({init:function(e){e=e||{},k.fn.init.call(this,e),this.center(e.center||new E),this._radius=V(e.radius)?e.radius:1,this._fallbackFill=e.fallbackFill},radius:function(e){return V(e)?(this._radius=e,this.geometryChange(),this):this._radius},fallbackFill:function(e){return V(e)?(this._fallbackFill=e,this.optionsChange(),this):this._fallbackFill}}),a(C.fn,["center"]),D(z,{Arc:f,Circle:p,Element:Z,ElementsArray:d,Gradient:k,GradientStop:y,Group:u,Image:w,LinearGradient:x,MultiPath:_,Path:v,RadialGradient:C,Segment:m,Text:h})}(window.kendo.jQuery),function(e){function t(e){var t=[];return e.replace(g,function(e,n){t.push(parseFloat(n))}),t}function n(e,t,n){var i,r=t?0:1;for(i=0;e.length>i;i+=2)e.splice(i+r,0,n)}function i(e,t){return e&&t?t.scaleCopy(2).translate(-e.x,-e.y):void 0}function r(e,t,n){var i=1/3;return t=t.clone().scale(2/3),{controlOut:t.clone().translateWith(e.scaleCopy(i)),controlIn:t.translateWith(n.scaleCopy(i))}}var o=window.kendo,a=o.drawing,s=o.geometry,l=o.Class,c=s.Point,d=o.deepExtend,u=e.trim,h=o.util,p=h.last,f=/([a-z]{1})([^a-z]*)(z)?/gi,g=/[,\s]?(-?(?:\d+\.)?\d+)/g,m="m",v="z",_=l.extend({parse:function(e,n){var i,r=new a.MultiPath(n),o=new c;return e.replace(f,function(e,n,a,s){var l=n.toLowerCase(),c=l===n,d=t(u(a));if(l===m&&(c?(o.x+=d[0],o.y+=d[1]):(o.x=d[0],o.y=d[1]),r.moveTo(o.x,o.y),d.length>2&&(l="l",d.splice(0,2))),w[l])w[l](r,{parameters:d,position:o,isRelative:c,previousCommand:i}),s&&s.toLowerCase()===v&&r.close();else if(l!==m)throw Error("Error while parsing SVG path. Unsupported command: "+l);i=l}),r}}),w={l:function(e,t){var n,i,r=t.parameters,o=t.position;for(n=0;r.length>n;n+=2)i=new c(r[n],r[n+1]),t.isRelative&&i.translateWith(o),e.lineTo(i.x,i.y),o.x=i.x,o.y=i.y},c:function(e,t){var n,i,r,o,a=t.parameters,s=t.position;for(o=0;a.length>o;o+=6)n=new c(a[o],a[o+1]),i=new c(a[o+2],a[o+3]),r=new c(a[o+4],a[o+5]),t.isRelative&&(i.translateWith(s),n.translateWith(s),r.translateWith(s)),e.curveTo(n,i,r),s.x=r.x,s.y=r.y},v:function(e,t){var i=t.isRelative?0:t.position.x;n(t.parameters,!0,i),this.l(e,t)},h:function(e,t){var i=t.isRelative?0:t.position.y;n(t.parameters,!1,i),this.l(e,t)},a:function(e,t){var n,i,r,o,a,s,l=t.parameters,d=t.position;for(n=0;l.length>n;n+=7)i=l[n],r=l[n+1],o=l[n+3],a=l[n+4],s=new c(l[n+5],l[n+6]),t.isRelative&&s.translateWith(d),e.arcTo(s,i,r,o,a),d.x=s.x,d.y=s.y},s:function(e,t){var n,r,o,a,s,l=t.parameters,d=t.position,u=t.previousCommand;for(("s"==u||"c"==u)&&(a=p(p(e.paths).segments).controlIn()),s=0;l.length>s;s+=4)o=new c(l[s],l[s+1]),r=new c(l[s+2],l[s+3]),t.isRelative&&(o.translateWith(d),r.translateWith(d)),n=a?i(a,d):d.clone(),a=o,e.curveTo(n,o,r),d.x=r.x,d.y=r.y},q:function(e,t){var n,i,o,a,s=t.parameters,l=t.position;for(a=0;s.length>a;a+=4)o=new c(s[a],s[a+1]),i=new c(s[a+2],s[a+3]),t.isRelative&&(o.translateWith(l),i.translateWith(l)),n=r(l,o,i),e.curveTo(n.controlOut,n.controlIn,i),l.x=i.x,l.y=i.y},t:function(e,t){var n,o,a,s,l,d=t.parameters,u=t.position,h=t.previousCommand;for(("q"==h||"t"==h)&&(s=p(p(e.paths).segments),o=s.controlIn().clone().translateWith(u.scaleCopy(-1/3)).scale(1.5)),l=0;d.length>l;l+=2)a=new c(d[l],d[l+1]),t.isRelative&&a.translateWith(u),o=o?i(o,u):u.clone(),n=r(u,o,a),e.curveTo(n.controlOut,n.controlIn,a),u.x=a.x,u.y=a.y}};_.current=new _,a.Path.parse=function(e,t){return _.current.parse(e,t)},d(a,{PathParser:_})}(window.kendo.jQuery),function(e){function t(e){var t,n,i,r;try{t=e.getScreenCTM?e.getScreenCTM():null}catch(o){}t&&(n=-t.e%1,i=-t.f%1,r=e.style,(0!==n||0!==i)&&(r.left=n+"px",r.top=i+"px"))}function n(){var e=document.getElementsByTagName("base")[0],t="",n=document.location.href,i=n.indexOf("#");return e&&!d.support.browser.msie&&(-1!==i&&(n=n.substring(0,i)),t=n),t}function i(e){return"url("+n()+"#"+e+")"}function r(e){var t,n,i,r=new z({encodeText:!0}),o=e.clippedBBox();return o&&(t=o.getOrigin(),n=new p.Group,n.transform(h.transform().translate(-t.x,-t.y)),n.children.push(e),e=n),r.load([e]),i="<?xml version='1.0' ?><svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+E+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+r.render()+"</svg>",r.destroy(),i}function o(t,n){var i=r(t);return n&&n.raw||(i="data:image/svg+xml;base64,"+g.encodeBase64(i)),e.Deferred().resolve(i).promise()}function a(e,t){return"clip"==e||"fill"==e&&(!t||t.nodeType==C)}function s(e){if(!e||!e.indexOf||e.indexOf("&")<0)return e;var t=s._element;return t.innerHTML=e,t.textContent||t.innerText}var l,c=document,d=window.kendo,u=d.deepExtend,h=d.geometry,p=d.drawing,f=p.BaseNode,g=d.util,m=g.defined,v=g.isTransparent,_=g.renderAttr,w=g.renderAllAttr,y=g.renderTemplate,b=e.inArray,k="butt",x=p.DASH_ARRAYS,C="gradient",S="none",T=".kendo",D="solid",A=" ",E="http://www.w3.org/2000/svg",I="transform",P="undefined",M=p.Surface.extend({init:function(e,n){p.Surface.fn.init.call(this,e,n),this._root=new z(this.options),Q(this.element[0],this._template(this)),this._rootElement=this.element[0].firstElementChild,t(this._rootElement),this._root.attachTo(this._rootElement),this.element.on("click"+T,this._click),this.element.on("mouseover"+T,this._mouseenter),this.element.on("mouseout"+T,this._mouseleave),this.resize()},type:"svg",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,this.element.off(T)),p.Surface.fn.destroy.call(this)},translate:function(e){var t=d.format("{0} {1} {2} {3}",Math.round(e.x),Math.round(e.y),this._size.width,this._size.height);this._offset=e,this._rootElement.setAttribute("viewBox",t)},draw:function(e){this._root.load([e])},clear:function(){this._root.clear()},svg:function(){return"<?xml version='1.0' ?>"+this._template(this)},_resize:function(){this._offset&&this.translate(this._offset)},_template:y("<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+E+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>#= d._root.render() #</svg>")}),F=f.extend({init:function(e){f.fn.init.call(this,e),this.definitions={}},destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),this.clearDefinitions(),f.fn.destroy.call(this)},load:function(e,t){var n,i,r,o,a=this,s=a.element;for(o=0;e.length>o;o++)i=e[o],r=i.children,n=new Y[i.nodeType](i),m(t)?a.insertAt(n,t):a.append(n),n.createDefinitions(),r&&r.length>0&&n.load(r),s&&n.attachTo(s,t)},root:function(){for(var e=this;e.parent;)e=e.parent;return e},attachTo:function(e,t){var n,i=c.createElement("div");Q(i,"<svg xmlns='"+E+"' version='1.1'>"+this.render()+"</svg>"),n=i.firstChild.firstChild,n&&(m(t)?e.insertBefore(n,e.childNodes[t]):e.appendChild(n),this.setElement(n))},setElement:function(e){var t,n,i=this.childNodes;for(this.element&&(this.element._kendoNode=null),this.element=e,this.element._kendoNode=this,n=0;i.length>n;n++)t=e.childNodes[n],i[n].setElement(t)},clear:function(){var e,t;for(this.clearDefinitions(),this.element&&(this.element.innerHTML=""),e=this.childNodes,t=0;e.length>t;t++)e[t].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null),f.fn.removeSelf.call(this)},template:y("#= d.renderChildren() #"),render:function(){return this.template(this)},renderChildren:function(){var e,t=this.childNodes,n="";for(e=0;t.length>e;e++)n+=t[e].render();return n},optionsChange:function(e){var t=e.field,n=e.value;"visible"===t?this.css("display",n?"":S):l[t]&&a(t,n)?this.updateDefinition(t,n):"opacity"===t&&this.attr("opacity",n),f.fn.optionsChange.call(this,e)},attr:function(e,t){this.element&&this.element.setAttribute(e,t)},allAttr:function(e){for(var t=0;e.length>t;t++)this.attr(e[t][0],e[t][1])},css:function(e,t){this.element&&(this.element.style[e]=t)},allCss:function(e){for(var t=0;e.length>t;t++)this.css(e[t][0],e[t][1])},removeAttr:function(e){this.element&&this.element.removeAttribute(e)},mapTransform:function(e){var t=[];return e&&t.push([I,"matrix("+e.matrix().toString(6)+")"]),t},renderTransform:function(){return w(this.mapTransform(this.srcElement.transform()))},transformChange:function(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(I)},mapStyle:function(){var e=this.srcElement.options,t=[["cursor",e.cursor]];return e.visible===!1&&t.push(["display",S]),t},renderStyle:function(){return _("style",g.renderStyle(this.mapStyle()))},renderOpacity:function(){return _("opacity",this.srcElement.options.opacity)},createDefinitions:function(){var e,t,n,i,r=this.srcElement,o=this.definitions;if(r){n=r.options;for(t in l)e=n.get(t),e&&a(t,e)&&(o[t]=e,i=!0);i&&this.definitionChange({action:"add",definitions:o})}},definitionChange:function(e){this.parent&&this.parent.definitionChange(e)},updateDefinition:function(e,t){var n=this.definitions,r=n[e],o=l[e],a={};r&&(a[e]=r,this.definitionChange({action:"remove",definitions:a}),delete n[e]),t?(a[e]=t,this.definitionChange({action:"add",definitions:a}),n[e]=t,this.attr(o,i(t.id))):r&&this.removeAttr(o)},clearDefinitions:function(){var e,t=this.definitions;for(e in t){this.definitionChange({action:"remove",definitions:t}),this.definitions={};break}},renderDefinitions:function(){return w(this.mapDefinitions())},mapDefinitions:function(){var e,t=this.definitions,n=[];for(e in t)n.push([l[e],i(t[e].id)]);return n}}),z=F.extend({init:function(e){F.fn.init.call(this),this.options=e,this.defs=new R},attachTo:function(e){this.element=e,this.defs.attachTo(e.firstElementChild)},clear:function(){f.fn.clear.call(this)},template:y("#=d.defs.render()##= d.renderChildren() #"),definitionChange:function(e){this.defs.definitionChange(e)}}),R=F.extend({init:function(){F.fn.init.call(this),this.definitionMap={}},attachTo:function(e){this.element=e},template:y("<defs>#= d.renderChildren()#</defs>"),definitionChange:function(e){var t=e.definitions,n=e.action;"add"==n?this.addDefinitions(t):"remove"==n&&this.removeDefinitions(t)},createDefinition:function(e,t){var n;return"clip"==e?n=B:"fill"==e&&(t instanceof p.LinearGradient?n=G:t instanceof p.RadialGradient&&(n=$)),new n(t)},addDefinitions:function(e){for(var t in e)this.addDefinition(t,e[t])},addDefinition:function(e,t){var n,i=this.definitionMap,r=t.id,o=this.element,a=i[r];a?a.count++:(n=this.createDefinition(e,t),i[r]={element:n,count:1},this.append(n),o&&n.attachTo(this.element))},removeDefinitions:function(e){for(var t in e)this.removeDefinition(e[t])},removeDefinition:function(e){var t=this.definitionMap,n=e.id,i=t[n];i&&(i.count--,0===i.count&&(this.remove(b(i.element,this.childNodes),1),delete t[n]))}}),B=F.extend({init:function(e){F.fn.init.call(this),this.srcElement=e,this.id=e.id,this.load([e])},template:y("<clipPath id='#=d.id#'>#= d.renderChildren()#</clipPath>")}),H=F.extend({template:y("<g#= d.renderTransform() + d.renderStyle() + d.renderOpacity() + d.renderDefinitions()#>#= d.renderChildren() #</g>"),optionsChange:function(e){e.field==I&&this.transformChange(e.value),F.fn.optionsChange.call(this,e)}}),L=F.extend({geometryChange:function(){this.attr("d",this.renderData()),this.invalidate()},optionsChange:function(e){switch(e.field){case"fill":e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:e.value}));break;case"stroke":e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr("stroke");break;case I:this.transformChange(e.value);break;default:var t=this.attributeMap[e.field];t&&this.attr(t,e.value)}F.fn.optionsChange.call(this,e)},attributeMap:{"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},content:function(){this.element&&(this.element.textContent=this.srcElement.content())},renderData:function(){return this.printPath(this.srcElement)},printPath:function(e){var t,n,i,r,o,a=e.segments,s=a.length;if(s>0){for(t=[],o=1;s>o;o++)i=this.segmentType(a[o-1],a[o]),i!==r&&(r=i,t.push(i)),t.push("L"===i?this.printPoints(a[o].anchor()):this.printPoints(a[o-1].controlOut(),a[o].controlIn(),a[o].anchor()));return n="M"+this.printPoints(a[0].anchor())+A+t.join(A),e.options.closed&&(n+="Z"),n}},printPoints:function(){var e,t=arguments,n=t.length,i=[];for(e=0;n>e;e++)i.push(t[e].toString(3));return i.join(A)},segmentType:function(e,t){return e.controlOut()&&t.controlIn()?"C":"L"},mapStroke:function(e){var t=[];return e&&!v(e.color)?(t.push(["stroke",e.color]),t.push(["stroke-width",e.width]),t.push(["stroke-linecap",this.renderLinecap(e)]),t.push(["stroke-linejoin",e.lineJoin]),m(e.opacity)&&t.push(["stroke-opacity",e.opacity]),m(e.dashType)&&t.push(["stroke-dasharray",this.renderDashType(e)])):t.push(["stroke",S]),t},renderStroke:function(){return w(this.mapStroke(this.srcElement.options.stroke))},renderDashType:function(e){var t,n,i,r=e.width||1,o=e.dashType;if(o&&o!=D){for(t=x[o.toLowerCase()],n=[],i=0;t.length>i;i++)n.push(t[i]*r);return n.join(" ")}},renderLinecap:function(e){var t=e.dashType,n=e.lineCap;return t&&t!=D?k:n},mapFill:function(e){var t=[];return e&&e.nodeType==C||(e&&!v(e.color)?(t.push(["fill",e.color]),m(e.opacity)&&t.push(["fill-opacity",e.opacity])):t.push(["fill",S])),t},renderFill:function(){return w(this.mapFill(this.srcElement.options.fill))},template:y("<path #= d.renderStyle() # #= d.renderOpacity() # #= kendo.util.renderAttr('d', d.renderData()) # #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() #></path>")}),N=L.extend({renderData:function(){return this.printPath(this.srcElement.toPath())}}),O=L.extend({renderData:function(){var e,t,n=this.srcElement.paths;if(n.length>0){for(e=[],t=0;n.length>t;t++)e.push(this.printPath(n[t]));return e.join(" ")}}}),V=L.extend({geometryChange:function(){var e=this.center();this.attr("cx",e.x),this.attr("cy",e.y),this.attr("r",this.radius()),this.invalidate()},center:function(){return this.srcElement.geometry().center},radius:function(){return this.srcElement.geometry().radius},template:y("<circle #= d.renderStyle() # #= d.renderOpacity() # cx='#= d.center().x #' cy='#= d.center().y #' r='#= d.radius() #' #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # ></circle>")}),U=L.extend({geometryChange:function(){var e=this.pos();this.attr("x",e.x),this.attr("y",e.y),this.invalidate()},optionsChange:function(e){"font"===e.field?(this.attr("style",g.renderStyle(this.mapStyle())),this.geometryChange()):"content"===e.field&&L.fn.content.call(this,this.srcElement.content()),L.fn.optionsChange.call(this,e)},mapStyle:function(){var e=L.fn.mapStyle.call(this),t=this.srcElement.options.font,n=this.root().options;return n&&n.encodeText&&(t=d.htmlEncode(t)),e.push(["font",t]),e},pos:function(){var e=this.srcElement.position(),t=this.srcElement.measure();return e.clone().setY(e.y+t.baseline)},content:function(){var e=this.srcElement.content(),t=this.root().options;return t&&t.encodeText&&(e=s(e),e=d.htmlEncode(e)),e},template:y("<text #= d.renderStyle() # #= d.renderOpacity() # x='#= this.pos().x #' y='#= this.pos().y #' #= d.renderStroke() # #= d.renderTransform() # #= d.renderDefinitions() # #= d.renderFill() #><tspan>#= d.content() #</tspan></text>")}),W=L.extend({geometryChange:function(){this.allAttr(this.mapPosition()),this.invalidate()},optionsChange:function(e){"src"===e.field&&this.allAttr(this.mapSource()),L.fn.optionsChange.call(this,e)},mapPosition:function(){var e=this.srcElement.rect(),t=e.topLeft();return[["x",t.x],["y",t.y],["width",e.width()+"px"],["height",e.height()+"px"]]},renderPosition:function(){return w(this.mapPosition())},mapSource:function(){return[["xlink:href",this.srcElement.src()]]},renderSource:function(){return w(this.mapSource())},template:y("<image preserveAspectRatio='none' #= d.renderStyle() # #= d.renderTransform()# #= d.renderOpacity() # #= d.renderPosition() # #= d.renderSource() # #= d.renderDefinitions()#></image>")}),j=F.extend({template:y("<stop #=d.renderOffset()# #=d.renderStyle()# />"),renderOffset:function(){return _("offset",this.srcElement.offset())},mapStyle:function(){var e=this.srcElement;return[["stop-color",e.color()],["stop-opacity",e.opacity()]]},optionsChange:function(e){"offset"==e.field?this.attr(e.field,e.value):("color"==e.field||"opacity"==e.field)&&this.css("stop-"+e.field,e.value)}}),q=F.extend({init:function(e){F.fn.init.call(this,e),this.id=e.id,this.loadStops()},loadStops:function(){var e,t,n=this.srcElement,i=n.stops,r=this.element;for(t=0;i.length>t;t++)e=new j(i[t]),this.append(e),r&&e.attachTo(r)},optionsChange:function(e){"gradient.stops"==e.field?(f.fn.clear.call(this),this.loadStops()):e.field==C&&this.allAttr(this.mapCoordinates())},renderCoordinates:function(){return w(this.mapCoordinates())},mapSpace:function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]}}),G=q.extend({template:y("<linearGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</linearGradient>"),mapCoordinates:function(){var e=this.srcElement,t=e.start(),n=e.end(),i=[["x1",t.x],["y1",t.y],["x2",n.x],["y2",n.y],this.mapSpace()];return i}}),$=q.extend({template:y("<radialGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</radialGradient>"),mapCoordinates:function(){var e=this.srcElement,t=e.center(),n=e.radius(),i=[["cx",t.x],["cy",t.y],["r",n],this.mapSpace()];
16
+ return i}}),Y={Group:H,Text:U,Path:L,MultiPath:O,Circle:V,Arc:N,Image:W},Q=function(e,t){e.innerHTML=t};!function(){var e="<svg xmlns='"+E+"'></svg>",t=c.createElement("div"),n=typeof DOMParser!=P;t.innerHTML=e,n&&t.firstChild.namespaceURI!=E&&(Q=function(e,t){var n=new DOMParser,i=n.parseFromString(t,"text/xml"),r=c.adoptNode(i.documentElement);e.innerHTML="",e.appendChild(r)})}(),s._element=document.createElement("span"),l={clip:"clip-path",fill:"fill"},d.support.svg=function(){return c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),d.support.svg&&p.SurfaceFactory.current.register("svg",M,10),u(p,{exportSVG:o,svg:{ArcNode:N,CircleNode:V,ClipNode:B,DefinitionNode:R,GradientStopNode:j,GroupNode:H,ImageNode:W,LinearGradientNode:G,MultiPathNode:O,Node:F,PathNode:L,RadialGradientNode:$,RootNode:z,Surface:M,TextNode:U,_exportGroup:r}})}(window.kendo.jQuery),function(e){function t(t,n){var i,r,o,a,s,l,c={width:"800px",height:"600px",cors:"Anonymous"},d=t.clippedBBox();return d&&(i=d.getOrigin(),r=new y.Group,r.transform(w.transform().translate(-i.x,-i.y)),r.children.push(t),t=r,o=d.getSize(),c.width=o.width+"px",c.height=o.height+"px"),n=p(c,n),a=e("<div />").css({display:"none",width:n.width,height:n.height}).appendTo(document.body),s=new T(a,n),s.draw(t),l=s.image(),l.always(function(){s.destroy(),a.remove()}),l}function n(e,t){var n,i,r;for(r=0;t.length>r;r++)i=t[r],n=h.parseColor(i.color()),n.a*=i.opacity(),e.addColorStop(i.offset(),n.toCssRgba())}var i,r,o,a,s,l,c,d,u=document,h=window.kendo,p=h.deepExtend,f=h.util,g=f.defined,m=f.isTransparent,v=f.renderTemplate,_=f.valueOrDefault,w=h.geometry,y=h.drawing,b=y.BaseNode,k="butt",x=y.DASH_ARRAYS,C=1e3/60,S="solid",T=y.Surface.extend({init:function(t,n){y.Surface.fn.init.call(this,t,n),this.element[0].innerHTML=this._template(this);var r=this.element[0].firstElementChild;r.width=e(t).width(),r.height=e(t).height(),this._rootElement=r,this._root=new i(r)},destroy:function(){y.Surface.fn.destroy.call(this),this._root&&(this._root.destroy(),this._root=null)},type:"canvas",draw:function(e){this._root.load([e],void 0,this.options.cors)},clear:function(){this._root.clear()},image:function(){var t,n=this._root,i=this._rootElement,r=[];return n.traverse(function(e){e.loading&&r.push(e.loading)}),t=e.Deferred(),e.when.apply(e,r).done(function(){n._invalidate();try{var e=i.toDataURL();t.resolve(e)}catch(r){t.reject(r)}}).fail(function(e){t.reject(e)}),t.promise()},_resize:function(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.invalidate()},_template:v("<canvas style='width: 100%; height: 100%;'></canvas>")}),D=b.extend({init:function(e){b.fn.init.call(this,e),e&&this.initClip()},initClip:function(){var e=this.srcElement.clip();e&&(this.clip=e,e.addObserver(this))},clear:function(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),b.fn.clear.call(this)},clearClip:function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},setClip:function(e){this.clip&&(e.beginPath(),r.fn.renderPoints(e,this.clip),e.clip())},optionsChange:function(e){"clip"==e.field&&(this.clearClip(),this.initClip()),b.fn.optionsChange.call(this,e)},setTransform:function(e){if(this.srcElement){var t=this.srcElement.transform();t&&e.transform.apply(e,t.matrix().toArray(6))}},load:function(e,t,n){var i,r,o,a,s=this;for(a=0;e.length>a;a++)r=e[a],o=r.children,i=new d[r.nodeType](r,n),o&&o.length>0&&i.load(o,t,n),g(t)?s.insertAt(i,t):s.append(i);s.invalidate()},setOpacity:function(e){if(this.srcElement){var t=this.srcElement.opacity();g(t)&&this.globalAlpha(e,t)}},globalAlpha:function(e,t){t&&e.globalAlpha&&(t*=e.globalAlpha),e.globalAlpha=t}}),A=D.extend({renderTo:function(e){var t,n=this.childNodes;for(e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),t=0;n.length>t;t++)n[t].renderTo(e);e.restore()}});y.mixins.Traversable.extend(A.fn,"childNodes"),i=A.extend({init:function(t){A.fn.init.call(this),this.canvas=t,this.ctx=t.getContext("2d"),this.invalidate=h.throttle(e.proxy(this._invalidate,this),C)},destroy:function(){A.fn.destroy.call(this),this.canvas=null,this.ctx=null},_invalidate:function(){this.ctx&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx))}}),y.mixins.Traversable.extend(i.fn,"childNodes"),r=D.extend({renderTo:function(e){e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),this.renderPoints(e,this.srcElement),this.setLineDash(e),this.setLineCap(e),this.setLineJoin(e),this.setFill(e),this.setStroke(e),e.restore()},setFill:function(e){var t=this.srcElement.options.fill,n=!1;return t&&("gradient"==t.nodeType?(this.setGradientFill(e,t),n=!0):m(t.color)||(e.fillStyle=t.color,e.save(),this.globalAlpha(e,t.opacity),e.fill(),e.restore(),n=!0)),n},setGradientFill:function(e,t){var i,r,o,a,s=this.srcElement.rawBBox();t instanceof y.LinearGradient?(r=t.start(),o=t.end(),i=e.createLinearGradient(r.x,r.y,o.x,o.y)):t instanceof y.RadialGradient&&(a=t.center(),i=e.createRadialGradient(a.x,a.y,0,a.x,a.y,t.radius())),n(i,t.stops),e.save(),t.userSpace()||e.transform(s.width(),0,0,s.height(),s.origin.x,s.origin.y),e.fillStyle=i,e.fill(),e.restore()},setStroke:function(e){var t=this.srcElement.options.stroke;return t&&!m(t.color)?(e.strokeStyle=t.color,e.lineWidth=_(t.width,1),e.save(),this.globalAlpha(e,t.opacity),e.stroke(),e.restore(),!0):void 0},dashType:function(){var e=this.srcElement.options.stroke;return e&&e.dashType?e.dashType.toLowerCase():void 0},setLineDash:function(e){var t,n=this.dashType();n&&n!=S&&(t=x[n],e.setLineDash?e.setLineDash(t):(e.mozDash=t,e.webkitLineDash=t))},setLineCap:function(e){var t=this.dashType(),n=this.srcElement.options.stroke;t&&t!==S?e.lineCap=k:n&&n.lineCap&&(e.lineCap=n.lineCap)},setLineJoin:function(e){var t=this.srcElement.options.stroke;t&&t.lineJoin&&(e.lineJoin=t.lineJoin)},renderPoints:function(e,t){var n,i,r,o,a,s,l=t.segments;if(0!==l.length){for(n=l[0],i=n.anchor(),e.moveTo(i.x,i.y),r=1;l.length>r;r++)n=l[r],i=n.anchor(),o=l[r-1],a=o.controlOut(),s=n.controlIn(),a&&s?e.bezierCurveTo(a.x,a.y,s.x,s.y,i.x,i.y):e.lineTo(i.x,i.y);t.options.closed&&e.closePath()}}}),o=r.extend({renderPoints:function(e){var t,n=this.srcElement.paths;for(t=0;n.length>t;t++)r.fn.renderPoints(e,n[t])}}),a=r.extend({renderPoints:function(e){var t=this.srcElement.geometry(),n=t.center,i=t.radius;e.arc(n.x,n.y,i,0,2*Math.PI)}}),s=r.extend({renderPoints:function(e){var t=this.srcElement.toPath();r.fn.renderPoints.call(this,e,t)}}),l=r.extend({renderTo:function(e){var t=this.srcElement,n=t.position(),i=t.measure();e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),e.font=t.options.font,this.setFill(e)&&e.fillText(t.content(),n.x,n.y+i.baseline),this.setStroke(e)&&(this.setLineDash(e),e.strokeText(t.content(),n.x,n.y+i.baseline)),e.restore()}}),c=r.extend({init:function(t,n){var i,o;r.fn.init.call(this,t),this.onLoad=e.proxy(this.onLoad,this),this.onError=e.proxy(this.onError,this),i=this.img=new Image,n&&(i.crossOrigin=n),i.onload=this.onLoad,i.onerror=this.onError,o=i.src=t.src(),(i.complete||void 0===i.complete)&&(i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",i.src=o),this.loading=e.Deferred()},renderTo:function(e){"resolved"===this.loading.state()&&(e.save(),this.setTransform(e),this.setClip(e),this.drawImage(e),e.restore())},optionsChange:function(t){"src"===t.field?(this.loading=e.Deferred(),this.img.src=this.srcElement.src()):r.fn.optionsChange.call(this,t)},onLoad:function(){this.loading.resolve(),this.invalidate()},onError:function(){this.loading.reject(Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},drawImage:function(e){var t=this.srcElement.rect(),n=t.topLeft();e.drawImage(this.img,n.x,n.y,t.width(),t.height())}}),d={Group:A,Text:l,Path:r,MultiPath:o,Circle:a,Arc:s,Image:c},h.support.canvas=function(){return!!u.createElement("canvas").getContext}(),h.support.canvas&&y.SurfaceFactory.current.register("canvas",T,20),p(h.drawing,{exportImage:t,canvas:{ArcNode:s,CircleNode:a,GroupNode:A,ImageNode:c,MultiPathNode:o,Node:D,PathNode:r,RootNode:i,Surface:T,TextNode:l}})}(window.kendo.jQuery),function(e){function t(){if(u.namespaces&&!u.namespaces.kvml){u.namespaces.add("kvml","urn:schemas-microsoft-com:vml");var e=u.styleSheets.length>30?u.styleSheets[0]:u.createStyleSheet();e.addRule(".kvml","behavior:url(#default#VML)")}}function n(e){var t=u.createElement("kvml:"+e);return t.className="kvml",t}function i(e){var t,n=e.length,i=[];for(t=0;n>t;t++)i.push(e[t].scaleCopy(P).toString(0,","));return i.join(" ")}function r(e,t){var n,r,a,s,l,c=e.segments,d=c.length;if(d>0){for(n=[],l=1;d>l;l++)a=o(c[l-1],c[l]),a!==s&&(s=a,n.push(a)),n.push("l"===a?i([c[l].anchor()]):i([c[l-1].controlOut(),c[l].controlIn(),c[l].anchor()]));return r="m "+i([c[0].anchor()])+" "+n.join(" "),e.options.closed&&(r+=" x"),t!==!0&&(r+=" e"),r}}function o(e,t){return e.controlOut()&&t.controlIn()?"c":"l"}function a(e){return 0===e.indexOf("fill")||0===e.indexOf(F)}function s(e,t){var n;return n=e?l(e,t.color(),t.opacity()):l(t.color(),"#fff",1-t.opacity())}function l(e,t,n){var i=new k(e),r=new k(t),o=c(i.r,r.r,n),a=c(i.g,r.g,n),s=c(i.b,r.b,n);return new k(o,a,s).toHex()}function c(e,t,n){return h.round(n*t+(1-n)*e)}var d,u=document,h=Math,p=h.atan2,f=h.sqrt,g=window.kendo,m=g.deepExtend,v=e.noop,_=g.drawing,w=_.BaseNode,y=g.geometry,b=y.toMatrix,k=g.Color,x=g.util,C=x.isTransparent,S=x.defined,T=x.deg,D=x.round,A=x.valueOrDefault,E="none",I=".kendo",P=100,M=P*P,F="gradient",z=4,R=_.Surface.extend({init:function(e,n){_.Surface.fn.init.call(this,e,n),t(),this.element.empty(),this._root=new H,this._root.attachTo(this.element[0]),this.element.on("click"+I,this._click),this.element.on("mouseover"+I,this._mouseenter),this.element.on("mouseout"+I,this._mouseleave)},type:"vml",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this.element.off(I)),_.Surface.fn.destroy.call(this)},draw:function(e){this._root.load([e],void 0,null)},clear:function(){this._root.clear()}}),B=w.extend({init:function(e){w.fn.init.call(this,e),this.createElement(),this.attachReference()},observe:v,destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),w.fn.destroy.call(this)},clear:function(){var e,t;for(this.element&&(this.element.innerHTML=""),e=this.childNodes,t=0;e.length>t;t++)e[t].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null),w.fn.removeSelf.call(this)},createElement:function(){this.element=u.createElement("div")},attachReference:function(){this.element._kendoNode=this},load:function(e,t,n,i){var r,o,a,s,l,c;for(i=A(i,1),this.srcElement&&(i*=A(this.srcElement.options.opacity,1)),r=0;e.length>r;r++)o=e[r],a=o.children,s=o.currentTransform(n),l=i*A(o.options.opacity,1),c=new ot[o.nodeType](o,s,l),a&&a.length>0&&c.load(a,t,s,i),S(t)?this.insertAt(c,t):this.append(c),c.attachTo(this.element,t)},attachTo:function(e,t){S(t)?e.insertBefore(this.element,e.children[t]||null):e.appendChild(this.element)},optionsChange:function(e){"visible"==e.field&&this.css("display",e.value!==!1?"":E)},setStyle:function(){this.allCss(this.mapStyle())},mapStyle:function(){var e=[];return this.srcElement&&this.srcElement.options.visible===!1&&e.push(["display",E]),e},mapOpacityTo:function(e,t){var n=A(this.opacity,1);n*=A(t,1),e.push(["opacity",n])},attr:function(e,t){this.element&&(this.element[e]=t)},allAttr:function(e){for(var t=0;e.length>t;t++)this.attr(e[t][0],e[t][1])},css:function(e,t){this.element&&(this.element.style[e]=t)},allCss:function(e){for(var t=0;e.length>t;t++)this.css(e[t][0],e[t][1])}}),H=B.extend({createElement:function(){B.fn.createElement.call(this),this.allCss([["width","100%"],["height","100%"],["position","relative"],["visibility","visible"]])},attachReference:v}),L=g.Class.extend({init:function(e,t){this.srcElement=e,this.observer=t,e.addObserver(this)},geometryChange:function(){this.observer.optionsChange({field:"clip",value:this.srcElement})},clear:function(){this.srcElement.removeObserver(this)}}),N=B.extend({init:function(e){B.fn.init.call(this,e),e&&this.initClip()},observe:function(){w.fn.observe.call(this)},mapStyle:function(){var e=B.fn.mapStyle.call(this);return this.srcElement&&this.srcElement.clip()&&e.push(["clip",this.clipRect()]),e},optionsChange:function(e){"clip"==e.field&&(this.clearClip(),this.initClip(),this.setClip()),B.fn.optionsChange.call(this,e)},clear:function(){this.clearClip(),B.fn.clear.call(this)},initClip:function(){this.srcElement.clip()&&(this.clip=new L(this.srcElement.clip(),this),this.clip.observer=this)},clearClip:function(){this.clip&&(this.clip.clear(),this.clip=null,this.css("clip",this.clipRect()))},setClip:function(){this.clip&&this.css("clip",this.clipRect())},clipRect:function(){var e,t,n,i=d,r=this.srcElement.clip();return r&&(e=this.clipBBox(r),t=e.topLeft(),n=e.bottomRight(),i=g.format("rect({0}px {1}px {2}px {3}px)",t.y,n.x,n.y,t.x)),i},clipBBox:function(e){var t=this.srcElement.rawBBox().topLeft(),n=e.rawBBox();return n.origin.translate(-t.x,-t.y),n}}),O=N.extend({createElement:function(){B.fn.createElement.call(this),this.setStyle()},attachTo:function(e,t){this.css("display",E),B.fn.attachTo.call(this,e,t),this.srcElement.options.visible!==!1&&this.css("display","")},_attachTo:function(e){var t=document.createDocumentFragment();t.appendChild(this.element),e.appendChild(t)},mapStyle:function(){var e=N.fn.mapStyle.call(this);return e.push(["position","absolute"]),e.push(["white-space","nowrap"]),e},optionsChange:function(e){"transform"===e.field&&this.refreshTransform(),"opacity"===e.field&&this.refreshOpacity(),N.fn.optionsChange.call(this,e)},refreshTransform:function(e){var t,n=this.srcElement.currentTransform(e),i=this.childNodes,r=i.length;for(this.setClip(),t=0;r>t;t++)i[t].refreshTransform(n)},currentOpacity:function(){var e=A(this.srcElement.options.opacity,1);return this.parent&&this.parent.currentOpacity&&(e*=this.parent.currentOpacity()),e},refreshOpacity:function(){var e,t=this.childNodes,n=t.length,i=this.currentOpacity();for(e=0;n>e;e++)t[e].refreshOpacity(i)},initClip:function(){if(N.fn.initClip.call(this),this.clip){var e=this.clip.srcElement.bbox(this.srcElement.currentTransform());e&&(this.css("width",e.width()+e.origin.x),this.css("height",e.height()+e.origin.y))}},clipBBox:function(e){return e.bbox(this.srcElement.currentTransform())},clearClip:function(){N.fn.clearClip.call(this)}}),V=B.extend({init:function(e,t){this.opacity=t,B.fn.init.call(this,e)},createElement:function(){this.element=n("stroke"),this.setOpacity()},optionsChange:function(e){0===e.field.indexOf("stroke")&&this.setStroke()},refreshOpacity:function(e){this.opacity=e,this.setStroke()},setStroke:function(){this.allAttr(this.mapStroke())},setOpacity:function(){this.setStroke()},mapStroke:function(){var e,t=this.srcElement.options.stroke,n=[];return t&&!C(t.color)&&0!==t.width?(n.push(["on","true"]),n.push(["color",t.color]),n.push(["weight",(t.width||1)+"px"]),this.mapOpacityTo(n,t.opacity),S(t.dashType)&&n.push(["dashstyle",t.dashType]),S(t.lineJoin)&&n.push(["joinstyle",t.lineJoin]),S(t.lineCap)&&(e=t.lineCap.toLowerCase(),"butt"===e&&(e="butt"===e?"flat":e),n.push(["endcap",e]))):n.push(["on","false"]),n}}),U=B.extend({init:function(e,t,n){this.opacity=n,B.fn.init.call(this,e)},createElement:function(){this.element=n("fill"),this.setFill()},optionsChange:function(e){a(e.field)&&this.setFill()},refreshOpacity:function(e){this.opacity=e,this.setOpacity()},setFill:function(){this.allAttr(this.mapFill())},setOpacity:function(){this.setFill()},attr:function(e,t){var n,i=this.element;if(i){for(n=e.split(".");n.length>1;)i=i[n.shift()];i[n[0]]=t}},mapFill:function(){var e=this.srcElement.fill(),t=[["on","false"]];return e&&(e.nodeType==F?t=this.mapGradient(e):C(e.color)||(t=this.mapFillColor(e))),t},mapFillColor:function(e){var t=[["on","true"],["color",e.color]];return this.mapOpacityTo(t,e.opacity),t},mapGradient:function(e){var t,n=this.srcElement.options,i=n.fallbackFill||e.fallbackFill&&e.fallbackFill();return t=e instanceof _.LinearGradient?this.mapLinearGradient(e):e instanceof _.RadialGradient&&e.supportVML?this.mapRadialGradient(e):i?this.mapFillColor(i):[["on","false"]]},mapLinearGradient:function(e){var t=e.start(),n=e.end(),i=x.deg(p(n.y-t.y,n.x-t.x)),r=[["on","true"],["type",F],["focus",0],["method","none"],["angle",270-i]];return this.addColors(r),r},mapRadialGradient:function(e){var t=this.srcElement.rawBBox(),n=e.center(),i=(n.x-t.origin.x)/t.width(),r=(n.y-t.origin.y)/t.height(),o=[["on","true"],["type","gradienttitle"],["focus","100%"],["focusposition",i+" "+r],["method","none"]];return this.addColors(o),o},addColors:function(e){var t,n,i=this.srcElement.options,r=[],o=i.fill.stops,a=i.baseColor,l=this.element.colors?"colors.value":"colors",c=s(a,o[0]),d=s(a,o[o.length-1]);for(n=0;o.length>n;n++)t=o[n],r.push(h.round(100*t.offset())+"% "+s(a,t));e.push([l,r.join(",")],["color",c],["color2",d])}}),W=B.extend({init:function(e,t){this.transform=t,B.fn.init.call(this,e)},createElement:function(){this.element=n("skew"),this.setTransform()},optionsChange:function(e){"transform"===e.field&&this.refresh(this.srcElement.currentTransform())},refresh:function(e){this.transform=e,this.setTransform()},transformOrigin:function(){return"-0.5,-0.5"},setTransform:function(){this.allAttr(this.mapTransform())},mapTransform:function(){var e=this.transform,t=[],n=b(e);return n?(n.round(z),t.push(["on","true"],["matrix",[n.a,n.c,n.b,n.d,0,0].join(",")],["offset",n.e+"px,"+n.f+"px"],["origin",this.transformOrigin()])):t.push(["on","false"]),t}}),j=N.extend({init:function(e,t,n){this.fill=this.createFillNode(e,t,n),this.stroke=new V(e,n),this.transform=this.createTransformNode(e,t),N.fn.init.call(this,e)},attachTo:function(e,t){this.fill.attachTo(this.element),this.stroke.attachTo(this.element),this.transform.attachTo(this.element),B.fn.attachTo.call(this,e,t)},createFillNode:function(e,t,n){return new U(e,t,n)},createTransformNode:function(e,t){return new W(e,t)},createElement:function(){this.element=n("shape"),this.setCoordsize(),this.setStyle()},optionsChange:function(e){a(e.field)?this.fill.optionsChange(e):0===e.field.indexOf("stroke")?this.stroke.optionsChange(e):"transform"===e.field?this.transform.optionsChange(e):"opacity"===e.field&&(this.fill.setOpacity(),this.stroke.setOpacity()),N.fn.optionsChange.call(this,e)},refreshTransform:function(e){this.transform.refresh(this.srcElement.currentTransform(e))},refreshOpacity:function(e){e*=A(this.srcElement.options.opacity,1),this.fill.refreshOpacity(e),this.stroke.refreshOpacity(e)},mapStyle:function(e,t){var n,i=N.fn.mapStyle.call(this);return e&&t||(e=t=P),i.push(["position","absolute"],["width",e+"px"],["height",t+"px"]),n=this.srcElement.options.cursor,n&&i.push(["cursor",n]),i},setCoordsize:function(){this.allAttr([["coordorigin","0 0"],["coordsize",M+" "+M]])}}),q=B.extend({createElement:function(){this.element=n("path"),this.setPathData()},geometryChange:function(){this.setPathData()},setPathData:function(){this.attr("v",this.renderData())},renderData:function(){return r(this.srcElement)}}),G=j.extend({init:function(e,t,n){this.pathData=this.createDataNode(e),j.fn.init.call(this,e,t,n)},attachTo:function(e,t){this.pathData.attachTo(this.element),j.fn.attachTo.call(this,e,t)},createDataNode:function(e){return new q(e)},geometryChange:function(){this.pathData.geometryChange(),j.fn.geometryChange.call(this)}}),$=q.extend({renderData:function(){var e,t,n,i=this.srcElement.paths;if(i.length>0){for(e=[],t=0;i.length>t;t++)n=i.length-1>t,e.push(r(i[t],n));return e.join(" ")}}}),Y=G.extend({createDataNode:function(e){return new $(e)}}),Q=W.extend({transformOrigin:function(){var e=this.srcElement.geometry().bbox(),t=e.center(),n=-t.x/e.width(),i=-t.y/e.height();return n+","+i}}),K=j.extend({createElement:function(){this.element=n("oval"),this.setStyle()},createTransformNode:function(e,t){return new Q(e,t)},geometryChange:function(){j.fn.geometryChange.call(this),this.setStyle(),this.refreshTransform()},mapStyle:function(){var e=this.srcElement.geometry(),t=e.radius,n=e.center,i=2*t,r=j.fn.mapStyle.call(this,i,i);return r.push(["left",n.x-t+"px"],["top",n.y-t+"px"]),r}}),X=q.extend({renderData:function(){return r(this.srcElement.toPath())}}),Z=G.extend({createDataNode:function(e){return new X(e)}}),J=q.extend({createElement:function(){q.fn.createElement.call(this),this.attr("textpathok",!0)},renderData:function(){var e=this.srcElement.rect(),t=e.center();return"m "+i([new y.Point(e.topLeft().x,t.y)])+" l "+i([new y.Point(e.bottomRight().x,t.y)])}}),et=B.extend({createElement:function(){this.element=n("textpath"),this.attr("on",!0),this.attr("fitpath",!1),this.setStyle(),this.setString()},optionsChange:function(e){"content"===e.field?this.setString():this.setStyle(),B.fn.optionsChange.call(this,e)},mapStyle:function(){return[["font",this.srcElement.options.font]]},setString:function(){this.attr("string",this.srcElement.content())}}),tt=G.extend({init:function(e,t,n){this.path=new et(e),G.fn.init.call(this,e,t,n)},createDataNode:function(e){return new J(e)},attachTo:function(e,t){this.path.attachTo(this.element),G.fn.attachTo.call(this,e,t)},optionsChange:function(e){("font"===e.field||"content"===e.field)&&(this.path.optionsChange(e),this.pathData.geometryChange(e)),G.fn.optionsChange.call(this,e)}}),nt=q.extend({renderData:function(){var e=this.srcElement.rect(),t=(new _.Path).moveTo(e.topLeft()).lineTo(e.topRight()).lineTo(e.bottomRight()).lineTo(e.bottomLeft()).close();return r(t)}}),it=W.extend({init:function(e,t,n){this.opacity=n,W.fn.init.call(this,e,t)},createElement:function(){this.element=n("fill"),this.attr("type","frame"),this.attr("rotate",!0),this.setOpacity(),this.setSrc(),this.setTransform()},optionsChange:function(e){"src"===e.field&&this.setSrc(),W.fn.optionsChange.call(this,e)},geometryChange:function(){this.refresh()},refreshOpacity:function(e){this.opacity=e,this.setOpacity()},setOpacity:function(){var e=[];this.mapOpacityTo(e,this.srcElement.options.opacity),this.allAttr(e)},setSrc:function(){this.attr("src",this.srcElement.src())},mapTransform:function(){var e,t,n,i,r,o,a,s,l=this.srcElement,c=l.rawBBox(),d=c.center(),u=P/2,h=P,g=c.width()/h,m=c.height()/h,v=0,_=this.transform;return _?(n=b(_),i=f(n.a*n.a+n.b*n.b),r=f(n.c*n.c+n.d*n.d),g*=i,m*=r,o=T(p(n.b,n.d)),a=T(p(-n.c,n.a)),v=(o+a)/2,0!==v?(s=l.bbox().center(),e=(s.x-u)/h,t=(s.y-u)/h):(e=(d.x*i+n.e-u)/h,t=(d.y*r+n.f-u)/h)):(e=(d.x-u)/h,t=(d.y-u)/h),g=D(g,z),m=D(m,z),e=D(e,z),t=D(t,z),v=D(v,z),[["size",g+","+m],["position",e+","+t],["angle",v]]}}),rt=G.extend({createFillNode:function(e,t,n){return new it(e,t,n)},createDataNode:function(e){return new nt(e)},optionsChange:function(e){("src"===e.field||"transform"===e.field)&&this.fill.optionsChange(e),G.fn.optionsChange.call(this,e)},geometryChange:function(){this.fill.geometryChange(),G.fn.geometryChange.call(this)},refreshTransform:function(e){G.fn.refreshTransform.call(this,e),this.fill.refresh(this.srcElement.currentTransform(e))}}),ot={Group:O,Text:tt,Path:G,MultiPath:Y,Circle:K,Arc:Z,Image:rt};g.support.vml=function(){var e=g.support.browser;return e.msie&&9>e.version}(),d="inherit",g.support.browser.msie&&8>g.support.browser.version&&(d="rect(auto auto auto auto)"),g.support.vml&&_.SurfaceFactory.current.register("vml",R,30),m(_,{vml:{ArcDataNode:X,ArcNode:Z,CircleTransformNode:Q,CircleNode:K,FillNode:U,GroupNode:O,ImageNode:rt,ImageFillNode:it,ImagePathDataNode:nt,MultiPathDataNode:$,MultiPathNode:Y,Node:B,PathDataNode:q,PathNode:G,RootNode:H,StrokeNode:V,Surface:R,TextNode:tt,TextPathNode:et,TextPathDataNode:J,TransformNode:W}})}(window.kendo.jQuery),function(e,t,n){"use strict";function i(){function e(){var t,r,o;for(t=0;arguments.length>t;++t){if(r=arguments[t],r===n)throw Error("Cannot output undefined to PDF");if(r instanceof y)r.beforeRender(e),r.render(e);else if(z(r))f(r,e);else if(p(r))g(r,e);else if("number"==typeof r){if(isNaN(r))throw Error("Cannot output NaN to PDF");o=r.toFixed(7),o.indexOf(".")>=0&&(o=o.replace(/\.?0+$/,"")),"-0"==o&&(o="0"),i.writeString(o)}else/string|boolean/.test(typeof r)?i.writeString(r+""):"function"==typeof r.get?i.write(r.get()):"object"==typeof r&&(r?e(new N(r)):i.writeString("null"))}}var t=0,i=D();return e.writeData=function(e){i.write(e)},e.withIndent=function(n){++t,n(e),--t},e.indent=function(){e(K,d("",2*t," ")),e.apply(null,arguments)},e.offset=function(){return i.offset()},e.toString=function(){throw Error("FIX CALLER")},e.get=function(){return i.get()},e.stream=function(){return i},e}function r(e,t){var n=e.beforeRender,i=e.render;e.beforeRender=function(){},e.render=function(e){e(t," 0 R")},e.renderFull=function(r){e._offset=r.offset(),r(t," 0 obj "),n.call(e,r),i.call(e,r),r(" endobj")}}function o(e){function t(t,n){return e&&null!=e[t]?e[t]:n}var n,o,a,s,l,c,d=this,h=i(),p=0,f=[];if(d.getOption=t,d.attach=function(e){return f.indexOf(e)<0&&(r(e,++p),f.push(e)),e},d.FONTS={},d.IMAGES={},n=t("paperSize",J.a4),"string"==typeof n&&(n=J[n.toLowerCase()],null==n))throw Error("Unknown paper size");n[0]=w(n[0]),n[1]=w(n[1]),t("landscape",!1)&&(n=[Math.max(n[0],n[1]),Math.min(n[0],n[1])]),o=t("margin"),o&&(o.left=w(o.left,0),o.top=w(o.top,0),o.right=w(o.right,0),o.bottom=w(o.bottom,0),t("addMargin")&&(n[0]+=o.left+o.right,n[1]+=o.top+o.bottom)),a=n[0],s=n[1],o&&(a-=o.left+o.right,s-=o.top+o.bottom),l=d.attach(new V),c=d.attach(new U([0,0,n[0],n[1]])),l.setPages(c),d.addPage=function(){var e=new O(i(),null,!0),t=new G(d,{Contents:d.attach(e),Parent:c});return t._content=e,c.addPage(d.attach(t)),t.transform(1,0,0,-1,0,n[1]),o&&(t.translate(o.left,o.top),t.rect(0,0,a,s),t.clip()),t},d.render=function(){var e,n;for(h("%PDF-1.4",K,"%ÂÁÚÏÎ",K,K),e=0;f.length>e;++e)f[e].renderFull(h),h(K,K);for(n=h.offset(),h("xref",K,0," ",f.length+1,K),h("0000000000 65535 f ",K),e=0;f.length>e;++e)h(u(f[e]._offset,10)," 00000 n ",K);return h(K),h("trailer",K),h(new N({Size:f.length+1,Root:l,Info:new N({Producer:new R("Kendo UI PDF Generator"),Title:new R(t("title","")),Author:new R(t("author","")),Subject:new R(t("subject","")),Keywords:new R(t("keywords","")),Creator:new R(t("creator","Kendo UI PDF Generator")),CreationDate:t("date",new Date)})}),K,K),h("startxref",K,n,K),h("%%EOF",K),h.stream().offset(0)}}function a(t,n){function i(){e.console&&(e.console.error?e.console.error("Cannot load URL: %s",t):e.console.log("Cannot load URL: %s",t)),n(null)}var r=new XMLHttpRequest;r.open("GET",t,!0),Q&&(r.responseType="arraybuffer"),r.onload=function(){200==r.status||304==r.status?n(Q?new Uint8Array(r.response):new VBArray(r.responseBody).toArray()):i()},r.onerror=i,r.send(null)}function s(e,t){var n=et[e];n?t(n):a(e,function(n){if(null==n)throw Error("Cannot load font from "+e);var i=new Y.pdf.TTFFont(n);et[e]=i,t(i)})}function l(e,t){var i=tt[e];i?t(i):(i=new Image,i.onload=function(){var n,r,o,a,s,l,c,d,u,h,p=document.createElement("canvas");p.width=i.width,p.height=i.height,n=p.getContext("2d"),n.drawImage(i,0,0);try{r=n.getImageData(0,0,i.width,i.height)}catch(f){return t(tt[e]="TAINTED")}for(o=!1,a=D(),s=D(),l=r.data,c=0;l.length>c;)a.writeByte(l[c++]),a.writeByte(l[c++]),a.writeByte(l[c++]),d=l[c++],255>d&&(o=!0),s.writeByte(d);o?i=new C(i.width,i.height,a,s):(u=p.toDataURL("image/jpeg"),u=u.substr(u.indexOf(";base64,")+8),h=D(),h.writeBase64(u),h.offset(0),i=new x(i.width,i.height,h)),t(tt[e]=i)},i.onerror=function(){t(tt[e]="TAINTED")},i.crossOrigin="Anonymous",i.src=e,(i.complete||i.complete===n)&&(i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",i.src=e))}function c(e){return function(t,n){var i=t.length,r=i;if(0===i)return n();for(;r-->0;)e(t[r],function(){0===--i&&n()})}}function d(e,t,n){for(;t>e.length;)e=n+e;return e}function u(e,t){return d(e+"",t,"0")}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(e){return e instanceof Date}function f(e,t){t("["),e.length>0&&t.withIndent(function(){for(var n=0;e.length>n;++n)n>0&&n%8===0?t.indent(e[n]):t(" ",e[n])}),t(" ]")}function g(e,t){t("(D:",u(e.getUTCFullYear(),4),u(e.getUTCMonth()+1,2),u(e.getUTCDate(),2),u(e.getUTCHours(),2),u(e.getUTCMinutes(),2),u(e.getUTCSeconds(),2),"Z)")}function m(e){return e*(72/25.4)}function v(e){return m(10*e)}function _(e){return 72*e}function w(e,n){var i,r;if("number"==typeof e)return e;if("string"==typeof e&&(i=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(e),i&&(r=t(i[1]),!isNaN(r))))return"pt"==i[2]?r:{mm:m,cm:v,"in":_}[i[2]](r);if(null!=n)return n;throw Error("Can't parse unit: "+e)}function y(){}function b(e,t,n){n||(n=y),e.prototype=new n;for(var i in t)h(t,i)&&(e.prototype[i]=t[i]);return e}function k(e){return h(L,e)?L[e]:L[e]=new H(e)}function x(e,t,n){this.asStream=function(){var i=new O(n,{Type:k("XObject"),Subtype:k("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:k("DeviceRGB"),Filter:k("DCTDecode")});return i._resourceName=k("I"+ ++X),i}}function C(e,t,n,i){this.asStream=function(r){var o=new O(i,{Type:k("XObject"),Subtype:k("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:k("DeviceGray")},!0),a=new O(n,{Type:k("XObject"),Subtype:k("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:k("DeviceRGB"),SMask:r.attach(o)},!0);return a._resourceName=k("I"+ ++X),a}}function S(e){function t(e){return 1==e.length?e[0]:{FunctionType:3,Functions:e,Domain:[0,1],Bounds:d,Encode:u}}var n,i,r,o,a,s=!1,l=[],c=[],d=[],u=[];for(n=1;e.length>n;++n)i=e[n-1],r=e[n],o=i.color,a=r.color,c.push({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[o.r,o.g,o.b],C1:[a.r,a.g,a.b]}),l.push({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[o.a],C1:[a.a]}),(1>o.a||1>a.a)&&(s=!0),d.push(r.offset),u.push(0,1);return d.pop(),{hasAlpha:s,colors:t(c),opacities:s?t(l):null}}function T(e,t,n){var i="radial"==t.type,r=S(t.stops),o=i?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],a={Type:k("Shading"),ShadingType:i?3:2,ColorSpace:k("DeviceRGB"),Coords:o,Domain:[0,1],Function:r.colors,Extend:[!0,!0]},s=r.hasAlpha?{Type:k("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:k("Mask"),S:k("Luminosity"),G:e.attach(new O("/a0 gs /s0 sh",{Type:k("XObject"),Subtype:k("Form"),FormType:1,BBox:t.userSpace?[n.left,n.top+n.height,n.left+n.width,n.top]:[0,1,1,0],Group:{Type:k("Group"),S:k("Transparency"),CS:k("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:k("DeviceGray"),Coords:o,Domain:[0,1],ShadingType:i?3:2,Function:r.opacities,Extend:[!0,!0]}}}}))}}:null;return{hasAlpha:r.hasAlpha,shading:new N(a),opacity:new N(s)}}function D(e){function t(){return S>=T}function n(){return T>S?e[S++]:0}function i(t){y(S),e[S++]=255&t,S>T&&(T=S)}function r(){return n()<<8|n()}function o(e){i(e>>8),i(e)}function a(){var e=r();return e>=32768?e-65536:e}function s(e){o(0>e?e+65536:e)}function l(){return 65536*r()+r()}function c(e){o(e>>>16&65535),o(65535&e)}function d(){var e=l();return e>=2147483648?e-4294967296:e}function u(e){c(0>e?e+4294967296:e)}function h(){return l()/65536}function p(e){c(Math.round(65536*e))}function f(){return d()/65536}function g(e){u(Math.round(65536*e))}function m(e){return w(e,n)}function v(e){return String.fromCharCode.apply(String,m(e))}function _(e){for(var t=0;e.length>t;++t)i(e.charCodeAt(t))}function w(e,t){for(var n=Array(e),i=0;e>i;++i)n[i]=t();return n}var y,b,k,x,C,S=0,T=0;return null==e?e=Q?new Uint8Array(256):[]:T=e.length,y=Q?function(t){if(t>=e.length){var n=new Uint8Array(Math.max(t+256,2*e.length));n.set(e,0),e=n}}:function(){},b=Q?function(){return new Uint8Array(e.buffer,0,T)}:function(){return e},k=Q?function(t){if("string"==typeof t)return _(t);var n=t.length;y(S+n),e.set(t,S),S+=n,S>T&&(T=S)}:function(e){if("string"==typeof e)return _(e);
17
+ for(var t=0;e.length>t;++t)i(e[t])},x=Q?function(t,n){if(e.buffer.slice)return new Uint8Array(e.buffer.slice(t,t+n));var i=new Uint8Array(n);return i.set(new Uint8Array(e.buffer,t,n)),i}:function(t,n){return e.slice(t,t+n)},C={eof:t,readByte:n,writeByte:i,readShort:r,writeShort:o,readLong:l,writeLong:c,readFixed:h,writeFixed:p,readShort_:a,writeShort_:s,readLong_:d,writeLong_:u,readFixed_:f,writeFixed_:g,read:m,write:k,readString:v,writeString:_,times:w,get:b,slice:x,offset:function(e){return null!=e?(S=e,C):S},skip:function(e){S+=e},toString:function(){throw Error("FIX CALLER. BinaryStream is no longer convertible to string!")},length:function(){return T},saveExcursion:function(e){var t=S;try{return e()}finally{S=t}},writeBase64:function(e){window.atob?_(window.atob(e)):k(Z.decode(e))},base64:function(){return Z.encode(b())}}}function A(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function E(e){var t,n=/^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i,i=n.exec(e);return i?(t=i[8]?parseInt(i[8],10):12,{italic:i[2]&&"italic"==i[2].toLowerCase(),variant:i[4],bold:i[6]&&/bold|700/i.test(i[6]),fontSize:t,lineHeight:i[12]?"normal"==i[12]?t:parseInt(i[12],10):null,fontFamily:i[14].split(/\s*,\s*/g).map(A)}):{fontSize:12,fontFamily:"sans-serif"}}function I(e){function t(t){return e.bold&&(t+="|bold"),e.italic&&(t+="|italic"),t.toLowerCase()}var n,i,r,o=e.fontFamily;if(o instanceof Array){for(r=0;o.length>r;++r)if(n=t(o[r]),i=$[n])return i}else i=$[o.toLowerCase()];return i||(i="Times-Roman"),i}function P(e,t){if(1==arguments.length)for(var n in e)P(n,e[n]);else e=e.toLowerCase(),$[e]=t}function M(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],c=t[1],d=t[2],u=t[3],h=t[4],p=t[5];return[n*l+i*d,n*c+i*u,r*l+o*d,r*c+o*u,a*l+s*d+h,a*c+s*u+p]}function F(e){return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}var z,R,B,H,L,N,O,V,U,W,j,q,G,$,Y=e.kendo,Q=!!e.Uint8Array,K="\n",X=0,Z=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{decode:function(t){for(var n,i,r,o,a,s,l,c=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),d=0,u=c.length,h=[];u>d;)n=e.indexOf(c.charAt(d++)),i=e.indexOf(c.charAt(d++)),r=e.indexOf(c.charAt(d++)),o=e.indexOf(c.charAt(d++)),a=n<<2|i>>>4,s=(15&i)<<4|r>>>2,l=(3&r)<<6|o,h.push(a),64!=r&&h.push(s),64!=o&&h.push(l);return h},encode:function(t){for(var n,i,r,o,a,s,l,c=0,d=t.length,u="";d>c;)n=t[c++],i=t[c++],r=t[c++],o=n>>>2,a=(3&n)<<4|i>>>4,s=(15&i)<<2|r>>>6,l=63&r,c-d==2?s=l=64:c-d==1&&(l=64),u+=e.charAt(o)+e.charAt(a)+e.charAt(s)+e.charAt(l);return u}}}(),J={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]},et={"Times-Roman":!0,"Times-Bold":!0,"Times-Italic":!0,"Times-BoldItalic":!0,Helvetica:!0,"Helvetica-Bold":!0,"Helvetica-Oblique":!0,"Helvetica-BoldOblique":!0,Courier:!0,"Courier-Bold":!0,"Courier-Oblique":!0,"Courier-BoldOblique":!0,Symbol:!0,ZapfDingbats:!0},tt={},nt=c(s),it=c(l);o.prototype={loadFonts:nt,loadImages:it,getFont:function(e){var t=this.FONTS[e];if(!t){if(t=et[e],!t)throw Error("Font "+e+" has not been loaded");t=this.attach(t===!0?new W(e):new j(this,t)),this.FONTS[e]=t}return t},getImage:function(e){var t=this.IMAGES[e];if(!t){if(t=tt[e],!t)throw Error("Image "+e+" has not been loaded");if("TAINTED"===t)return null;t=this.IMAGES[e]=this.attach(t.asStream(this))}return t},getOpacityGS:function(e,n){var i,r,o,a=t(e).toFixed(3);return e=t(a),a+=n?"S":"F",i=this._opacityGSCache||(this._opacityGSCache={}),r=i[a],r||(o={Type:k("ExtGState")},n?o.CA=e:o.ca=e,r=this.attach(new N(o)),r._resourceName=k("GS"+ ++X),i[a]=r),r},dict:function(e){return new N(e)},name:function(e){return k(e)},stream:function(e,t){return new O(t,e)}},z=Array.isArray||function(e){return e instanceof Array},y.prototype.beforeRender=function(){},R=b(function(e){this.value=e},{render:function(e){var t,n="",i=this.escape();for(t=0;i.length>t;++t)n+=String.fromCharCode(255&i.charCodeAt(t));e("(",n,")")},escape:function(){return this.value.replace(/([\(\)\\])/g,"\\$1")},toString:function(){return this.value}}),B=b(function(e){this.value=e},{render:function(e){e("<");for(var t=0;this.value.length>t;++t)e(u(this.value.charCodeAt(t).toString(16),4));e(">")}},R),H=b(function(e){this.name=e},{render:function(e){e("/"+this.escape())},escape:function(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return"#"+u(e.charCodeAt(0).toString(16),2)})},toString:function(){return this.name}}),L={},H.get=k,N=b(function(e){this.props=e},{render:function(e){var t=this.props,n=!0;e("<<"),e.withIndent(function(){for(var i in t)h(t,i)&&!/^_/.test(i)&&(n=!1,e.indent(k(i)," ",t[i]))}),n||e.indent(),e(">>")}}),O=b(function(e,t,n){if("string"==typeof e){var i=D();i.write(e),e=i}this.data=e,this.props=t||{},this.compress=n},{render:function(t){var n=this.data.get(),i=this.props;this.compress&&e.pako&&"function"==typeof e.pako.deflate&&(i.Filter?i.Filter instanceof Array||(i.Filter=[i.Filter]):i.Filter=[],i.Filter.unshift(k("FlateDecode")),n=e.pako.deflate(n)),i.Length=n.length,t(new N(i)," stream",K),t.writeData(n),t(K,"endstream")}}),V=b(function(e){e=this.props=e||{},e.Type=k("Catalog")},{setPages:function(e){this.props.Pages=e}},N),U=b(function(e){this.props={Type:k("Pages"),Kids:[],Count:0,MediaBox:e}},{addPage:function(e){this.props.Kids.push(e),this.props.Count++}},N),W=b(function(e){this.props={Type:k("Font"),Subtype:k("Type1"),BaseFont:k(e)},this._resourceName=k("F"+ ++X)},{encodeText:function(e){return new R(e+"")}},N),j=b(function(e,t,n){var i,r;n=this.props=n||{},n.Type=k("Font"),n.Subtype=k("Type0"),n.Encoding=k("Identity-H"),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=k("F"+ ++X),i=t.head,this.name=t.psName,r=this.scale=t.scale,this.bbox=[i.xMin*r,i.yMin*r,i.xMax*r,i.yMax*r],this.italicAngle=t.post.italicAngle,this.ascent=t.ascent*r,this.descent=t.descent*r,this.lineGap=t.lineGap*r,this.capHeight=t.os2.capHeight||this.ascent,this.xHeight=t.os2.xHeight||0,this.stemV=0,this.familyClass=(t.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&7>=this.familyClass,this.isScript=10==this.familyClass,this.flags=(t.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(0!==this.italicAngle?64:0)|32},{encodeText:function(e){return new B(this._sub.encodeText(e+""))},beforeRender:function(){var e,t,n,r,o=this,a=o._sub,s=a.render(),l=new O(D(s),{Length1:s.length},!0),c=o._pdf.attach(new N({Type:k("FontDescriptor"),FontName:k(o._sub.psName),FontBBox:o.bbox,Flags:o.flags,StemV:o.stemV,ItalicAngle:o.italicAngle,Ascent:o.ascent,Descent:o.descent,CapHeight:o.capHeight,XHeight:o.xHeight,FontFile2:o._pdf.attach(l)})),d=a.ncid2ogid,u=a.firstChar,h=a.lastChar,p=[];!function f(e,t){if(h>=e){var n=d[e];null==n?f(e+1):(t||p.push(e,t=[]),t.push(o._font.widthOfGlyph(n)),f(e+1,t))}}(u),e=new N({Type:k("Font"),Subtype:k("CIDFontType2"),BaseFont:k(o._sub.psName),CIDSystemInfo:new N({Registry:new R("Adobe"),Ordering:new R("Identity"),Supplement:0}),FontDescriptor:c,FirstChar:u,LastChar:h,DW:Math.round(o._font.widthOfGlyph(0)),W:p,CIDToGIDMap:o._pdf.attach(o._makeCidToGidMap())}),t=o.props,t.BaseFont=k(o._sub.psName),t.DescendantFonts=[o._pdf.attach(e)],n=new q(u,h,a.subset),r=new O(i(),null,!0),r.data(n),t.ToUnicode=o._pdf.attach(r)},_makeCidToGidMap:function(){return new O(D(this._sub.cidToGidMap()),null,!0)}},N),q=b(function(e,t,n){this.firstChar=e,this.lastChar=t,this.map=n},{render:function(e){e.indent("/CIDInit /ProcSet findresource begin"),e.indent("12 dict begin"),e.indent("begincmap"),e.indent("/CIDSystemInfo <<"),e.indent(" /Registry (Adobe)"),e.indent(" /Ordering (UCS)"),e.indent(" /Supplement 0"),e.indent(">> def"),e.indent("/CMapName /Adobe-Identity-UCS def"),e.indent("/CMapType 2 def"),e.indent("1 begincodespacerange"),e.indent(" <0000><ffff>"),e.indent("endcodespacerange");var t=this;e.indent(t.lastChar-t.firstChar+1," beginbfchar"),e.withIndent(function(){var n,i;for(n=t.firstChar;t.lastChar>=n;++n)i=t.map[n],e.indent("<",u(n.toString(16),4),">","<",u(i.toString(16),4),">")}),e.indent("endbfchar"),e.indent("endcmap"),e.indent("CMapName currentdict /CMap defineresource pop"),e.indent("end"),e.indent("end")}}),G=b(function(e,t){this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._font=null,this._fontSize=null,this._contextStack=[],t=this.props=t||{},t.Type=k("Page"),t.ProcSet=[k("PDF"),k("Text"),k("ImageB"),k("ImageC"),k("ImageI")],t.Resources=new N({Font:new N(this._fontResources),ExtGState:new N(this._gsResources),XObject:new N(this._xResources),Pattern:new N(this._patResources),Shading:new N(this._shResources)})},{_out:function(){this._content.data.apply(null,arguments)},transform:function(e,t,n,i,r,o){F(arguments)||(this._matrix=M(this._matrix,arguments),this._out(e," ",t," ",n," ",i," ",r," ",o," cm"),this._out(K))},translate:function(e,t){this.transform(1,0,0,1,e,t)},scale:function(e,t){this.transform(e,0,0,t,0,0)},rotate:function(e){var t=Math.cos(e),n=Math.sin(e);this.transform(t,n,-n,t,0,0)},beginText:function(){this._textMode=!0,this._out("BT",K)},endText:function(){this._textMode=!1,this._out("ET",K)},_requireTextMode:function(){if(!this._textMode)throw Error("Text mode required; call page.beginText() first")},_requireFont:function(){if(!this._font)throw Error("No font selected; call page.setFont() first")},setFont:function(e,t){this._requireTextMode(),null==e?e=this._font:e instanceof j||(e=this._pdf.getFont(e)),null==t&&(t=this._fontSize),this._fontResources[e._resourceName]=e,this._font=e,this._fontSize=t,this._out(e._resourceName," ",t," Tf",K)},setTextLeading:function(e){this._requireTextMode(),this._out(e," TL",K)},setTextRenderingMode:function(e){this._requireTextMode(),this._out(e," Tr",K)},showText:function(e){this._requireFont(),this._out(this._font.encodeText(e)," Tj",K)},showTextNL:function(e){this._requireFont(),this._out(this._font.encodeText(e)," '",K)},setStrokeColor:function(e,t,n){this._out(e," ",t," ",n," RG",K)},setOpacity:function(e){this.setFillOpacity(e),this.setStrokeOpacity(e),this._opacity*=e},setStrokeOpacity:function(e){if(1>e){var t=this._pdf.getOpacityGS(this._opacity*e,!0);this._gsResources[t._resourceName]=t,this._out(t._resourceName," gs",K)}},setFillColor:function(e,t,n){this._out(e," ",t," ",n," rg",K)},setFillOpacity:function(e){if(1>e){var t=this._pdf.getOpacityGS(this._opacity*e,!1);this._gsResources[t._resourceName]=t,this._out(t._resourceName," gs",K)}},gradient:function(e,t){var n,i,r;this.save(),this.rect(t.left,t.top,t.width,t.height),this.clip(),e.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top),n=T(this._pdf,e,t),i="S"+ ++X,this._shResources[i]=this._pdf.attach(n.shading),n.hasAlpha&&(r="O"+ ++X,this._gsResources[r]=this._pdf.attach(n.opacity),this._out("/"+r+" gs ")),this._out("/"+i+" sh",K),this.restore()},setDashPattern:function(e,t){this._out(e," ",t," d",K)},setLineWidth:function(e){this._out(e," w",K)},setLineCap:function(e){this._out(e," J",K)},setLineJoin:function(e){this._out(e," j",K)},setMitterLimit:function(e){this._out(e," M",K)},save:function(){this._contextStack.push(this._context()),this._out("q",K)},restore:function(){this._out("Q",K),this._context(this._contextStack.pop())},moveTo:function(e,t){this._out(e," ",t," m",K)},lineTo:function(e,t){this._out(e," ",t," l",K)},bezier:function(e,t,n,i,r,o){this._out(e," ",t," ",n," ",i," ",r," ",o," c",K)},bezier1:function(e,t,n,i){this._out(e," ",t," ",n," ",i," y",K)},bezier2:function(e,t,n,i){this._out(e," ",t," ",n," ",i," v",K)},close:function(){this._out("h",K)},rect:function(e,t,n,i){this._out(e," ",t," ",n," ",i," re",K)},ellipse:function(e,t,n,i){function r(t){return e+t}function o(e){return t+e}var a=.5522847498307936;this.moveTo(r(0),o(i)),this.bezier(r(n*a),o(i),r(n),o(i*a),r(n),o(0)),this.bezier(r(n),o(-i*a),r(n*a),o(-i),r(0),o(-i)),this.bezier(r(-n*a),o(-i),r(-n),o(-i*a),r(-n),o(0)),this.bezier(r(-n),o(i*a),r(-n*a),o(i),r(0),o(i))},circle:function(e,t,n){this.ellipse(e,t,n,n)},stroke:function(){this._out("S",K)},nop:function(){this._out("n",K)},clip:function(){this._out("W n",K)},closeStroke:function(){this._out("s",K)},fill:function(){this._out("f",K)},fillStroke:function(){this._out("B",K)},drawImage:function(e){var t=this._pdf.getImage(e);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName," Do",K))},comment:function(e){var t=this;e.split(/\r?\n/g).forEach(function(e){t._out("% ",e,K)})},_context:function(e){return null==e?{opacity:this._opacity,matrix:this._matrix}:(this._opacity=e.opacity,this._matrix=e.matrix,n)}},N),$={serif:"Times-Roman","serif|bold":"Times-Bold","serif|italic":"Times-Italic","serif|bold|italic":"Times-BoldItalic","sans-serif":"Helvetica","sans-serif|bold":"Helvetica-Bold","sans-serif|italic":"Helvetica-Oblique","sans-serif|bold|italic":"Helvetica-BoldOblique",monospace:"Courier","monospace|bold":"Courier-Bold","monospace|italic":"Courier-Oblique","monospace|bold|italic":"Courier-BoldOblique"},Y.pdf={Document:o,BinaryStream:D,defineFont:P,parseFontDef:E,getFontURL:I,loadFonts:nt,loadImages:it,TEXT_RENDERING_MODE:{fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7}}}(this,parseFloat),function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.keys(e).sort(function(e,t){return e-t}).map(parseFloat)}function i(e){var t,n,i;for(this.raw=e,this.scalerType=e.readLong(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),t=this.tables={},n=0;this.tableCount>n;++n)i={tag:e.readString(4),checksum:e.readLong(),offset:e.readLong(),length:e.readLong()},t[i.tag]=i}function r(e){function n(e,t){this.definition=t,this.length=t.length,this.offset=t.offset,this.file=e,this.rawData=e.raw,this.parse(e.raw)}n.prototype.raw=function(){return this.rawData.slice(this.offset,this.length)};for(var i in e)t(e,i)&&(n[i]=n.prototype[i]=e[i]);return n}function o(){var e,t="",n=_+"";for(e=0;n.length>e;++e)t+=String.fromCharCode(n.charCodeAt(e)-48+65);return++_,t}function a(e){this.font=e,this.subset={},this.unicodes={},this.ogid2ngid={0:0},this.ngid2ogid={0:0},this.ncid2ogid={},this.next=this.firstChar=1,this.nextGid=1,this.psName=o()+"+"+this.font.psName}function s(e,t){var n,i,r,o,a=this,s=a.contents=y(e);if("ttcf"==s.readString(4)){if(!t)throw Error("Must specify a name for TTC files");for(n=s.readLong(),i=s.readLong(),r=0;i>r;++r)if(o=s.readLong(),s.saveExcursion(function(){s.offset(o),a.parse()}),a.psName==t)return;throw Error("Font "+t+" not found in collection")}s.offset(0),a.parse()}var l,c,d,u,h,p,f,g,m,v,_,w=e.kendo.pdf,y=w.BinaryStream;i.prototype={readTable:function(e,t){var n=this.tables[e];if(!n)throw Error("Table "+e+" not found in directory");return this[e]=n.table=new t(this,n)},render:function(e){var n,i,r,o,a,s,l,c,d=Object.keys(e).length,u=Math.pow(2,Math.floor(Math.log(d)/Math.LN2)),h=16*u,p=Math.floor(Math.log(u)/Math.LN2),f=16*d-h,g=y();g.writeLong(this.scalerType),g.writeShort(d),g.writeShort(h),g.writeShort(p),g.writeShort(f),n=16*d,i=g.offset()+n,r=null,o=y();for(a in e)if(t(e,a))for(s=e[a],g.writeString(a),g.writeLong(this.checksum(s)),g.writeLong(i),g.writeLong(s.length),o.write(s),"head"==a&&(r=i),i+=s.length;i%4;)o.writeByte(0),i++;return g.write(o.get()),l=this.checksum(g.get()),c=2981146554-l,g.offset(r+8),g.writeLong(c),g.get()},checksum:function(e){e=y(e);for(var t=0;!e.eof();)t+=e.readLong();return 4294967295&t}},l=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.revision=e.readLong(),this.checkSumAdjustment=e.readLong(),this.magicNumber=e.readLong(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.read(8),this.modified=e.read(8),this.xMin=e.readShort_(),this.yMin=e.readShort_(),this.xMax=e.readShort_(),this.yMax=e.readShort_(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort_(),this.indexToLocFormat=e.readShort_(),this.glyphDataFormat=e.readShort_()},render:function(e){var t=y();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(e),t.writeShort_(this.glyphDataFormat),t.get()}}),c=r({parse:function(e){e.offset(this.offset);var t=this.file.head.indexToLocFormat;this.offsets=0===t?e.times(this.length/2,function(){return 2*e.readShort()}):e.times(this.length/4,e.readLong)},offsetOf:function(e){return this.offsets[e]},lengthOf:function(e){return this.offsets[e+1]-this.offsets[e]},render:function(e){var t,n=y(),i=e[e.length-1]>65535;for(t=0;e.length>t;++t)i?n.writeLong(e[t]):n.writeShort(e[t]/2);return{format:i?1:0,table:n.get()}}}),d=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort_(),this.minRightSideBearing=e.readShort_(),this.xMaxExtent=e.readShort_(),this.caretSlopeRise=e.readShort_(),this.caretSlopeRun=e.readShort_(),this.caretOffset=e.readShort_(),e.skip(8),this.metricDataFormat=e.readShort_(),this.numOfLongHorMetrics=e.readShort()},render:function(e){var t=y();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(e.length),t.get()}}),u=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.numGlyphs=e.readShort(),this.maxPoints=e.readShort(),this.maxContours=e.readShort(),this.maxComponentPoints=e.readShort(),this.maxComponentContours=e.readShort(),this.maxZones=e.readShort(),this.maxTwilightPoints=e.readShort(),this.maxStorage=e.readShort(),this.maxFunctionDefs=e.readShort(),this.maxInstructionDefs=e.readShort(),this.maxStackElements=e.readShort(),this.maxSizeOfInstructions=e.readShort(),this.maxComponentElements=e.readShort(),this.maxComponentDepth=e.readShort()},render:function(e){var t=y();return t.writeLong(this.version),t.writeShort(e.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}}),h=r({parse:function(e){var t,n,i;e.offset(this.offset),t=this.file,n=t.hhea,this.metrics=e.times(n.numOfLongHorMetrics,function(){return{advance:e.readShort(),lsb:e.readShort_()}}),i=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics,this.leftSideBearings=e.times(i,e.readShort_)},forGlyph:function(e){var t=this.metrics,n=t.length;return n>e?t[e]:{advance:t[n-1].advance,lsb:this.leftSideBearings[e-n]}},render:function(e){var t,n,i=y();for(t=0;e.length>t;++t)n=this.forGlyph(e[t]),i.writeShort(n.advance),i.writeShort_(n.lsb);return i.get()}}),p=function(){function e(e){this.raw=e}function n(e){var t,n,r;for(this.raw=e,t=this.glyphIds=[],n=this.idOffsets=[];;){if(r=e.readShort(),n.push(e.offset()),t.push(e.readShort()),!(r&a))break;e.skip(r&i?4:2),r&l?e.skip(8):r&s?e.skip(4):r&o&&e.skip(2)}}var i,o,a,s,l,c;return e.prototype={compound:!1,render:function(){return this.raw.get()}},i=1,o=8,a=32,s=64,l=128,c=256,n.prototype={compound:!0,render:function(e){var t,n,i=y(this.raw.get());for(t=0;this.glyphIds.length>t;++t)n=this.glyphIds[t],i.offset(this.idOffsets[t]),i.writeShort(e[n]);return i.get()}},r({parse:function(){this.cache={}},glyphFor:function(i){var r,o,a,s,l,c,d,u,h,p,f,g=this.cache;return t(g,i)?g[i]:(r=this.file.loca,o=r.lengthOf(i),0===o?g[i]=null:(a=this.rawData,s=this.offset+r.offsetOf(i),l=y(a.slice(s,o)),c=l.readShort_(),d=l.readShort_(),u=l.readShort_(),h=l.readShort_(),p=l.readShort_(),f=g[i]=-1==c?new n(l):new e(l),f.numberOfContours=c,f.xMin=d,f.yMin=u,f.xMax=h,f.yMax=p,f))},render:function(e,t,n){var i,r,o,a=y(),s=[];for(i=0;t.length>i;++i)r=t[i],o=e[r],s.push(a.offset()),o&&a.write(o.render(n));return s.push(a.offset()),{table:a.get(),offsets:s}}})}(),f=function(){function e(e,t){this.text=e,this.length=e.length,this.platformID=t.platformID,this.platformSpecificID=t.platformSpecificID,this.languageID=t.languageID,this.nameID=t.nameID}return r({parse:function(t){var n,i,r,o,a,s,l,c;for(t.offset(this.offset),n=t.readShort(),i=t.readShort(),r=this.offset+t.readShort(),o=t.times(i,function(){return{platformID:t.readShort(),platformSpecificID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:t.readShort()+r}}),a=this.strings={},s=0;o.length>s;++s)l=o[s],t.offset(l.offset),c=t.readString(l.length),a[l.nameID]||(a[l.nameID]=[]),a[l.nameID].push(new e(c,l));this.postscriptEntry=a[6][0],this.postscriptName=this.postscriptEntry.text.replace(/[^\x20-\x7F]/g,"")},render:function(n){var i,r,o,a,s,l,c=this.strings,d=0;for(i in c)t(c,i)&&(d+=c[i].length);r=y(),o=y(),r.writeShort(0),r.writeShort(d),r.writeShort(6+12*d);for(i in c)if(t(c,i))for(a=6==i?[new e(n,this.postscriptEntry)]:c[i],s=0;a.length>s;++s)l=a[s],r.writeShort(l.platformID),r.writeShort(l.platformSpecificID),r.writeShort(l.languageID),r.writeShort(l.nameID),r.writeShort(l.length),r.writeShort(o.offset()),o.writeString(l.text);return r.write(o.get()),r.get()}})}(),g=function(){var e=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(/\s+/g);return r({parse:function(e){var t,n;switch(e.offset(this.offset),this.format=e.readLong(),this.italicAngle=e.readFixed_(),this.underlinePosition=e.readShort_(),this.underlineThickness=e.readShort_(),this.isFixedPitch=e.readLong(),this.minMemType42=e.readLong(),this.maxMemType42=e.readLong(),this.minMemType1=e.readLong(),this.maxMemType1=e.readLong(),this.format){case 65536:case 196608:break;case 131072:for(t=e.readShort(),this.glyphNameIndex=e.times(t,e.readShort),this.names=[],n=this.offset+this.length;e.offset()<n;)this.names.push(e.readString(e.readByte()));break;case 151552:t=e.readShort(),this.offsets=e.read(t);break;case 262144:this.map=e.times(this.file.maxp.numGlyphs,e.readShort)}},glyphFor:function(t){switch(this.format){case 65536:return e[t]||".notdef";case 131072:var n=this.glyphNameIndex[t];return e.length>n?e[n]:this.names[n-e.length]||".notdef";case 151552:case 196608:return".notdef";case 262144:return this.map[t]||65535}},render:function(t){var n,i,r,o,a,s,l;if(196608==this.format)return this.raw();for(n=y(this.rawData.slice(this.offset,32)),n.writeLong(131072),n.offset(32),i=[],r=[],o=0;t.length>o;++o)a=t[o],s=this.glyphFor(a),l=e.indexOf(s),l>=0?i.push(l):(i.push(e.length+r.length),r.push(s));for(n.writeShort(t.length),o=0;i.length>o;++o)n.writeShort(i[o]);for(o=0;r.length>o;++o)n.writeByte(r[o].length),n.writeString(r[o]);return n.get()}})}(),m=function(){function e(e,t){var n=this;n.platformID=e.readShort(),n.platformSpecificID=e.readShort(),n.offset=t+e.readLong(),e.saveExcursion(function(){var t,i,r,o,a,s,l,c,d,u,h,p,f;switch(e.offset(n.offset),n.format=e.readShort(),n.length=e.readShort(),n.language=e.readShort(),n.isUnicode=3==n.platformID&&1==n.platformSpecificID&&4==n.format||0===n.platformID&&4==n.format,n.codeMap={},n.format){case 0:for(t=0;256>t;++t)n.codeMap[t]=e.readByte();break;case 4:for(i=e.readShort()/2,e.skip(6),r=e.times(i,e.readShort),e.skip(2),o=e.times(i,e.readShort),a=e.times(i,e.readShort_),s=e.times(i,e.readShort),l=(n.length+n.offset-e.offset())/2,c=e.times(l,e.readShort),t=0;i>t;++t)for(d=o[t],u=r[t],h=d;u>=h;++h)0===s[t]?p=h+a[t]:(f=s[t]/2-(i-t)+(h-d),p=c[f]||0,0!==p&&(p+=a[t])),n.codeMap[h]=65535&p}})}function t(e,t){function i(n){return t[e[n]]}var r,o,a,s,l,c,d,u,h,p,f,g,m,v,_,w,b,k=n(e),x=[],C=[],S=null,T=null;for(r=0;k.length>r;++r)o=k[r],a=i(o),s=a-o,(null==S||s!==T)&&(S&&C.push(S),x.push(o),T=s),S=o;for(S&&C.push(S),C.push(65535),x.push(65535),l=x.length,c=2*l,d=2*Math.pow(2,Math.floor(Math.log(l)/Math.LN2)),u=Math.log(d/2)/Math.LN2,h=c-d,p=[],f=[],g=[],r=0;l>r;++r){if(m=x[r],v=C[r],65535==m){p.push(0),f.push(0);break}if(_=i(m),m-_>=32768)for(p.push(0),f.push(2*(g.length+l-r)),w=m;v>=w;++w)g.push(i(w));else p.push(_-m),f.push(0)}return b=y(),b.writeShort(3),b.writeShort(1),b.writeLong(12),b.writeShort(4),b.writeShort(16+8*l+2*g.length),b.writeShort(0),b.writeShort(c),b.writeShort(d),b.writeShort(u),b.writeShort(h),C.forEach(b.writeShort),b.writeShort(0),x.forEach(b.writeShort),p.forEach(b.writeShort_),f.forEach(b.writeShort),g.forEach(b.writeShort),b.get()}return r({parse:function(t){var n,i=this,r=i.offset;t.offset(r),i.version=t.readShort(),n=t.readShort(),i.unicodeEntry=null,i.tables=t.times(n,function(){var n=new e(t,r);return n.isUnicode&&(i.unicodeEntry=n),n})},render:function(e,n){var i=y();return i.writeShort(0),i.writeShort(1),i.write(t(e,n)),i.get()},getUnicodeEntry:function(){if(!this.unicodeEntry)throw Error("Font doesn't have an Unicode encoding");return this.unicodeEntry}})}(),v=r({parse:function(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))},render:function(){return this.raw()}}),_=1e5,a.prototype={use:function(e){var t,n,i,r,o;if("string"==typeof e){for(n="",i=0;e.length>i;++i)t=this.use(e.charCodeAt(i)),n+=String.fromCharCode(t);return n}return t=this.unicodes[e],t||(t=this.next++,this.subset[t]=e,this.unicodes[e]=t,r=this.font.cmap.getUnicodeEntry().codeMap[e],r&&(this.ncid2ogid[t]=r,null==this.ogid2ngid[r]&&(o=this.nextGid++,this.ogid2ngid[r]=o,this.ngid2ogid[o]=r))),t},encodeText:function(e){return this.use(e)},glyphIds:function(){return n(this.ogid2ngid)},glyphsFor:function(e,t){var n,i,r;for(t||(t={}),n=0;e.length>n;++n)i=e[n],t[i]||(r=t[i]=this.font.glyf.glyphFor(i),r&&r.compound&&this.glyphsFor(r.glyphIds,t));return t},render:function(){var e,i,r,o,a,s,l,c,d=this.glyphsFor(this.glyphIds());for(e in d)t(d,e)&&(e=parseInt(e,10),null==this.ogid2ngid[e]&&(i=this.nextGid++,this.ogid2ngid[e]=i,this.ngid2ogid[i]=e));return r=n(this.ngid2ogid),o=r.map(function(e){return this.ngid2ogid[e]},this),a=this.font,s=a.glyf.render(d,o,this.ogid2ngid),l=a.loca.render(s.offsets),this.lastChar=this.next-1,c={cmap:m.render(this.ncid2ogid,this.ogid2ngid),glyf:s.table,loca:l.table,hmtx:a.hmtx.render(o),hhea:a.hhea.render(o),maxp:a.maxp.render(o),post:a.post.render(o),name:a.name.render(this.psName),head:a.head.render(l.format),"OS/2":a.os2.render()},this.font.directory.render(c)},cidToGidMap:function(){var e,t,n,i=y(),r=0;for(e=this.firstChar;this.next>e;++e){for(;e>r;)i.writeShort(0),r++;t=this.ncid2ogid[e],t?(n=this.ogid2ngid[t],i.writeShort(n)):i.writeShort(0),r++}return i.get()}},s.prototype={parse:function(){var e=this.directory=new i(this.contents);this.head=e.readTable("head",l),this.loca=e.readTable("loca",c),this.hhea=e.readTable("hhea",d),this.maxp=e.readTable("maxp",u),this.hmtx=e.readTable("hmtx",h),this.glyf=e.readTable("glyf",p),this.name=e.readTable("name",f),this.post=e.readTable("post",g),this.cmap=e.readTable("cmap",m),this.os2=e.readTable("OS/2",v),this.psName=this.name.postscriptName,this.ascent=this.os2.ascent||this.hhea.ascent,this.descent=this.os2.descent||this.hhea.descent,this.lineGap=this.os2.lineGap||this.hhea.lineGap,this.scale=1e3/this.head.unitsPerEm},widthOfGlyph:function(e){return this.hmtx.forGlyph(e).advance*this.scale},makeSubset:function(){return new a(this)}},w.TTFFont=s}(this),function(e){e.PDFMixin={extend:function(e){e.events.push("pdfExport"),e.options.pdf=this.options,e.saveAsPDF=this.saveAsPDF},options:{fileName:"Export.pdf",proxyURL:"",paperSize:"auto",landscape:!1,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator",date:null},saveAsPDF:function(){if(!this.trigger("pdfExport")){var t=this.options.pdf;
18
+ e.drawing.drawDOM(this.wrapper[0]).then(function(n){return e.drawing.exportPDF(n,t)}).done(function(n){e.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy})})}}}}(kendo),function(e,t){"use strict";function n(){if(!e.pdf)throw Error("kendo.pdf.js is not loaded");return e.pdf}function i(e,t){function i(e,t){return d.pdf&&null!=d.pdf[e]?d.pdf[e]:t}function r(){var r,a,s,c,d,u,p;--o>0||(r=i("paperSize","auto"),a=!1,"auto"==r&&(h?(s=h.getSize(),r=[s.width,s.height],a=!0,c=h.getOrigin(),d=new D.Group,d.transform(new A.Matrix(1,0,0,1,-c.x,-c.y)),d.append(e),e=d):r="A4"),u=new(n().Document)({paperSize:r,landscape:i("landscape",!1),margin:i("margin"),addMargin:a,title:i("title"),author:i("author"),subject:i("subject"),keywords:i("keywords"),creator:i("creator"),date:i("date")}),p=u.addPage(),l(e,p,u),t(u.render(),u,p))}var o,a=[],c=[],d=e.options,u=T(e),h=u.bbox;e=u.root,e.traverse(function(e){s({Image:function(e){c.indexOf(e.src())<0&&c.push(e.src())},Text:function(e){var t=n().parseFontDef(e.options.font),i=n().getFontURL(t);a.indexOf(i)<0&&a.push(i)}},e)}),o=2,n().loadFonts(a,r),n().loadImages(c,r)}function r(e,t){i(e,function(e){t("data:application/pdf;base64,"+e.base64())})}function o(e,t){i(e,function(e){t(new Blob([e.get()],{type:"application/pdf"}))})}function a(t,n,i,a){window.Blob&&!e.support.browser.safari?o(t,function(t){e.saveAs({dataURI:t,fileName:n}),a&&a(t)}):r(t,function(t){e.saveAs({dataURI:t,fileName:n,proxyURL:i}),a&&a(t)})}function s(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function l(e,t,n){var i,r,o;e.DEBUG&&t.comment(e.DEBUG),i=e.transform(),r=e.opacity(),t.save(),null!=r&&1>r&&t.setOpacity(r),c(e,t,n),d(e,t,n),u(e,t,n),i&&(o=i.matrix(),t.transform(o.a,o.b,o.c,o.d,o.e,o.f)),s({Path:v,MultiPath:_,Circle:w,Arc:y,Text:b,Image:x,Group:k},e,t,n),t.restore()}function c(e,t){var n,i,r,o,a,s,l=e.stroke&&e.stroke();if(l){if(n=l.color){if(n=S(n),null==n)return;t.setStrokeColor(n.r,n.g,n.b),1!=n.a&&t.setStrokeOpacity(n.a)}if(i=l.width,null!=i){if(0===i)return;t.setLineWidth(i)}r=l.dashType,r&&t.setDashPattern(E[r],0),o=l.lineCap,o&&t.setLineCap(I[o]),a=l.lineJoin,a&&t.setLineJoin(P[a]),s=l.opacity,null!=s&&t.setStrokeOpacity(s)}}function d(e,t){var n,i,r=e.fill&&e.fill();if(r&&!(r instanceof D.Gradient)){if(n=r.color){if(n=S(n),null==n)return;t.setFillColor(n.r,n.g,n.b),1!=n.a&&t.setFillOpacity(n.a)}i=r.opacity,null!=i&&t.setFillOpacity(i)}}function u(e,t,n){var i=e.clip();i&&(m(i,t,n),t.clip())}function h(e){return e&&(e instanceof D.Gradient||e.color&&!/^(none|transparent)$/i.test(e.color)&&(null==e.width||e.width>0)&&(null==e.opacity||e.opacity>0))}function p(e,t,n,i){var r,o,a,s,l,c,d=e.fill();return d instanceof D.Gradient?(i?t.stroke():t.nop(),d instanceof D.LinearGradient?(r={x:d.start().x,y:d.start().y},o={x:d.end().x,y:d.end().y},a={type:"linear",start:r,end:o,userSpace:d.userSpace(),stops:d.stops.elements().map(function(e){var t,n=e.offset();return n=/%$/.test(n)?parseFloat(n)/100:parseFloat(n),t=S(e.color()),t.a*=e.opacity(),{offset:n,color:t}})},s=e.rawBBox(),l=s.topLeft(),c=s.getSize(),s={left:l.x,top:l.y,width:c.width,height:c.height},t.gradient(a,s),!0):void(window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in PDF output."))):void 0}function f(e,t,n){h(e.fill())&&h(e.stroke())?p(e,t,n,!0)||t.fillStroke():h(e.fill())?p(e,t,n,!1)||t.fill():h(e.stroke())?t.stroke():t.nop()}function g(e,t){var n,i,r,o=e.segments;if(4==o.length&&e.options.closed){for(n=[],i=0;o.length>i;++i){if(o[i].controlIn())return!1;n[i]=o[i].anchor()}if(r=n[0].y==n[1].y&&n[1].x==n[2].x&&n[2].y==n[3].y&&n[3].x==n[0].x||n[0].x==n[1].x&&n[1].y==n[2].y&&n[2].x==n[3].x&&n[3].y==n[0].y)return t.rect(n[0].x,n[0].y,n[2].x-n[0].x,n[2].y-n[0].y),!0}}function m(e,t,n){var i,r,o,a,s,l,c=e.segments;if(0!==c.length&&!g(e,t,n)){for(r=0;c.length>r;++r)o=c[r],a=o.anchor(),i?(s=i.controlOut(),l=o.controlIn(),s&&l?t.bezier(s.x,s.y,l.x,l.y,a.x,a.y):t.lineTo(a.x,a.y)):t.moveTo(a.x,a.y),i=o;e.options.closed&&t.close()}}function v(e,t,n){m(e,t,n),f(e,t,n)}function _(e,t,n){var i,r=e.paths;for(i=0;r.length>i;++i)m(r[i],t,n);f(e,t,n)}function w(e,t,n){var i=e.geometry();t.circle(i.center.x,i.center.y,i.radius),f(e,t,n)}function y(e,t,n){var i,r=e.geometry().curvePoints();for(t.moveTo(r[0].x,r[0].y),i=1;r.length>i;)t.bezier(r[i].x,r[i++].y,r[i].x,r[i++].y,r[i].x,r[i++].y);f(e,t,n)}function b(e,t){var i,r=n().parseFontDef(e.options.font),o=e._position;e.fill()&&e.stroke()?i=n().TEXT_RENDERING_MODE.fillAndStroke:e.fill()?i=n().TEXT_RENDERING_MODE.fill:e.stroke()&&(i=n().TEXT_RENDERING_MODE.stroke),t.transform(1,0,0,-1,o.x,o.y+r.fontSize),t.beginText(),t.setFont(n().getFontURL(r),r.fontSize),t.setTextRenderingMode(i),t.showText(e.content()),t.endText()}function k(e,t,n){var i,r=e.children;for(i=0;r.length>i;++i)l(r[i],t,n)}function x(e,t){var n=e.src(),i=e.rect(),r=i.getOrigin(),o=i.getSize();t.transform(o.width,0,0,-o.height,r.x,r.y+o.height),t.drawImage(n)}function C(e,n){var i=t.Deferred();return e.options.set("pdf",n),D.pdf.toDataURL(e,i.resolve),i.promise()}function S(t){var n=e.parseColor(t,!0);return n?n.toRGB():null}function T(e){function t(e){return l=!0,e}function n(e){return e.visible()&&e.opacity()>0&&(h(e.fill())||h(e.stroke()))}function i(e){var t,n,i=[];for(t=0;e.length>t;++t)n=a(e[t]),null!=n&&i.push(n);return i}function r(e,t){var n,i=c,r=d;e.transform()&&(d=d.multiplyCopy(e.transform().matrix())),n=e.clip(),n&&(n=n.bbox(),n&&(n=n.bbox(d),c=c?A.Rect.intersect(c,n):n));try{return t()}finally{c=i,d=r}}function o(e){if(null==c)return!1;var t=e.rawBBox().bbox(d);return c&&t&&(t=A.Rect.intersect(t,c)),t}function a(a){if(!(a instanceof D.Group||a instanceof D.MultiPath)){var l=o(a);if(!l)return t(null);u=u?A.Rect.union(u,l):l}return s({Path:function(e){return 0!==e.segments.length&&n(e)?e:t(null)},MultiPath:function(e){if(!n(e))return t(null);var r=new D.MultiPath(e.options);return r.paths=i(e.paths),0===r.paths.length?t(null):r},Circle:function(e){return n(e)?e:t(null)},Arc:function(e){return n(e)?e:t(null)},Text:function(e){return/\S/.test(e.content())&&n(e)?e:t(null)},Image:function(e){return e.visible()&&e.opacity()>0?e:t(null)},Group:function(n){return r(n,function(){var r=new D.Group(n.options);return r.children=i(n.children),n!==e&&0===r.children.length?t(null):r})}},a)}var l,c=!1,d=A.Matrix.unit(),u=null;do l=!1,e=a(e);while(e&&l);return{root:e,bbox:u}}var D=e.drawing,A=e.geometry,E={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},I={butt:0,round:1,square:2},P={miter:0,round:1,bevel:2};e.deepExtend(D,{exportPDF:C,pdf:{toDataURL:r,toBlob:o,saveAs:a,toStream:i}})}(window.kendo,window.kendo.jQuery),function(e,t,n){"use strict";function i(e){function t(t){return i=t.exec(e.substr(a))}function n(e){return e.replace(/^\s+|\s+$/g,"")}for(var i,r=[],o=0,a=0,s=0,l=!1;e.length>a;)t(/^\s+/)?a+=i[0].length:t(/^[\(\[\{]/)?(s++,a++):t(/^[\)\]\}]/)?(s--,a++):!l&&t(/^[\"\']/)?(l=i[0],a++):"'"==l&&t(/^\\\'/)?a+=2:'"'==l&&t(/^\\\"/)?a+=2:"'"==l&&t(/^\'/)?(l=!1,a++):'"'==l&&t(/^\"/)?(l=!1,a++):t(/^\s*,\s*/)?(!l&&!s&&a>o&&(r.push(n(e.substring(o,a))),o=a+i[0].length),a+=i[0].length):a++;return a>o&&r.push(n(e.substring(o,a))),r}function r(e,t){var n=kendo.parseColor(e);return n&&(n=n.toRGB(),t?n=n.toCssRgba():0===n.a&&(n=null)),n}function o(e,t){function n(e){j[e]||(j[e]=!0,o.push(e))}function i(){--r<=0&&t()}var r,o=[];!function s(e){var t,i=a(h(u(e),"background-image"));for(/^img$/i.test(e.tagName)&&n(e.src),i&&n(i),t=e.firstChild;t;t=t.nextSibling)1==t.nodeType&&s(t)}(e),r=o.length,0===r&&i(),o.forEach(function(e){var t=j[e]=new Image;t.onload=i,t.onerror=function(){j[e]=null,i()},t.src=e,(t.complete||void 0===t.complete)&&(t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",t.src=e)})}function a(e){var t=/^\s*url\((['"]?)(.*?)\1\)\s*$/i.exec(e);return t?t[2]:void 0}function s(e,t,n){var i,r;L=Object.create(L),L[e.tagName.toLowerCase()]={element:e,style:t},i=h(t,"text-decoration"),i&&"none"!=i&&(r=h(t,"color"),i.split(/\s+/g).forEach(function(e){L[e]||(L[e]=r)})),d(e)&&(L._stackingContext={element:e,group:n})}function l(){L=Object.getPrototypeOf(L)}function c(e){if(null!=L._clipbox){var t=e.bbox(L._matrix);L._clipbox=L._clipbox?V.Rect.intersect(L._clipbox,t):t}}function d(e){function t(e){return h(n,e)}var n=u(e);return"none"!=t("transform")||"static"!=t("position")&&"auto"!=t("z-index")||t("opacity")<1?!0:void 0}function u(e){return window.getComputedStyle(e)}function h(e,t){return e.getPropertyValue(t)||W.webkit&&e.getPropertyValue("-webkit-"+t)||W.firefox&&e.getPropertyValue("-moz-"+t)||W.opera&&e.getPropertyValue("-o-"+t)||W.msie&&e.getPropertyValue("-ms-"+t)}function p(e,t,n,i){e.setProperty(t,n,i),W.webkit?e.setProperty("-webkit-"+t,n,i):W.firefox?e.setProperty("-moz-"+t,n,i):W.opera?e.setProperty("-o-"+t,n,i):W.msie&&(e.setProperty("-ms-"+t,n,i),t="ms"+t.replace(/(^|-)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),e[t]=n)}function f(e,n){return n="border-"+n,{width:t(h(e,n+"-width")),style:h(e,n+"-style"),color:r(h(e,n+"-color"),!0)}}function g(e,t){var n=e.style.cssText,i=t();return e.style.cssText=n,i}function m(e,n){var i=h(e,"border-"+n+"-radius").split(/\s+/g).map(t);return 1==i.length&&i.push(i[0]),S({x:i[0],y:i[1]})}function v(e){var t=e.getBoundingClientRect();return t=_(t,"border-*-width",e),t=_(t,"padding-*",e)}function _(e,n,i){var r,o,a,s,l;return"string"==typeof n?(r=u(i),o=t(h(r,n.replace("*","top"))),a=t(h(r,n.replace("*","right"))),s=t(h(r,n.replace("*","bottom"))),l=t(h(r,n.replace("*","left")))):"number"==typeof n&&(o=a=s=l=n),{top:e.top+o,right:e.right-a,bottom:e.bottom-s,left:e.left+l,width:e.right-e.left-a-l,height:e.bottom-e.top-s-o}}function w(e){var n,i,r=h(e,"transform");return"none"==r?null:(n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(r),n?(i=h(e,"transform-origin"),n=n[1].split(/\s*,\s*/g).map(t),i=i.split(/\s+/g).map(t),{matrix:n,origin:i}):void 0)}function y(e){return 180*e/n.PI%360}function b(e){var i=t(e);return/grad$/.test(e)?n.PI*i/200:/rad$/.test(e)?i:/turn$/.test(e)?n.PI*i*2:/deg$/.test(e)?n.PI*i/180:void 0}function k(e,t){return t=new V.Matrix(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function x(e,t){e.clip(t)}function C(e,t,n,i){for(var r=new V.Arc([t,n],i).curvePoints(),o=1;r.length>o;)e.curveTo(r[o++],r[o++],r[o++])}function S(e){return(0>=e.x||0>=e.y)&&(e.x=e.y=0),e}function T(e,n,i){var r,o,a,s,l,c,d,p,g=u(e),v=m(g,"top-left"),_=m(g,"top-right"),w=m(g,"bottom-left"),y=m(g,"bottom-right");return("padding"==i||"content"==i)&&(r=f(g,"top"),o=f(g,"right"),a=f(g,"bottom"),s=f(g,"left"),v.x-=s.width,v.y-=r.width,_.x-=o.width,_.y-=r.width,y.x-=o.width,y.y-=a.width,w.x-=s.width,w.y-=a.width,"content"==i&&(l=t(h(g,"padding-top")),c=t(h(g,"padding-right")),d=t(h(g,"padding-bottom")),p=t(h(g,"padding-left")),v.x-=p,v.y-=l,_.x-=c,_.y-=l,y.x-=c,y.y-=d,w.x-=p,w.y-=d)),"number"==typeof i&&(v.x-=i,v.y-=i,_.x-=i,_.y-=i,y.x-=i,y.y-=i,w.x-=i,w.y-=i),D(n,v,_,y,w)}function D(e,t,n,i,r){var o=new O.Path({fill:null,stroke:null});return S(t),S(n),S(i),S(r),o.moveTo(e.left,e.top+t.y),t.x&&C(o,e.left+t.x,e.top+t.y,{startAngle:-180,endAngle:-90,radiusX:t.x,radiusY:t.y}),o.lineTo(e.right-n.x,e.top),n.x&&C(o,e.right-n.x,e.top+n.y,{startAngle:-90,endAngle:0,radiusX:n.x,radiusY:n.y}),o.lineTo(e.right,e.bottom-i.y),i.x&&C(o,e.right-i.x,e.bottom-i.y,{startAngle:0,endAngle:90,radiusX:i.x,radiusY:i.y}),o.lineTo(e.left+r.x,e.bottom),r.x&&C(o,e.left+r.x,e.bottom-r.y,{startAngle:90,endAngle:180,radiusX:r.x,radiusY:r.y}),o.close()}function A(e,o){function s(t){var n,i,r,o,a,s;if(/^td$/i.test(e.tagName)&&(n=L.table,n&&"collapse"==h(n.style,"border-collapse"))){if(i=f(n.style,"left").width,r=f(n.style,"top").width,0===i&&0===r)return t;if(o=n.element.getBoundingClientRect(),a=n.element.rows[0].cells[0],s=a.getBoundingClientRect(),s.top==o.top||s.left==o.left)return U.call(t).map(function(e){return{left:e.left+i,top:e.top+r,right:e.right+i,bottom:e.bottom+r,height:e.height,width:e.width}})}return t}function l(e,t,i,r,a,s,l,c){function d(t,r,o){var a=n.PI/2*t/(t+i),s={x:r.x-t,y:r.y-i},l=new O.Path({fill:{color:e},stroke:null}).moveTo(0,0);k(l,o),C(l,0,r.y,{startAngle:-90,endAngle:-y(a),radiusX:r.x,radiusY:r.y}),s.x>0&&s.y>0?(l.lineTo(s.x*n.cos(a),r.y-s.y*n.sin(a)),C(l,0,r.y,{startAngle:-y(a),endAngle:-90,radiusX:s.x,radiusY:s.y,anticlockwise:!0})):s.x>0?l.lineTo(s.x,i).lineTo(0,i):l.lineTo(s.x,i).lineTo(s.x,0),h.append(l.close())}if(!(0>=i)){var u,h=new O.Group;k(h,c),o.append(h),S(s),S(l),u=new O.Path({fill:{color:e},stroke:null}),h.append(u),u.moveTo(s.x?n.max(s.x,r):0,0).lineTo(t-(l.x?n.max(l.x,a):0),0).lineTo(t-n.max(l.x,a),i).lineTo(n.max(s.x,r),i).close(),s.x&&d(r,s,[-1,0,0,1,s.x,0]),l.x&&d(a,l,[1,0,0,1,t-l.x,0])}}function d(e){var t,n,i,r,a,s,l,c=new O.Group;for(x(c,D(e,Y,Q,X,K)),o.append(c),J&&(t=new O.Path({fill:{color:J.toCssRgba()},stroke:null}),t.moveTo(e.left,e.top).lineTo(e.right,e.top).lineTo(e.right,e.bottom).lineTo(e.left,e.bottom).close(),c.append(t)),l=v.length;--l>=0;)n=v[l],i=w[l]||w[w.length-1],r=b[l]||b[b.length-1],a=A[l]||A[A.length-1],s=P[l]||P[P.length-1],p(c,e,n,i,r,a,s)}function p(n,i,r,o,s,l,c){function d(n,i,r,a,d){function u(){for(;m.origin.x>i.left;)m.origin.x-=r}function h(){for(;m.origin.y>i.top;)m.origin.y-=a}function p(){for(;i.right>m.origin.x;)d(n,m.clone()),m.origin.x+=r}var f,g,m,v,w=r/a,y=i;if("content-box"==l?(y=_(y,"border-*-width",e),y=_(y,"padding-*",e)):"padding-box"==l&&(y=_(y,"border-*-width",e)),/^\s*auto(\s+auto)?\s*$/.test(c)||(f=c.split(/\s+/g),r=/%$/.test(f[0])?y.width*t(f[0])/100:t(f[0]),a=1==f.length||"auto"==f[1]?r/w:/%$/.test(f[1])?y.height*t(f[1])/100:t(f[1])),g=(s+"").split(/\s+/),1==g.length&&(g[1]="50%"),g[0]=/%$/.test(g[0])?t(g[0])/100*(y.width-r):t(g[0]),g[1]=/%$/.test(g[1])?t(g[1])/100*(y.height-a):t(g[1]),m=new V.Rect([y.left+g[0],y.top+g[1]],[r,a]),"no-repeat"==o)d(n,m);else if("repeat-x"==o)u(),p();else if("repeat-y"==o)for(h();i.bottom>m.origin.y;)d(n,m.clone()),m.origin.y+=a;else if("repeat"==o)for(u(),h(),v=m.origin.clone();i.bottom>m.origin.y;)m.origin.x=v.x,p(),m.origin.y+=a}var u,h,p;r&&"none"!=r&&(/^url\(\"data:image\/svg/i.test(r)||(u=a(r),u?(h=j[u],h&&h.width>0&&h.height>0&&d(n,i,h.width,h.height,function(e,t){e.append(new O.Image(u,t))})):(p=N(r),p&&d(n,i,i.width,i.height,E(p)))))}function g(t,n,i){function r(e){return{x:e.y,y:e.x}}var a,s,c;if(0!==t.width&&0!==t.height&&(d(t),a=$.width>0&&(n&&"ltr"==Z||i&&"rtl"==Z),s=q.width>0&&(i&&"ltr"==Z||n&&"rtl"==Z),0!==H.width||0!==$.width||0!==q.width||0!==G.width)){if(H.color==q.color&&H.color==G.color&&H.color==$.color&&H.width==q.width&&H.width==G.width&&H.width==$.width&&a&&s)return t=_(t,H.width/2),c=T(e,t,H.width/2),c.options.stroke={color:H.color,width:H.width},void o.append(c);if(0===Y.x&&0===Q.x&&0===X.x&&0===K.x&&2>H.width&&2>$.width&&2>q.width&&2>G.width)return H.width>0&&o.append(new O.Path({stroke:{width:H.width,color:H.color}}).moveTo(t.left,t.top+H.width/2).lineTo(t.right,t.top+H.width/2)),G.width>0&&o.append(new O.Path({stroke:{width:G.width,color:G.color}}).moveTo(t.left,t.bottom-G.width/2).lineTo(t.right,t.bottom-G.width/2)),a&&o.append(new O.Path({stroke:{width:$.width,color:$.color}}).moveTo(t.left+$.width/2,t.top).lineTo(t.left+$.width/2,t.bottom)),void(s&&o.append(new O.Path({stroke:{width:q.width,color:q.color}}).moveTo(t.right-q.width/2,t.top).lineTo(t.right-q.width/2,t.bottom)));l(H.color,t.width,H.width,$.width,q.width,Y,Q,[1,0,0,1,t.left,t.top]),l(G.color,t.width,G.width,q.width,$.width,X,K,[-1,0,0,-1,t.right,t.bottom]),l($.color,t.height,$.width,G.width,H.width,r(K),r(Y),[0,-1,1,0,t.left,t.bottom]),l(q.color,t.height,q.width,H.width,G.width,r(Q),r(X),[0,1,-1,0,t.right,t.top])}}var v,w,b,A,P,M,z,R,B=u(e),H=f(B,"top"),q=f(B,"right"),G=f(B,"bottom"),$=f(B,"left"),Y=m(B,"top-left"),Q=m(B,"top-right"),K=m(B,"bottom-left"),X=m(B,"bottom-right"),Z=h(B,"direction"),J=h(B,"background-color");for(J=r(J),v=i(h(B,"background-image")),w=i(h(B,"background-repeat")),b=i(h(B,"background-position")),A=i(h(B,"background-origin")),P=i(h(B,"background-size")),W.msie&&10>W.version&&(b=i(e.currentStyle.backgroundPosition)),M=_(e.getBoundingClientRect(),"border-*-width",e),function(){var e,n,i,r,a,s,l,d=h(B,"clip"),u=/^\s*rect\((.*)\)\s*$/.exec(d);u&&(e=u[1].split(/[ ,]+/g),n="auto"==e[0]?M.top:t(e[0])+M.top,i="auto"==e[1]?M.right:t(e[1])+M.left,r="auto"==e[2]?M.bottom:t(e[2])+M.top,a="auto"==e[3]?M.left:t(e[3])+M.left,s=new O.Group,l=(new O.Path).moveTo(a,n).lineTo(i,n).lineTo(i,r).lineTo(a,r).close(),x(s,l),o.append(s),o=s,c(l))}(),z=e.getClientRects(),1==z.length&&(z=[e.getBoundingClientRect()]),z=s(z),R=0;z.length>R;++R)g(z[R],0===R,R==z.length-1);return function(){function t(){var t=T(e,M,"padding"),n=new O.Group;x(n,t),o.append(n),o=n,c(t)}/^(hidden|auto|scroll)/.test(h(B,"overflow"))?t():/^(hidden|auto|scroll)/.test(h(B,"overflow-x"))?t():/^(hidden|auto|scroll)/.test(h(B,"overflow-y"))&&t()}(),I(e,o)||F(e,o),o}function E(e){return function(i,r){{var o,a,s,l,c,d,u,h,p,f,g,m,v,_=r.width(),w=r.height();r.topLeft()}switch(e.type){case"linear":switch(o=null!=e.angle?e.angle:n.PI,e.to){case"top":o=0;break;case"left":o=-n.PI/2;break;case"bottom":o=n.PI;break;case"right":o=n.PI/2;break;case"top left":case"left top":o=-n.atan2(w,_);break;case"top right":case"right top":o=n.atan2(w,_);break;case"bottom left":case"left bottom":o=n.PI+n.atan2(w,_);break;case"bottom right":case"right bottom":o=n.PI-n.atan2(w,_)}e.reverse&&(o-=n.PI),o%=2*n.PI,0>o&&(o+=2*n.PI),a=n.abs(_*n.sin(o))+n.abs(w*n.cos(o)),s=n.atan(_*n.tan(o)/w),l=n.sin(s),c=n.cos(s),d=n.abs(l)+n.abs(c),u=d/2*l,h=d/2*c,o>n.PI/2&&3*n.PI/2>=o&&(u=-u,h=-h),p=[],f=0,g=e.stops.map(function(n,i){var r,o=n.percent;return o?o=t(o)/100:n.length?o=t(n.length)/a:0===i?o=0:i==e.stops.length-1&&(o=1),r={color:n.color.toCssRgba(),offset:o},null!=o?(f=o,p.forEach(function(e,t){var n=e.stop;n.offset=e.left+(f-e.left)*(t+1)/(p.length+1)}),p=[]):p.push({left:f,stop:r}),r}),m=[.5-u,.5+h],v=[.5+u,.5-h],i.append(O.Path.fromRect(r).stroke(null).fill(new O.LinearGradient({start:m,end:v,stops:g,userSpace:!1})));break;case"radial":window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in HTML renderer")}}}function I(t,n){var i,r,o,a;return t.getAttribute(kendo.attr("role"))&&(i=kendo.widgetInstance(e(t)),i&&(i.exportDOMVisual||i.exportVisual))?(r=i.exportDOMVisual?i.exportDOMVisual():i.exportVisual(),o=new O.Group,o.children.push(r),a=t.getBoundingClientRect(),o.transform(V.transform().translate(a.left,a.top)),n.append(o),!0):void 0}function P(e,t,n){var i=v(e),r=new V.Rect([i.left,i.top],[i.width,i.height]),o=new O.Image(t,r);x(o,T(e,i,"content")),n.append(o)}function M(e,n){var i=u(e),r=u(n),o=t(h(i,"z-index")),a=t(h(r,"z-index")),s=h(i,"position"),l=h(r,"position");return isNaN(o)&&isNaN(a)?/static|absolute/.test(s)&&/static|absolute/.test(l)?0:"static"==s?-1:"static"==l?1:0:isNaN(o)?0===a?0:a>0?-1:1:isNaN(a)?0===o?0:o>0?1:-1:t(o)-t(a)}function F(e,t){var n,i,r,o,a,s,l,c,d;switch(e.tagName.toLowerCase()){case"img":P(e,e.src,t);break;case"canvas":try{P(e,e.toDataURL("image/jpeg"),t)}catch(p){}break;case"textarea":case"input":break;default:for(n=[],i=[],r=[],o=[],a=e.firstChild;a;a=a.nextSibling)switch(a.nodeType){case 3:/\S/.test(a.data)&&z(e,a,t);break;case 1:s=u(a),l=h(s,"display"),c=h(s,"float"),d=h(s,"position"),"static"!=d?o.push(a):"inline"!=l?"none"!=c?i.push(a):n.push(a):r.push(a)}n.sort(M).forEach(function(e){B(e,t)}),i.sort(M).forEach(function(e){B(e,t)}),r.sort(M).forEach(function(e){B(e,t)}),o.sort(M).forEach(function(e){B(e,t)})}}function z(e,n,i){function r(){for(var e,t,i;!/\S/.test(s.charAt(p));){if(p>=f)return!0;p++}for(l.setStart(n,p),e=0;++p<=f;)if(++e,l.setEnd(n,p),e>1&&(d&&/\s/.test(s.charAt(p-1))||l.getClientRects().length>1)){l.setEnd(n,--p);break}t=l.getClientRects()[0],i=(""+l).replace(/\s+$/,""),o(i,t)}function o(e,t){var n,r,o;e=e.replace(/[\r\n ]+/g," "),W.msie&&!isNaN(m)&&(n=O.util.measureText(e,{font:v}),r=(t.top+t.bottom-n.height)/2,t={top:r,right:t.right,bottom:r+n.height,left:t.left,height:n.height,width:t.right-t.left}),o=new O.Text(e,new V.Point(t.left,t.top),{font:v,fill:{color:_}}),i.append(o),a(t)}function a(e){function t(t,n){var r,o;t&&(r=g/12,o=new O.Path({stroke:{width:r,color:t}}),n-=r,o.moveTo(e.left,n).lineTo(e.right,n),i.append(o))}t(L.underline,e.bottom),t(L["line-through"],e.bottom-e.height/2.7),t(L.overline,e.top)}var s,l,c,d,p,f,g,m,v,_,w=u(e);if(!(t(h(w,"text-indent"))<-500)&&(s=n.data,l=e.ownerDocument.createRange(),c=h(w,"text-align"),d="justify"==c,p=0,f=/\S\s*$/.exec(n.data).index+1,g=h(w,"font-size"),m=h(w,"line-height"),v=[h(w,"font-style"),h(w,"font-variant"),h(w,"font-weight"),g,h(w,"font-family")].join(" "),g=t(g),m=t(m),0!==g))for(_=h(w,"color");!r(););}function R(e,t){var n,i,r=L._stackingContext.group,o=r.children;for(n=0;o.length>n&&!(null!=o[n]._dom_zIndex&&o[n]._dom_zIndex>t);++n);return i=new O.Group,r.insertAt(i,n),i._dom_zIndex=t,L._clipbox&&i.clip(O.Path.fromRect(L._clipbox)),i}function B(n,i){var r,o,a,c,d,f,m;/^(style|script|link|meta|iframe|svg)$/i.test(n.tagName)||null!=L._clipbox&&(r=u(n),o=t(h(r,"opacity")),a=h(r,"visibility"),c=h(r,"display"),0!==o&&"hidden"!=a&&"none"!=c&&(d=w(r),m=h(r,"z-index"),(d||1>o)&&"auto"==m&&(m=0),"auto"!=m?f=R(i,m):(f=new O.Group,i.append(f)),f.DEBUG=e(n).data("debug"),1>o&&f.opacity(o*f.opacity()),s(n,r,f),d?g(n,function(){var e,t,i,o;p(n.style,"transform","none","important"),p(n.style,"transition","none","important"),"static"==h(r,"position")&&p(n.style,"position","relative","important"),e=n.getBoundingClientRect(),t=e.left+d.origin[0],i=e.top+d.origin[1],o=[1,0,0,1,-t,-i],o=H(o,d.matrix),o=H(o,[1,0,0,1,t,i]),o=k(f,o),L._matrix=L._matrix.multiplyCopy(o),A(n,f)}):A(n,f),l()))}function H(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],c=t[1],d=t[2],u=t[3],h=t[4],p=t[5];return[n*l+i*d,n*c+i*u,r*l+o*d,r*c+o*u,a*l+s*d+h,a*c+s*u+p]}var L,N,O=kendo.drawing,V=kendo.geometry,U=Array.prototype.slice,W=kendo.support.browser,j={};O.drawDOM=function(t){var n=e.Deferred();return t=e(t)[0],t?o(t,function(){var e=new O.Group,i=t.getBoundingClientRect();k(e,[1,0,0,1,-i.left,-i.top]),L._clipbox=!1,L._matrix=V.Matrix.unit(),L._stackingContext={element:t,group:e},B(t,e),n.resolve(e)}):n.reject("No element to export"),n.promise()},L={},N=function(){var e=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,n=/^([-0-9.]+px)/,i=/^(left|right|top|bottom|to|center)\W/,r=/^([-0-9.]+(deg|grad|rad|turn))/,o=/^(\s+)/,a=/^(\()/,s=/^(\))/,l=/^(,)/;return function(c){function d(){var e=o.exec(c);e&&(c=c.substr(e[1].length))}function u(e){d();var t=e.exec(c);return t?(c=c.substr(t[1].length),t[1]):void 0}function h(){var e,i,r=kendo.parseColor(c,!0);return r?(c=c.substr(r.match[0].length),r=r.toRGB(),(e=u(n))||(i=u(t)),{color:r,length:e,percent:i}):void 0}function p(e){var n,o,d,p,g,m,v=[],_=!1;if(u(a)){for(n=u(r),n?(n=b(n),u(l)):(o=u(i),"to"==o?o=u(i):o&&/^-/.test(e)&&(_=!0),d=u(i),u(l)),/-moz-/.test(e)&&null==n&&null==o&&(p=u(t),g=u(t),_=!0,"0%"==p?o="left":"100%"==p&&(o="right"),"0%"==g?d="top":"100%"==g&&(d="bottom"),u(l));c&&!u(s)&&(m=h());)v.push(m),u(l);return{type:"linear",angle:n,to:o&&d?o+" "+d:o?o:d?d:null,stops:v,reverse:_,orig:f}}}var f=c,g=u(e);return g?p(g):void 0}}()}(window.kendo.jQuery,parseFloat,Math),function(e){var t=e.noop,n=window.kendo,i=n.Class,r=n.util,o=n.animationFrame,a=n.deepExtend,s=i.extend({init:function(e,t){var n=this;n.options=a({},n.options,t),n.element=e},options:{duration:500,easing:"swing"},setup:t,step:t,play:function(){var t=this,n=t.options,i=e.easing[n.easing],a=n.duration,s=n.delay||0,l=r.now()+s,c=l+a;0===a?(t.step(1),t.abort()):setTimeout(function(){var e=function(){var n,s,d,u;t._stopped||(n=r.now(),s=r.limitValue(n-l,0,a),d=s/a,u=i(d,s,0,1,a),t.step(u),c>n?o(e):t.abort())};e()},s)},abort:function(){this._stopped=!0},destroy:function(){this.abort()}}),l=function(){this._items=[]};l.prototype={register:function(e,t){this._items.push({name:e,type:t})},create:function(e,t){var n,i,r,o=this._items;if(t&&t.type)for(i=t.type.toLowerCase(),r=0;o.length>r;r++)if(o[r].name.toLowerCase()===i){n=o[r];break}return n?new n.type(e,t):void 0}},l.current=new l,s.create=function(e,t,n){return l.current.create(e,t,n)},a(n.drawing,{Animation:s,AnimationFactory:l})}(window.kendo.jQuery,Math),function(e){function t(t){var n,i=s.ui.validator.ruleResolvers||{},r={};for(n in i)e.extend(!0,r,i[n].resolve(t));return r}function n(e){return e.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function i(e){return e=(e+"").split("."),e.length>1?e[1].length:0}function r(t){return e(e.parseHTML?e.parseHTML(t):t)}function o(t,n){var i,r,o,a,l=e();for(o=0,a=t.length;a>o;o++)i=t[o],u.test(i.className)&&(r=i.getAttribute(s.attr("for")),r===n&&(l=l.add(i)));return l}var a,s=window.kendo,l=s.ui.Widget,c=".kendoValidator",d="k-invalid-msg",u=RegExp(d,"i"),h="k-invalid",p=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,f=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,g=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",m=":checkbox:not([disabled],[readonly])",v="[type=number],[type=range]",_="blur",w="name",y="form",b="novalidate",k=e.proxy,x=function(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)},C=function(e,t,n){var i=e.val();return e.filter(t).length&&""!==i?x(i,n):!0},S=function(e,t){return e.length?null!=e[0].attributes[t]:!1};s.ui.validator||(s.ui.validator={rules:{},messages:{}}),a=l.extend({init:function(n,i){var r=this,o=t(n),a="["+s.attr("validate")+"!=false]";i=i||{},i.rules=e.extend({},s.ui.validator.rules,o.rules,i.rules),i.messages=e.extend({},s.ui.validator.messages,o.messages,i.messages),l.fn.init.call(r,n,i),r._errorTemplate=s.template(r.options.errorTemplate),r.element.is(y)&&r.element.attr(b,b),r._inputSelector=g+a,r._checkboxSelector=m+a,r._errors={},r._attachEvents(),r._isValidated=!1},events:["validate","change"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> </span> #=message#</span>',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date"},rules:{required:function(e){var t=e.filter("[type=checkbox]").length&&!e.is(":checked"),n=e.val();return!(S(e,"required")&&(""===n||!n||t))},pattern:function(e){return e.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&""!==e.val()?x(e.val(),e.attr("pattern")):!0},min:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[min]").length&&""!==e.val()){var t=parseFloat(e.attr("min"))||0,n=s.parseFloat(e.val());return n>=t}return!0},max:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[max]").length&&""!==e.val()){var t=parseFloat(e.attr("max"))||0,n=s.parseFloat(e.val());return t>=n}return!0},step:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[step]").length&&""!==e.val()){var t,n=parseFloat(e.attr("min"))||0,r=parseFloat(e.attr("step"))||1,o=parseFloat(e.val()),a=i(r);return a?(t=Math.pow(10,a),(o-n)*t%(r*t)/Math.pow(100,a)===0):(o-n)%r===0}return!0},email:function(e){return C(e,"[type=email],["+s.attr("type")+"=email]",p)},url:function(e){return C(e,"[type=url],["+s.attr("type")+"=url]",f)},date:function(e){return e.filter("[type^=date],["+s.attr("type")+"=date]").length&&""!==e.val()?null!==s.parseDate(e.val(),e.attr(s.attr("format"))):!0}},validateOnBlur:!0},destroy:function(){l.fn.destroy.call(this),this.element.off(c)},value:function(){return this._isValidated?0===this.errors().length:!1},_submit:function(e){return this.validate()?!0:(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!1)},_checkElement:function(e){var t=this.value();this.validateInput(e),this.value()!==t&&this.trigger("change")},_attachEvents:function(){var t=this;t.element.is(y)&&t.element.on("submit"+c,k(t._submit,t)),t.options.validateOnBlur&&(t.element.is(g)?(t.element.on(_+c,function(){t._checkElement(t.element)}),t.element.is(m)&&t.element.on("click"+c,function(){t._checkElement(t.element)})):(t.element.on(_+c,t._inputSelector,function(){t._checkElement(e(this))}),t.element.on("click"+c,t._checkboxSelector,function(){t._checkElement(e(this))})))},validate:function(){var e,t,n,i,r=!1,o=this.value();if(this._errors={},this.element.is(g))r=this.validateInput(this.element);else{for(i=!1,e=this.element.find(this._inputSelector),t=0,n=e.length;n>t;t++)this.validateInput(e.eq(t))||(i=!0);r=!i}return this.trigger("validate",{valid:r}),o!==r&&this.trigger("change"),r},validateInput:function(t){var i,o,a,l,c,u,p,f,g;return t=e(t),this._isValidated=!0,i=this,o=i._errorTemplate,a=i._checkValidity(t),l=a.valid,c="."+d,u=t.attr(w)||"",p=i._findMessageContainer(u).add(t.next(c).filter(function(){var t=e(this);return t.filter("["+s.attr("for")+"]").length?t.attr(s.attr("for"))===u:!0})).hide(),t.removeAttr("aria-invalid"),l?delete i._errors[u]:(f=i._extractMessage(t,a.key),i._errors[u]=f,g=r(o({message:n(f)})),i._decorateMessageContainer(g,u),p.replaceWith(g).length||g.insertAfter(t),g.show(),t.attr("aria-invalid",!0)),t.toggleClass(h,!l),l},hideMessages:function(){var e=this,t="."+d,n=e.element;n.is(g)?n.next(t).hide():n.find(t).hide()},_findMessageContainer:function(t){var n,i,r,a=s.ui.validator.messageLocators,l=e();for(i=0,r=this.element.length;r>i;i++)l=l.add(o(this.element[i].getElementsByTagName("*"),t));for(n in a)l=l.add(a[n].locate(this.element,t));return l},_decorateMessageContainer:function(e,t){var n,i=s.ui.validator.messageLocators;e.addClass(d).attr(s.attr("for"),t||"");for(n in i)i[n].decorate(e,t);e.attr("role","alert")
19
+ },_extractMessage:function(e,t){var n=this,i=n.options.messages[t],r=e.attr(w);return i=s.isFunction(i)?i(e):i,s.format(e.attr(s.attr(t+"-msg"))||e.attr("validationMessage")||e.attr("title")||i||"",r,e.attr(t))},_checkValidity:function(e){var t,n=this.options.rules;for(t in n)if(!n[t].call(this,e))return{valid:!1,key:t};return{valid:!0}},errors:function(){var e,t=[],n=this._errors;for(e in n)t.push(n[e]);return t}}),s.ui.plugin(a)}(window.kendo.jQuery),function(e){function t(e,t){var n=e.x.location,i=e.y.location,r=t.x.location,o=t.y.location,a=n-r,s=i-o;return{center:{x:(n+r)/2,y:(i+o)/2},distance:Math.sqrt(a*a+s*s)}}function n(e){var t,n,i,r=[],a=e.originalEvent,s=e.currentTarget,l=0;if(e.api)r.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:"api"});else if(e.type.match(/touch/))for(n=a?a.changedTouches:[],t=n.length;t>l;l++)i=n[l],r.push({location:i,event:e,target:i.target,currentTarget:s,id:i.identifier,type:"touch"});else r.push(o.pointers||o.msPointers?{location:a,event:e,target:e.target,currentTarget:s,id:a.pointerId,type:"pointer"}:{id:1,event:e,target:e.target,currentTarget:s,location:e,type:"mouse"});return r}function i(e){for(var t=r.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var r=window.kendo,o=r.support,a=window.document,s=r.Class,l=r.Observable,c=e.now,d=e.extend,u=o.mobileOS,h=u&&u.android,p=800,f=o.browser.msie?5:0,g="press",m="hold",v="select",_="start",w="move",y="end",b="cancel",k="tap",x="release",C="gesturestart",S="gesturechange",T="gestureend",D="gesturetap",A={api:0,touch:0,mouse:9,pointer:9},E=s.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=c()},move:function(e){var t=this,n=e["page"+t.axis],i=c(),r=i-t.timeStamp||1;(n||!h)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/r,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),I=s.extend({init:function(e,t,n){d(this,{x:new E("X",n.location),y:new E("Y",n.location),type:n.type,threshold:e.threshold||A[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(g,this.pressEvent)},_hold:function(){this._trigger(m,this.pressEvent)},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(P.current&&P.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(w,e)}},end:function(e){var t=this;t.endTime=c(),t._finished||(t._finished=!0,t._trigger(x,e),t._moved?t._trigger(y,e):t._trigger(k,e),clearTimeout(t._holdTimeout),t.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=c(),this._moved=!0,this._trigger(_,e)},_trigger:function(e,t){var n=this,i=t.event,r={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,r)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}}),P=l.extend({init:function(t,n){var s,c,u,h=this,A=r.guid();n=n||{},s=h.filter=n.filter,h.threshold=n.threshold||f,h.minHold=n.minHold||p,h.touches=[],h._maxTouches=n.multiTouch?2:1,h.allowSelection=n.allowSelection,h.captureUpIfMoved=n.captureUpIfMoved,h.eventNS=A,t=e(t).handler(h),l.fn.init.call(h),d(h,{element:t,surface:e(n.global&&!o.touch?a.documentElement:n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),h.surface.handler(h).on(r.applyEventMap("move",A),"_move").on(r.applyEventMap("up cancel",A),"_end"),t.on(r.applyEventMap("down",A),s,"_start"),(o.pointers||o.msPointers)&&t.css("-ms-touch-action","pinch-zoom double-tap-zoom"),n.preventDragEvent&&t.on(r.applyEventMap("dragstart",A),r.preventDefault),t.on(r.applyEventMap("mousedown",A),s,{root:t},"_select"),h.captureUpIfMoved&&o.eventCapture&&(c=h.surface[0],u=e.proxy(h.preventIfMoving,h),i(function(e){c.addEventListener(e,u,!0)})),h.bind([g,m,k,_,w,y,x,b,C,S,T,D,v],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&o.eventCapture&&(e=t.surface[0],i(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget)},capture:function(){P.current=this},cancel:function(){this._disposeAll(),this.trigger(b)},notify:function(e,n){var i=this,r=i.touches;if(this._isMultiTouch()){switch(e){case w:e=S;break;case y:e=T;break;case k:e=D}d(n,{touches:r},t(r[0],r[1]))}return this.trigger(e,d(n,{type:e}))},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(v,{event:e}))&&e.preventDefault()},_start:function(t){var i,r,o=this,a=0,s=o.filter,l=n(t),c=l.length,d=t.which;if(!(d&&d>1||o._maxTouchesReached()))for(P.current=null,o.currentTarget=t.currentTarget,o.stopPropagation&&t.stopPropagation();c>a&&!o._maxTouchesReached();a++)r=l[a],i=s?e(r.currentTarget):o.element,i.length&&(r=new I(o,i,r),o.touches.push(r),r.press(),o._isMultiTouch()&&o.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_eachTouch:function(e,t){var i,r,o,a,s=this,l={},c=n(t),d=s.touches;for(i=0;d.length>i;i++)r=d[i],l[r.id]=r;for(i=0;c.length>i;i++)o=c[i],a=l[o.id],a&&a[e](o)},_apiCall:function(t,n,i,r){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(r||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});P.defaultThreshold=function(e){f=e},P.minHold=function(e){p=e},r.getTouches=n,r.touchDelta=t,r.UserEvents=P}(window.kendo.jQuery),function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e,t){return parseInt(e.css(t),10)||0}function r(e,t){return Math.min(Math.max(e,t.min),t.max)}function o(e,t){var n=k(e),r=n.left+i(e,"borderLeftWidth")+i(e,"paddingLeft"),o=n.top+i(e,"borderTopWidth")+i(e,"paddingTop"),a=r+e.width()-t.outerWidth(!0),s=o+e.height()-t.outerHeight(!0);return{x:{min:r,max:a},y:{min:o,max:s}}}function a(e,n,i){for(var r,o,a=0,s=n&&n.length,l=i&&i.length;e&&e.parentNode;){for(a=0;s>a;a++)if(r=n[a],r.element[0]===e)return{target:r,targetElement:e};for(a=0;l>a;a++)if(o=i[a],f.matchesSelector.call(e,o.options.filter))return{target:o,targetElement:e};e=e.parentNode}return t}var s,l,c,d,u,h,p=window.kendo,f=p.support,g=window.document,m=p.Class,v=p.ui.Widget,_=p.Observable,w=p.UserEvents,y=e.proxy,b=e.extend,k=p.getOffset,x={},C={},S={},T=p.elementUnderCursor,D="keyup",A="change",E="dragstart",I="hold",P="drag",M="dragend",F="dragcancel",z="dragenter",R="dragleave",B="drop",H=_.extend({init:function(t,n){var i=this,r=t[0];i.capture=!1,r.addEventListener?(e.each(p.eventMap.down.split(" "),function(){r.addEventListener(this,y(i._press,i),!0)}),e.each(p.eventMap.up.split(" "),function(){r.addEventListener(this,y(i._release,i),!0)})):(e.each(p.eventMap.down.split(" "),function(){r.attachEvent(this,y(i._press,i))}),e.each(p.eventMap.up.split(" "),function(){r.attachEvent(this,y(i._release,i))})),_.fn.init.call(i),i.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(e){var t=this;t.trigger("press"),t.capture&&e.preventDefault()},_release:function(e){var t=this;t.trigger("release"),t.capture&&(e.preventDefault(),t.cancelCapture())}}),L=_.extend({init:function(t){var n=this;_.fn.init.call(n),n.forcedEnabled=!1,e.extend(n,t),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){e.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())},outOfBounds:function(e){return e>this.max||this.min>e},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(e){this.scale=e},update:function(e){var t=this,n=t.virtual?t._virtualMax:t.getTotal(),i=n*t.scale,r=t.getSize();0!==n&&(t.max=t.virtual?-t._virtualMin:0,t.size=r,t.total=i,t.min=Math.min(t.max,r-i),t.minScale=r/n,t.centerOffset=(i-r)/2,t.enabled=t.forcedEnabled||i>r,e||t.trigger(A,t))}}),N=_.extend({init:function(e){var t=this;_.fn.init.call(t),t.x=new L(b({horizontal:!0},e)),t.y=new L(b({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(A,e)},rescale:function(e){this.x.rescale(e),this.y.rescale(e),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(A)}}),O=_.extend({init:function(e){var t=this;b(t,e),_.fn.init.call(t)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(e){var t=this,n=t.dimension,i=t.axis,r=t.movable,o=r[i]+e;n.enabled&&((n.min>o&&0>e||o>n.max&&e>0)&&(e*=t.resistance),r.translateAxis(i,e),t.trigger(A,t))}}),V=m.extend({init:function(e){var t,n,i,r,o=this;b(o,{elastic:!0},e),i=o.elastic?.5:0,r=o.movable,o.x=t=new O({axis:"x",dimension:o.dimensions.x,resistance:i,movable:r}),o.y=n=new O({axis:"y",dimension:o.dimensions.y,resistance:i,movable:r}),o.userEvents.bind(["move","end","gesturestart","gesturechange"],{gesturestart:function(e){o.gesture=e,o.offset=o.dimensions.container.offset()},gesturechange:function(e){var i,a,s,l=o.gesture,c=l.center,d=e.center,u=e.distance/l.distance,h=o.dimensions.minScale,p=o.dimensions.maxScale;h>=r.scale&&1>u&&(u+=.8*(1-u)),r.scale*u>=p&&(u=p/r.scale),a=r.x+o.offset.left,s=r.y+o.offset.top,i={x:(a-c.x)*u+d.x-a,y:(s-c.y)*u+d.y-s},r.scaleWith(u),t.dragMove(i.x),n.dragMove(i.y),o.dimensions.rescale(r.scale),o.gesture=e,e.preventDefault()},move:function(e){e.event.target.tagName.match(/textarea|input/i)||(t.dimension.enabled||n.dimension.enabled?(t.dragMove(e.x.delta),n.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end:function(e){e.preventDefault()}})}}),U=f.transitions.prefix+"Transform";l=f.hasHW3D?function(e,t,n){return"translate3d("+e+"px,"+t+"px,0) scale("+n+")"}:function(e,t,n){return"translate("+e+"px,"+t+"px) scale("+n+")"},c=_.extend({init:function(t){var n=this;_.fn.init.call(n),n.element=e(t),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(l(n.x,n.y,n.scale))},translateAxis:function(e,t){this[e]+=t,this.refresh()},scaleTo:function(e){this.scale=e,this.refresh()},scaleWith:function(e){this.scale*=e,this.refresh()},translate:function(e){this.x+=e.x,this.y+=e.y,this.refresh()},moveAxis:function(e,t){this[e]=t,this.refresh()},moveTo:function(e){b(this,e),this.refresh()},refresh:function(){var e,t=this,n=t.x,i=t.y;t.round&&(n=Math.round(n),i=Math.round(i)),e=l(n,i,t.scale),e!=t.coordinates&&(p.support.browser.msie&&10>p.support.browser.version?(t.element[0].style.position="absolute",t.element[0].style.left=t.x+"px",t.element[0].style.top=t.y+"px"):t.element[0].style[U]=e,t._saveCoordinates(e),t.trigger(A))},_saveCoordinates:function(e){this.coordinates=e}}),d=v.extend({init:function(e,t){var n,i=this;v.fn.init.call(i,e,t),n=i.options.group,n in C?C[n].push(i):C[n]=[i]},events:[z,R,B],options:{name:"DropTarget",group:"default"},destroy:function(){var e,t=this.options.group,n=C[t]||S[t];if(n.length>1){for(v.fn.destroy.call(this),e=0;n.length>e;e++)if(n[e]==this){n.splice(e,1);break}}else d.destroyGroup(t)},_trigger:function(e,n){var i=this,r=x[i.options.group];return r?i.trigger(e,b({},n.event,{draggable:r,dropTarget:n.dropTarget})):t},_over:function(e){this._trigger(z,e)},_out:function(e){this._trigger(R,e)},_drop:function(e){var t=this,n=x[t.options.group];n&&(n.dropped=!t._trigger(B,e))}}),d.destroyGroup=function(e){var t,n=C[e]||S[e];if(n){for(t=0;n.length>t;t++)v.fn.destroy.call(n[t]);n.length=0,delete C[e],delete S[e]}},d._cache=C,u=d.extend({init:function(e,t){var n,i=this;v.fn.init.call(i,e,t),n=i.options.group,n in S?S[n].push(i):S[n]=[i]},options:{name:"DropTargetArea",group:"default",filter:null}}),h=v.extend({init:function(e,t){var n=this;v.fn.init.call(n,e,t),n._activated=!1,n.userEvents=new w(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:y(n._start,n),hold:y(n._hold,n),move:y(n._drag,n),end:y(n._end,n),cancel:y(n._cancel,n),select:y(n._select,n)}),n._afterEndHandler=y(n._afterEnd,n),n._captureEscape=y(n._captureEscape,n)},events:[I,E,P,M,F],options:{name:"Draggable",distance:p.support.touch?0:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(e){var t=this;e.keyCode===p.keys.ESC&&(t._trigger(F,{event:e}),t.userEvents.cancel())},_updateHint:function(t){var n,i=this,o=i.options,a=i.boundaries,s=o.axis,l=i.options.cursorOffset;l?n={left:t.x.location+l.left,top:t.y.location+l.top}:(i.hintOffset.left+=t.x.delta,i.hintOffset.top+=t.y.delta,n=e.extend({},i.hintOffset)),a&&(n.top=r(n.top,a.y),n.left=r(n.left,a.x)),"x"===s?delete n.top:"y"===s&&delete n.left,i.hint.css(n)},_shouldIgnoreTarget:function(t){var n=this.options.ignore;return n&&e(t).is(n)},_select:function(e){this._shouldIgnoreTarget(e.event.target)||e.preventDefault()},_start:function(n){var i,r=this,a=r.options,s=a.container,l=a.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||a.holdToDrag&&!r._activated?(r.userEvents.cancel(),t):(r.currentTarget=n.target,r.currentTargetOffset=k(r.currentTarget),l&&(r.hint&&r.hint.stop(!0,!0).remove(),r.hint=p.isFunction(l)?e(l.call(r,r.currentTarget)):l,i=k(r.currentTarget),r.hintOffset=i,r.hint.css({position:"absolute",zIndex:2e4,left:i.left,top:i.top}).appendTo(g.body),r.angular("compile",function(){return r.hint.removeAttr("ng-repeat"),{elements:r.hint.get(),scopeFrom:n.target}})),x[a.group]=r,r.dropped=!1,s&&(r.boundaries=o(s,r.hint)),r._trigger(E,n)&&(r.userEvents.cancel(),r._afterEnd()),r.userEvents.capture(),e(g).on(D,r._captureEscape),t)},_hold:function(e){this.currentTarget=e.target,this._trigger(I,e)?this.userEvents.cancel():this._activated=!0},_drag:function(n){var i=this;n.preventDefault(),i._withDropTarget(n,function(i,r){if(!i)return s&&(s._trigger(R,b(n,{dropTarget:e(s.targetElement)})),s=null),t;if(s){if(r===s.targetElement)return;s._trigger(R,b(n,{dropTarget:e(s.targetElement)}))}i._trigger(z,b(n,{dropTarget:e(r)})),s=b(i,{targetElement:r})}),i._trigger(P,b(n,{dropTarget:s})),i.hint&&i._updateHint(n)},_end:function(t){var n=this;n._withDropTarget(t,function(n,i){n&&(n._drop(b({},t,{dropTarget:e(i)})),s=null)}),n._trigger(M,t),n._cancel(t.event)},_cancel:function(){var e=this;e._activated=!1,e.hint&&!e.dropped?setTimeout(function(){e.hint.stop(!0,!0).animate(e.currentTargetOffset,"fast",e._afterEndHandler)},0):e._afterEnd()},_trigger:function(e,t){var n=this;return n.trigger(e,b({},t.event,{x:t.x,y:t.y,currentTarget:n.currentTarget,dropTarget:t.dropTarget}))},_withDropTarget:function(e,t){var i,r,o=this,s=o.options,l=C[s.group],c=S[s.group];(l&&l.length||c&&c.length)&&(i=T(e),o.hint&&n(o.hint[0],i)&&(o.hint.hide(),i=T(e),i||(i=T(e)),o.hint.show()),r=a(i,l,c),r?t(r.target,r.targetElement):t())},destroy:function(){var e=this;v.fn.destroy.call(e),e._afterEnd(),e.userEvents.destroy(),e.currentTarget=null},_afterEnd:function(){var t=this;t.hint&&t.hint.remove(),delete x[t.options.group],t.trigger("destroy"),e(g).off(D,t._captureEscape)}}),p.ui.plugin(d),p.ui.plugin(u),p.ui.plugin(h),p.TapCapture=H,p.containerBoundaries=o,b(p.ui,{Pane:V,PaneDimensions:N,Movable:c})}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile,r=n.effects,o=i.ui,a=e.proxy,s=e.extend,l=o.Widget,c=n.Class,d=n.ui.Movable,u=n.ui.Pane,h=n.ui.PaneDimensions,p=r.Transition,f=r.Animation,g=Math.abs,m=500,v=.7,_=.96,w=10,y=55,b=.5,k=5,x="km-scroller-release",C="km-scroller-refresh",S="pull",T="change",D="resize",A="scroll",E=2,I=f.extend({init:function(e){var t=this;f.fn.init.call(t),s(t,e),t.userEvents.bind("gestureend",a(t.start,t)),t.tapCapture.bind("press",a(t.cancel,t))},enabled:function(){return this.dimensions.minScale>this.movable.scale},done:function(){return.01>this.dimensions.minScale-this.movable.scale},tick:function(){var e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)},onEnd:function(){var e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}}),P=f.extend({init:function(e){var t=this;f.fn.init.call(t),s(t,e,{transition:new p({axis:e.axis,movable:e.movable,onEnd:function(){t._end()}})}),t.tapCapture.bind("press",function(){t.cancel()}),t.userEvents.bind("end",a(t.start,t)),t.userEvents.bind("gestureend",a(t.start,t)),t.userEvents.bind("tap",a(t.onEnd,t))},onCancel:function(){this.transition.cancel()},freeze:function(e){var t=this;t.cancel(),t._moveTo(e)},onEnd:function(){var e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()},done:function(){return g(this.velocity)<1},start:function(e){var t,n=this;n.dimension.enabled&&(n.paneAxis.outOfBounds()?n._snapBack():(t=e.touch.id===E?0:e.touch[n.axis].velocity,n.velocity=Math.max(Math.min(t*n.velocityMultiplier,y),-y),n.tapCapture.captureNext(),f.fn.start.call(n)))},tick:function(){var e=this,t=e.dimension,n=e.paneAxis.outOfBounds()?b:e.friction,i=e.velocity*=n,r=e.movable[e.axis]+i;!e.elastic&&t.outOfBounds(r)&&(r=Math.max(Math.min(r,t.max),t.min),e.velocity=0),e.movable.moveAxis(e.axis,r)},_end:function(){this.tapCapture.cancelCapture(),this.end()},_snapBack:function(){var e=this,t=e.dimension,n=e.movable[e.axis]>t.max?t.max:t.min;e._moveTo(n)},_moveTo:function(e){this.transition.moveTo({location:e,duration:m,ease:p.easeOutExpo})}}),M=f.extend({init:function(e){var t=this;n.effects.Animation.fn.init.call(this),s(t,e,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates(),this.moveTo(this.origin)},done:function(){return g(this.offset.y)<k&&g(this.offset.x)<k},onEnd:function(){this.moveTo(this.destination),this.callback&&this.callback.call()},setCoordinates:function(e,t){this.offset={},this.origin=e,this.destination=t},setCallback:function(e){e&&n.isFunction(e)?this.callback=e:e=t},_updateCoordinates:function(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}),F=c.extend({init:function(t){var n=this,i="x"===t.axis,r=e('<div class="km-touch-scrollbar km-'+(i?"horizontal":"vertical")+'-scrollbar" />');s(n,t,{element:r,elementSize:0,movable:new d(r),scrollMovable:t.movable,alwaysVisible:t.alwaysVisible,size:i?"width":"height"}),n.scrollMovable.bind(T,a(n.refresh,n)),n.container.append(r),t.alwaysVisible&&n.show()},refresh:function(){var e=this,t=e.axis,n=e.dimension,i=n.size,r=e.scrollMovable,o=i/n.total,a=Math.round(-r[t]*o),s=Math.round(i*o);o>=1?this.element.css("display","none"):this.element.css("display",""),a+s>i?s=i-a:0>a&&(s+=a,a=0),e.elementSize!=s&&(e.element.css(e.size,s+"px"),e.elementSize=s),e.movable.moveAxis(t,a)},show:function(){this.element.css({opacity:v,visibility:"visible"})},hide:function(){this.alwaysVisible||this.element.css({opacity:0})}}),z=l.extend({init:function(i,r){var o,c,p,f,m,v,_,w,y,b=this;return l.fn.init.call(b,i,r),i=b.element,(b._native=b.options.useNative&&n.support.hasNativeScrolling)?(i.addClass("km-native-scroller").prepend('<div class="km-scroll-header"/>'),s(b,{scrollElement:i,fixedContainer:i.children().first()}),t):(i.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('<div class="km-scroll-container"/>').prepend('<div class="km-scroll-header"/>'),o=i.children().eq(1),c=new n.TapCapture(i),p=new d(o),f=new h({element:o,container:i,forcedEnabled:b.options.zoom}),m=this.options.avoidScrolling,v=new n.UserEvents(i,{allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:b.options.zoom,start:function(t){f.refresh();var n=g(t.x.velocity),i=g(t.y.velocity),r=2*n>=i,o=e.contains(b.fixedContainer[0],t.event.target),a=2*i>=n;!o&&!m(t)&&b.enabled&&(f.x.enabled&&r||f.y.enabled&&a)?v.capture():v.cancel()}}),_=new u({movable:p,dimensions:f,userEvents:v,elastic:b.options.elastic}),w=new I({movable:p,dimensions:f,userEvents:v,tapCapture:c}),y=new M({moveTo:function(e){b.scrollTo(e.x,e.y)}}),p.bind(T,function(){b.scrollTop=-p.y,b.scrollLeft=-p.x,b.trigger(A,{scrollTop:b.scrollTop,scrollLeft:b.scrollLeft})}),b.options.mousewheelScrolling&&i.on("DOMMouseScroll mousewheel",a(this,"_wheelScroll")),s(b,{movable:p,dimensions:f,zoomSnapBack:w,animatedScroller:y,userEvents:v,pane:_,tapCapture:c,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:i.children().first()}),b._initAxis("x"),b._initAxis("y"),b._wheelEnd=function(){b._wheel=!1,b.userEvents.end(0,b._wheelY)},f.refresh(),b.options.pullToRefresh&&b._initPullToRefresh(),t)},_wheelScroll:function(e){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);var t=n.wheelDeltaY(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(e,t){this.dimensions.y.virtualSize(e,t)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}},events:[S,A,D],_resize:function(){this._native||this.contentResized()},setOptions:function(e){var t=this;l.fn.setOptions.call(t,e),e.pullToRefresh&&t._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},scrollTo:function(e,t){this._native?(this.scrollElement.scrollLeft(g(e)),this.scrollElement.scrollTop(g(t))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:t}))},animatedScrollTo:function(e,t,n){var i,r;this._native?this.scrollTo(e,t):(i={x:this.movable.x,y:this.movable.y},r={x:e,y:t},this.animatedScroller.setCoordinates(i,r),this.animatedScroller.setCallback(n),this.animatedScroller.start())},pullHandled:function(){var e=this;e.refreshHint.removeClass(C),e.hintContainer.html(e.pullTemplate({})),e.yinertia.onEnd(),e.xinertia.onEnd(),e.userEvents.cancel()},destroy:function(){l.fn.destroy.call(this),this.userEvents&&this.userEvents.destroy()},_scale:function(e){this.dimensions.rescale(e),this.movable.scaleTo(e)},_initPullToRefresh:function(){var e=this;e.dimensions.y.forceEnabled(),e.pullTemplate=n.template(e.options.messages.pullTemplate),e.releaseTemplate=n.template(e.options.messages.releaseTemplate),e.refreshTemplate=n.template(e.options.messages.refreshTemplate),e.scrollElement.prepend('<span class="km-scroller-pull"><span class="km-icon"></span><span class="km-loading-left"></span><span class="km-loading-right"></span><span class="km-template">'+e.pullTemplate({})+"</span></span>"),e.refreshHint=e.scrollElement.children().first(),e.hintContainer=e.refreshHint.children(".km-template"),e.pane.y.bind("change",a(e._paneChange,e)),e.userEvents.bind("end",a(e._dragEnd,e))},_dragEnd:function(){var e=this;e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(x).addClass(C),e.hintContainer.html(e.refreshTemplate({})),e.yinertia.freeze(e.options.pullOffset/2),e.trigger("pull"))},_paneChange:function(){var e=this;e.movable.y/b>e.options.pullOffset?e.pulled||(e.pulled=!0,e.refreshHint.removeClass(C).addClass(x),e.hintContainer.html(e.releaseTemplate({}))):e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(x),e.hintContainer.html(e.pullTemplate({})))},_initAxis:function(e){var t=this,n=t.movable,i=t.dimensions[e],r=t.tapCapture,o=t.pane[e],a=new F({axis:e,movable:n,dimension:i,container:t.element,alwaysVisible:t.options.visibleScrollHints});i.bind(T,function(){a.refresh()}),o.bind(T,function(){a.show()}),t[e+"inertia"]=new P({axis:e,paneAxis:o,movable:n,tapCapture:r,userEvents:t.userEvents,dimension:i,elastic:t.options.elastic,friction:t.options.friction||_,velocityMultiplier:t.options.velocityMultiplier||w,end:function(){a.hide(),t.trigger("scrollEnd",{axis:e,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}});o.plugin(z)}(window.kendo.jQuery),function(e,t){function n(e){return e.position().top+3}var i=window.kendo,r=i.ui.Widget,o=e.proxy,a=!1,s=".kendoGroupable",l="change",c=i.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-si-arrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})</span>${data.title ? data.title: data.field}</a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-group-delete"></span></a></div>',{useWithBlock:!1}),d=function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(i.attr("title"))||t.attr(i.attr("field"))).prepend('<span class="k-icon k-drag-status k-denied" />')},u=e('<div class="k-grouping-dropclue"/>'),h=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,p=r.extend({init:function(c,h){var p,f,g=this,m=i.guid(),v=o(g._intializePositions,g),_=g._dropCuePositions=[];r.fn.init.call(g,c,h),a=i.support.isRtl(c),f=a?"right":"left",g.draggable=p=g.options.draggable||new i.ui.Draggable(g.element,{filter:g.options.draggableElements,hint:d,group:m}),g.groupContainer=e(g.options.groupContainer,g.element).kendoDropTarget({group:p.options.group,dragenter:function(e){g._canDrag(e.draggable.currentTarget)&&(e.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"),u.css("top",n(g.groupContainer)).css(f,0).appendTo(g.groupContainer))},dragleave:function(e){e.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied"),u.remove()},drop:function(t){var n,r=t.draggable.currentTarget,o=r.attr(i.attr("field")),s=r.attr(i.attr("title")),l=g.indicator(o),c=g._dropCuePositions,d=c[c.length-1];(r.hasClass("k-group-indicator")||g._canDrag(r))&&(d?(n=g._dropCuePosition(i.getOffset(u).left+parseInt(d.element.css("marginLeft"),10)*(a?-1:1)+parseInt(d.element.css("marginRight"),10)),n&&g._canDrop(e(l),n.element,n.left)&&(n.before?n.element.before(l||g.buildIndicator(o,s)):n.element.after(l||g.buildIndicator(o,s)),g._change())):(g.groupContainer.append(g.buildIndicator(o,s)),g._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:d,group:p.options.group,dragcancel:o(g._dragCancel,g),dragstart:function(e){var t=e.currentTarget,i=parseInt(t.css("marginLeft"),10),r=t.position(),o=a?r.left-i:r.left+t.outerWidth();v(),u.css({top:n(g.groupContainer),left:o}).appendTo(g.groupContainer),this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){g._dragEnd(this)},drag:o(g._drag,g)}).on("click"+s,".k-button",function(t){t.preventDefault(),g._removeIndicator(e(this).parent())}).on("click"+s,".k-link",function(t){var n=e(this).parent(),r=g.buildIndicator(n.attr(i.attr("field")),n.attr(i.attr("title")),"asc"==n.attr(i.attr("dir"))?"desc":"asc");n.before(r).remove(),g._change(),t.preventDefault()}),p.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){g._dragEnd(this)},dragcancel:o(g._dragCancel,g),dragstart:function(e){var n,i,r;return g.options.allowDrag||g._canDrag(e.currentTarget)?(v(),_.length?(n=_[_.length-1].element,i=parseInt(n.css("marginRight"),10),r=n.position().left+n.outerWidth()+i):r=0,t):(e.preventDefault(),t)},drag:o(g._drag,g)}),g.dataSource=g.options.dataSource,g.dataSource&&g._refreshHandler?g.dataSource.unbind(l,g._refreshHandler):g._refreshHandler=o(g.refresh,g),g.dataSource&&(g.dataSource.bind("change",g._refreshHandler),g.refresh())},refresh:function(){var t=this,n=t.dataSource;t.groupContainer&&t.groupContainer.empty().append(e.map(n.group()||[],function(e){var n=e.field.replace(h,"\\$1"),r=t.element.find(t.options.filter).filter("["+i.attr("field")+"="+n+"]");return t.buildIndicator(e.field,r.attr(i.attr("title")),e.dir)}).join("")),t._invalidateGroupContainer()},destroy:function(){var e=this;r.fn.destroy.call(e),e.groupContainer.off(s),e.groupContainer.data("kendoDropTarget")&&e.groupContainer.data("kendoDropTarget").destroy(),e.groupContainer.data("kendoDraggable")&&e.groupContainer.data("kendoDraggable").destroy(),e.options.draggable||e.draggable.destroy(),e.dataSource&&e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=null),e.groupContainer=e.element=e.draggable=null},options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"}},indicator:function(t){var n=e(".k-group-indicator",this.groupContainer);return e.grep(n,function(n){return e(n).attr(i.attr("field"))===t})[0]},buildIndicator:function(e,t,n){return c({field:e.replace(/"/g,"'"),dir:n,title:t,ns:i.ns})},descriptors:function(){var t,n,r,o,a,s=this,l=e(".k-group-indicator",s.groupContainer);return t=s.element.find(s.options.filter).map(function(){var t=e(this),r=t.attr(i.attr("aggregates")),s=t.attr(i.attr("field"));if(r&&""!==r)for(n=r.split(","),r=[],o=0,a=n.length;a>o;o++)r.push({field:s,aggregate:n[o]});return r}).toArray(),e.map(l,function(n){return n=e(n),r=n.attr(i.attr("field")),{field:r,dir:n.attr(i.attr("dir")),aggregates:t||[]}})},_removeIndicator:function(e){var t=this;e.remove(),t._invalidateGroupContainer(),t._change()},_change:function(){var e=this;e.dataSource&&e.dataSource.group(e.descriptors())},_dropCuePosition:function(t){var n,i,r,o,s,l=this._dropCuePositions;if(u.is(":visible")&&0!==l.length)return t=Math.ceil(t),n=l[l.length-1],i=n.left,r=n.right,o=parseInt(n.element.css("marginLeft"),10),s=parseInt(n.element.css("marginRight"),10),t>=r&&!a||i>t&&a?t={left:n.element.position().left+(a?-o:n.element.outerWidth()+s),element:n.element,before:!1}:(t=e.grep(l,function(e){return t>=e.left&&e.right>=t||a&&t>e.right
20
+ })[0],t&&(t={left:a?t.element.position().left+t.element.outerWidth()+s:t.element.position().left-o,element:t.element,before:!0})),t},_drag:function(e){var t=this._dropCuePosition(e.x.location);t&&u.css({left:t.left,right:"auto"})},_canDrag:function(e){var t=e.attr(i.attr("field"));return"false"!=e.attr(i.attr("groupable"))&&t&&(e.hasClass("k-group-indicator")||!this.indicator(t))},_canDrop:function(e,t,n){var i=e.next(),r=e[0]!==t[0]&&(!i[0]||t[0]!==i[0]||!a&&n>i.position().left||a&&n<i.position().left);return r},_dragEnd:function(t){var n=this,r=t.currentTarget.attr(i.attr("field")),o=n.indicator(r);t!==n.options.draggable&&!t.dropped&&o&&n._removeIndicator(e(o)),n._dragCancel()},_dragCancel:function(){u.remove(),this._dropCuePositions=[]},_intializePositions:function(){var t,n=this,r=e(".k-group-indicator",n.groupContainer);n._dropCuePositions=e.map(r,function(n){return n=e(n),t=i.getOffset(n).left,{left:parseInt(t,10),right:parseInt(t+n.outerWidth(),10),element:n}})},_invalidateGroupContainer:function(){var e=this.groupContainer;e&&e.is(":empty")&&e.html(this.options.messages.empty)}});i.ui.plugin(p)}(window.kendo.jQuery),function(e){function t(t,n){t=e(t),n?t.find(".k-drag-status").removeClass("k-add").addClass("k-denied"):t.find(".k-drag-status").removeClass("k-denied").addClass("k-add")}var n=window.kendo,i=n.getOffset,r=n.ui.Widget,o="change",a="k-reorderable",s=r.extend({init:function(s,l){var c,d=this,u=n.guid()+"-reorderable";r.fn.init.call(d,s,l),s=d.element.addClass(a),l=d.options,d.draggable=c=l.draggable||new n.ui.Draggable(s,{group:u,filter:l.filter,hint:l.hint}),d.reorderDropCue=e('<div class="k-reorder-cue"><div class="k-icon k-i-arrow-s"></div><div class="k-icon k-i-arrow-n"></div></div>'),s.find(c.options.filter).kendoDropTarget({group:c.options.group,dragenter:function(e){var n,r,o,a;d._draggable&&(n=this.element,o=!d._dropTargetAllowed(n)||d._isLastDraggable(),t(e.draggable.hint,o),o||(r=i(n),a=r.left,l.inSameContainer&&!l.inSameContainer({source:n,target:d._draggable,sourceIndex:d._index(n),targetIndex:d._index(d._draggable)})?d._dropTarget=n:d._index(n)>d._index(d._draggable)&&(a+=n.outerWidth()),d.reorderDropCue.css({height:n.outerHeight(),top:r.top,left:a}).appendTo(document.body)))},dragleave:function(e){t(e.draggable.hint,!0),d.reorderDropCue.remove(),d._dropTarget=null},drop:function(){var e,t,n;d._dropTarget=null,d._draggable&&(e=this.element,t=d._draggable,n=!1,d._dropTargetAllowed(e)&&!d._isLastDraggable()&&d.trigger(o,{element:d._draggable,target:e,oldIndex:d._index(t),newIndex:d._index(e),position:i(d.reorderDropCue).left>i(e).left?"after":"before"}))}}),c.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){d.reorderDropCue.remove(),d._draggable=null,d._elements=null},dragend:function(){d.reorderDropCue.remove(),d._draggable=null,d._elements=null},dragstart:function(e){d._draggable=e.currentTarget,d._elements=d.element.find(d.draggable.options.filter)},drag:function(e){var t,n;d._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-denied")&&(t=i(d._dropTarget).left,n=d._dropTarget.outerWidth(),d.reorderDropCue.css(e.pageX>t+n/2?{left:t+n}:{left:t}))}})},options:{name:"Reorderable",filter:"*"},events:[o],_isLastDraggable:function(){var e,t=this.options.inSameContainer,n=this._draggable[0],i=this._elements.get(),r=!1;if(!t)return!1;for(;!r&&i.length>0;)e=i.pop(),r=n!==e&&t({source:n,target:e,sourceIndex:this._index(n),targetIndex:this._index(e)});return!r},_dropTargetAllowed:function(e){var t=this.options.inSameContainer,n=this.options.dragOverContainers,i=this._draggable;return i[0]===e[0]?!1:t&&n?t({source:i,target:e,sourceIndex:this._index(i),targetIndex:this._index(e)})?!0:n(this._index(i),this._index(e)):!0},_index:function(e){return this._elements.index(e)},destroy:function(){var t=this;r.fn.destroy.call(t),t.element.find(t.draggable.options.filter).each(function(){var t=e(this);t.data("kendoDropTarget")&&t.data("kendoDropTarget").destroy()}),t.draggable&&(t.draggable.destroy(),t.draggable.element=t.draggable=null),t.elements=t.reorderDropCue=t._elements=t._draggable=null}});n.ui.plugin(s)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o=e.proxy,a=n.isFunction,s=e.extend,l="horizontal",c="vertical",d="start",u="resize",h="resizeend",p=r.extend({init:function(e,t){var n=this;r.fn.init.call(n,e,t),n.orientation=n.options.orientation.toLowerCase()!=c?l:c,n._positionMouse=n.orientation==l?"x":"y",n._position=n.orientation==l?"left":"top",n._sizingDom=n.orientation==l?"outerWidth":"outerHeight",n.draggable=new i.Draggable(e,{distance:0,filter:t.handle,drag:o(n._resize,n),dragcancel:o(n._cancel,n),dragstart:o(n._start,n),dragend:o(n._stop,n)}),n.userEvents=n.draggable.userEvents},events:[u,h,d],options:{name:"Resizable",orientation:l},resize:function(){},_max:function(e){var n=this,i=n.hint?n.hint[n._sizingDom]():0,r=n.options.max;return a(r)?r(e):r!==t?n._initialElementPosition+r-i:r},_min:function(e){var n=this,i=n.options.min;return a(i)?i(e):i!==t?n._initialElementPosition+i:i},_start:function(t){var n=this,i=n.options.hint,r=e(t.currentTarget);n._initialElementPosition=r.position()[n._position],n._initialMousePosition=t[n._positionMouse].startLocation,i&&(n.hint=a(i)?e(i(r)):i,n.hint.css({position:"absolute"}).css(n._position,n._initialElementPosition).appendTo(n.element)),n.trigger(d,t),n._maxPosition=n._max(t),n._minPosition=n._min(t),e(document.body).css("cursor",r.css("cursor"))},_resize:function(e){var n,i=this,r=i._maxPosition,o=i._minPosition,a=i._initialElementPosition+(e[i._positionMouse].location-i._initialMousePosition);n=o!==t?Math.max(o,a):a,i.position=n=r!==t?Math.min(r,n):n,i.hint&&i.hint.toggleClass(i.options.invalidClass||"",n==r||n==o).css(i._position,n),i.resizing=!0,i.trigger(u,s(e,{position:n}))},_stop:function(t){var n=this;n.hint&&n.hint.remove(),n.resizing=!1,n.trigger(h,s(t,{position:n.position})),e(document.body).css("cursor","")},_cancel:function(e){var n=this;n.hint&&(n.position=t,n.hint.css(n._position,n._initialElementPosition),n._stop(e))},destroy:function(){var e=this;r.fn.destroy.call(e),e.draggable&&e.draggable.destroy()},press:function(e){if(e){var t=e.position(),n=this;n.userEvents.press(t.left,t.top,e[0]),n.targetPosition=t,n.target=e}},move:function(e){var n=this,i=n._position,r=n.targetPosition,o=n.position;o===t&&(o=r[i]),r[i]=o+e,n.userEvents.move(r.left,r.top)},end:function(){this.userEvents.end(),this.target=this.position=t}});n.ui.plugin(p)}(window.kendo.jQuery),function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e){return e.clone()}function r(e){return e.clone().removeAttr("id").css("visibility","hidden")}var o=window.kendo,a=o.ui.Widget,s="start",l="beforeMove",c="move",d="end",u="change",h="cancel",p="sort",f="remove",g="receive",m=">*",v=-1,_=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n.options.placeholder||(n.options.placeholder=r),n.options.hint||(n.options.hint=i),n._draggable=n._createDraggable()},events:[s,l,c,d,u,h],options:{name:"Sortable",hint:null,placeholder:null,filter:m,holdToDrag:!1,disabled:null,container:null,connectWith:null,handler:null,cursorOffset:null,axis:null,ignore:null,cursor:"auto"},destroy:function(){this._draggable.destroy(),a.fn.destroy.call(this)},_createDraggable:function(){var t=this,n=t.element,i=t.options;return new o.ui.Draggable(n,{filter:i.filter,hint:o.isFunction(i.hint)?i.hint:e(i.hint),holdToDrag:i.holdToDrag,container:i.container?e(i.container):null,cursorOffset:i.cursorOffset,axis:i.axis,ignore:i.ignore,dragstart:e.proxy(t._dragstart,t),dragcancel:e.proxy(t._dragcancel,t),drag:e.proxy(t._drag,t),dragend:e.proxy(t._dragend,t)})},_dragstart:function(t){var n=this.draggedElement=t.currentTarget,i=t.target||o.elementUnderCursor(t),r=this.options.disabled,a=this.options.handler,l=this.options.placeholder,c=this.placeholder=e(o.isFunction(l)?l.call(this,n):l);r&&n.is(r)?t.preventDefault():a&&!e(i).is(a)?t.preventDefault():this.trigger(s,{item:n,draggableEvent:t})?t.preventDefault():(n.css("display","none"),n.before(c),this._setCursor())},_dragcancel:function(){this._cancel(),this.trigger(h,{item:this.draggedElement}),this._resetCursor()},_drag:function(n){var i,r,o,a,s,l=this.draggedElement,c=this._findTarget(n),d={left:n.x.location,top:n.y.location},u={x:n.x.delta,y:n.y.delta},h=this.options.axis,p={item:l,list:this,draggableEvent:n};if("x"===h||"y"===h)return this._movementByAxis(h,d,u[h],p),t;if(c){if(i=this._getElementCenter(c.element),r={left:Math.round(d.left-i.left),top:Math.round(d.top-i.top)},e.extend(p,{target:c.element}),c.appendToBottom)return this._movePlaceholder(c,null,p),t;if(c.appendAfterHidden&&this._movePlaceholder(c,"next",p),this._isFloating(c.element)?0>u.x&&0>r.left?o="prev":u.x>0&&r.left>0&&(o="next"):0>u.y&&0>r.top?o="prev":u.y>0&&r.top>0&&(o="next"),o){for(s="prev"===o?jQuery.fn.prev:jQuery.fn.next,a=s.call(c.element);a.length&&!a.is(":visible");)a=s.call(a);a[0]!=this.placeholder[0]&&this._movePlaceholder(c,o,p)}}},_dragend:function(n){var i,r,o,a,s=this.placeholder,l=this.draggedElement,c=this.indexOf(l),h=this.indexOf(s),m=this.options.connectWith;return this._resetCursor(),o={action:p,item:l,oldIndex:c,newIndex:h,draggableEvent:n},h>=0?r=this.trigger(d,o):(i=s.parents(m).getKendoSortable(),o.action=f,a=e.extend({},o,{action:g,oldIndex:v,newIndex:i.indexOf(s)}),r=!(!this.trigger(d,o)&&!i.trigger(d,a))),r||h===c?(this._cancel(),t):(s.replaceWith(l),l.show(),this._draggable.dropped=!0,o={action:this.indexOf(l)!=v?p:f,item:l,oldIndex:c,newIndex:this.indexOf(l),draggableEvent:n},this.trigger(u,o),i&&(a=e.extend({},o,{action:g,oldIndex:v,newIndex:i.indexOf(l)}),i.trigger(u,a)),t)},_findTarget:function(n){var i,r,o=this._findElementUnderCursor(n),a=this.options.connectWith;return e.contains(this.element[0],o)?(i=this.items(),r=i.filter(o)[0]||i.has(o)[0],r?{element:e(r),sortable:this}:null):this.element[0]==o&&this._isEmpty()?{element:this.element,sortable:this,appendToBottom:!0}:this.element[0]==o&&this._isLastHidden()?(r=this.items().eq(0),{element:r,sortable:this,appendAfterHidden:!0}):a?this._searchConnectedTargets(o,n):t},_findElementUnderCursor:function(e){{var t=o.elementUnderCursor(e),i=e.sender;this.items()}return n(i.hint[0],t)&&(i.hint.hide(),t=o.elementUnderCursor(e),t||(t=o.elementUnderCursor(e)),i.hint.show()),t},_searchConnectedTargets:function(t,n){var i,r,o,a,s=e(this.options.connectWith);for(a=0;s.length>a;a++)if(i=s.eq(a).getKendoSortable(),e.contains(s[a],t)){if(i)return r=i.items(),o=r.filter(t)[0]||r.has(t)[0],o?(i.placeholder=this.placeholder,{element:e(o),sortable:i}):null}else if(s[a]==t){if(i&&i._isEmpty())return{element:s.eq(a),sortable:i,appendToBottom:!0};if(this._isCursorAfterLast(i,n))return o=i.items().last(),{element:o,sortable:i}}},_isCursorAfterLast:function(e,t){var n,i,r=e.items().last(),a={left:t.x.location,top:t.y.location};return n=o.getOffset(r),n.top+=r.outerHeight(),n.left+=r.outerWidth(),i=this._isFloating(r)?n.left-a.left:n.top-a.top,0>i?!0:!1},_movementByAxis:function(t,n,i,r){var o,a="x"===t?n.left:n.top,s=0>i?this.placeholder.prev():this.placeholder.next();s.length&&!s.is(":visible")&&(s=0>i?s.prev():s.next()),e.extend(r,{target:s}),o=this._getElementCenter(s),o&&(o="x"===t?o.left:o.top),s.length&&0>i&&0>a-o?this._movePlaceholder({element:s,sortable:this},"prev",r):s.length&&i>0&&a-o>0&&this._movePlaceholder({element:s,sortable:this},"next",r)},_movePlaceholder:function(e,t,n){var i=this.placeholder;e.sortable.trigger(l,n)||(t?"prev"===t?e.element.before(i):"next"===t&&e.element.after(i):e.element.append(i),e.sortable.trigger(c,n))},_setCursor:function(){var t,n=this.options.cursor;n&&"auto"!==n&&(t=e(document.body),this._originalCursorType=t.css("cursor"),t.css({cursor:n}),this._cursorStylesheet||(this._cursorStylesheet=e("<style>* { cursor: "+n+" !important; }</style>")),this._cursorStylesheet.appendTo(t))},_resetCursor:function(){this._originalCursorType&&(e(document.body).css("cursor",this._originalCursorType),this._originalCursorType=null,this._cursorStylesheet.remove())},_getElementCenter:function(e){var t=e.length?o.getOffset(e):null;return t&&(t.top+=e.outerHeight()/2,t.left+=e.outerWidth()/2),t},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_cancel:function(){this.draggedElement.show(),this.placeholder.remove()},_items:function(){var e,t=this.options.filter;return e=t?this.element.find(t):this.element.children()},indexOf:function(e){var t=this._items(),n=this.placeholder,i=this.draggedElement;return n&&e[0]==n[0]?t.not(i).index(e):t.not(n).index(e)},items:function(){var e=this.placeholder,t=this._items();return e&&(t=t.not(e)),t},_isEmpty:function(){return!this.items().length},_isLastHidden:function(){return 1===this.items().length&&this.items().is(":hidden")}});o.ui.plugin(_)}(window.kendo.jQuery),function(e,t){function n(e,t){var n=r.getOffset(e),i=t.left+t.width,o=t.top+t.height;return n.right=n.left+e.outerWidth(),n.bottom=n.top+e.outerHeight(),!(n.left>i||t.left>n.right||n.top>o||t.top>n.bottom)}var i,r=window.kendo,o=r.ui.Widget,a=e.proxy,s=Math.abs,l="aria-selected",c="k-state-selected",d="k-state-selecting",u="k-selectable",h="change",p=".kendoSelectable",f="k-state-unselecting",g="input,a,textarea,.k-multiselect-wrap,select,button",m=r.support.browser.msie,v=!1;!function(e){!function(){e('<div class="parent"><span /></div>').on("click",">*",function(){v=!0}).find("span").click().end().off()}()}(e),i=o.extend({init:function(t,n){var i,s=this;o.fn.init.call(s,t,n),s._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),s._lastActive=null,s.element.addClass(u),s.relatedTarget=s.options.relatedTarget,i=s.options.multiple,this.options.aria&&i&&s.element.attr("aria-multiselectable",!0),s.userEvents=new r.UserEvents(s.element,{global:!0,allowSelection:!0,filter:(v?"":"."+u+" ")+s.options.filter,tap:a(s._tap,s)}),i&&s.userEvents.bind("start",a(s._start,s)).bind("move",a(s._move,s)).bind("end",a(s._end,s)).bind("select",a(s._select,s))},events:[h],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,r=!1;for(e=e[0],t=0;i>t;t++)if(n[t]===e){r=!0;break}return r},_tap:function(t){var n,i=e(t.target),r=this,o=t.event.ctrlKey||t.event.metaKey,a=r.options.multiple,s=a&&t.event.shiftKey,l=t.event.which,d=t.event.button;!r._isElement(i.closest("."+u))||l&&3==l||d&&2==d||this._allowSelection(t.event.target)&&(n=i.hasClass(c),a&&o||r.clear(),i=i.add(r.relatedTarget(i)),s?r.selectRange(r._firstSelectee(),i):(n&&o?(r._unselect(i),r._notify(h)):r.value(i),r._lastActive=r._downTarget=i))},_start:function(n){var i,r=this,o=e(n.target),a=o.hasClass(c),s=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(r._downTarget=o,!r._isElement(o.closest("."+u)))return r.userEvents.cancel(),t;r.options.useAllItems?r._items=r.element.find(r.options.filter):(i=o.closest(r.element),r._items=i.find(r.options.filter)),n.sender.capture(),r._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),s||r.clear(),o=o.add(r.relatedTarget(o)),a&&(r._selectElement(o,!0),s&&o.addClass(f))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:s(e.x.initialDelta),height:s(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e,t=this;t._marquee.remove(),t._unselect(t.element.find(t.options.filter+"."+f)).removeClass(f),e=t.element.find(t.options.filter+"."+d),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,r,o,a,s=this._downTarget[0],l=this._items;for(i=0,r=l.length;r>i;i++)a=l.eq(i),o=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(c)?t&&s!==a[0]&&o.removeClass(c).addClass(f):a.hasClass(d)||a.hasClass(f)||o.addClass(d):a.hasClass(d)?o.removeClass(d):t&&a.hasClass(f)&&o.removeClass(f).addClass(c)},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(h),t):n.element.find(n.options.filter+"."+c)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),r=!n&&this._notify("select",{element:t});i.removeClass(d),r||(i.addClass(c),this.options.aria&&i.attr(l,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(c),this.options.aria&&e.attr(l,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!m||m&&!e(r._activeElement()).is(g))&&t.preventDefault()},_allowSelection:function(t){return e(t).is(g)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var e=this.element.find(this.options.filter+"."+c);this._unselect(e)},selectRange:function(t,n){var i,r,o,a=this;for(a.clear(),a.element.length>1&&(o=a.options.continuousItems()),o&&o.length||(o=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],o),n=e.inArray(e(n)[0],o),t>n&&(r=t,t=n,n=r),a.options.useAllItems||(n+=a.element.length-1),i=t;n>=i;i++)a._selectElement(o[i]);a._notify(h)},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(p),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),i.parseOptions=function(e){var t="string"==typeof e&&e.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}},r.ui.plugin(i)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=n.keys,a="click",s="k-button",l="k-button-icon",c="k-button-icontext",d=".kendoButton",u="disabled",h="k-state-disabled",p="k-state-focused",f="k-state-selected",g=i.extend({init:function(e,t){var o=this;i.fn.init.call(o,e,t),e=o.wrapper=o.element,t=o.options,e.addClass(s).attr("role","button"),t.enable=t.enable&&!e.attr(u),o.enable(t.enable),o._tabindex(),o._graphics(),e.on(a+d,r(o._click,o)).on("focus"+d,r(o._focus,o)).on("blur"+d,r(o._blur,o)).on("keydown"+d,r(o._keydown,o)).on("keyup"+d,r(o._keyup,o)),n.notify(o)},destroy:function(){var e=this;e.wrapper.off(d),i.fn.destroy.call(e)},events:[a],options:{name:"Button",icon:"",spriteCssClass:"",imageUrl:"",enable:!0},_isNativeButton:function(){return"button"==this.element.prop("tagName").toLowerCase()},_click:function(e){this.options.enable&&this.trigger(a,{event:e})},_focus:function(){this.options.enable&&this.element.addClass(p)},_blur:function(){this.element.removeClass(p)},_keydown:function(e){var t=this;t._isNativeButton()||(e.keyCode==o.ENTER||e.keyCode==o.SPACEBAR)&&(e.keyCode==o.SPACEBAR&&(e.preventDefault(),t.options.enable&&t.element.addClass(f)),t._click(e))},_keyup:function(){this.element.removeClass(f)},_graphics:function(){var t,n,i,r=this,o=r.element,a=r.options,s=a.icon,d=a.spriteCssClass,u=a.imageUrl;(d||u||s)&&(i=!0,o.contents().not("span.k-sprite").not("span.k-icon").not("img.k-image").each(function(t,n){(1==n.nodeType||3==n.nodeType&&e.trim(n.nodeValue).length>0)&&(i=!1)}),o.addClass(i?l:c)),s?(t=o.children("span.k-icon").first(),t[0]||(t=e('<span class="k-icon"></span>').prependTo(o)),t.addClass("k-i-"+s)):d?(t=o.children("span.k-sprite").first(),t[0]||(t=e('<span class="k-sprite"></span>').prependTo(o)),t.addClass(d)):u&&(n=o.children("img.k-image").first(),n[0]||(n=e('<img alt="icon" class="k-image" />').prependTo(o)),n.attr("src",u))},enable:function(e){var n=this,i=n.element;e===t&&(e=!0),e=!!e,n.options.enable=e,i.toggleClass(h,!e).attr("aria-disabled",!e).attr(u,!e);try{i.blur()}catch(r){}}});n.ui.plugin(g)}(window.kendo.jQuery),function(e,t){function n(e,t,n,i,r){return e({idx:t,text:n,ns:c.ns,numeric:i,title:r||""})}function i(e,t,n){return k({className:e.substring(1),text:t,wrapClassName:n||""})}function r(e,t,n,i){e.find(t).parent().attr(c.attr("page"),n).attr("tabindex",-1).toggleClass("k-state-disabled",i)}function o(e,t){r(e,p,1,1>=t)}function a(e,t){r(e,g,Math.max(1,t-1),1>=t)}function s(e,t,n){r(e,m,Math.min(n,t+1),t>=n)}function l(e,t,n){r(e,f,n,t>=n)}var c=window.kendo,d=c.ui,u=d.Widget,h=e.proxy,p=".k-i-seek-w",f=".k-i-seek-e",g=".k-i-arrow-w",m=".k-i-arrow-e",v="change",_=".kendoPager",w="click",y="keydown",b="disabled",k=c.template('<a href="\\#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #">#=text#</span></a>'),x=u.extend({init:function(t,n){var r,d,b=this;u.fn.init.call(b,t,n),n=b.options,b.dataSource=c.data.DataSource.create(n.dataSource),b.linkTemplate=c.template(b.options.linkTemplate),b.selectTemplate=c.template(b.options.selectTemplate),r=b.page(),d=b.totalPages(),b._refreshHandler=h(b.refresh,b),b.dataSource.bind(v,b._refreshHandler),n.previousNext&&(b.element.find(p).length||(b.element.append(i(p,n.messages.first,"k-pager-first")),o(b.element,r,d)),b.element.find(g).length||(b.element.append(i(g,n.messages.previous)),a(b.element,r,d))),n.numeric&&(b.list=b.element.find(".k-pager-numbers"),b.list.length||(b.list=e('<ul class="k-pager-numbers k-reset" />').appendTo(b.element))),n.input&&(b.element.find(".k-pager-input").length||b.element.append('<span class="k-pager-input k-label">'+n.messages.page+'<input class="k-textbox">'+c.format(n.messages.of,d)+"</span>"),b.element.on(y+_,".k-pager-input input",h(b._keydown,b))),n.previousNext&&(b.element.find(m).length||(b.element.append(i(m,n.messages.next)),s(b.element,r,d)),b.element.find(f).length||(b.element.append(i(f,n.messages.last,"k-pager-last")),l(b.element,r,d))),n.pageSizes&&(b.element.find(".k-pager-sizes").length||e('<span class="k-pager-sizes k-label"><select/>'+n.messages.itemsPerPage+"</span>").appendTo(b.element).find("select").html(e.map(e.isArray(n.pageSizes)?n.pageSizes:[5,10,20],function(e){return"<option>"+e+"</option>"}).join("")).end().appendTo(b.element),b.element.find(".k-pager-sizes select").val(b.pageSize()),c.ui.DropDownList&&b.element.find(".k-pager-sizes select").show().kendoDropDownList(),b.element.on(v+_,".k-pager-sizes select",h(b._change,b))),n.refresh&&(b.element.find(".k-pager-refresh").length||b.element.append('<a href="#" class="k-pager-refresh k-link" title="'+n.messages.refresh+'"><span class="k-icon k-i-refresh">'+n.messages.refresh+"</span></a>"),b.element.on(w+_,".k-pager-refresh",h(b._refreshClick,b))),n.info&&(b.element.find(".k-pager-info").length||b.element.append('<span class="k-pager-info k-label" />')),b.element.on(w+_,"a",h(b._click,b)).addClass("k-pager-wrap k-widget"),n.autoBind&&b.refresh(),c.notify(b)},destroy:function(){var e=this;u.fn.destroy.call(e),e.element.off(_),e.dataSource.unbind(v,e._refreshHandler),e._refreshHandler=null,c.destroy(e.element),e.element=e.list=null},events:[v],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#</span></li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;t.dataSource.unbind(v,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(v,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,i,r,d=this,u=1,h="",p=d.page(),f=d.options,g=d.pageSize(),m=d.dataSource.total(),v=d.totalPages(),_=d.linkTemplate,w=f.buttonCount;if(!e||"itemchange"!=e.action){if(f.numeric){for(p>w&&(r=p%w,u=0===r?p-w+1:p-r+1),i=Math.min(u+w-1,v),u>1&&(h+=n(_,u-1,"...",!1,f.messages.morePages)),t=u;i>=t;t++)h+=n(t==p?d.selectTemplate:_,t,t,!0);v>i&&(h+=n(_,t,"...",!1,f.messages.morePages)),""===h&&(h=d.selectTemplate({text:0})),d.list.html(h)}f.info&&(h=m>0?c.format(f.messages.display,(p-1)*g+1,Math.min(p*g,m),m):f.messages.empty,d.element.find(".k-pager-info").html(h)),f.input&&d.element.find(".k-pager-input").html(d.options.messages.page+'<input class="k-textbox">'+c.format(f.messages.of,v)).find("input").val(p).attr(b,1>m).toggleClass("k-state-disabled",1>m),f.previousNext&&(o(d.element,p,v),a(d.element,p,v),s(d.element,p,v),l(d.element,p,v)),f.pageSizes&&d.element.find(".k-pager-sizes select").val(g).filter("["+c.attr("role")+"=dropdownlist]").kendoDropDownList("value",g).kendoDropDownList("text",g)}},_keydown:function(e){if(e.keyCode===c.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),n=parseInt(t.val(),10);(isNaN(n)||1>n||n>this.totalPages())&&(n=this.page()),t.val(n),this.page(n)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=parseInt(e.currentTarget.value,10);isNaN(t)||this.dataSource.pageSize(t)},_click:function(t){var n=e(t.currentTarget);t.preventDefault(),n.is(".k-state-disabled")||this.page(n.attr(c.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/this.pageSize())},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.dataSource.page(e),this.trigger(v,{index:e}),t)}});d.plugin(x)}(window.kendo.jQuery),function(e){function t(t,n){return t===n||e.contains(t,n)}var n=window.kendo,i=n.ui,r=i.Widget,o=n.support,a=n.getOffset,s=n._activeElement,l="open",c="close",d="deactivate",u="activate",h="center",p="left",f="right",g="top",m="bottom",v="absolute",_="hidden",w="body",y="location",b="position",k="visible",x="effects",C="k-state-active",S="k-state-border",T=/k-state-border-(\w+)/,D=".k-picker-wrap, .k-dropdown-wrap, .k-link",A="down",E=e(document.documentElement),I=e(window),P="scroll",M="resize scroll",F=o.transitions.css,z=F+"transform",R=e.extend,B=".kendoPopup",H=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],L=r.extend({init:function(t,i){var o,a=this;i=i||{},i.isRtl&&(i.origin=i.origin||m+" "+f,i.position=i.position||g+" "+f),r.fn.init.call(a,t,i),t=a.element,i=a.options,a.collisions=i.collision?i.collision.split(" "):[],a.downEvent=n.applyEventMap(A,n.guid()),1===a.collisions.length&&a.collisions.push(a.collisions[0]),o=e(a.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),i.appendTo=e(e(i.appendTo)[0]||o[0]||w),a.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!i.isRtl).css({position:v}).appendTo(i.appendTo).on("mouseenter"+B,function(){a._hovered=!0}).on("mouseleave"+B,function(){a._hovered=!1}),a.wrapper=e(),i.animation===!1&&(i.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),R(i.animation.open,{complete:function(){a.wrapper.css({overflow:k}),a._trigger(u)}}),R(i.animation.close,{complete:function(){a._animationClose()}}),a._mousedownProxy=function(e){a._mousedown(e)},a._resizeProxy=function(e){a._resize(e)},i.toggleTarget&&e(i.toggleTarget).on(i.toggleEvent+B,e.proxy(a.toggle,a))},events:[l,u,c,d],options:{name:"Popup",toggleEvent:"click",origin:m+" "+p,position:g+" "+p,anchor:w,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var t,i,r,o,a=this,s=a.options;a.wrapper.hide(),t=a.wrapper.data(y),i=e(s.anchor),t&&a.wrapper.css(t),s.anchor!=w&&(r=((i.attr("class")||"").match(T)||["","down"])[1],o=S+"-"+r,i.removeClass(o).children(D).removeClass(C).removeClass(o),a.element.removeClass(S+"-"+n.directions[r].reverse)),a._closing=!1,a._trigger(d)},destroy:function(){var t,i=this,o=i.options,a=i.element.off(B);r.fn.destroy.call(i),o.toggleTarget&&e(o.toggleTarget).off(B),o.modal||(E.unbind(i.downEvent,i._mousedownProxy),i._scrollableParents().unbind(P,i._resizeProxy),I.unbind(M,i._resizeProxy)),n.destroy(i.element.children()),a.removeData(),o.appendTo[0]===document.body&&(t=a.parent(".k-animation-container"),t[0]?t.remove():a.remove())},open:function(t,i){var r,a,s,c=this,d={isFixed:!isNaN(parseInt(i,10)),x:t,y:i},u=c.element,h=c.options,p="down",f=e(h.anchor),m=u[0]&&u.hasClass("km-widget");if(!c.visible()){if(h.copyAnchorStyles&&(m&&"font-size"==H[0]&&H.shift(),u.css(n.getComputedStyles(f[0],H))),u.data("animating")||c._trigger(l))return;h.modal||(E.unbind(c.downEvent,c._mousedownProxy).bind(c.downEvent,c._mousedownProxy),o.mobileOS.ios||o.mobileOS.android||(c._scrollableParents().unbind(P,c._resizeProxy).bind(P,c._resizeProxy),I.unbind(M,c._resizeProxy).bind(M,c._resizeProxy))),c.wrapper=a=n.wrap(u,h.autosize).css({overflow:_,display:"block",position:v}),o.mobileOS.android&&a.css(z,"translatez(0)"),a.css(b),e(h.appendTo)[0]==document.body&&a.css(g,"-10000px"),r=R(!0,{},h.animation.open),c.flipped=c._position(d),r.effects=n.parseEffects(r.effects,c.flipped),p=r.effects.slideIn?r.effects.slideIn.direction:p,h.anchor!=w&&(s=S+"-"+p,u.addClass(S+"-"+n.directions[p].reverse),f.addClass(s).children(D).addClass(C).addClass(s)),u.data(x,r.effects).kendoStop(!0).kendoAnimate(r)}},toggle:function(){var e=this;e[e.visible()?c:l]()},visible:function(){return this.element.is(":"+k)},close:function(t){var i,r,o,a,s=this,l=s.options;if(s.visible()){if(i=s.wrapper[0]?s.wrapper:n.wrap(s.element).hide(),s._closing||s._trigger(c))return;s.element.find(".k-popup").each(function(){var n=e(this),i=n.data("kendoPopup");i&&i.close(t)}),E.unbind(s.downEvent,s._mousedownProxy),s._scrollableParents().unbind(P,s._resizeProxy),I.unbind(M,s._resizeProxy),t?r={hide:!0,effects:{}}:(r=R(!0,{},l.animation.close),o=s.element.data(x),a=r.effects,!a&&!n.size(a)&&o&&n.size(o)&&(r.effects=o,r.reverse=!0),s._closing=!0),s.element.kendoStop(!0),i.css({overflow:_}),s.element.kendoAnimate(r)}},_trigger:function(e){return this.trigger(e,{type:e})},_resize:function(e){var n=this;"resize"===e.type?(clearTimeout(n._resizeTimeout),n._resizeTimeout=setTimeout(function(){n._position(),n._resizeTimeout=null},50)):n._hovered||t(n.element[0],s())||n.close()},_mousedown:function(i){var r=this,o=r.element[0],a=r.options,s=e(a.anchor)[0],l=a.toggleTarget,c=n.eventTarget(i),d=e(c).closest(".k-popup"),u=d.parent().parent(".km-shim").length;d=d[0],(u||!d||d===r.element[0])&&"popover"!==e(i.target).closest("a").data("rel")&&(t(o,c)||t(s,c)||l&&t(e(l)[0],c)||r.close())},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,n,i,r,o,a){var s=0;return a=a||t,o!==r&&o!==h&&r!==h&&(e+a>i&&(s+=-(n+t)),0>e+s&&(s+=n+t)),s},_scrollableParents:function(){return e(this.options.anchor).parentsUntil("body").filter(function(e,t){var i=n.getComputedStyles(t,["overflow"]);return"visible"!=i.overflow})},_position:function(t){var n,i,r,s,l,c,d,u,h,p=this,f=p.element.css(b,""),g=p.wrapper,m=p.options,_=e(m.viewport),w=_.offset(),k=e(m.anchor),x=m.origin.toLowerCase().split(" "),C=m.position.toLowerCase().split(" "),S=p.collisions,T=o.zoomLevel(),D=10002,A=!!(_[0]==window&&window.innerWidth&&1.02>=T),E=0,I=A?window.innerWidth:_.width(),P=A?window.innerHeight:_.height(),M=k.parents().filter(g.siblings());if(M[0])if(i=Math.max(+M.css("zIndex"),0))D=i+10;else for(n=k.parentsUntil(M),r=n.length;r>E;E++)i=+e(n[E]).css("zIndex"),i&&i>D&&(D=i+10);return g.css("zIndex",D),g.css(t&&t.isFixed?{left:t.x,top:t.y}:p._align(x,C)),s=a(g,b,k[0]===g.offsetParent()[0]),l=a(g),c=k.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),c.length&&(s=a(g,b,!0),l=a(g)),_[0]===window?(l.top-=window.pageYOffset||document.documentElement.scrollTop||0,l.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(l.top-=w.top,l.left-=w.left),p.wrapper.data(y)||g.data(y,R({},s)),d=R({},l),u=R({},s),"fit"===S[0]&&(u.top+=p._fit(d.top,g.outerHeight(),P/T)),"fit"===S[1]&&(u.left+=p._fit(d.left,g.outerWidth(),I/T)),h=R({},u),"flip"===S[0]&&(u.top+=p._flip(d.top,f.outerHeight(),k.outerHeight(),P/T,x[0],C[0],g.outerHeight())),"flip"===S[1]&&(u.left+=p._flip(d.left,f.outerWidth(),k.outerWidth(),I/T,x[1],C[1],g.outerWidth())),f.css(b,v),g.css(u),u.left!=h.left||u.top!=h.top
21
+ },_align:function(t,n){var i,r=this,o=r.wrapper,s=e(r.options.anchor),l=t[0],c=t[1],d=n[0],u=n[1],p=a(s),g=e(r.options.appendTo),v=o.outerWidth(),_=o.outerHeight(),w=s.outerWidth(),y=s.outerHeight(),b=p.top,k=p.left,x=Math.round;return g[0]!=document.body&&(i=a(g),b-=i.top,k-=i.left),l===m&&(b+=y),l===h&&(b+=x(y/2)),d===m&&(b-=_),d===h&&(b-=x(_/2)),c===f&&(k+=w),c===h&&(k+=x(w/2)),u===f&&(k-=v),u===h&&(k-=x(v/2)),{top:b,left:k}}});i.plugin(L)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=e.extend,a=window.setTimeout,s="click",l="show",c="hide",d="k-notification",u=".k-notification-wrap .k-i-close",h="info",p="success",f="warning",g="error",m="top",v="left",_="bottom",w="right",y="up",b=".kendoNotification",k='<div class="k-widget k-notification"></div>',x='<div class="k-notification-wrap"><span class="k-icon k-i-note">#=typeIcon#</span>#=content#<span class="k-icon k-i-close">Hide</span></div>',C=i.extend({init:function(t,r){var o=this;i.fn.init.call(o,t,r),r=o.options,r.appendTo&&e(r.appendTo).is(t)||o.element.hide(),o._compileTemplates(r.templates),o._guid="_"+n.guid(),o._isRtl=n.support.isRtl(t),o._compileStacking(r.stacking,r.position.top),n.notify(o)},events:[l,c],options:{name:"Notification",position:{pinned:!0,top:null,left:null,bottom:20,right:20},stacking:"default",hideOnClick:!0,button:!1,allowHideAfter:0,autoHideAfter:5e3,appendTo:null,width:null,height:null,templates:[],animation:{open:{effects:"fade:in",duration:300},close:{effects:"fade:out",duration:600,hide:!0}}},_compileTemplates:function(t){var i=this,r=n.template;i._compiled={},e.each(t,function(t,n){i._compiled[n.type]=r(n.template||e("#"+n.templateId).html())}),i._defaultCompiled=r(x)},_getCompiled:function(e){var t=this,n=t._defaultCompiled;return e?t._compiled[e]||n:n},_compileStacking:function(e,t){var n,i,r=this,o={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0};switch(e){case"down":n=_+" "+v,i=m+" "+v,delete o.paddingBottom;break;case w:n=m+" "+w,i=m+" "+v,delete o.paddingRight;break;case v:n=m+" "+v,i=m+" "+w,delete o.paddingLeft;break;case y:n=m+" "+v,i=_+" "+v,delete o.paddingTop;break;default:null!==t?(n=_+" "+v,i=m+" "+v,delete o.paddingBottom):(n=m+" "+v,i=_+" "+v,delete o.paddingTop)}r._popupOrigin=n,r._popupPosition=i,r._popupPaddings=o},_attachPopupEvents:function(e,t){function n(e){e.on(s+b,function(){t.close()})}var i,r=e.allowHideAfter,o=!isNaN(r)&&r>0;e.hideOnClick?t.bind("activate",function(){o?a(function(){n(t.element)},r):n(t.element)}):e.button&&(i=t.element.find(u),o?a(function(){n(i)},r):n(i))},_showPopup:function(t,i){var r,s,l=this,c=i.autoHideAfter,d=i.position.left,h=i.position.top;s=e("."+l._guid).last(),r=new n.ui.Popup(t,{anchor:s[0]?s:document.body,origin:l._popupOrigin,position:l._popupPosition,animation:i.animation,modal:!0,collision:"",isRtl:l._isRtl,close:function(){l._triggerHide(this.element)},deactivate:function(e){e.sender.element.off(b),e.sender.element.find(u).off(b),e.sender.destroy()}}),l._attachPopupEvents(i,r),s[0]?r.open():(null===d&&(d=e(window).width()-t.width()-i.position.right),null===h&&(h=e(window).height()-t.height()-i.position.bottom),r.open(d,h)),r.wrapper.addClass(l._guid).css(o({margin:0},l._popupPaddings)),i.position.pinned?(r.wrapper.css("position","fixed"),s[0]&&l._togglePin(r.wrapper,!0)):s[0]||l._togglePin(r.wrapper,!1),c>0&&a(function(){r.close()},c)},_togglePin:function(t,n){var i=e(window),r=n?-1:1;t.css({top:parseInt(t.css(m),10)+r*i.scrollTop(),left:parseInt(t.css(v),10)+r*i.scrollLeft()})},_attachStaticEvents:function(e,t){function n(e){e.on(s+b,r(i._hideStatic,i,t))}var i=this,o=e.allowHideAfter,l=!isNaN(o)&&o>0;e.hideOnClick?l?a(function(){n(t)},o):n(t):e.button&&(l?a(function(){n(t.find(u))},o):n(t.find(u)))},_showStatic:function(e,t){var n=this,i=t.autoHideAfter,r=t.animation,o=t.stacking==y||t.stacking==v?"prependTo":"appendTo";e.addClass(n._guid)[o](t.appendTo).hide().kendoAnimate(r.open||!1),n._attachStaticEvents(t,e),i>0&&a(function(){n._hideStatic(e)},i)},_hideStatic:function(e){e.kendoAnimate(o(this.options.animation.close||!1,{complete:function(){e.off(b).find(u).off(b),e.remove()}})),this._triggerHide(e)},_triggerHide:function(e){this.trigger(c,{element:e}),this.angular("cleanup",function(){return{elements:e}})},show:function(i,r){var a,s,c=this,u=c.options,p=e(k);return r||(r=h),null!==i&&i!==t&&""!==i&&(n.isFunction(i)&&(i=i()),s={typeIcon:r,content:""},a=e.isPlainObject(i)?o(s,i):o(s,{content:i}),p.addClass(d+"-"+r).toggleClass(d+"-button",u.button).attr("data-role","alert").css({width:u.width,height:u.height}).append(c._getCompiled(r)(a)),c.angular("compile",function(){return{elements:p,data:[{dataItem:a}]}}),e(u.appendTo)[0]?c._showStatic(p,u):c._showPopup(p,u),c.trigger(l,{element:p})),c},info:function(e){return this.show(e,h)},success:function(e){return this.show(e,p)},warning:function(e){return this.show(e,f)},error:function(e){return this.show(e,g)},hide:function(){var t=this,n=t.getNotifications();return n.each(t.options.appendTo?function(n,i){t._hideStatic(e(i))}:function(t,n){var i=e(n).data("kendoPopup");i&&i.close()}),t},getNotifications:function(){var t=this,n=e("."+t._guid);return t.options.appendTo?n:n.children("."+d)},setOptions:function(e){var n,r=this;i.fn.setOptions.call(r,e),n=r.options,e.templates!==t&&r._compileTemplates(n.templates),(e.stacking!==t||e.position!==t)&&r._compileStacking(n.stacking,n.position.top)},destroy:function(){i.fn.destroy.call(this),this.getNotifications().off(b).find(u).off(b)}});n.ui.plugin(C)}(window.kendo.jQuery),function(e){function t(e){for(;e.length;)n(e),e=e.parent()}function n(e){var t=e.data(o.ns+"title");t&&(e.attr("title",t),e.removeData(o.ns+"title"))}function i(e){var t=e.attr("title");t&&(e.data(o.ns+"title",t),e.attr("title",""))}function r(e){for(;e.length&&!e.is("body");)i(e),e=e.parent()}var o=window.kendo,a=o.ui.Widget,s=o.ui.Popup,l=o.isFunction,c=e.isPlainObject,d=e.extend,u=e.proxy,h=e(document),p=o.isLocalUrl,f="_tt_active",g="aria-describedby",m="show",v="hide",_="error",w="contentLoad",y="requestStart",b="k-content-frame",k='<div role="tooltip" class="k-widget k-tooltip#if (!autoHide) {# k-tooltip-closable#}#">#if (!autoHide) {# <div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close</a></div> #}#<div class="k-tooltip-content"></div>#if (callout){ #<div class="k-callout k-callout-#=dir#"></div>#}#</div>',x=o.template("<iframe frameborder='0' class='"+b+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),C=".kendoTooltip",S={bottom:{origin:"bottom center",position:"top center"},top:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"},center:{position:"center center",origin:"center center"}},T={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},D={bottom:"n",top:"s",left:"e",right:"w",center:"n"},A={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},E=function(e){return e.target.data(o.ns+"title")},I=a.extend({init:function(e,t){var n,i=this;a.fn.init.call(i,e,t),n=i.options.position.match(/left|right/)?"horizontal":"vertical",i.dimensions=A[n],i._documentKeyDownHandler=u(i._documentKeyDown,i),i.element.on(i.options.showOn+C,i.options.filter,u(i._showOn,i)).on("mouseenter"+C,i.options.filter,u(i._mouseenter,i)),this.options.autoHide&&i.element.on("mouseleave"+C,i.options.filter,u(i._mouseleave,i))},options:{name:"Tooltip",filter:"",content:E,showAfter:100,callout:!0,position:"bottom",showOn:"mouseenter",autoHide:!0,width:null,height:null,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:!0}}},events:[m,v,w,_,y],_mouseenter:function(t){r(e(t.currentTarget))},_showOn:function(t){var n=this,i=e(t.currentTarget);n.options.showOn&&n.options.showOn.match(/click|focus/)?n._show(i):(clearTimeout(n.timeout),n.timeout=setTimeout(function(){n._show(i)},n.options.showAfter))},_appendContent:function(e){var t,n=this,i=n.options.content,r=n.content,a=n.options.iframe;c(i)&&i.url?("iframe"in n.options||(a=!p(i.url)),n.trigger(y,{options:i,target:e}),a?(r.hide(),t=r.find("."+b)[0],t?t.src=i.url||t.src:r.html(x({content:i})),r.find("."+b).off("load"+C).on("load"+C,function(){n.trigger(w),r.show()})):(r.empty(),o.ui.progress(r,!0),n._ajaxRequest(i))):i&&l(i)?(i=i({sender:this,target:e}),r.html(i||"")):r.html(i),n.angular("compile",function(){return{elements:r}})},_ajaxRequest:function(e){var t=this;jQuery.ajax(d({type:"GET",dataType:"html",cache:!1,error:function(e,n){o.ui.progress(t.content,!1),t.trigger(_,{status:n,xhr:e})},success:u(function(e){o.ui.progress(t.content,!1),t.content.html(e),t.trigger(w)},t)},e))},_documentKeyDown:function(e){e.keyCode===o.keys.ESC&&this.hide()},refresh:function(){var e=this,t=e.popup;t&&t.options.anchor&&e._appendContent(t.options.anchor)},hide:function(){this.popup&&this.popup.close()},show:function(e){e=e||this.element,r(e),this._show(e)},_show:function(e){var n=this,i=n.target();n.popup||n._initPopup(),i&&i[0]!=e[0]&&(n.popup.close(),n.popup.element.kendoStop(!0,!0)),i&&i[0]==e[0]||(n._appendContent(e),n.popup.options.anchor=e),n.popup.one("deactivate",function(){t(e),e.removeAttr(g),this.element.removeAttr("id").attr("aria-hidden",!0),h.off("keydown"+C,n._documentKeyDownHandler)}),n.popup.open()},_initPopup:function(){var t=this,n=t.options,i=e(o.template(k)({callout:n.callout&&"center"!==n.position,dir:D[n.position],autoHide:n.autoHide}));t.popup=new s(i,d({activate:function(){var e=this.options.anchor,i=e[0].id||t.element[0].id;i&&(e.attr(g,i+f),this.element.attr("id",i+f)),n.callout&&t._positionCallout(),this.element.removeAttr("aria-hidden"),h.on("keydown"+C,t._documentKeyDownHandler),t.trigger(m)},close:function(){t.trigger(v)},copyAnchorStyles:!1,animation:n.animation},S[n.position])),i.css({width:n.width,height:n.height}),t.content=i.find(".k-tooltip-content"),t.arrow=i.find(".k-callout"),n.autoHide?i.on("mouseleave"+C,u(t._mouseleave,t)):i.on("click"+C,".k-tooltip-button",u(t._closeButtonClick,t))},_closeButtonClick:function(e){e.preventDefault(),this.hide()},_mouseleave:function(n){if(this.popup){var i=e(n.currentTarget),r=i.offset(),o=n.pageX,a=n.pageY;if(r.right=r.left+i.outerWidth(),r.bottom=r.top+i.outerHeight(),o>r.left&&r.right>o&&a>r.top&&r.bottom>a)return;this.popup.close()}else t(e(n.currentTarget));clearTimeout(this.timeout)},_positionCallout:function(){var t=this,n=t.options.position,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=parseInt(t.arrow.css("border-top-width"),10),c=e(o.element).offset(),d=D[o.flipped?T[n]:n],u=s[r]-c[r]+e(a)[i.size]()/2-l;t.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-"+d).css(r,u)},target:function(){return this.popup?this.popup.options.anchor:null},destroy:function(){var e=this.popup;e&&(e.element.off(C),e.destroy()),this.element.off(C),h.off("keydown"+C,this._documentKeyDownHandler),a.fn.destroy.call(this)}});o.ui.plugin(I)}(window.kendo.jQuery),function(e,t){function n(t,i){var r,o=!1;return t.filters&&(r=e.grep(t.filters,function(e){return o=n(e,i),e.filters?e.filters.length:e.field!=i}),o||t.filters.length===r.length||(o=!0),t.filters=r),o}var i=window.kendo,r=i.ui,o=r.Widget,a=i.keys,s=i.support,l=i.htmlEncode,c=i._activeElement,d="id",u="li",h="change",p="k-state-focused",f="k-state-hover",g="k-loading",m="open",v="close",_="select",w="selected",y="progress",b="requestEnd",k="width",x=e.extend,C=e.proxy,S=s.browser,T=S.msie&&9>S.version,D=/"/g,A={ComboBox:"DropDownList",DropDownList:"ComboBox"},E=i.ui.DataBoundWidget.extend({init:function(t,n){var i,r=this,a=r.ns;o.fn.init.call(r,t,n),t=r.element,r._isSelect=t.is(_),r._template(),r.ul=e('<ul unselectable="on" class="k-list k-reset"/>').css({overflow:s.kineticScrollNeeded?"":"auto"}).on("mouseenter"+a,u,function(){e(this).addClass(f)}).on("mouseleave"+a,u,function(){e(this).removeClass(f)}).on("click"+a,u,C(r._click,r)).attr({tabIndex:-1,role:"listbox","aria-hidden":!0}),r.list=e("<div class='k-list-container'/>").append(r.ul).on("mousedown"+a,C(r._listMousedown,r)),i=t.attr(d),i&&(r.list.attr(d,i+"-list"),r.ul.attr(d,i+"_listbox"),r._optionID=i+"_option_selected"),r._header(),r._accessors(),r._initValue()},options:{valuePrimitive:!1,headerTemplate:""},setOptions:function(e){o.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable)},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_listMousedown:function(e){this.filterInput&&this.filterInput[0]===e.target||e.preventDefault()},_filterSource:function(e,t){var i=this,r=i.options,o=i.dataSource,a=x({},o.filter()||{}),s=n(a,r.dataTextField);(e||s)&&i.trigger("filtering",{filter:e})||(e&&(a=a.filters||[],a.push(e)),t?o.read(a):o.filter(a))},_header:function(){var t,n=this,i=n.options.headerTemplate;e.isFunction(i)&&(i=i({})),i&&(n.list.prepend(i),t=n.ul.prev(),n.header=t[0]?t:null,n.header&&n.angular("compile",function(){return{elements:n.header}}))},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,n=t.dataSource.reader.model;n&&n.fields&&(e=n.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},items:function(){return this.ul[0].children},current:function(e){var n=this,i=n._focused.add(n.filterInput),r=n._optionID;return e===t?n._current:(n._current&&(n._current.removeClass(p).removeAttr("aria-selected").removeAttr(d),i.removeAttr("aria-activedescendant")),e&&(e.addClass(p),n._scroll(e),r&&(e.attr("id",r),i.attr("aria-activedescendant",r))),n._current=e,t)},destroy:function(){var e=this,t=e.ns;o.fn.destroy.call(e),e._unbindDataSource(),e.ul.off(t),e.list.off(t),e._touchScroller&&e._touchScroller.destroy(),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(n){var i=this;return n===t?n=i.selectedIndex:"number"!=typeof n&&(n=e(i.items()).index(n)),i._data()[n]},_accessors:function(){var e=this,t=e.element,n=e.options,r=i.getter,o=t.attr(i.attr("text-field")),a=t.attr(i.attr("value-field"));!n.dataTextField&&o&&(n.dataTextField=o),!n.dataValueField&&a&&(n.dataValueField=a),e._text=r(n.dataTextField),e._value=r(n.dataValueField)},_aria:function(e){var n=this,i=n.options,r=n._focused.add(n.filterInput);i.suggest!==t&&r.attr("aria-autocomplete",i.suggest?"both":"list"),e=e?e+" "+n.ul[0].id:n.ul[0].id,r.attr("aria-owns",e),n.ul.attr("aria-live",i.filter&&"none"!==i.filter?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,n=this,i=n.selectedIndex,r=n.options.value,o=n.value();n._isSelect&&!n._bound&&r&&(o=r),o!==n._old?e=!0:i!==t&&i!==n._oldIndex&&(e=!0),e&&(n._old=o,n._oldIndex=i,n.element.trigger(h),n.trigger(h))},_click:function(t){t.isDefaultPrevented()||this._accept(e(t.currentTarget))},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,n=e.options,i=e.element.is("[disabled]");n.enable!==t&&(n.enabled=n.enable),!n.enabled||i?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_focus:function(e){var n=this,i=!0;return n.popup.visible()&&e&&n.trigger(_,{item:e})?(n.close(),t):(n._select(e),n._triggerCascade(i),n._blur(),t)},_index:function(e){var t,n,i=this,r=i._data();for(t=0,n=r.length;n>t;t++)if(i._dataValue(r[t])==e)return t;return-1},_dataValue:function(e){var n=this._value(e);return n===t&&(n=this._text(e)),n},_height:function(e){if(e){var t,n,i=this,r=i.list,o=i.options.height,a=i.popup.visible();n=r.add(r.parent(".k-animation-container")).show(),o=i.ul[0].scrollHeight>o?o:"auto",n.height(o),"auto"!==o&&(t=i.ul[0].offsetTop,t&&(o=r.height()-t)),i.ul.height(o),a||n.hide()}},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.wrapper;if(n.data(k)||!i)return e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&S.msie&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i="border-box"!==n.css("box-sizing")?t-(n.outerWidth()-n.width()):t,n.css({fontFamily:r.css("font-family"),width:i}).data(k,i),!0},_openHandler:function(e){this._adjustListWidth(),this.trigger(m)?e.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(e){this.trigger(v)?e.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_firstOpen:function(){this._height(this._data().length)},_popup:function(){var e=this;e.popup=new r.Popup(e.list,x({},e.options.popup,{anchor:e.wrapper,open:C(e._openHandler,e),close:C(e._closeHandler,e),animation:e.options.animation,isRtl:s.isRtl(e.wrapper)})),e.popup.one(m,C(e._firstOpen,e)),e._touchScroller=i.touchScroller(e.popup.element)},_makeUnselectable:function(){T&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(f,"mouseenter"===t.type)},_toggle:function(e,n){var i=this,r=s.touch&&s.MSPointers&&s.pointers;e=e!==t?e:!i.popup.visible(),n||r||i._focused[0]===c()||i._focused.focus(),i[e?m:v]()},_scroll:function(e){if(e){e[0]&&(e=e[0]);var t,n,i=this.ul[0],r=e.offsetTop,o=e.offsetHeight,a=i.scrollTop,s=i.clientHeight,l=r+o,c=this._touchScroller;c?(t=c.dimensions.y,t.enabled&&r>t.size&&(r=r-t.size+o+4,c.scrollTo(0,-r))):(n=this.header?this.header.outerHeight():0,n+=this.filterInput?this.filterInput.outerHeight():0,i.scrollTop=a>r?r-n:l>a+s?l-s-n:a)}},_template:function(){var e=this,t=e.options,n=t.template,r=t.dataSource;e._isSelect&&e.element[0].length&&(r||(t.dataTextField=t.dataTextField||"text",t.dataValueField=t.dataValueField||"value")),n?(n=i.template(n),e.template=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+n(e)+"</li>"}):e.template=i.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+i.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1})},_triggerCascade:function(e){var t=this,n=t.value();(!t._bound&&n||t._old!==n)&&t.trigger("cascade",{userTriggered:e})},_unbindDataSource:function(){var e=this;e.dataSource.unbind(h,e._refreshHandler).unbind(y,e._progressHandler).unbind(b,e._requestEndHandler).unbind("error",e._errorHandler)}});x(E,{inArray:function(e,t){var n,i,r=t.children;if(!e||e.parentNode!==t)return-1;for(n=0,i=r.length;i>n;n++)if(e===r[n])return n;return-1}}),i.ui.List=E,r.Select=E.extend({init:function(e,t){E.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this._bound=!1,this.options.autoBind&&this.dataSource.fetch()},close:function(){this.popup.close()},select:function(e){var n=this;return e===t?n.selectedIndex:(n._select(e),n._triggerCascade(),n._old=n._accessor(),n._oldIndex=n.selectedIndex,t)},search:function(e){var t,n,i,r,o,a;e="string"==typeof e?e:this.text(),t=this,n=e.length,i=t.options,r=i.ignoreCase,o=i.filter,a=i.dataTextField,clearTimeout(t._typing),(!n||n>=i.minLength)&&(t._state="filter","none"===o?t._filter(e):(t._open=!0,t._filterSource({value:r?e.toLowerCase():e,field:a,operator:o,ignoreCase:r})))},_accessor:function(e,n){var i,r=this.element[0],o=this._isSelect,a=r.selectedIndex;return e===t?(o?a>-1&&(i=r.options[a],i&&(e=i.value)):e=r.value,e):(o?(a>-1&&r.options[a].removeAttribute(w),r.selectedIndex=n,i=r.options[n],i&&i.setAttribute(w,w)):r.value=e,t)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(g),e._focused.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._arrow&&(e._focused.attr("aria-busy",!0),e._arrow.addClass(g))},100))},_requestEnd:function(){this._request=!1},_dataSource:function(){var t,n=this,r=n.element,o=n.options,a=o.dataSource||{};a=e.isArray(a)?{data:a}:a,n._isSelect&&(t=r[0].selectedIndex,t>-1&&(o.index=t),a.select=r,a.fields=[{field:o.dataTextField},{field:o.dataValueField}]),n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._refreshHandler=C(n.refresh,n),n._progressHandler=C(n._showBusy,n),n._requestEndHandler=C(n._requestEnd,n),n._errorHandler=C(n._hideBusy,n)),n.dataSource=i.data.DataSource.create(a).bind(h,n._refreshHandler).bind(y,n._progressHandler).bind(b,n._requestEndHandler).bind("error",n._errorHandler)},_get:function(t){var n,i,r=this,o=r._data();if("function"==typeof t)for(n=0,i=o.length;i>n;n++)if(t(o[n])){t=n;break}if("number"==typeof t){if(0>t)return e();t=e(r.ul[0].children[t])}return t&&t.nodeType&&(t=e(t)),t},_move:function(e){var t,n,i=this,r=e.keyCode,o=i.ul[0],s=i.popup.visible()?"_select":"_accept",l=i._current,c=r===a.DOWN;if(r===a.UP||c){if(e.altKey)i.toggle(c);else{if(t=o.firstChild,!t&&!i._accessor()&&"filter"!==i._state)return i._fetch||(i.dataSource.one(h,function(){i._move(e),i._fetch=!1}),i._fetch=!0,i._filterSource()),e.preventDefault(),!0;c?(!l||-1===i.selectedIndex&&!i.value()&&l[0]===t?l=t:(l=l[0].nextSibling,l||t!==o.lastChild||(l=t)),i[s](l)):(l=l?l[0].previousSibling:o.lastChild,l||t!==o.lastChild||(l=t),i[s](l))}e.preventDefault(),n=!0}else r===a.ENTER||r===a.TAB?(i.popup.visible()&&e.preventDefault(),i.popup.visible()||l&&l.hasClass("k-state-selected")||(l=null),i._accept(l,r),n=!0):r===a.ESC&&(i.popup.visible()&&e.preventDefault(),i.close(),n=!0);return n},_selectItem:function(){var e,n,i=this,r=i._bound===t,o=i.options;e=i._isSelect&&!i._initial&&!o.value&&o.index&&!i._bound,e||(n=i._selectedValue||r&&o.value||i._accessor()),n?i.value(n):r&&i.select(o.index)},_fetchItems:function(e){var n=this,i=n.ul[0].firstChild;return n._request?!0:n._bound||n._fetch||i?t:n.options.cascadeFrom?!i:(n.dataSource.one(h,function(){n._old=t,n.value(e),n._fetch=!1}),n._fetch=!0,n.dataSource.fetch(),!0)},_options:function(e,n){var i,r,o,a,s=this,c=s.element,d=e.length,u="",h=0;for(n&&(h=1,u=n);d>h;h++)i="<option",r=e[h],o=s._text(r),a=s._value(r),a!==t&&(a+="",-1!==a.indexOf('"')&&(a=a.replace(D,"&quot;")),i+=' value="'+a+'"'),i+=">",o!==t&&(i+=l(o)),i+="</option>",u+=i;c.html(u)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=r.on("reset",t._resetHandler))},_cascade:function(){var t,i,r,o,a,s=this,l=s.options,c=l.cascadeFrom;if(c){if(s._selectedValue=l.value||s._accessor(),i=e("#"+c),t=i.data("kendo"+l.name),t||(t=i.data("kendo"+A[l.name])),!t)return;l.autoBind=!1,o=l.cascadeFromField||t.options.dataValueField,a=function(){s.dataSource.unbind(h,a);var e=s._selectedValue||s.value();s._userTriggered?s._clearSelection(t,!0):e?(s.value(e),s.dataSource.view()[0]&&-1!==s.selectedIndex||s._clearSelection(t,!0)):s.select(l.index),s.enable(),s._triggerCascade(s._userTriggered),s._userTriggered=!1},r=function(){var e,i,r,l=t.dataItem(),c=l?t._value(l):null;c||0===c?(e=s.dataSource.filter()||{},n(e,o),i=e.filters||[],i.push({field:o,operator:"eq",value:c}),r=function(){s.unbind("dataBound",r),a.apply(s,arguments)},s.first("dataBound",r),s.dataSource.filter(i)):(s.enable(!1),s._clearSelection(t),s._triggerCascade(s._userTriggered),s._userTriggered=!1)},t.first("cascade",function(e){s._userTriggered=e.userTriggered,r()}),t._bound?r():t.value()||s.enable(!1)}}})}(window.kendo.jQuery),function(e,t){function n(e,t,n,i){var r,o=e.getFullYear(),a=t.getFullYear(),s=n.getFullYear();return o-=o%i,r=o+(i-1),a>o&&(o=a),r>s&&(r=s),o+"-"+r}function i(e){for(var t,n=0,i=e.min,r=e.max,o=e.start,a=e.setter,l=e.build,c=e.cells||12,d=e.perRow||4,u=e.content||P,h=e.empty||M,p=e.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';c>n;n++)n>0&&n%d===0&&(p+='</tr><tr role="row">'),t=l(o,n),p+=s(o,i,r)?u(t):h(t),a(o,1);return p+"</tr></tbody></table>"}function r(e,t,n){var i=e.getFullYear(),r=t.getFullYear(),o=r,a=0;return n&&(r-=r%n,o=r-r%n+n-1),i>o?a=1:r>i&&(a=-1),a}function o(){var e=new ft;return new ft(e.getFullYear(),e.getMonth(),e.getDate())}function a(e,t,n){var i=o();return e&&(i=new ft(+e)),t>i?i=new ft(+t):i>n&&(i=new ft(+n)),i}function s(e,t,n){return+e>=+t&&+n>=+e}function l(e,t){return e.slice(t).concat(e.slice(0,t))}function c(e,t,n){t=t instanceof ft?t.getFullYear():e.getFullYear()+n*t,e.setFullYear(t)}function d(t){e(this).toggleClass($,it.indexOf(t.type)>-1||t.type==tt)}function u(e){e.preventDefault()}function h(e){return A(e).calendars.standard}function p(e){var n=gt[e.start],i=gt[e.depth],r=A(e.culture);e.format=T(e.format||r.calendars.standard.patterns.d),isNaN(n)&&(n=0,e.start=U),(i===t||i>n)&&(e.depth=U),e.dates||(e.dates=[])}function f(e){z&&e.find("*").attr("unselectable","on")}function g(e,t){for(var n=0,i=t.length;i>n;n++)if(e===+t[n])return!0;return!1}function m(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate():!1}function v(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth():!1}var _,w=window.kendo,y=w.support,b=w.ui,k=b.Widget,x=w.keys,C=w.parseDate,S=w.date.adjustDST,T=w._extractFormat,D=w.template,A=w.getCulture,E=w.support.transitions,I=E?E.css+"transform-origin":"",P=D('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#</a></td>',{useWithBlock:!1}),M=D('<td role="gridcell">&nbsp;</td>',{useWithBlock:!1}),F=w.support.browser,z=F.msie&&9>F.version,R=".kendoCalendar",B="click"+R,H="keydown"+R,L="id",N="min",O="left",V="slideIn",U="month",W="century",j="change",q="navigate",G="value",$="k-state-hover",Y="k-state-disabled",Q="k-state-focused",K="k-other-month",X=' class="'+K+'"',Z="k-nav-today",J="td:has(.k-link)",et="blur"+R,tt="focus",nt=tt+R,it=y.touch?"touchstart":"mouseenter",rt=y.touch?"touchstart"+R:"mouseenter"+R,ot=y.touch?"touchend"+R+" touchmove"+R:"mouseleave"+R,at=6e4,st=864e5,lt="_prevArrow",ct="_nextArrow",dt="aria-disabled",ut="aria-selected",ht=e.proxy,pt=e.extend,ft=Date,gt={month:0,year:1,decade:2,century:3},mt=k.extend({init:function(t,n){var i,r,o=this;k.fn.init.call(o,t,n),t=o.wrapper=o.element,n=o.options,n.url=window.unescape(n.url),o._templates(),o._header(),o._footer(o.footer),r=t.addClass("k-widget k-calendar").on(rt+" "+ot,J,d).on(H,"table.k-content",ht(o._move,o)).on(B,J,function(t){var n=t.currentTarget.firstChild;-1!=n.href.indexOf("#")&&t.preventDefault(),o._click(e(n))}).on("mouseup"+R,"table.k-content, .k-footer",function(){o._focusView(o.options.focusOnNav!==!1)}).attr(L),r&&(o._cellID=r+"_cell_selected"),p(n),i=C(n.value,n.format,n.culture),o._index=gt[n.start],o._current=new ft(+a(i,n.min,n.max)),o._addClassProxy=function(){o._active=!0,o._cell.addClass(Q)},o._removeClassProxy=function(){o._active=!1,o._cell.removeClass(Q)},o.value(i),w.notify(o)},options:{name:"Calendar",value:null,min:new ft(1900,0,1),max:new ft(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:U,depth:U,animation:{horizontal:{effects:V,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[j,q],setOptions:function(e){var t=this;p(e),e.dates[0]||(e.dates=t.options.dates),k.fn.setOptions.call(t,e),t._templates(),t._footer(t.footer),t._index=gt[t.options.start],t.navigate()},destroy:function(){var e=this,t=e._today;e.element.off(R),e._title.off(R),e[lt].off(R),e[ct].off(R),w.destroy(e._table),t&&w.destroy(t.off(R)),k.fn.destroy.call(e)},current:function(){return this._current},view:function(){return this._view},focus:function(e){e=e||this._table,this._bindTable(e),e.focus()},min:function(e){return this._option(N,e)},max:function(e){return this._option("max",e)},navigateToPast:function(){this._navigate(lt,-1)},navigateToFuture:function(){this._navigate(ct,1)},navigateUp:function(){var e=this,t=e._index;e._title.hasClass(Y)||e.navigate(e._current,++t)},navigateDown:function(e){var n=this,i=n._index,r=n.options.depth;if(e)return i===gt[r]?(+n._value!=+e&&(n.value(e),n.trigger(j)),t):(n.navigate(e,--i),t)},navigate:function(n,i){i=isNaN(i)?gt[i]:i;var r,o,s,l,c=this,d=c.options,u=d.culture,h=d.min,p=d.max,g=c._title,m=c._table,v=c._oldTable,w=c._value,y=c._current,b=n&&+n>+y,k=i!==t&&i!==c._index;n||(n=y),c._current=n=new ft(+a(n,h,p)),i===t?i=c._index:c._index=i,c._view=o=_.views[i],s=o.compare,l=i===gt[W],g.toggleClass(Y,l).attr(dt,l),l=s(n,h)<1,c[lt].toggleClass(Y,l).attr(dt,l),l=s(n,p)>-1,c[ct].toggleClass(Y,l).attr(dt,l),m&&v&&v.data("animating")&&(v.kendoStop(!0,!0),m.kendoStop(!0,!0)),c._oldTable=m,(!m||c._changeView)&&(g.html(o.title(n,h,p,u)),c._table=r=e(o.content(pt({min:h,max:p,date:n,url:d.url,dates:d.dates,format:d.format,culture:u},c[o.name]))),f(r),c._animate({from:m,to:r,vertical:k,future:b}),c._focus(n),c.trigger(q)),i===gt[d.depth]&&w&&c._class("k-state-selected",o.toDateString(w)),c._class(Q,o.toDateString(n)),!m&&c._cell&&c._cell.removeClass(Q),c._changeView=!0},value:function(e){var n=this,i=n._view,r=n.options,o=n._view,a=r.min,l=r.max;return e===t?n._value:(e=C(e,r.format,r.culture),null!==e&&(e=new ft(+e),s(e,a,l)||(e=null)),n._value=e,o&&null===e&&n._cell?n._cell.removeClass("k-state-selected"):(n._changeView=!e||i&&0!==i.compare(e,n._current),n.navigate(e)),t)},_move:function(t){var n,i,r,o,s=this,l=s.options,c=t.keyCode,d=s._view,u=s._index,h=new ft(+s._current),p=w.support.isRtl(s.wrapper);return t.target===s._table[0]&&(s._active=!0),t.ctrlKey?c==x.RIGHT&&!p||c==x.LEFT&&p?(s.navigateToFuture(),i=!0):c==x.LEFT&&!p||c==x.RIGHT&&p?(s.navigateToPast(),i=!0):c==x.UP?(s.navigateUp(),i=!0):c==x.DOWN&&(s._click(e(s._cell[0].firstChild)),i=!0):(c==x.RIGHT&&!p||c==x.LEFT&&p?(n=1,i=!0):c==x.LEFT&&!p||c==x.RIGHT&&p?(n=-1,i=!0):c==x.UP?(n=0===u?-7:-4,i=!0):c==x.DOWN?(n=0===u?7:4,i=!0):c==x.ENTER?(s._click(e(s._cell[0].firstChild)),i=!0):c==x.HOME||c==x.END?(r=c==x.HOME?"first":"last",o=d[r](h),h=new ft(o.getFullYear(),o.getMonth(),o.getDate(),h.getHours(),h.getMinutes(),h.getSeconds(),h.getMilliseconds()),i=!0):c==x.PAGEUP?(i=!0,s.navigateToPast()):c==x.PAGEDOWN&&(i=!0,s.navigateToFuture()),(n||r)&&(r||d.setDate(h,n),s._focus(a(h,l.min,l.max)))),i&&t.preventDefault(),s._current},_animate:function(e){var t=this,n=e.from,i=e.to,r=t._active;n?n.parent().data("animating")?(n.off(R),n.parent().kendoStop(!0,!0).remove(),n.remove(),i.insertAfter(t.element[0].firstChild),t._focusView(r)):n.is(":visible")&&t.options.animation!==!1?t[e.vertical?"_vertical":"_horizontal"](n,i,e.future):(i.insertAfter(n),n.off(R).remove(),t._focusView(r)):(i.insertAfter(t.element[0].firstChild),t._bindTable(i))},_horizontal:function(e,t,n){var i=this,r=i._active,o=i.options.animation.horizontal,a=o.effects,s=e.outerWidth();a&&-1!=a.indexOf(V)&&(e.add(t).css({width:s}),e.wrap("<div/>"),i._focusView(r,e),e.parent().css({position:"relative",width:2*s,"float":O,"margin-left":n?0:-s}),t[n?"insertAfter":"insertBefore"](e),pt(o,{effects:V+":"+(n?"right":O),complete:function(){e.off(R).remove(),i._oldTable=null,t.unwrap(),i._focusView(r)}}),e.parent().kendoStop(!0,!0).kendoAnimate(o))},_vertical:function(e,t){var n,i,r=this,o=r.options.animation.vertical,a=o.effects,s=r._active;a&&-1!=a.indexOf("zoom")&&(t.css({position:"absolute",top:e.prev().outerHeight(),left:0}).insertBefore(e),I&&(n=r._cellByDate(r._view.toDateString(r._current)),i=n.position(),i=i.left+parseInt(n.width()/2,10)+"px "+(i.top+parseInt(n.height()/2,10)+"px"),t.css(I,i)),e.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){e.off(R).remove(),r._oldTable=null,t.css({position:"static",top:0,left:0}),r._focusView(s)}}),t.kendoStop(!0,!0).kendoAnimate(o))},_cellByDate:function(t){return this._table.find("td:not(."+K+")").filter(function(){return e(this.firstChild).attr(w.attr(G))===t})},_class:function(t,n){var i=this,r=i._cellID,o=i._cell;
22
+ o&&o.removeAttr(ut).removeAttr("aria-label").removeAttr(L),o=i._table.find("td:not(."+K+")").removeClass(t).filter(function(){return e(this.firstChild).attr(w.attr(G))===n}).attr(ut,!0),t!==Q||i._active||i.options.focusOnNav===!1||(t=""),o.addClass(t),o[0]&&(i._cell=o),r&&(o.attr(L,r),i._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",r))},_bindTable:function(e){e.on(nt,this._addClassProxy).on(et,this._removeClassProxy)},_click:function(e){var t=this,n=t.options,i=new Date(+t._current),r=e.attr(w.attr(G)).split("/");r=new ft(r[0],r[1],r[2]),S(r,0),t._view.setDate(i,r),t.navigateDown(a(i,n.min,n.max))},_focus:function(e){var t=this,n=t._view;0!==n.compare(e,t._current)?t.navigate(e):(t._current=e,t._class(Q,n.toDateString(e)))},_focusView:function(e,t){e&&this.focus(t)},_footer:function(n){var i=this,r=o(),a=i.element,s=a.find(".k-footer");return n?(s[0]||(s=e('<div class="k-footer"><a href="#" class="k-link k-nav-today"></a></div>').appendTo(a)),i._today=s.show().find(".k-link").html(n(r)).attr("title",w.toString(r,"D",i.options.culture)),i._toggle(),t):(i._toggle(!1),s.hide(),t)},_header:function(){var e,t=this,n=t.element;n.find(".k-header")[0]||n.html('<div class="k-header"><a href="#" role="button" class="k-link k-nav-prev"><span class="k-icon k-i-arrow-w"></span></a><a href="#" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a><a href="#" role="button" class="k-link k-nav-next"><span class="k-icon k-i-arrow-e"></span></a></div>'),e=n.find(".k-link").on(rt+" "+ot+" "+nt+" "+et,d).click(!1),t._title=e.eq(1).on(B,function(){t._active=t.options.focusOnNav!==!1,t.navigateUp()}),t[lt]=e.eq(0).on(B,function(){t._active=t.options.focusOnNav!==!1,t.navigateToPast()}),t[ct]=e.eq(2).on(B,function(){t._active=t.options.focusOnNav!==!1,t.navigateToFuture()})},_navigate:function(e,t){var n=this,i=n._index+1,r=new ft(+n._current);e=n[e],e.hasClass(Y)||(i>3?r.setFullYear(r.getFullYear()+100*t):_.views[i].setDate(r,t),n.navigate(r))},_option:function(e,n){var i,r=this,o=r.options,a=r._value||r._current;return n===t?o[e]:(n=C(n,o.format,o.culture),n&&(o[e]=new ft(+n),i=e===N?n>a:a>n,(i||v(a,n))&&(i&&(r._value=null),r._changeView=!0),r._changeView||(r._changeView=!(!o.month.content&&!o.month.empty)),r.navigate(r._value),r._toggle()),t)},_toggle:function(e){var n=this,i=n.options,r=n._today;e===t&&(e=s(o(),i.min,i.max)),r&&(r.off(B),e?r.addClass(Z).removeClass(Y).on(B,ht(n._todayClick,n)):r.removeClass(Z).addClass(Y).on(B,u))},_todayClick:function(e){var t=this,n=gt[t.options.depth],i=o();e.preventDefault(),0===t._view.compare(t._current,i)&&t._index==n&&(t._changeView=!1),t._value=i,t.navigate(i,n),t.trigger(j)},_templates:function(){var e=this,t=e.options,n=t.footer,i=t.month,r=i.content,o=i.empty;e.month={content:D('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+w.attr("value")+'="#=data.dateString#" title="#=data.title#">'+(r||"#=data.value#")+"</a></td>",{useWithBlock:!!r}),empty:D('<td role="gridcell">'+(o||"&nbsp;")+"</td>",{useWithBlock:!!o})},e.footer=n!==!1?D(n||'#= kendo.toString(data,"D","'+t.culture+'") #',{useWithBlock:!1}):null}});b.plugin(mt),_={firstDayOfMonth:function(e){return new ft(e.getFullYear(),e.getMonth(),1)},firstVisibleDay:function(e,t){t=t||w.culture().calendar;for(var n=t.firstDay,i=new ft(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)_.setTime(i,-1*st);return i},setTime:function(e,t){var n=e.getTimezoneOffset(),i=new ft(e.getTime()+t),r=i.getTimezoneOffset()-n;e.setTime(i.getTime()+r*at)},views:[{name:U,title:function(e,t,n,i){return h(i).months.names[e.getMonth()]+" "+e.getFullYear()},content:function(e){for(var t=this,n=0,r=e.min,o=e.max,a=e.date,s=e.dates,c=e.format,d=e.culture,u=e.url,p=u&&s[0],f=h(d),m=f.firstDay,v=f.days,y=l(v.names,m),b=l(v.namesShort,m),k=_.firstVisibleDay(a,f),x=t.first(a),C=t.last(a),T=t.toDateString,D=new ft,A='<table tabindex="0" role="grid" class="k-content" cellspacing="0"><thead><tr role="row">';7>n;n++)A+='<th scope="col" title="'+y[n]+'">'+b[n]+"</th>";return D=new ft(D.getFullYear(),D.getMonth(),D.getDate()),S(D,0),D=+D,i({cells:42,perRow:7,html:A+='</tr></thead><tbody><tr role="row">',start:new ft(k.getFullYear(),k.getMonth(),k.getDate()),min:new ft(r.getFullYear(),r.getMonth(),r.getDate()),max:new ft(o.getFullYear(),o.getMonth(),o.getDate()),content:e.content,empty:e.empty,setter:t.setDate,build:function(e){var t=[],n=e.getDay(),i="",r="#";return(x>e||e>C)&&t.push(K),+e===D&&t.push("k-today"),(0===n||6===n)&&t.push("k-weekend"),p&&g(+e,s)&&(r=u.replace("{0}",w.toString(e,c,d)),i=" k-action-link"),{date:e,dates:s,ns:w.ns,title:w.toString(e,"D",d),value:e.getDate(),dateString:T(e),cssClass:t[0]?' class="'+t.join(" ")+'"':"",linkClass:i,url:r}}})},first:function(e){return _.firstDayOfMonth(e)},last:function(e){var t=new ft(e.getFullYear(),e.getMonth()+1,0),n=_.firstDayOfMonth(e),i=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return i&&t.setHours(n.getHours()+i/60),t},compare:function(e,t){var n,i=e.getMonth(),r=e.getFullYear(),o=t.getMonth(),a=t.getFullYear();return n=r>a?1:a>r?-1:i==o?0:i>o?1:-1},setDate:function(e,t){var n=e.getHours();t instanceof ft?e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):_.setTime(e,t*st),S(e,n)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/"+e.getDate()}},{name:"year",title:function(e){return e.getFullYear()},content:function(e){var t=h(e.culture).months.namesAbbr,n=this.toDateString,r=e.min,o=e.max;return i({min:new ft(r.getFullYear(),r.getMonth(),1),max:new ft(o.getFullYear(),o.getMonth(),1),start:new ft(e.date.getFullYear(),0,1),setter:this.setDate,build:function(e){return{value:t[e.getMonth()],ns:w.ns,dateString:n(e),cssClass:""}}})},first:function(e){return new ft(e.getFullYear(),0,e.getDate())},last:function(e){return new ft(e.getFullYear(),11,e.getDate())},compare:function(e,t){return r(e,t)},setDate:function(e,t){var n,i=e.getHours();t instanceof ft?(n=t.getMonth(),e.setFullYear(t.getFullYear(),n,e.getDate()),n!==e.getMonth()&&e.setDate(0)):(n=e.getMonth()+t,e.setMonth(n),n>11&&(n-=12),n>0&&e.getMonth()!=n&&e.setDate(0)),S(e,i)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/1"}},{name:"decade",title:function(e,t,i){return n(e,t,i,10)},content:function(e){var t=e.date.getFullYear(),n=this.toDateString;return i({start:new ft(t-t%10-1,0,1),min:new ft(e.min.getFullYear(),0,1),max:new ft(e.max.getFullYear(),0,1),setter:this.setDate,build:function(e,t){return{value:e.getFullYear(),ns:w.ns,dateString:n(e),cssClass:0===t||11==t?X:""}}})},first:function(e){var t=e.getFullYear();return new ft(t-t%10,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new ft(t-t%10+9,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,10)},setDate:function(e,t){c(e,t,1)},toDateString:function(e){return e.getFullYear()+"/0/1"}},{name:W,title:function(e,t,i){return n(e,t,i,100)},content:function(e){var t=e.date.getFullYear(),n=e.min.getFullYear(),r=e.max.getFullYear(),o=this.toDateString,a=n,s=r;return a-=a%10,s-=s%10,10>s-a&&(s=a+9),i({start:new ft(t-t%100-10,0,1),min:new ft(a,0,1),max:new ft(s,0,1),setter:this.setDate,build:function(e,t){var i=e.getFullYear(),a=i+9;return n>i&&(i=n),a>r&&(a=r),{ns:w.ns,value:i+" - "+a,dateString:o(e),cssClass:0===t||11==t?X:""}}})},first:function(e){var t=e.getFullYear();return new ft(t-t%100,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new ft(t-t%100+99,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,100)},setDate:function(e,t){c(e,t,10)},toDateString:function(e){var t=e.getFullYear();return t-t%10+"/0/1"}}]},_.isEqualDatePart=m,_.makeUnselectable=f,_.restrictValue=a,_.isInRange=s,_.normalize=p,_.viewsEnum=gt,w.calendar=_}(window.kendo.jQuery),function(e,t){function n(t){var n=t.parseFormats,i=t.format;B.normalize(t),n=e.isArray(n)?n:[n],-1===e.inArray(i,n)&&n.splice(0,0,t.format),t.parseFormats=n}function i(e){e.preventDefault()}var r,o=window.kendo,a=o.ui,s=a.Widget,l=o.parseDate,c=o.keys,d=o.template,u=o._activeElement,h="<div />",p="<span />",f=".kendoDatePicker",g="click"+f,m="open",v="close",_="change",w="disabled",y="readonly",b="k-state-default",k="k-state-focused",x="k-state-selected",C="k-state-disabled",S="k-state-hover",T="mouseenter"+f+" mouseleave"+f,D="mousedown"+f,A="id",E="min",I="max",P="month",M="aria-disabled",F="aria-expanded",z="aria-hidden",R="aria-readonly",B=o.calendar,H=B.isInRange,L=B.restrictValue,N=B.isEqualDatePart,O=e.extend,V=e.proxy,U=Date,W=function(t){var n,i=this,r=document.body,s=e(h).attr(z,"true").addClass("k-calendar-container").appendTo(r);i.options=t=t||{},n=t.id,n&&(n+="_dateview",s.attr(A,n),i._dateViewID=n),i.popup=new a.Popup(s,O(t.popup,t,{name:"Popup",isRtl:o.support.isRtl(t.anchor)})),i.div=s,i.value(t.value)};W.prototype={_calendar:function(){var t,n=this,r=n.calendar,s=n.options;r||(t=e(h).attr(A,o.guid()).appendTo(n.popup.element).on(D,i).on(g,"td:has(.k-link)",V(n._click,n)),n.calendar=r=new a.Calendar(t),n._setOptions(s),o.calendar.makeUnselectable(r.element),r.navigate(n._value||n._current,s.start),n.value(n._value))},_setOptions:function(e){this.calendar.setOptions({focusOnNav:!1,change:e.change,culture:e.culture,dates:e.dates,depth:e.depth,footer:e.footer,format:e.format,max:e.max,min:e.min,month:e.month,start:e.start})},setOptions:function(e){var t=this.options;this.options=O(t,e,{change:t.change,close:t.close,open:t.open}),this.calendar&&this._setOptions(this.options)},destroy:function(){this.popup.destroy()},open:function(){var e=this;e._calendar(),e.popup.open()},close:function(){this.popup.close()},min:function(e){this._option(E,e)},max:function(e){this._option(I,e)},toggle:function(){var e=this;e[e.popup.visible()?v:m]()},move:function(e){var n=this,i=e.keyCode,r=n.calendar,o=e.ctrlKey&&i==c.DOWN||i==c.ENTER;if(i==c.ESC)return n.close(),t;if(e.altKey)return i==c.DOWN?(n.open(),e.preventDefault()):i==c.UP&&(n.close(),e.preventDefault()),t;if(n.popup.visible())return o&&r._cell.hasClass(x)?(n.close(),e.preventDefault(),t):(n._current=r._move(e),t)},current:function(e){this._current=e,this.calendar._focus(e)},value:function(e){var t=this,n=t.calendar,i=t.options;t._value=e,t._current=new U(+L(e,i.min,i.max)),n&&n.value(e)},_click:function(e){-1!==e.currentTarget.className.indexOf(x)&&this.close()},_option:function(e,t){var n=this,i=n.calendar;n.options[e]=t,i&&i[e](t)}},W.normalize=n,o.DateView=W,r=s.extend({init:function(e,t){var i,r,a=this;s.fn.init.call(a,e,t),e=a.element,t=a.options,t.min=l(e.attr("min"))||l(t.min),t.max=l(e.attr("max"))||l(t.max),n(t),a._wrapper(),a.dateView=new W(O({},t,{id:e.attr(A),anchor:a.wrapper,change:function(){a._change(this.value()),a.close()},close:function(t){a.trigger(v)?t.preventDefault():(e.attr(F,!1),r.attr(z,!0))},open:function(t){var n,i=a.options;a.trigger(m)?t.preventDefault():(a.element.val()!==a._oldText&&(n=l(e.val(),i.parseFormats,i.culture),a.dateView[n?"current":"value"](n)),e.attr(F,!0),r.attr(z,!1),a._updateARIA(n))}})),r=a.dateView.div,a._icon();try{e[0].setAttribute("type","text")}catch(c){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":a.dateView._dateViewID}),a._reset(),a._template(),i=e.is("[disabled]"),i?a.enable(!1):a.readonly(e.is("[readonly]")),a._old=a._update(t.value||a.element.val()),a._oldText=e.val(),o.notify(a)},events:[m,v,_],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:P,depth:P,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(e){var t=this,i=t._value;s.fn.setOptions.call(t,e),e=t.options,e.min=l(e.min),e.max=l(e.max),n(e),t.dateView.setOptions(e),i&&(t.element.val(o.toString(i,e.format,e.culture)),t._updateARIA(i))},_editable:function(e){var t=this,n=t._dateIcon.off(f),r=t.element.off(f),o=t._inputWrapper.off(f),a=e.readonly,s=e.disable;a||s?(o.addClass(s?C:b).removeClass(s?b:C),r.attr(w,s).attr(y,a).attr(M,s).attr(R,a)):(o.addClass(b).removeClass(C).on(T,t._toggleHover),r.removeAttr(w).removeAttr(y).attr(M,!1).attr(R,!1).on("keydown"+f,V(t._keydown,t)).on("focusout"+f,V(t._blur,t)).on("focus"+f,function(){t._inputWrapper.addClass(k)}),n.on(g,V(t._click,t)).on(D,i))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;s.fn.destroy.call(e),e.dateView.destroy(),e.element.off(f),e._dateIcon.off(f),e._inputWrapper.off(f),e._form&&e._form.off("reset",e._resetHandler)},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(e){return this._option(E,e)},max:function(e){return this._option(I,e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(k)},_click:function(){var e=this,t=e.element;e.dateView.toggle(),o.support.touch||t[0]===u()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.element.trigger(_),t.trigger(_))},_keydown:function(e){var t=this,n=t.dateView,i=t.element.val();n.popup.visible()||e.keyCode!=c.ENTER||i===t._oldText?(n.move(e),t._updateARIA(n._current)):t._change(i)},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select</span></span>').insertAfter(i)),n._dateIcon=t.attr({role:"button","aria-controls":n.dateView._dateViewID})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=l(n,r.parseFormats,r.culture),n&&(r[e]=new U(+n),i.dateView[e](n)),t)},_update:function(e){var t,n=this,i=n.options,r=i.min,a=i.max,s=n._value,c=l(e,i.parseFormats,i.culture),d=null===c&&null===s||c instanceof Date&&s instanceof Date;return+c===+s&&d?(t=o.toString(c,i.format,i.culture),t!==e&&n.element.val(null===c?e:t),c):(null!==c&&N(c,r)?c=L(c,r,a):H(c,r,a)||(c=null),n._value=c,n.dateView.value(c),n.element.val(c?o.toString(c,i.format,i.culture):e),n._updateARIA(c),c)},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datepicker"),t[0]||(t=i.wrap(p).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(p).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=d(this.options.ARIATemplate)},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr("aria-activedescendant"),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr("aria-activedescendant",t.attr("id")))}}),a.plugin(r)}(window.kendo.jQuery),function(e,t){function n(e,t,n){return n?t.substring(0,e).split(n).length-1:0}function i(e,t,i){return t.split(i)[n(e,t,i)]}function r(e,t,i,r){var o=t.split(r);return o.splice(n(e,t,r),1,i),r&&""!==o[o.length-1]&&o.push(""),o.join(r)}var o=window.kendo,a=o.support,s=o.caret,l=o._activeElement,c=a.placeholder,d=o.ui,u=d.List,h=o.keys,p=o.data.DataSource,f="aria-disabled",g="aria-readonly",m="k-state-default",v="disabled",_="readonly",w="k-state-focused",y="k-state-selected",b="k-state-disabled",k="k-state-hover",x=".kendoAutoComplete",C="mouseenter"+x+" mouseleave"+x,S=e.proxy,T=u.extend({init:function(t,n){var i,r=this;r.ns=x,n=e.isArray(n)?{dataSource:n}:n,u.fn.init.call(r,t,n),t=r.element,n=r.options,n.placeholder=n.placeholder||t.attr("placeholder"),c&&t.attr("placeholder",n.placeholder),r._wrapper(),r._loader(),r._dataSource(),r._ignoreCase(),t[0].type="text",i=r.wrapper,r._popup(),t.addClass("k-input").on("keydown"+x,S(r._keydown,r)).on("paste"+x,S(r._search,r)).on("focus"+x,function(){r._prev=r._accessor(),r._placeholder(!1),i.addClass(w)}).on("focusout"+x,function(){r._change(),r._placeholder(),i.removeClass(w)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0}),r._enable(),r._old=r._accessor(),t[0].id&&t.attr("aria-owns",r.ul[0].id),r._aria(),r._placeholder(),o.notify(r)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",dataTextField:"",minLength:1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},value:null},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=S(e.refresh,e),e._progressHandler=S(e._showBusy,e)),e.dataSource=p.create(e.options.dataSource).bind("change",e._refreshHandler).bind("progress",e._progressHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource()},events:["open","close","change","select","filtering","dataBinding","dataBound"],setOptions:function(e){u.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},_editable:function(e){var t=this,n=t.element,i=t.wrapper.off(x),r=e.readonly,o=e.disable;r||o?(i.addClass(o?b:m).removeClass(o?m:b),n.attr(v,o).attr(_,r).attr(f,o).attr(g,r)):(i.addClass(m).removeClass(b).on(C,t._toggleHover),n.removeAttr(v).removeAttr(_).attr(f,!1).attr(g,!1))},close:function(){var e=this,t=e._current;t&&t.removeClass(y),e.current(null),e.popup.close()},destroy:function(){var e=this;e.element.off(x),e.wrapper.off(x),u.fn.destroy.call(e)},refresh:function(){var n,i=this,r=i.ul[0],a=i.popup,s=i.options,c=i._data(),d=c.length,u=i.element[0]===l();i._angularItems("cleanup"),i.trigger("dataBinding"),r.innerHTML=o.render(i.template,c),i._height(d),a.visible()&&a._position(),d&&(s.highlightFirst&&i.current(e(r.firstChild)),s.suggest&&u&&i.suggest(e(r.firstChild))),i._open&&(i._open=!1,n=d?"open":"close",i._typing&&!u&&(n="close"),a[n](),i._typing=t),i._touchScroller&&i._touchScroller.reset(),i._makeUnselectable(),i._hideBusy(),i._angularItems("compile"),i.trigger("dataBound")},select:function(e){this._select(e)},search:function(e){var t,n=this,r=n.options,o=r.ignoreCase,a=r.separator;e=e||n._accessor(),n._current=null,clearTimeout(n._typing),a&&(e=i(s(n.element)[0],e,a)),t=e.length,(!t||t>=r.minLength)&&(n._open=!0,n._filterSource({value:o?e.toLowerCase():e,operator:r.filter,field:r.dataTextField,ignoreCase:o}))},suggest:function(e){var i,r=this,o=r._last,a=r._accessor(),c=r.element[0],d=s(c)[0],p=r.options.separator,f=a.split(p),g=n(d,a,p),m=d;return o==h.BACKSPACE||o==h.DELETE?(r._last=t,t):(e=e||"","string"!=typeof e&&(i=u.inArray(e[0],r.ul[0]),e=i>-1?r._text(r._data()[i]):""),0>=d&&(d=a.toLowerCase().indexOf(e.toLowerCase())+1),i=a.substring(0,d).lastIndexOf(p),i=i>-1?d-(i+p.length):d,a=f[g].substring(0,i),e&&(i=e.toLowerCase().indexOf(a.toLowerCase()),i>-1&&(e=e.substring(i+a.length),m=d+e.length,a+=e),p&&""!==f[f.length-1]&&f.push("")),f[g]=a,r._accessor(f.join(p||"")),c===l()&&s(c,d,m),t)},value:function(e){return e===t?this._accessor():(this._accessor(e),this._old=this._accessor(),t)},_accessor:function(e){var n=this,i=n.element[0];return e===t?(e=i.value,i.className.indexOf("k-readonly")>-1&&e===n.options.placeholder?"":e):(i.value=null===e?"":e,n._placeholder(),t)},_accept:function(e){var t=this.element;this._focus(e),s(t,t.val().length)},_keydown:function(t){var n=this,i=n.ul[0],r=t.keyCode,o=n._current,a=n.popup.visible();n._last=r,r===h.DOWN?(a&&n._move(o?o.next():e(i.firstChild)),t.preventDefault()):r===h.UP?(a&&n._move(o?o.prev():e(i.lastChild)),t.preventDefault()):r===h.ENTER||r===h.TAB?(r===h.ENTER&&n.popup.visible()&&t.preventDefault(),n._accept(o)):r===h.ESC?(n.popup.visible()&&t.preventDefault(),n.close()):n._search()},_move:function(e){var t=this;e=e[0]?e:null,t.current(e),t.options.suggest&&t.suggest(e)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._loading.hide(),e.element.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._busy||(e._busy=setTimeout(function(){e.element.attr("aria-busy",!0),e._loading.show()},100))},_placeholder:function(e){if(!c){var n,i=this,r=i.element,o=i.options.placeholder;if(o){if(n=r.val(),e===t&&(e=!n),e||(o=n!==o?n:""),n===i._old&&!e)return;r.toggleClass("k-readonly",e).val(o),o||r[0]!==document.activeElement||s(r[0],0,0)}}},_search:function(){var e=this;clearTimeout(e._typing),e._typing=setTimeout(function(){e._prev!==e._accessor()&&(e._prev=e._accessor(),e.search())},e.options.delay)},_select:function(t){var n,i,o=this,a=o.options.separator,l=o._data();t=e(t),t[0]&&!t.hasClass(y)&&(i=u.inArray(t[0],o.ul[0]),i>-1&&(l=l[i],n=o._text(l),a&&(n=r(s(o.element)[0],o._accessor(),n,a)),o._accessor(n),o._prev=o._accessor(),o.current(t.addClass(y))))},_loader:function(){this._loading=e('<span class="k-icon k-loading" style="display:none"></span>').insertAfter(this.element)},_toggleHover:function(t){e(t.currentTarget).toggleClass(k,"mouseenter"===t.type)},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent()),e.attr("tabindex",-1),e.attr("role","presentation"),e[0].style.cssText=i.style.cssText,n.css({width:"100%",height:i.style.height}),t._focused=t.element,t.wrapper=e.addClass("k-widget k-autocomplete k-header").addClass(i.className)}});d.plugin(T)}(window.kendo.jQuery),function(e,t){function n(e,t,n){for(var i,r=0,o=t.length-1;o>r;++r)i=t[r],i in e||(e[i]={}),e=e[i];e[t[o]]=n}var i=window.kendo,r=i.ui,o=r.Select,a=i.support.mobileOS,s=i._activeElement,l=i.keys,c=".kendoDropDownList",d="disabled",u="readonly",h="change",p="k-state-focused",f="k-state-default",g="k-state-disabled",m="aria-disabled",v="aria-readonly",_="k-state-selected",w="mouseenter"+c+" mouseleave"+c,y="tabindex",b="filter",k="accept",x=e.proxy,C=o.extend({init:function(n,r){var a,s,l,d=this,u=r&&r.index;d.ns=c,r=e.isArray(r)?{dataSource:r}:r,o.fn.init.call(d,n,r),r=d.options,n=d.element.on("focus"+c,x(d._focusHandler,d)),d._inputTemplate(),d._reset(),d._prev="",d._word="",d._wrapper(),d._tabindex(),d.wrapper.data(y,d.wrapper.attr(y)),d._span(),d._popup(),d._mobile(),d._dataSource(),d._ignoreCase(),d._filterHeader(),d._aria(),d._enable(),d._oldIndex=d.selectedIndex=-1,d._cascade(),u!==t&&(r.index=u),r.autoBind?d.dataSource.fetch():-1===d.selectedIndex&&(l=r.text||"",l||(a=r.optionLabel,s=a&&0===r.index,d._isSelect?l=s?a:n.children(":selected").text():!n[0].value&&s&&(l=a)),d._textAccessor(l)),i.notify(d)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,template:"",valueTemplate:"",delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},filter:"none",minLength:1},events:["open","close",h,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._inputTemplate(),this._accessors(),this._filterHeader(),this._enable(),this._aria()},destroy:function(){var e=this;e.wrapper.off(c),e.element.off(c),e._inputWrapper.off(c),e._arrow.off(),e._arrow=null,o.fn.destroy.call(e)},open:function(){var e=this;e.popup.visible()||(e.ul[0].firstChild&&e._state!==k?(e.popup.open(),e._focusElement(e.filterInput),e._scroll(e._current)):(e._open=!0,e._state="rebind",e.filterInput&&e.filterInput.val(""),e._filterSource()))},toggle:function(e){this._toggle(e,!0)},refresh:function(){var t,n,r=this,o=r._data(),a=o.length,s=r.options.optionLabel,l=r._state===b,c=r.element[0];r.trigger("dataBinding"),r._current&&r.current(null),r._angularItems("cleanup"),r.ul[0].innerHTML=i.render(r.template,o),r._angularItems("compile"),r._height(l?a||1:a),r.popup.visible()&&r.popup._position(),r._isSelect&&(t=c.selectedIndex,n=r.value(),a?s&&(s=r._option("",r._optionLabelText(s))):n&&(t=0,s=r._option(n,r.text())),r._options(o,s),c.selectedIndex=-1===t?0:t),r._hideBusy(),r._makeUnselectable(),l?r.current(e(r.ul[0].firstChild)):(r._open&&r.toggle(!!a),r._open=!1,r._fetch||(a?r._selectItem():r._textAccessor()!==s&&(r.element.val(""),r._textAccessor("")))),r._bound=!!a,r.trigger("dataBound")},text:function(e){var n,i,r=this,o=r.options.ignoreCase;return e=null===e?"":e,e===t?r._textAccessor():("string"==typeof e&&(i=o?e.toLowerCase():e,n=r._select(function(e){return e=r._text(e),o&&(e=(e+"").toLowerCase()),e===i}),n&&(e=n)),r._textAccessor(e),t)},value:function(e){var n,i,r=this;return e===t?r._accessor():(null!==e&&(e=""+e),r._selectedValue=e,i=e||r.options.optionLabel&&!r.element[0].disabled&&""===e,i&&r._fetchItems(e)||(n=r._index(e),r.select(n>-1?n:0)),t)},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(p),this._prevent=!1},_focusoutHandler:function(){var e=this,t=e._state===b,n=window.self!==window.top;e._prevent||(t&&e._select(e._current),(!t||e.dataItem())&&e._triggerCascade(),i.support.mobileOS.ios&&n?e._change():e._blur(),e._inputWrapper.removeClass(p),e._prevent=!0,e._open=!1,e.element.blur())},_wrapperMousedown:function(){this._prevent=!!this.filterInput},_wrapperClick:function(e){e.preventDefault(),this._focused=this.wrapper,this._toggle()},_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,o=t.wrapper.add(t.filterInput).off(c),a=t._inputWrapper.off(w);r||i?i?(o.removeAttr(y),a.addClass(g).removeClass(f)):(a.addClass(f).removeClass(g),o.on("focusin"+c,x(t._focusinHandler,t)).on("focusout"+c,x(t._focusoutHandler,t))):(n.removeAttr(d).removeAttr(u),a.addClass(f).removeClass(g).on(w,t._toggleHover),o.attr(y,o.data(y)).attr(m,!1).attr(v,!1).on("keydown"+c,x(t._keydown,t)).on("focusin"+c,x(t._focusinHandler,t)).on("focusout"+c,x(t._focusoutHandler,t)).on("mousedown"+c,x(t._wrapperMousedown,t)),t.wrapper.on("click"+c,x(t._wrapperClick,t)),t.filterInput||o.on("keypress"+c,x(t._keypress,t))),n.attr(d,i).attr(u,r),o.attr(m,i).attr(v,r)},_accept:function(e,t){var n=this,i=n.filterInput&&n.filterInput[0]===s();n._focus(e),n._focusElement(n.wrapper),i&&t===l.TAB&&n.wrapper.focusout()},_option:function(e,t){return'<option value="'+e+'">'+t+"</option>"},_optionLabelText:function(){var e=this.options,t=e.dataTextField,n=e.optionLabel;return n&&t&&"object"==typeof n?this._text(n):n},_data:function(){var e=this,t=e.options,r=t.optionLabel,o=t.dataTextField,a=t.dataValueField,s=e.dataSource.view(),l=s.length,c=r,d=0;if(r&&l){for("object"==typeof r?c=r:o&&(c={},o=o.split("."),a=a.split("."),n(c,a,""),n(c,o,r)),c=new i.data.ObservableArray([c]);l>d;d++)c.push(s[d]);s=c}return s},_selectItem:function(){o.fn._selectItem.call(this),this.current()||this.select(0)},_keydown:function(e){var t,n=this,i=e.keyCode,r=e.altKey,o=n.ul[0];i===l.LEFT?i=l.UP:i===l.RIGHT&&(i=l.DOWN),e.keyCode=i,t=n._move(e),n.popup.visible()&&n.filterInput||(i===l.HOME?(t=!0,e.preventDefault(),n._select(o.firstChild)):i===l.END&&(t=!0,e.preventDefault(),n._select(o.lastChild))),r&&i===l.UP&&n._focusElement(n.wrapper),r||t||!n.filterInput||n._search()},_selectNext:function(e,n){for(var i,r=this,o=n,a=r._data(),s=a.length,l=r.options.ignoreCase,c=function(n,i){return n+="",l&&(n=n.toLowerCase()),0===n.indexOf(e)?(r._select(i),r._triggerEvents(),!0):t};s>n;n++)if(i=r._text(a[n]),i&&c(i,n))return!0;if(o>0&&s>o)for(n=0;o>=n;n++)if(i=r._text(a[n]),i&&c(i,n))return!0;return!1},_keypress:function(e){var t,n,r,o=this;0!==e.which&&e.keyCode!==i.keys.ENTER&&(t=String.fromCharCode(e.charCode||e.keyCode),n=o.selectedIndex,r=o._word,o.options.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),o._last===t&&1>=r.length&&n>-1&&(r||(r=t),o._selectNext(r,n+1))||(o._word=r+t,o._last=t,o._search()))},_popupOpen:function(){var e=this.popup;e.wrapper=i.wrap(e.element),e.element.closest(".km-root")[0]&&(e.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},_popup:function(){o.fn._popup.call(this),this.popup.one("open",x(this._popupOpen,this))},_focusElement:function(e){var t=s(),n=this.wrapper,i=this.filterInput,r=e===i?n:i;i&&r[0]===t&&(this._prevent=!0,this._focused=e.focus())},_filter:function(e){var n,i;e&&(n=this,i=n.options.ignoreCase,i&&(e=e.toLowerCase()),n._select(function(r){var o=n._text(r);return o!==t?(o+="",i&&(o=o.toLowerCase()),0===o.indexOf(e)):t}))},_search:function(){var e=this,n=e.dataSource,i=e.selectedIndex,r=e._word;if(clearTimeout(e._typing),"none"!==e.options.filter)e._typing=setTimeout(function(){var t=e.filterInput.val();e._prev!==t&&(e._prev=t,e.search(t)),e._typing=null},e.options.delay);else{if(e._typing=setTimeout(function(){e._word=""},e.options.delay),-1===i&&(i=0),!e.ul[0].firstChild)return n.one(h,function(){n.data()[0]&&i>-1&&e._selectNext(r,i)}).fetch(),t;e._selectNext(r,i),e._triggerEvents()}},_select:function(e){var n,i,o=this,a=o._current,s=null;return e=o._get(e),e&&e[0]&&!e.hasClass(_)&&(o._state===b&&(o._state=k),a&&a.removeClass(_),i=r.List.inArray(e[0],o.ul[0]),i>-1&&(o.selectedIndex=i,s=o._data()[i],n=o._value(s),null===n&&(n=""),o._textAccessor(s),o._accessor(n!==t?n:o._text(s),i),o._selectedValue=o._accessor(),o.current(e.addClass(_)),o._optionID&&o._current.attr("aria-selected",!0))),s},_triggerEvents:function(){this.popup.visible()||(this._triggerCascade(),this._change())},_mobile:function(){var e=this,t=e.popup,n=t.element.parents(".km-root").eq(0);n.length&&a&&(t.options.animation.open.effects=a.android||a.meego?"fadeIn":a.ios||a.wp?"slideIn:up":t.options.animation.open.effects)},_filterHeader:function(){var t,n=this.options,i="none"!==n.filter;this.filterInput&&(this.filterInput.off(c).parent().remove(),this.filterInput=null),i&&(t='<span unselectable="on" class="k-icon k-i-search">select</span>',this.filterInput=e('<input class="k-textbox"/>').attr({role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),this.list.prepend(e('<span class="k-list-filter" />').append(this.filterInput.add(t))))},_span:function(){var t,n=this,i=n.wrapper,r="span.k-input";t=i.find(r),t[0]||(i.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=i.find(r)),n.span=t,n._inputWrapper=e(i[0].firstChild),n._arrow=i.find(".k-icon")},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent(),e[0].style.cssText=i.style.cssText),n.hide(),t._focused=t.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(i.className).css("display","").attr({unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1})},_clearSelection:function(){var e=this,n=e.options.optionLabel;return e.options.value="",e._selectedValue="",e.dataSource.view()[0]&&(n||e._userTriggered)?(e.select(0),t):(e.selectedIndex=-1,e.element.val(""),e._textAccessor(e.options.optionLabel),t)},_inputTemplate:function(){var t=this,n=t.options.valueTemplate;n=n?i.template(n):e.proxy(i.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=n},_textAccessor:function(r){var o,a=this.dataItem(),s=this.options,l=this.span;return r===t?l.text():(e.isPlainObject(r)||r instanceof i.data.ObservableObject?a=r:a&&this._text(a)===r||(s.dataTextField?(a={},n(a,s.dataTextField.split("."),r),n(a,s.dataValueField.split("."),this._accessor())):a=r),o=function(){return{elements:l.get(),data:[{dataItem:a}]}},this.angular("cleanup",o),l.html(this.valueTemplate(a)),this.angular("compile",o),t)}});r.plugin(C)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.List,o=i.Select,a=n.caret,s=n.support,l=s.placeholder,c=n._activeElement,d=n.keys,u=".kendoComboBox",h="click"+u,p="mousedown"+u,f="disabled",g="readonly",m="change",v="k-state-default",_="k-state-focused",w="k-state-disabled",y="aria-disabled",b="aria-readonly",k="k-state-selected",x="filter",C="accept",S="rebind",T="mouseenter"+u+" mouseleave"+u,D=null,A=e.proxy,E=o.extend({init:function(t,i){var r,a=this;
23
+ a.ns=u,i=e.isArray(i)?{dataSource:i}:i,o.fn.init.call(a,t,i),i=a.options,t=a.element.on("focus"+u,A(a._focusHandler,a)),i.placeholder=i.placeholder||t.attr("placeholder"),a._reset(),a._wrapper(),a._input(),a._tabindex(a.input),a._popup(),a._dataSource(),a._ignoreCase(),a._enable(),a._oldIndex=a.selectedIndex=-1,a._cascade(),a._aria(),i.autoBind?a._filterSource():(r=i.text,!r&&a._isSelect&&(r=t.children(":selected").text()),r&&(a.input.val(r),a._prev=r)),r||a._placeholder(),n.notify(a)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:0,height:200,highlightFirst:!0,template:"",filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{}},events:["open","close",m,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},current:function(e){var n=this,i=n._current;return e===t?i:(i&&i.removeClass(k),o.fn.current.call(n,e),t)},destroy:function(){var e=this;e.input.off(u),e.element.off(u),e._inputWrapper.off(u),o.fn.destroy.call(e)},_focusHandler:function(){this.input.focus()},_arrowClick:function(){this._toggle()},_inputFocus:function(){this._inputWrapper.addClass(_),this._placeholder(!1)},_inputFocusout:function(){var e=this;e._inputWrapper.removeClass(_),clearTimeout(e._typing),e._typing=null,e.options.text!==e.input.val()&&e.text(e.text()),e._placeholder(),e._blur(),e.element.blur()},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._inputWrapper.off(u),o=t.element.add(t.input.off(u)),a=t._arrow.parent().off(h+" "+p);i||n?(r.addClass(n?w:v).removeClass(n?v:w),o.attr(f,n).attr(g,i).attr(y,n).attr(b,i)):(r.addClass(v).removeClass(w).on(T,t._toggleHover),o.removeAttr(f).removeAttr(g).attr(y,!1).attr(b,!1),a.on(h,A(t._arrowClick,t)).on(p,function(e){e.preventDefault()}),t.input.on("keydown"+u,A(t._keydown,t)).on("focus"+u,A(t._inputFocus,t)).on("focusout"+u,A(t._inputFocusout,t)))},open:function(){var e=this,t=e._state,n=e.dataSource.options.serverFiltering;e.popup.visible()||(!e.ul[0].firstChild&&t!==x||t===C&&!n?(e._open=!0,e._state=S,e._filterSource()):(e.popup.open(),e._scroll(e._current)))},refresh:function(){var i,r,o=this,a=o.ul[0],s=o.options,l=o._state,d=o._data(),u=d.length,h=!0;o._angularItems("cleanup"),o.trigger("dataBinding"),a.innerHTML=n.render(o.template,d),o._height(u),o.popup.visible()&&o.popup._position(),o._isSelect&&(i=o.element[0].children[0],l===S&&(o._state=""),r=o._option,o._option=t,o._options(d),r&&r[0].selected?o._custom(r.val(),h):o._bound||i||o._custom("",h)),u&&(s.highlightFirst&&o.current(e(a.firstChild)),s.suggest&&o.input.val()&&o._request!==t&&o.suggest(e(a.firstChild))),l===x||o._fetch||o._selectItem(),o._open&&(o._open=!1,o._typing&&o.input[0]!==c()?o.popup.close():o.toggle(!!u),o._typing=null),o._touchScroller&&o._touchScroller.reset(),o._makeUnselectable(),o._hideBusy(),o._bound=!0,o._angularItems("compile"),o.trigger("dataBound")},suggest:function(e){var n,i=this,o=i.input[0],s=i.text(),l=a(o)[0],u=i._last;return u==d.BACKSPACE||u==d.DELETE?(i._last=t,t):(e=e||"","string"!=typeof e&&(n=r.inArray(e[0],i.ul[0]),e=n>-1?i._text(i.dataSource.view()[n]):""),0>=l&&(l=s.toLowerCase().indexOf(e.toLowerCase())+1),e?(n=e.toLowerCase().indexOf(s.toLowerCase()),n>-1&&(s+=e.substring(n+s.length))):s=s.substring(0,l),s.length===l&&e||(o.value=s,o===c()&&a(o,l,s.length)),t)},text:function(e){var n,i,r,o,a,s;return e=null===e?"":e,n=this,i=n.input[0],r=n.options.ignoreCase,o=e,e===t?i.value:(a=n.dataItem(),a&&n._text(a)===e&&(s=n._value(a),null===s?s="":s+="",s===n._old)?(n._triggerCascade(),t):(r&&(o=o.toLowerCase()),n._select(function(e){return e=n._text(e),r&&(e=(e+"").toLowerCase()),e===o}),0>n.selectedIndex&&(n._custom(e),i.value=e),n._prev=i.value,n._triggerCascade(),t))},toggle:function(e){this._toggle(e,!0)},value:function(e){var n,i=this,r=i.options;return e===t?i._accessor():(null!==e&&(e=""+e),i._selectedValue=e,!i._open&&e&&i._fetchItems(e)||(n=i._index(e),n>-1?i.select(n):(i.current(D),i._custom(e),(r.value!==e||r.text!==i.input.val())&&(i.text(e),i._placeholder())),i._old=i._accessor(),i._oldIndex=i.selectedIndex),t)},_accept:function(e){var t=this;e?t._focus(e):(t.text(t.text()),t._change())},_custom:function(t,n){var i=this,r=i.element,o=i._option;i._state!==x||n||(i._state=C),i._isSelect?(o||(o=i._option=e("<option/>"),r.append(o)),o.text(t),o[0].selected=!0):r.val(t),i._selectedValue=t},_filter:function(e){var n=this,i=n.options,r=n.dataSource,o=i.ignoreCase,a=function(i){var r=n._text(i);return r!==t?(r+="",""!==r&&""===e?!1:(o&&(r=r.toLowerCase()),0===r.indexOf(e))):t};return o&&(e=e.toLowerCase()),n.ul[0].firstChild?(-1!==n._highlight(a)&&(i.suggest&&n._current&&n.suggest(n._current),n.open()),n._hideBusy(),t):(r.one(m,function(){r.view()[0]&&n.search(e)}).fetch(),t)},_highlight:function(n){var i,o=this;return n===t||null===n?-1:(n=o._get(n),i=r.inArray(n[0],o.ul[0]),-1==i&&(o.options.highlightFirst&&!o.text()?(n=o.ul[0].firstChild,n&&(n=e(n))):n=D),o.current(n),i)},_input:function(){var t,n=this,i=n.element.removeClass("k-input")[0],r=i.accessKey,o=n.wrapper,a="input.k-input",s=i.name||"";s&&(s='name="'+s+'_input" '),t=o.find(a),t[0]||(o.append('<span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input '+s+'class="k-input" type="text" autocomplete="off"/><span tabindex="-1" unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=o.find(a)),t[0].style.cssText=i.style.cssText,i.maxLength>-1&&(t[0].maxLength=i.maxLength),t.addClass(i.className).val(this.options.text||i.value).css({width:"100%",height:i.style.height}).attr({role:"combobox","aria-expanded":!1}).show(),l&&t.attr("placeholder",n.options.placeholder),r&&(i.accessKey="",t[0].accessKey=r),n._focused=n.input=t,n._inputWrapper=e(o[0].firstChild),n._arrow=o.find(".k-icon").attr({role:"button",tabIndex:-1}),i.id&&n._arrow.attr("aria-controls",n.ul[0].id)},_keydown:function(e){var t=this,n=e.keyCode;t._last=n,clearTimeout(t._typing),t._typing=null,n==d.TAB||t._move(e)||t._search()},_placeholder:function(e){if(!l){var n,i=this,r=i.input,o=i.options.placeholder;if(o){if(n=i.value(),e===t&&(e=!n),r.toggleClass("k-readonly",e),!e){if(n)return;o=""}r.val(o),o||r[0]!==c()||a(r[0],0,0)}}},_search:function(){var e=this;e._typing=setTimeout(function(){var t=e.text();e._prev!==t&&(e._prev=t,e.search(t)),e._typing=null},e.options.delay)},_select:function(e){var n,i,r=this,o=r._data(),a=r._highlight(e);r.selectedIndex=a,-1!==a&&(r._state===x&&(r._state=C),r._current.addClass(k),o=o[a],n=r._text(o),i=r._value(o),null===i&&(i=""),r._prev=r.input[0].value=n,r._accessor(i!==t?i:n,a),r._selectedValue=r._accessor(),r._placeholder(),r._optionID&&r._current.attr("aria-selected",!0))},_wrapper:function(){var e=this,t=e.element,n=t.parent();n.is("span.k-widget")||(n=t.hide().wrap("<span />").parent(),n[0].style.cssText=t[0].style.cssText),e.wrapper=n.addClass("k-widget k-combobox k-header").addClass(t[0].className).css("display","")},_clearSelection:function(e,t){var n=this,i=e._selectedValue||e.value(),r=i&&-1===e.selectedIndex;(t||!i||r)&&(n.value(""),n.options.value="")}});i.plugin(E)}(window.kendo.jQuery),function(e,t){function n(e,t){var n;if(null===e&&null!==t||null!==e&&null===t)return!1;if(n=e.length,n!==t.length)return!1;for(;n--;)if(e[n]!==t[n])return!1;return!0}function i(t){var n=t.firstChild;return n&&"none"===n.style.display&&(n=o(n,k)),n?e(n):n}function r(t){var n=t.lastChild;return n&&"none"===n.style.display&&(n=o(n,x)),n?e(n):n}function o(e,t){return e=e[t],e&&"none"===e.style.display&&(e=o(e,t)),e}var a=window.kendo,s=a.ui,l=s.List,c=a.keys,d=a._activeElement,u=a.data.ObservableArray,h=e.proxy,p="id",f="li",g="accept",m="filter",v="open",_="close",w="change",y="progress",b="select",k="nextSibling",x="previousSibling",C=' style="display:none"',S="aria-disabled",T="aria-readonly",D="k-state-focused",A="k-loading-hidden",E="k-state-hover",I="k-state-disabled",P="disabled",M="readonly",F=".kendoMultiSelect",z="click"+F,R="keydown"+F,B="mouseenter"+F,H="mouseleave"+F,L=B+" "+H,N=/"/g,O=e.isArray,V=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],U=l.extend({init:function(t,n){var i,r,o=this;o.ns=F,l.fn.init.call(o,t,n),o._wrapper(),o._tagList(),o._input(),o._textContainer(),o._loader(),o._tabindex(o.input),t=o.element.attr("multiple","multiple").hide(),n=o.options,r=n.value,n.placeholder||(n.placeholder=t.data("placeholder")),i=t.attr(p),i&&(o._tagID=i+"_tag_active",i+="_taglist",o.tagList.attr(p,i)),o._aria(i),o._dataSource(),o._ignoreCase(),o._popup(),o._values=[],o._dataItems=[],o._reset(),o._enable(),o._placeholder(),n.autoBind?o.dataSource.fetch():r&&(O(r)||(r=[r]),(e.isPlainObject(r[0])||!n.dataValueField)&&(o._retrieveData=!0,o.dataSource.data(r),o.value(o._initialValues))),a.notify(o)},options:{name:"MultiSelect",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:0,delay:100,value:null,maxSelectedItems:null,itemTemplate:"",tagTemplate:"",placeholder:"",height:200,animation:{}},events:[v,_,w,b,"filtering","dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){l.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria(this.tagList.attr(p))},current:function(e){return this.currentTag(null),l.fn.current.call(this,e)},currentTag:function(e){var n=this;return e===t?n._currentTag:(n._currentTag&&(n._currentTag.removeClass(D).removeAttr(p),n.input.removeAttr("aria-activedescendant")),e&&(e.addClass(D).attr(p,n._tagID),n.input.attr("aria-activedescendant",n._tagID)),n._currentTag=e,t)},dataItems:function(){return this._dataItems},destroy:function(){var e=this,t=e.ns;clearTimeout(e._busy),clearTimeout(e._typing),e.wrapper.off(t),e.tagList.off(t),e.input.off(t),l.fn.destroy.call(e)},_wrapperMousedown:function(e){var t=this,n="input"!==e.target.nodeName.toLowerCase();n&&e.preventDefault(),-1===e.target.className.indexOf("k-delete")&&(t.input[0]!==d()&&n&&t.input.focus(),0===t.options.minLength&&t.open())},_inputFocus:function(){this._placeholder(!1),this.wrapper.addClass(D)},_inputFocusout:function(){var e=this;clearTimeout(e._typing),e.wrapper.removeClass(D),e._placeholder(!e._dataItems[0],!0),e.close(),e._state===m&&(e._state=g),e.element.blur()},_tagListClick:function(t){this._unselect(e(t.target).closest(f)),this._change(),this.close()},_editable:function(t){var n=this,i=t.disable,r=t.readonly,o=n.wrapper.off(F),a=n.tagList.off(F),s=n.element.add(n.input.off(F));r||i?(i?o.addClass(I):o.removeClass(I),s.attr(P,i).attr(M,r).attr(S,i).attr(T,r)):(o.removeClass(I).on(L,n._toggleHover).on("mousedown"+F,h(n._wrapperMousedown,n)),n.input.on(R,h(n._keydown,n)).on("paste"+F,h(n._search,n)).on("focus"+F,h(n._inputFocus,n)).on("focusout"+F,h(n._inputFocusout,n)),s.removeAttr(P).removeAttr(M).attr(S,!1).attr(T,!1),a.on(B,f,function(){e(this).addClass(E)}).on(H,f,function(){e(this).removeClass(E)}).on(z,".k-delete",h(n._tagListClick,n)))},_close:function(){var e=this;e.options.autoClose||!e._visibleItems?e.close():(e.current(e.options.highlightFirst?i(e.ul[0]):null),e.popup._position())},close:function(){this.popup.close(),this.current(null)},open:function(){var e=this;e._request&&(e._retrieveData=!1),!e.ul[0].firstChild||e._state===g||e._retrieveData?(e._state="",e._open=!0,e._retrieveData=!1,e._filterSource()):e._visibleItems&&e._allowSelection()&&(e.popup.open(),e.current(e.options.highlightFirst?i(e.ul[0]):null))},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?v:_]()},refresh:function(){var e,t=this,n=null;t.trigger("dataBinding"),e=t._render(t.dataSource.view()),t._height(e),t._setInitialValues&&(t._setInitialValues=!1,t.value(t._initialValues)),t._open&&(t._open=!1,t.toggle(e)),t.popup.visible()&&(t.popup._position(),t.options.highlightFirst&&(n=i(t.ul[0]))),t.current(n),t._touchScroller&&t._touchScroller.reset(),t._makeUnselectable(),t._hideBusy(),t.trigger("dataBound")},search:function(e){var t,n,i=this,r=i.options,o=r.ignoreCase,a=r.filter,s=r.dataTextField,l=i.input.val();r.placeholder===l&&(l=""),clearTimeout(i._typing),e="string"==typeof e?e:l,n=e.length,(!n||n>=r.minLength)&&(i._state=m,i._open=!0,t={value:o?e.toLowerCase():e,field:s,operator:a,ignoreCase:o},i._filterSource(t,i._retrieveData),i._retrieveData=!1)},value:function(n){var i,r=this,o=e(r.tagList[0].children),a=o.length,s=0;if(n===t)return r._values;if(!r._fetchItems(n)){for(;a>s;s++)r._unselect(o.eq(s));if(null!==n){for(n=O(n)||n instanceof u?n:[n],s=0,a=n.length;a>s;s++)i=r._index(n[s]),i>-1&&r._select(i);r._old=r._values.slice()}}},_dataSource:function(){var e=this,t=e.element,n=e.options,i=n.dataSource||{};i=O(i)?{data:i}:i,i.select=t,i.fields=[{field:n.dataTextField},{field:n.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=h(e.refresh,e),e._progressHandler=h(e._showBusy,e)),e.dataSource=a.data.DataSource.create(i).bind(w,e._refreshHandler).bind(y,e._progressHandler)},_fetchItems:function(n){var i=this,r=e.isArray(n)&&0===n.length;if(!r&&n)return i._fetch||i.ul[0].firstChild?t:(i.dataSource.one(w,function(){i.value(n),i._fetch=!1}),i._fetch=!0,i.dataSource.fetch(),!0)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues),t._placeholder()})},t._form=r.on("reset",t._resetHandler))},_initValue:function(){var e=this,n=e.options.value||e.element.val();null===n?n=[]:(O(n)||(n=[n]),n=e._mapValues(n)),e._old=e._initialValues=n,e._setInitialValues=n[0]!==t},_mapValues:function(t){var n=this;return t&&e.isPlainObject(t[0])&&(t=e.map(t,function(e){return n._value(e)})),t},_change:function(){var e=this,t=e.value();n(t,e._old)||(e._old=t.slice(),e.trigger(w),e.element.trigger(w))},_click:function(n){var i=this,r=e(n.currentTarget);if(!n.isDefaultPrevented()){if(i.trigger(b,{item:r}))return i._close(),t;i._select(r),i._change(),i._close()}},_item:function(e,t){return e=e[t](),e[0]&&!e.is(":visible")&&(e=this._item(e,t)),e},_keydown:function(n){var s=this,l=n.keyCode,d=s._currentTag,u=s._current,h=s.input.val(),p=a.support.isRtl(s.wrapper),f=s.popup.visible();if(l===c.DOWN){if(n.preventDefault(),!f)return s.open(),t;u=u?o(u[0],k):i(s.ul[0]),u&&s.current(e(u))}else if(l===c.UP)f&&(u=u?o(u[0],x):r(s.ul[0]),s.current(e(u)),s._current[0]||s.close()),n.preventDefault();else if(l===c.LEFT&&!p||l===c.RIGHT&&p)h||(d=d?d.prev():e(s.tagList[0].lastChild),d[0]&&s.currentTag(d));else if(l===c.RIGHT&&!p||l===c.LEFT&&p)!h&&d&&(d=d.next(),s.currentTag(d[0]?d:null));else if(l===c.ENTER&&f){if(u){if(s.trigger(b,{item:u}))return s._close(),t;s._select(u)}s._change(),s._close(),n.preventDefault()}else l===c.ESC?(f?n.preventDefault():s.currentTag(null),s.close()):l===c.HOME?f?s.current(i(s.ul[0])):h||(d=s.tagList[0].firstChild,d&&s.currentTag(e(d))):l===c.END?f?s.current(r(s.ul[0])):h||(d=s.tagList[0].lastChild,d&&s.currentTag(e(d))):l!==c.DELETE&&l!==c.BACKSPACE||h?(clearTimeout(s._typing),setTimeout(function(){s._scale()}),s._search()):(l!==c.BACKSPACE||d||(d=e(s.tagList[0].lastChild)),d&&d[0]&&(s._unselect(d),s._change(),s._close()))},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(A),e._request=!1,e._busy=null},_showBusyHandler:function(){this.input.attr("aria-busy",!0),this._loading.removeClass(A)},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(h(e._showBusyHandler,e),100))},_placeholder:function(e,n){var i=this,r=i.input,o=d();e===t&&(e=!1,r[0]!==o&&(e=!i._dataItems[0])),i._prev="",r.toggleClass("k-readonly",e).val(e?i.options.placeholder:""),r[0]!==o||n||a.caret(r[0],0,0),i._scale()},_scale:function(){var e,t=this,n=t.wrapper,i=n.width(),r=t._span.text(t.input.val());n.is(":visible")?e=r.width()+25:(r.appendTo(document.documentElement),i=e=r.width()+25,r.appendTo(n)),t.input.width(e>i?i:e)},_option:function(e,n){var i="<option",r=this._text(e),o=this._value(e);return o!==t&&(o+="",-1!==o.indexOf('"')&&(o=o.replace(N,"&quot;")),i+=' value="'+o+'"'),n&&(i+=' selected="selected"'),i+=">",r!==t&&(i+=a.htmlEncode(r)),i+="</option>"},_render:function(e){for(var t,n,i=this,r=e.length,o=i.itemTemplate,a=i._dataItems.slice(0),s=0,l=0,c="",d="";r>l;l++)t=e[l],n=i._selected(a,t),d+=o(t,l,n),c+=i._option(t,n),n||(s+=1);if(r=a.length)for(l=0;r>l;l++)c+=i._option(a[l],!0);return i.ul[0].innerHTML=d,i.element.html(c),i._visibleItems=s,s},_selected:function(e,n){var i,r=this,o=r._text,a=r._value,s=a(n),l=e.length,c=!1,d=0;for(s===t&&(s=o(n));l>d;d++)if(n=e[d],i=a(n),i===t&&(i=o(n)),i!==t&&i===s){c=!0;break}return c&&e.splice(d,1),c},_search:function(){var e=this;e._typing=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this._values.length},_select:function(e){var t,n,i=this,r=i._values;i._allowSelection()&&(isNaN(e)?n=e.hide().data("idx"):(n=e,i.ul[0].children[n].style.display="none"),i.element[0].children[n].selected=!0,t=i.dataSource.view()[n],i.tagList.append(i.tagTemplate(t)),i._dataItems.push(t),r.push(i._dataValue(t)),i._visibleItems-=1,i.currentTag(null),i._placeholder(),i._height(i._visibleItems),i._state===m&&(i._state=g))},_unselect:function(t){var n,i,r,o,a,s=this,l=t.index();if(t.remove(),s.currentTag(null),s._values.splice(l,1),n=s._dataItems.splice(l,1)[0],i=s._dataValue(n),l=s._index(i),-1!==l)e(s.ul[0].children[l]).show(),s.element[0].children[l].selected=!1,s._visibleItems+=1,s._height(s._visibleItems);else for(l=s.dataSource.view().length,r=s.element[0].children,a=r.length;a>l;l++)if(o=r[l],o.value==i){o.selected=!1;break}s._placeholder()},_template:function(){var e,t=this,n=t.options,i=n.itemTemplate,r=n.tagTemplate,o=n.dataSource;t.element[0].length&&!o&&(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value"),e=a.template("#:"+a.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}),i=i?a.template(i):e,r=r?a.template(r):e,t.itemTemplate=function(e,t,n){return'<li tabindex="-1" role="option" data-idx="'+t+'" unselectable="on" class="k-item"'+(n?C:"")+">"+i(e)+"</li>"},t.tagTemplate=function(e){return'<li class="k-button" unselectable="on"><span unselectable="on">'+r(e)+'</span><span unselectable="on" class="k-icon k-delete">delete</span></li>'}},_input:function(){var t=this,n=t.element[0].accessKey,i=t._innerWrapper.children("input.k-input");i[0]||(i=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),t.element.removeAttr("accesskey"),t._focused=t.input=i.attr({accesskey:n,autocomplete:"off",role:"listbox","aria-expanded":!1})},_tagList:function(){var t=this,n=t._innerWrapper.children("ul");n[0]||(n=e('<ul role="listbox" unselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=n},_loader:function(){this._loading=e('<span class="k-icon k-loading '+A+'"></span>').insertAfter(this.input)},_textContainer:function(){var t=a.getComputedStyles(this.input[0],V);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,n=t.element,i=n.parent("span.k-multiselect");i[0]||(i=n.wrap('<div class="k-widget k-multiselect k-header" unselectable="on" />').parent(),i[0].style.cssText=n[0].style.cssText,e('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(n)),t.wrapper=i.addClass(n[0].className).css("display",""),t._innerWrapper=e(i[0].firstChild)}});s.plugin(U)}(window.kendo.jQuery),function(e,t){function n(e,t,n){var i=n?" k-slider-horizontal":" k-slider-vertical",r=e.style?e.style:t.attr("style"),o=t.attr("class")?" "+t.attr("class"):"",a="";return"bottomRight"==e.tickPlacement?a=" k-slider-bottomright":"topLeft"==e.tickPlacement&&(a=" k-slider-topleft"),r=r?" style='"+r+"'":"","<div class='k-widget k-slider"+i+o+"'"+r+"><div class='k-slider-wrap"+(e.showButtons?" k-slider-buttons":"")+a+"'></div></div>"}function i(e,t,n){var i="";return i="increase"==t?n?"k-i-arrow-e":"k-i-arrow-n":n?"k-i-arrow-w":"k-i-arrow-s","<a class='k-button k-button-"+t+"'><span class='k-icon "+i+"' title='"+e[t+"ButtonTitle"]+"'>"+e[t+"ButtonTitle"]+"</span></a>"}function r(e,t){var n,i="<ul class='k-reset k-slider-items'>",r=k.floor(c(t/e.smallStep))+1;for(n=0;r>n;n++)i+="<li class='k-tick' role='presentation'>&nbsp;</li>";return i+="</ul>"}function o(e,t){var n=t.is("input")?1:2,i=2==n?e.leftDragHandleTitle:e.dragHandleTitle;return"<div class='k-slider-track'><div class='k-slider-selection'><!-- --></div><a href='#' class='k-draghandle' title='"+i+"' role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(n>1?e.selectionStart||e.min:e.value||e.min)+"'>Drag</a>"+(n>1?"<a href='#' class='k-draghandle' title='"+e.rightDragHandleTitle+"'role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(e.selectionEnd||e.max)+"'>Drag</a>":"")+"</div>"}function a(e){return function(t){return t+e}}function s(e){return function(){return e}}function l(e){return(e+"").replace(".",f.cultures.current.numberFormat["."])}function c(e){e=parseFloat(e,10);var t=k.pow(10,G||0);return k.round(e*t)/t}function d(e,n){var i=w(e.getAttribute(n));return null===i&&(i=t),i}function u(e){return typeof e!==Y}function h(e){return 1e4*e}var p,f=window.kendo,g=f.ui.Widget,m=f.ui.Draggable,v=e.extend,_=f.format,w=f.parseFloat,y=e.proxy,b=e.isArray,k=Math,x=f.support,C=x.pointers,S=x.msPointers,T="change",D="slide",A=".slider",E="touchstart"+A+" mousedown"+A,I=C?"pointerdown"+A:S?"MSPointerDown"+A:E,P="touchend"+A+" mouseup"+A,M=C?"pointerup":S?"MSPointerUp"+A:P,F="moveSelection",z="keydown"+A,R="click"+A,B="mouseover"+A,H="focus"+A,L="blur"+A,N=".k-draghandle",O=".k-slider-track",V=".k-tick",U="k-state-selected",W="k-state-focused",j="k-state-default",q="k-state-disabled",G=3,$="disabled",Y="undefined",Q="tabindex",K=f.getTouches,X=g.extend({init:function(e,t){var n,i=this;g.fn.init.call(i,e,t),t=i.options,i._distance=c(t.max-t.min),i._isHorizontal="horizontal"==t.orientation,i._isRtl=i._isHorizontal&&f.support.isRtl(e),i._position=i._isHorizontal?"left":"bottom",i._sizeFn=i._isHorizontal?"width":"height",i._outerSize=i._isHorizontal?"outerWidth":"outerHeight",t.tooltip.format=t.tooltip.enabled?t.tooltip.format||"{0}":"{0}",i._createHtml(),i.wrapper=i.element.closest(".k-slider"),i._trackDiv=i.wrapper.find(O),i._setTrackDivWidth(),i._maxSelection=i._trackDiv[i._sizeFn](),i._sliderItemsInit(),i._tabindex(i.wrapper.find(N)),i[t.enabled?"enable":"disable"](),n=f.support.isRtl(i.wrapper)?-1:1,i._keyMap={37:a(-1*n*t.smallStep),40:a(-t.smallStep),39:a(1*n*t.smallStep),38:a(+t.smallStep),35:s(t.max),36:s(t.min),33:a(+t.largeStep),34:a(-t.largeStep)},f.notify(i)},events:[T,D],options:{enabled:!0,min:0,max:10,smallStep:1,largeStep:5,orientation:"horizontal",tickPlacement:"both",tooltip:{enabled:!0,format:"{0}"}},_resize:function(){this._setTrackDivWidth(),this.wrapper.find(".k-slider-items").remove(),this._maxSelection=this._trackDiv[this._sizeFn](),this._sliderItemsInit(),this._refresh()},_sliderItemsInit:function(){var e=this,t=e.options,n=e._maxSelection/((t.max-t.min)/t.smallStep),i=e._calculateItemsWidth(k.floor(e._distance/t.smallStep));"none"!=t.tickPlacement&&n>=2&&(e._trackDiv.before(r(t,e._distance)),e._setItemsWidth(i),e._setItemsTitle()),e._calculateSteps(i),"none"!=t.tickPlacement&&n>=2&&t.largeStep>=t.smallStep&&e._setItemsLargeTick()},getSize:function(){return f.dimensions(this.wrapper)},_setTrackDivWidth:function(){var e=this,t=2*parseFloat(e._trackDiv.css(e._isRtl?"right":e._position),10);e._trackDiv[e._sizeFn](e.wrapper[e._sizeFn]()-2-t)},_setItemsWidth:function(t){var n,i=this,r=i.options,o=0,a=t.length-1,s=i.wrapper.find(V),l=0,c=2,d=s.length,u=0;for(n=0;d-2>n;n++)e(s[n+1])[i._sizeFn](t[n]);if(i._isHorizontal?(e(s[o]).addClass("k-first")[i._sizeFn](t[a-1]),e(s[a]).addClass("k-last")[i._sizeFn](t[a])):(e(s[a]).addClass("k-first")[i._sizeFn](t[a]),e(s[o]).addClass("k-last")[i._sizeFn](t[a-1])),i._distance%r.smallStep!==0&&!i._isHorizontal){for(n=0;t.length>n;n++)u+=t[n];l=i._maxSelection-u,l+=parseFloat(i._trackDiv.css(i._position),10)+c,i.wrapper.find(".k-slider-items").css("padding-top",l)}},_setItemsTitle:function(){for(var t=this,n=t.options,i=t.wrapper.find(V),r=n.min,o=i.length,a=t._isHorizontal&&!t._isRtl?0:o-1,s=t._isHorizontal&&!t._isRtl?o:-1,l=t._isHorizontal&&!t._isRtl?1:-1;a-s!==0;a+=l)e(i[a]).attr("title",_(n.tooltip.format,c(r))),r+=n.smallStep},_setItemsLargeTick:function(){var t,n,i,r=this,o=r.options,a=r.wrapper.find(V),s=0;if(h(o.largeStep)%h(o.smallStep)===0||r._distance/o.largeStep>=3)for(r._isHorizontal||r._isRtl||(a=e.makeArray(a).reverse()),s=0;a.length>s;s++)t=e(a[s]),n=r._values[s],i=h(n-this.options.min),i%h(o.smallStep)===0&&i%h(o.largeStep)===0&&(t.addClass("k-tick-large").html("<span class='k-label'>"+t.attr("title")+"</span>"),0!==s&&s!==a.length-1&&t.css("line-height",t[r._sizeFn]()+"px"))},_calculateItemsWidth:function(e){var t,n,i,r=this,o=r.options,a=parseFloat(r._trackDiv.css(r._sizeFn))+1,s=a/r._distance;for(r._distance/o.smallStep-k.floor(r._distance/o.smallStep)>0&&(a-=r._distance%o.smallStep*s),t=a/e,n=[],i=0;e-1>i;i++)n[i]=t;return n[e-1]=n[e]=t/2,r._roundWidths(n)},_roundWidths:function(e){var t,n=0,i=e.length;for(t=0;i>t;t++)n+=e[t]-k.floor(e[t]),e[t]=k.floor(e[t]);return n=k.round(n),this._addAdditionalSize(n,e)},_addAdditionalSize:function(e,t){if(0===e)return t;var n,i=parseFloat(t.length-1)/parseFloat(1==e?e:e-1);for(n=0;e>n;n++)t[parseInt(k.round(i*n),10)]+=1;return t},_calculateSteps:function(e){var t,n=this,i=n.options,r=i.min,o=0,a=k.ceil(n._distance/i.smallStep),s=1;if(a+=n._distance/i.smallStep%1===0?1:0,e.splice(0,0,2*e[a-2]),e.splice(a-1,1,2*e.pop()),n._pixelSteps=[o],n._values=[r],0!==a){for(;a>s;)o+=(e[s-1]+e[s])/2,n._pixelSteps[s]=o,r+=i.smallStep,n._values[s]=c(r),s++;t=n._distance%i.smallStep===0?a-1:a,n._pixelSteps[t]=n._maxSelection,n._values[t]=i.max,n._isRtl&&(n._pixelSteps.reverse(),n._values.reverse())}},_getValueFromPosition:function(e,t){var n,i=this,r=i.options,o=k.max(r.smallStep*(i._maxSelection/i._distance),0),a=0,s=o/2;if(i._isHorizontal?(a=e-t.startPoint,i._isRtl&&(a=i._maxSelection-a)):a=t.startPoint-e,i._maxSelection-(parseInt(i._maxSelection%o,10)-3)/2<a)return r.max;for(n=0;i._pixelSteps.length>n;n++)if(k.abs(i._pixelSteps[n]-a)-1<=s)return c(i._values[n])},_getFormattedValue:function(e,t){var n,i,r,o=this,a="",s=o.options.tooltip;return b(e)?(i=e[0],r=e[1]):t&&t.type&&(i=t.selectionStart,r=t.selectionEnd),t&&(n=t.tooltipTemplate),!n&&s.template&&(n=f.template(s.template)),b(e)||t&&t.type?n?a=n({selectionStart:i,selectionEnd:r}):(i=_(s.format,i),r=_(s.format,r),a=i+" - "+r):(t&&(t.val=e),a=n?n({value:e}):_(s.format,e)),a},_getDraggableArea:function(){var e=this,t=f.getOffset(e._trackDiv);return{startPoint:e._isHorizontal?t.left:t.top+e._maxSelection,endPoint:e._isHorizontal?t.left+e._maxSelection:t.top}},_createHtml:function(){var e=this,t=e.element,r=e.options,a=t.find("input");2==a.length?(a.eq(0).prop("value",l(r.selectionStart)),a.eq(1).prop("value",l(r.selectionEnd))):t.prop("value",l(r.value)),t.wrap(n(r,t,e._isHorizontal)).hide(),r.showButtons&&t.before(i(r,"increase",e._isHorizontal)).before(i(r,"decrease",e._isHorizontal)),t.before(o(r,t))},_focus:function(t){var n=this,i=t.target,r=n.value(),o=n._drag;o||(i==n.wrapper.find(N).eq(0)[0]?(o=n._firstHandleDrag,n._activeHandle=0):(o=n._lastHandleDrag,n._activeHandle=1),r=r[n._activeHandle]),e(i).addClass(W+" "+U),o&&(n._activeHandleDrag=o,o.selectionStart=n.options.selectionStart,o.selectionEnd=n.options.selectionEnd,o._updateTooltip(r))},_focusWithMouse:function(t){t=e(t);var n=this,i=t.is(N)?t.index():0;window.setTimeout(function(){n.wrapper.find(N)[2==i?1:0].focus()},1),n._setTooltipTimeout()},_blur:function(t){var n=this,i=n._activeHandleDrag;e(t.target).removeClass(W+" "+U),i&&(i._removeTooltip(),delete n._activeHandleDrag,delete n._activeHandle)},_setTooltipTimeout:function(){var e=this;e._tooltipTimeout=window.setTimeout(function(){var t=e._drag||e._activeHandleDrag;t&&t._removeTooltip()},300)},_clearTooltipTimeout:function(){var e,t=this;window.clearTimeout(this._tooltipTimeout),e=t._drag||t._activeHandleDrag,e&&e.tooltipDiv&&e.tooltipDiv.stop(!0,!1).css("opacity",1)}}),Z=X.extend({init:function(n,i){var r,o=this;n.type="text",i=v({},{value:d(n,"value"),min:d(n,"min"),max:d(n,"max"),smallStep:d(n,"step")},i),n=e(n),i&&i.enabled===t&&(i.enabled=!n.is("[disabled]")),X.fn.init.call(o,n,i),i=o.options,u(i.value)&&null!==i.value||(i.value=i.min,n.prop("value",l(i.min))),i.value=k.max(k.min(i.value,i.max),i.min),r=o.wrapper.find(N),new Z.Selection(r,o,i),o._drag=new Z.Drag(r,"",o,i)},options:{name:"Slider",showButtons:!0,increaseButtonTitle:"Increase",decreaseButtonTitle:"Decrease",dragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},value:null},enable:function(n){var i,r,o,a=this,s=a.options;a.disable(),n!==!1&&(a.wrapper.removeClass(q).addClass(j),a.wrapper.find("input").removeAttr($),i=function(n){var i,r,o,s=K(n)[0];if(s){if(i=a._isHorizontal?s.location.pageX:s.location.pageY,r=a._getDraggableArea(),o=e(n.target),o.hasClass("k-draghandle"))return o.addClass(W+" "+U),t;a._update(a._getValueFromPosition(i,r)),a._focusWithMouse(n.target),a._drag.dragstart(n),n.preventDefault()}},a.wrapper.find(V+", "+O).on(I,i).end().on(I,function(){e(document.documentElement).one("selectstart",f.preventDefault)}).on(M,function(){a._drag._end()}),a.wrapper.find(N).attr(Q,0).on(P,function(){a._setTooltipTimeout()}).on(R,function(e){a._focusWithMouse(e.target),e.preventDefault()}).on(H,y(a._focus,a)).on(L,y(a._blur,a)),r=y(function(e){var t=a._nextValueByIndex(a._valueIndex+1*e);a._setValueInRange(t),a._drag._updateTooltip(t)},a),s.showButtons&&(o=y(function(e,t){this._clearTooltipTimeout(),(1===e.which||x.touch&&0===e.which)&&(r(t),this.timeout=setTimeout(y(function(){this.timer=setInterval(function(){r(t)},60)},this),200))},a),a.wrapper.find(".k-button").on(P,y(function(e){this._clearTimer(),a._focusWithMouse(e.target)},a)).on(B,function(t){e(t.currentTarget).addClass("k-state-hover")}).on("mouseout"+A,y(function(t){e(t.currentTarget).removeClass("k-state-hover"),this._clearTimer()},a)).eq(0).on(E,y(function(e){o(e,1)},a)).click(!1).end().eq(1).on(E,y(function(e){o(e,-1)},a)).click(f.preventDefault)),a.wrapper.find(N).off(z,!1).on(z,y(this._keydown,a)),s.enabled=!0)},disable:function(){var t=this;t.wrapper.removeClass(j).addClass(q),e(t.element).prop($,$),t.wrapper.find(".k-button").off(E).on(E,f.preventDefault).off(P).on(P,f.preventDefault).off("mouseleave"+A).on("mouseleave"+A,f.preventDefault).off(B).on(B,f.preventDefault),t.wrapper.find(V+", "+O).off(I).off(M),t.wrapper.find(N).attr(Q,-1).off(P).off(z).off(R).off(H).off(L),t.options.enabled=!1},_update:function(e){var t=this,n=t.value()!=e;t.value(e),n&&t.trigger(T,{value:t.options.value})},value:function(e){var n=this,i=n.options;return e=c(e),isNaN(e)?i.value:(e>=i.min&&i.max>=e&&i.value!=e&&(n.element.prop("value",l(e)),i.value=e,n._refreshAriaAttr(e),n._refresh()),t)},_refresh:function(){this.trigger(F,{value:this.options.value})},_refreshAriaAttr:function(e){var t,n=this,i=n._drag;t=i&&i._tooltipDiv?i._tooltipDiv.text():n._getFormattedValue(e,null),this.wrapper.find(N).attr("aria-valuenow",e).attr("aria-valuetext",t)},_clearTimer:function(){clearTimeout(this.timeout),clearInterval(this.timer)},_keydown:function(e){var t=this;e.keyCode in t._keyMap&&(t._clearTooltipTimeout(),t._setValueInRange(t._keyMap[e.keyCode](t.options.value)),t._drag._updateTooltip(t.value()),e.preventDefault())
24
+ },_setValueInRange:function(e){var n=this,i=n.options;return e=c(e),isNaN(e)?(n._update(i.min),t):(e=k.max(k.min(e,i.max),i.min),n._update(e),t)},_nextValueByIndex:function(e){var t=this._values.length;return this._isRtl&&(e=t-1-e),this._values[k.max(0,k.min(e,t-1))]},destroy:function(){var e=this;g.fn.destroy.call(e),e.wrapper.off(A).find(".k-button").off(A).end().find(N).off(A).end().find(V+", "+O).off(A).end(),e._drag.draggable.destroy(),e._drag._removeTooltip(!0)}});Z.Selection=function(e,t,n){function i(i){var r=i-n.min,o=t._valueIndex=k.ceil(c(r/n.smallStep)),a=parseInt(t._pixelSteps[o],10),s=t._trackDiv.find(".k-slider-selection"),l=parseInt(e[t._outerSize]()/2,10),d=t._isRtl?2:0;s[t._sizeFn](t._isRtl?t._maxSelection-a:a),e.css(t._position,a-l-d)}i(n.value),t.bind([T,D,F],function(e){i(parseFloat(e.value,10))})},Z.Drag=function(e,t,n,i){var r=this;r.owner=n,r.options=i,r.element=e,r.type=t,r.draggable=new m(e,{distance:0,dragstart:y(r._dragstart,r),drag:y(r.drag,r),dragend:y(r.dragend,r),dragcancel:y(r.dragcancel,r)}),e.click(!1)},Z.Drag.prototype={dragstart:function(e){this.owner._activeDragHandle=this,this.draggable.userEvents.cancel(),this.draggable.userEvents._start(e)},_dragstart:function(n){var i=this,r=i.owner,o=i.options;return o.enabled?(this.owner._activeDragHandle=this,r.element.off(B),r.wrapper.find("."+W).removeClass(W+" "+U),i.element.addClass(W+" "+U),e(document.documentElement).css("cursor","pointer"),i.dragableArea=r._getDraggableArea(),i.step=k.max(o.smallStep*(r._maxSelection/r._distance),0),i.type?(i.selectionStart=o.selectionStart,i.selectionEnd=o.selectionEnd,r._setZIndex(i.type)):i.oldVal=i.val=o.value,i._removeTooltip(!0),i._createTooltip(),t):(n.preventDefault(),t)},_createTooltip:function(){var t,n,i=this,r=i.owner,o=i.options.tooltip,a="",s=e(window);o.enabled&&(o.template&&(t=i.tooltipTemplate=f.template(o.template)),e(".k-slider-tooltip").remove(),i.tooltipDiv=e("<div class='k-widget k-tooltip k-slider-tooltip'><!-- --></div>").appendTo(document.body),a=r._getFormattedValue(i.val||r.value(),i),i.type||(n="k-callout-"+(r._isHorizontal?"s":"e"),i.tooltipInnerDiv="<div class='k-callout "+n+"'><!-- --></div>",a+=i.tooltipInnerDiv),i.tooltipDiv.html(a),i._scrollOffset={top:s.scrollTop(),left:s.scrollLeft()},i.moveTooltip())},drag:function(e){var t,n=this,i=n.owner,r=e.x.location,o=e.y.location,a=n.dragableArea.startPoint,s=n.dragableArea.endPoint;e.preventDefault(),n.val=i._isHorizontal?i._isRtl?n.constrainValue(r,a,s,s>r):n.constrainValue(r,a,s,r>=s):n.constrainValue(o,s,a,s>=o),n.oldVal!=n.val&&(n.oldVal=n.val,n.type?("firstHandle"==n.type?n.selectionStart=n.selectionEnd>n.val?n.val:n.selectionEnd=n.val:n.val>n.selectionStart?n.selectionEnd=n.val:n.selectionStart=n.selectionEnd=n.val,t={values:[n.selectionStart,n.selectionEnd],value:[n.selectionStart,n.selectionEnd]}):t={value:n.val},i.trigger(D,t)),n._updateTooltip(n.val)},_updateTooltip:function(e){var t=this,n=t.options,i=n.tooltip,r="";i.enabled&&(t.tooltipDiv||t._createTooltip(),r=t.owner._getFormattedValue(c(e),t),t.type||(r+=t.tooltipInnerDiv),t.tooltipDiv.html(r),t.moveTooltip())},dragcancel:function(){return this.owner._refresh(),e(document.documentElement).css("cursor",""),this._end()},dragend:function(){var t=this,n=t.owner;return e(document.documentElement).css("cursor",""),t.type?n._update(t.selectionStart,t.selectionEnd):(n._update(t.val),t.draggable.userEvents._disposeAll()),t._end()},_end:function(){var e=this,t=e.owner;return t._focusWithMouse(e.element),t.element.on(B),!1},_removeTooltip:function(t){var n=this,i=n.owner;n.tooltipDiv&&i.options.tooltip.enabled&&i.options.enabled&&(t?(n.tooltipDiv.remove(),n.tooltipDiv=null):n.tooltipDiv.fadeOut("slow",function(){e(this).remove(),n.tooltipDiv=null}))},moveTooltip:function(){var t,n,i,r,o=this,a=o.owner,s=0,l=0,c=o.element,d=f.getOffset(c),u=8,h=e(window),p=o.tooltipDiv.find(".k-callout"),g=o.tooltipDiv.outerWidth(),m=o.tooltipDiv.outerHeight();o.type?(t=a.wrapper.find(N),d=f.getOffset(t.eq(0)),n=f.getOffset(t.eq(1)),a._isHorizontal?(s=n.top,l=d.left+(n.left-d.left)/2):(s=d.top+(n.top-d.top)/2,l=n.left),r=t.eq(0).outerWidth()+2*u):(s=d.top,l=d.left,r=c.outerWidth()+2*u),a._isHorizontal?(l-=parseInt((g-c[a._outerSize]())/2,10),s-=m+p.height()+u):(s-=parseInt((m-c[a._outerSize]())/2,10),l-=g+p.width()+u),a._isHorizontal?(i=o._flip(s,m,r,h.outerHeight()+o._scrollOffset.top),s+=i,l+=o._fit(l,g,h.outerWidth()+o._scrollOffset.left)):(i=o._flip(l,g,r,h.outerWidth()+o._scrollOffset.left),s+=o._fit(s,m,h.outerHeight()+o._scrollOffset.top),l+=i),i>0&&p&&(p.removeClass(),p.addClass("k-callout k-callout-"+(a._isHorizontal?"n":"w"))),o.tooltipDiv.css({top:s,left:l})},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,n,i){var r=0;return e+t>i&&(r+=-(n+t)),0>e+r&&(r+=n+t),r},constrainValue:function(e,t,n,i){var r=this,o=0;return o=e>t&&n>e?r.owner._getValueFromPosition(e,r.dragableArea):i?r.options.max:r.options.min}},f.ui.plugin(Z),p=X.extend({init:function(n,i){var r,o=this,a=e(n).find("input"),s=a.eq(0)[0],c=a.eq(1)[0];s.type="text",c.type="text",i=v({},{selectionStart:d(s,"value"),min:d(s,"min"),max:d(s,"max"),smallStep:d(s,"step")},{selectionEnd:d(c,"value"),min:d(c,"min"),max:d(c,"max"),smallStep:d(c,"step")},i),i&&i.enabled===t&&(i.enabled=!a.is("[disabled]")),X.fn.init.call(o,n,i),i=o.options,u(i.selectionStart)&&null!==i.selectionStart||(i.selectionStart=i.min,a.eq(0).prop("value",l(i.min))),u(i.selectionEnd)&&null!==i.selectionEnd||(i.selectionEnd=i.max,a.eq(1).prop("value",l(i.max))),r=o.wrapper.find(N),new p.Selection(r,o,i),o._firstHandleDrag=new Z.Drag(r.eq(0),"firstHandle",o,i),o._lastHandleDrag=new Z.Drag(r.eq(1),"lastHandle",o,i)},options:{name:"RangeSlider",leftDragHandleTitle:"drag",rightDragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},selectionStart:null,selectionEnd:null},enable:function(n){var i,r=this,o=r.options;r.disable(),n!==!1&&(r.wrapper.removeClass(q).addClass(j),r.wrapper.find("input").removeAttr($),i=function(n){var i,a,s,l,c,d,u,h=K(n)[0];if(h){if(i=r._isHorizontal?h.location.pageX:h.location.pageY,a=r._getDraggableArea(),s=r._getValueFromPosition(i,a),l=e(n.target),l.hasClass("k-draghandle"))return r.wrapper.find("."+W).removeClass(W+" "+U),l.addClass(W+" "+U),t;o.selectionStart>s?(c=s,d=o.selectionEnd,u=r._firstHandleDrag):s>r.selectionEnd?(c=o.selectionStart,d=s,u=r._lastHandleDrag):o.selectionEnd-s>=s-o.selectionStart?(c=s,d=o.selectionEnd,u=r._firstHandleDrag):(c=o.selectionStart,d=s,u=r._lastHandleDrag),u.dragstart(n),r._setValueInRange(c,d),r._focusWithMouse(u.element)}},r.wrapper.find(V+", "+O).on(I,i).end().on(I,function(){e(document.documentElement).one("selectstart",f.preventDefault)}).on(M,function(){r._activeDragHandle&&r._activeDragHandle._end()}),r.wrapper.find(N).attr(Q,0).on(P,function(){r._setTooltipTimeout()}).on(R,function(e){r._focusWithMouse(e.target),e.preventDefault()}).on(H,y(r._focus,r)).on(L,y(r._blur,r)),r.wrapper.find(N).off(z,f.preventDefault).eq(0).on(z,y(function(e){this._keydown(e,"firstHandle")},r)).end().eq(1).on(z,y(function(e){this._keydown(e,"lastHandle")},r)),r.options.enabled=!0)},disable:function(){var e=this;e.wrapper.removeClass(j).addClass(q),e.wrapper.find("input").prop($,$),e.wrapper.find(V+", "+O).off(I).off(M),e.wrapper.find(N).attr(Q,-1).off(P).off(z).off(R).off(H).off(L),e.options.enabled=!1},_keydown:function(e,t){var n,i,r,o=this,a=o.options.selectionStart,s=o.options.selectionEnd;e.keyCode in o._keyMap&&(o._clearTooltipTimeout(),"firstHandle"==t?(r=o._activeHandleDrag=o._firstHandleDrag,a=o._keyMap[e.keyCode](a),a>s&&(s=a)):(r=o._activeHandleDrag=o._lastHandleDrag,s=o._keyMap[e.keyCode](s),a>s&&(a=s)),o._setValueInRange(a,s),n=Math.max(a,o.options.selectionStart),i=Math.min(s,o.options.selectionEnd),r.selectionEnd=Math.max(i,o.options.selectionStart),r.selectionStart=Math.min(n,o.options.selectionEnd),r._updateTooltip(o.value()[o._activeHandle]),e.preventDefault())},_update:function(e,t){var n=this,i=n.value(),r=i[0]!=e||i[1]!=t;n.value([e,t]),r&&n.trigger(T,{values:[e,t],value:[e,t]})},value:function(e){return e&&e.length?this._value(e[0],e[1]):this._value()},_value:function(e,n){var i=this,r=i.options,o=r.selectionStart,a=r.selectionEnd;return isNaN(e)&&isNaN(n)?[o,a]:(e=c(e),n=c(n),e>=r.min&&r.max>=e&&n>=r.min&&r.max>=n&&n>=e&&(o!=e||a!=n)&&(i.element.find("input").eq(0).prop("value",l(e)).end().eq(1).prop("value",l(n)),r.selectionStart=e,r.selectionEnd=n,i._refresh(),i._refreshAriaAttr(e,n)),t)},values:function(e,t){return b(e)?this._value(e[0],e[1]):this._value(e,t)},_refresh:function(){var e=this,t=e.options;e.trigger(F,{values:[t.selectionStart,t.selectionEnd],value:[t.selectionStart,t.selectionEnd]}),t.selectionStart==t.max&&t.selectionEnd==t.max&&e._setZIndex("firstHandle")},_refreshAriaAttr:function(e,t){var n,i=this,r=i.wrapper.find(N),o=i._activeHandleDrag;n=i._getFormattedValue([e,t],o),r.eq(0).attr("aria-valuenow",e),r.eq(1).attr("aria-valuenow",t),r.attr("aria-valuetext",n)},_setValueInRange:function(e,t){var n=this.options;e=k.max(k.min(e,n.max),n.min),t=k.max(k.min(t,n.max),n.min),e==n.max&&t==n.max&&this._setZIndex("firstHandle"),this._update(k.min(e,t),k.max(e,t))},_setZIndex:function(t){this.wrapper.find(N).each(function(n){e(this).css("z-index","firstHandle"==t?1-n:n)})},destroy:function(){var e=this;g.fn.destroy.call(e),e.wrapper.off(A).find(V+", "+O).off(A).end().find(N).off(A),e._firstHandleDrag.draggable.destroy(),e._lastHandleDrag.draggable.destroy()}}),p.Selection=function(e,t,n){function i(i){i=i||[];var o=i[0]-n.min,a=i[1]-n.min,s=k.ceil(c(o/n.smallStep)),l=k.ceil(c(a/n.smallStep)),d=t._pixelSteps[s],u=t._pixelSteps[l],h=parseInt(e.eq(0)[t._outerSize]()/2,10),p=t._isRtl?2:0;e.eq(0).css(t._position,d-h-p).end().eq(1).css(t._position,u-h-p),r(d,u)}function r(e,n){var i,r,o=t._trackDiv.find(".k-slider-selection");i=k.abs(e-n),o[t._sizeFn](i),t._isRtl?(r=k.max(e,n),o.css("right",t._maxSelection-r-1)):(r=k.min(e,n),o.css(t._position,r-1))}i(t.value()),t.bind([T,D,F],function(e){i(e.values)})},f.ui.plugin(p)}(window.kendo.jQuery),function(e,t,n){function i(e,t,n){n=d(n),n&&!n.equals(e.color())&&("change"==t&&(e._value=n),n=1!=n.a?n.toCssRgba():n.toCss(),e.trigger(t,{value:n}))}function r(e,t,n){var i,r;return e=Array.prototype.slice.call(e),i=e.length,r=e.indexOf(t),0>r?0>n?e[i-1]:e[0]:(r+=n,0>r?r+=i:r%=i,e[r])}function o(e){e.preventDefault()}function a(e,t){return function(){return e.apply(t,arguments)}}var s=window.kendo,l=s.ui,c=l.Widget,d=s.parseColor,u=s.Color,h=s.keys,p="background-color",f="k-state-selected",g="000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",m="FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000",v={apply:"Apply",cancel:"Cancel"},_=".kendoColorTools",w="click"+_,y="keydown"+_,b=s.support.browser,k=b.msie&&9>b.version,x=c.extend({init:function(e,t){var n,i=this;c.fn.init.call(i,e,t),e=i.element,t=i.options,i._value=t.value=d(t.value),i._tabIndex=e.attr("tabIndex")||0,n=i._ariaId=t.ariaId,n&&e.attr("aria-labelledby",n),t._standalone&&(i._triggerSelect=i._triggerChange)},options:{name:"ColorSelector",value:null,_standalone:!0},events:["change","select","cancel"],color:function(e){return e!==n&&(this._value=d(e),this._updateUI(this._value)),this._value},value:function(e){return e=this.color(e),e&&(e=this.options.opacity?e.toCssRgba():e.toCss()),e||null},enable:function(t){0===arguments.length&&(t=!0),e(".k-disabled-overlay",this.wrapper).remove(),t||this.wrapper.append("<div class='k-disabled-overlay'></div>"),this._onEnable(t)},_select:function(e,t){var n=this._value;e=this.color(e),t||(this.element.trigger("change"),e.equals(n)?this._standalone||this.trigger("cancel"):this.trigger("change",{value:this.value()}))},_triggerSelect:function(e){i(this,"select",e)},_triggerChange:function(e){i(this,"change",e)},destroy:function(){this.element&&this.element.off(_),this.wrapper&&this.wrapper.off(_).find("*").off(_),this.wrapper=null,c.fn.destroy.call(this)},_updateUI:e.noop,_selectOnHide:function(){return null},_cancel:function(){this.trigger("cancel")}}),C=x.extend({init:function(t,n){var i,r,o,l,c=this;if(x.fn.init.call(c,t,n),t=c.wrapper=c.element,n=c.options,i=n.palette,"websafe"==i?(i=m,n.columns=18):"basic"==i&&(i=g),"string"==typeof i&&(i=i.split(",")),e.isArray(i)&&(i=e.map(i,function(e){return d(e)})),c._selectedID=(n.ariaId||s.guid())+"_selected",t.addClass("k-widget k-colorpalette").attr("role","grid").attr("aria-readonly","true").append(e(c._template({colors:i,columns:n.columns,tileSize:n.tileSize,value:c._value,id:n.ariaId}))).on(w,".k-item",function(t){c._select(e(t.currentTarget).css(p))}).attr("tabIndex",c._tabIndex).on(y,a(c._keydown,c)),r=n.tileSize){if(/number|string/.test(typeof r))o=l=parseFloat(r);else{if("object"!=typeof r)throw Error("Unsupported value for the 'tileSize' argument");o=parseFloat(r.width),l=parseFloat(r.height)}t.find(".k-item").css({width:o,height:l})}},focus:function(){this.wrapper.focus()},options:{name:"ColorPalette",columns:10,tileSize:null,palette:"basic"},_onEnable:function(e){e?this.wrapper.attr("tabIndex",this._tabIndex):this.wrapper.removeAttr("tabIndex")},_keydown:function(t){var n,i,a=this.wrapper,s=a.find(".k-item"),l=s.filter("."+f).get(0),c=t.keyCode;if(c==h.LEFT?n=r(s,l,-1):c==h.RIGHT?n=r(s,l,1):c==h.DOWN?n=r(s,l,this.options.columns):c==h.UP?n=r(s,l,-this.options.columns):c==h.ENTER?(o(t),l&&this._select(e(l).css(p))):c==h.ESC&&this._cancel(),n){o(t),this._current(n);try{i=d(n.css(p)),this._triggerSelect(i)}catch(u){}}},_current:function(t){this.wrapper.find("."+f).removeClass(f).attr("aria-selected",!1).removeAttr("id"),e(t).addClass(f).attr("aria-selected",!0).attr("id",this._selectedID),this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant",this._selectedID)},_updateUI:function(t){var i=null;this.wrapper.find(".k-item").each(function(){var r=d(e(this).css(p));return r&&r.equals(t)?(i=this,!1):n}),this._current(i)},_template:s.template('<table class="k-palette k-reset" role="presentation"><tr role="row"># for (var i = 0; i < colors.length; ++i) { ## var selected = colors[i].equals(value); ## if (i && i % columns == 0) { # </tr><tr role="row"> # } #<td role="gridcell" unselectable="on" style="background-color:#= colors[i].toCss() #"#= selected ? " aria-selected=true" : "" # #=(id && i === 0) ? "id=\\""+id+"\\" " : "" # class="k-item#= selected ? " '+f+'" : "" #" aria-label="#= colors[i].toCss() #"></td># } #</tr></table>')}),S=x.extend({init:function(t,n){var i=this;x.fn.init.call(i,t,n),n=i.options,t=i.element,i.wrapper=t.addClass("k-widget k-flatcolorpicker").append(i._template(n)),i._hueElements=e(".k-hsv-rectangle, .k-transparency-slider .k-slider-track",t),i._selectedColor=e(".k-selected-color-display",t),i._colorAsText=e("input.k-color-value",t),i._sliders(),i._hsvArea(),i._updateUI(i._value||d("#f00")),t.find("input.k-color-value").on(y,function(t){var n,r,o=this;if(t.keyCode==h.ENTER)try{n=d(o.value),r=i.color(),i._select(n,n.equals(r))}catch(a){e(o).addClass("k-state-error")}else i.options.autoupdate&&setTimeout(function(){var e=d(o.value,!0);e&&i._updateUI(e,!0)},10)}).end().on(w,".k-controls button.apply",function(){i._select(i._getHSV())}).on(w,".k-controls button.cancel",function(){i._updateUI(i.color()),i._cancel()}),k&&i._applyIEFilter()},destroy:function(){this._hueSlider.destroy(),this._opacitySlider&&this._opacitySlider.destroy(),this._hueSlider=this._opacitySlider=this._hsvRect=this._hsvHandle=this._hueElements=this._selectedColor=this._colorAsText=null,x.fn.destroy.call(this)},options:{name:"FlatColorPicker",opacity:!1,buttons:!1,input:!0,preview:!0,autoupdate:!0,messages:v},_applyIEFilter:function(){var e=this.element.find(".k-hue-slider .k-slider-track")[0],t=e.currentStyle.backgroundImage;t=t.replace(/^url\([\'\"]?|[\'\"]?\)$/g,""),e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"', sizingMethod='scale')"},_sliders:function(){function e(e){n._updateUI(n._getHSV(e.value,null,null,null))}function t(e){n._updateUI(n._getHSV(null,null,null,e.value/100))}var n=this,i=n.element;n._hueSlider=i.find(".k-hue-slider").kendoSlider({min:0,max:359,tickPlacement:"none",showButtons:!1,slide:e,change:e}).data("kendoSlider"),n._opacitySlider=i.find(".k-transparency-slider").kendoSlider({min:0,max:100,tickPlacement:"none",showButtons:!1,slide:t,change:t}).data("kendoSlider")},_hsvArea:function(){function e(e,n){var i=this.offset,r=e-i.left,o=n-i.top,a=this.width,s=this.height;r=0>r?0:r>a?a:r,o=0>o?0:o>s?s:o,t._svChange(r/a,1-o/s)}var t=this,n=t.element,i=n.find(".k-hsv-rectangle"),r=i.find(".k-draghandle").attr("tabIndex",0).on(y,a(t._keydown,t));t._hsvEvents=new s.UserEvents(i,{global:!0,press:function(t){this.offset=s.getOffset(i),this.width=i.width(),this.height=i.height(),r.focus(),e.call(this,t.x.location,t.y.location)},start:function(){i.addClass("k-dragging"),r.focus()},move:function(t){t.preventDefault(),e.call(this,t.x.location,t.y.location)},end:function(){i.removeClass("k-dragging")}}),t._hsvRect=i,t._hsvHandle=r},_onEnable:function(e){this._hueSlider.enable(e),this._opacitySlider&&this._opacitySlider.enable(e),this.wrapper.find("input").attr("disabled",!e);var t=this._hsvRect.find(".k-draghandle");e?t.attr("tabIndex",this._tabIndex):t.removeAttr("tabIndex")},_keydown:function(e){function t(t,n){var r=i._getHSV();r[t]+=n*(e.shiftKey?.01:.05),0>r[t]&&(r[t]=0),r[t]>1&&(r[t]=1),i._updateUI(r),o(e)}function n(t){var n=i._getHSV();n.h+=t*(e.shiftKey?1:5),0>n.h&&(n.h=0),n.h>359&&(n.h=359),i._updateUI(n),o(e)}var i=this;switch(e.keyCode){case h.LEFT:e.ctrlKey?n(-1):t("s",-1);break;case h.RIGHT:e.ctrlKey?n(1):t("s",1);break;case h.UP:t(e.ctrlKey&&i._opacitySlider?"a":"v",1);break;case h.DOWN:t(e.ctrlKey&&i._opacitySlider?"a":"v",-1);break;case h.ENTER:i._select(i._getHSV());break;case h.F2:i.wrapper.find("input.k-color-value").focus().select();break;case h.ESC:i._cancel()}},focus:function(){this._hsvHandle.focus()},_getHSV:function(e,t,n,i){var r=this._hsvRect,o=r.width(),a=r.height(),s=this._hsvHandle.position();return null==e&&(e=this._hueSlider.value()),null==t&&(t=s.left/o),null==n&&(n=1-s.top/a),null==i&&(i=this._opacitySlider?this._opacitySlider.value()/100:1),u.fromHSV(e,t,n,i)},_svChange:function(e,t){var n=this._getHSV(null,e,t,null);this._updateUI(n)},_updateUI:function(e,t){var n=this,i=n._hsvRect;e&&(this._colorAsText.removeClass("k-state-error"),n._selectedColor.css(p,e.toDisplay()),t||n._colorAsText.val(n._opacitySlider?e.toCssRgba():e.toCss()),n._triggerSelect(e),e=e.toHSV(),n._hsvHandle.css({left:e.s*i.width()+"px",top:(1-e.v)*i.height()+"px"}),n._hueElements.css(p,u.fromHSV(e.h,1,1,1).toCss()),n._hueSlider.value(e.h),n._opacitySlider&&n._opacitySlider.value(100*e.a))},_selectOnHide:function(){return this.options.buttons?null:this._getHSV()},_template:s.template('# if (preview) { #<div class="k-selected-color"><div class="k-selected-color-display"><input class="k-color-value" #= !data.input ? \'style="visibility: hidden;"\' : "" #></div></div># } #<div class="k-hsv-rectangle"><div class="k-hsv-gradient"></div><div class="k-draghandle"></div></div><input class="k-hue-slider" /># if (opacity) { #<input class="k-transparency-slider" /># } ## if (buttons) { #<div unselectable="on" class="k-controls"><button class="k-button k-primary apply">#: messages.apply #</button> <button class="k-button cancel">#: messages.cancel #</button></div># } #')}),T=c.extend({init:function(t,n){var i,r,o,a,s,l=this;c.fn.init.call(l,t,n),n=l.options,t=l.element,i=t.attr("value")||t.val(),i=i?d(i,!0):d(n.value,!0),l._value=n.value=i,r=l.wrapper=e(l._template(n)),t.hide().after(r),t.is("input")&&(t.appendTo(r),o=t.closest("label"),a=t.attr("id"),a&&(o=o.add('label[for="'+a+'"]')),o.click(function(e){l.open(),e.preventDefault()})),l._tabIndex=t.attr("tabIndex")||0,l.enable(!t.attr("disabled")),s=t.attr("accesskey"),s&&(t.attr("accesskey",null),r.attr("accesskey",s)),l.bind("activate",function(e){e.isDefaultPrevented()||l.toggle()}),l._updateUI(i)},destroy:function(){this.wrapper.off(_).find("*").off(_),this._popup&&(this._selector.destroy(),this._popup.destroy()),this._selector=this._popup=this.wrapper=null,c.fn.destroy.call(this)},enable:function(e){var t=this,n=t.wrapper,i=n.children(".k-picker-wrap"),r=i.find(".k-select");0===arguments.length&&(e=!0),t.element.attr("disabled",!e),n.attr("aria-disabled",!e),r.off(_).on("mousedown"+_,o),n.addClass("k-state-disabled").removeAttr("tabIndex").add("*",n).off(_),e&&n.removeClass("k-state-disabled").attr("tabIndex",t._tabIndex).on("mouseenter"+_,function(){i.addClass("k-state-hover")}).on("mouseleave"+_,function(){i.removeClass("k-state-hover")}).on("focus"+_,function(){i.addClass("k-state-focused")}).on("blur"+_,function(){i.removeClass("k-state-focused")}).on(y,a(t._keydown,t)).on(w,".k-icon",a(t.toggle,t)).on(w,t.options.toolIcon?".k-tool-icon":".k-selected-color",function(){t.trigger("activate")})},_template:s.template('<span role="textbox" aria-haspopup="true" class="k-widget k-colorpicker k-header"><span class="k-picker-wrap k-state-default"># if (toolIcon) { #<span class="k-tool-icon #= toolIcon #"><span class="k-selected-color"></span></span># } else { #<span class="k-selected-color"></span># } #<span class="k-select" unselectable="on"><span class="k-icon k-i-arrow-s" unselectable="on"></span></span></span></span>'),options:{name:"ColorPicker",palette:null,columns:10,toolIcon:null,value:null,messages:v,opacity:!1,buttons:!0,preview:!0,ARIATemplate:'Current selected color is #=data || ""#'},events:["activate","change","select","open","close"],open:function(){this._getPopup().open()},close:function(){this._getPopup().close()},toggle:function(){this._getPopup().toggle()},color:x.fn.color,value:x.fn.value,_select:x.fn._select,_triggerSelect:x.fn._triggerSelect,_isInputTypeColor:function(){var e=this.element[0];return/^input$/i.test(e.tagName)&&/^color$/i.test(e.type)},_updateUI:function(e){var t="";e&&(t=this._isInputTypeColor()||1==e.a?e.toCss():e.toCssRgba(),this.element.val(t)),this._ariaTemplate||(this._ariaTemplate=s.template(this.options.ARIATemplate)),this.wrapper.attr("aria-label",this._ariaTemplate(t)),this._triggerSelect(e),this.wrapper.find(".k-selected-color").css(p,e?e.toDisplay():"transparent")},_keydown:function(e){var t=e.keyCode;this._getPopup().visible()?(t==h.ESC?this._selector._cancel():this._selector._keydown(e),o(e)):(t==h.ENTER||t==h.DOWN)&&(this.open(),o(e))},_getPopup:function(){var t,i,r,o,a=this,l=a._popup;return l||(t=a.options,i=t.palette?C:S,t._standalone=!1,delete t.select,delete t.change,delete t.cancel,r=s.guid(),o=a._selector=new i(e('<div id="'+r+'"/>').appendTo(document.body),t),a.wrapper.attr("aria-owns",r),a._popup=l=o.wrapper.kendoPopup({anchor:a.wrapper}).data("kendoPopup"),o.bind({select:function(e){a._updateUI(d(e.value))},change:function(){a._select(o.color()),a.close()},cancel:function(){a.close()}}),l.bind({close:function(e){if(a.trigger("close"))return e.preventDefault(),n;a.wrapper.children(".k-picker-wrap").removeClass("k-state-focused");var t=o._selectOnHide();t?a._select(t):(a.wrapper.focus(),a._updateUI(a.color()))},open:function(e){a.trigger("open")?e.preventDefault():a.wrapper.children(".k-picker-wrap").addClass("k-state-focused")},activate:function(){o._select(a.color(),!0),o.focus(),a.wrapper.children(".k-picker-wrap").addClass("k-state-focused")}})),l}});l.plugin(C),l.plugin(S),l.plugin(T)}(jQuery,parseInt),function(e,t){function n(e,t){return'<span unselectable="on" class="k-link"><span unselectable="on" class="k-icon k-i-arrow-'+e+'" title="'+t+'">'+t+"</span></span>"}var i=window.kendo,r=i.caret,o=i.keys,a=i.ui,s=a.Widget,l=i._activeElement,c=i._extractFormat,d=i.parseFloat,u=i.support.placeholder,h=i.getCulture,p=i._round,f="change",g="disabled",m="readonly",v="k-input",_="spin",w=".kendoNumericTextBox",y="touchend",b="mouseleave"+w,k="mouseenter"+w+" "+b,x="k-state-default",C="k-state-focused",S="k-state-hover",T="focus",D=".",A="k-state-selected",E="k-state-disabled",I="aria-disabled",P="aria-readonly",M=/^(-)?(\d*)$/,F=null,z=e.proxy,R=s.extend({init:function(e,n){var r,o,a,l,d,u=this,h=n&&n.step!==t;s.fn.init.call(u,e,n),n=u.options,e=u.element.on("focusout"+w,z(u._focusout,u)).attr("role","spinbutton"),n.placeholder=n.placeholder||e.attr("placeholder"),u._reset(),u._wrapper(),u._arrows(),u._input(),i.support.mobileOS?u._text.on(y+w+" "+T+w,function(t){u._toggleText(!1),t.type===T&&e.focus()}):u._text.on(T+w,z(u._click,u)),r=u.min(e.attr("min")),o=u.max(e.attr("max")),a=u._parse(e.attr("step")),n.min===F&&r!==F&&(n.min=r),n.max===F&&o!==F&&(n.max=o),h||a===F||(n.step=a),e.attr("aria-valuemin",n.min).attr("aria-valuemax",n.max),n.format=c(n.format),l=n.value,u.value(l!==F?l:e.val()),d=e.is("[disabled]"),d?u.enable(!1):u.readonly(e.is("[readonly]")),i.notify(u)},options:{name:"NumericTextBox",decimals:F,min:F,max:F,value:F,step:1,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[f,_],_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,o=t._text.add(n),a=t._inputWrapper.off(k);t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),n.off("keydown"+w).off("keypress"+w).off("paste"+w),r||i?(a.addClass(i?E:x).removeClass(i?x:E),o.attr(g,i).attr(m,r).attr(I,i).attr(P,r)):(a.addClass(x).removeClass(E).on(k,t._toggleHover),o.removeAttr(g).removeAttr(m).attr(I,!1).attr(P,!1),t._upArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(1),t._upArrow.addClass(A)}),t._downArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(-1),t._downArrow.addClass(A)}),t.element.on("keydown"+w,z(t._keydown,t)).on("keypress"+w,z(t._keypress,t)).on("paste"+w,z(t._paste,t)))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(w),e._upArrowEventHandler.destroy(),e._downArrowEventHandler.destroy(),e._form&&e._form.off("reset",e._resetHandler),s.fn.destroy.call(e)},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},step:function(e){return this._option("step",e)},value:function(e){var n,i=this;return e===t?i._value:(e=i._parse(e),n=i._adjust(e),e===n&&(i._update(e),i._old=i._value),t)},focus:function(){this._focusin()},_adjust:function(e){var t=this,n=t.options,i=n.min,r=n.max;return e===F?e:(i!==F&&i>e?e=i:r!==F&&e>r&&(e=r),e)},_arrows:function(){var t,r=this,o=function(){clearTimeout(r._spinning),t.removeClass(A)},a=r.options,s=a.spinners,l=r.element;t=l.siblings(".k-icon"),t[0]||(t=e(n("n",a.upArrowText)+n("s",a.downArrowText)).insertAfter(l),t.wrapAll('<span class="k-select"/>')),s||(t.parent().toggle(s),r._inputWrapper.addClass("k-expand-padding")),r._upArrow=t.eq(0),r._upArrowEventHandler=new i.UserEvents(r._upArrow,{release:o}),r._downArrow=t.eq(1),r._downArrowEventHandler=new i.UserEvents(r._downArrow,{release:o})},_blur:function(){var e=this;e._toggleText(!0),e._change(e.element.val())},_click:function(e){var t=this;clearTimeout(t._focusing),t._focusing=setTimeout(function(){var n,i,o,a=e.target,s=r(a)[0],l=a.value.substring(0,s),c=t._format(t.options.format),d=c[","],u=0;d&&(i=RegExp("\\"+d,"g"),o=RegExp("([\\d\\"+d+"]+)(\\"+c[D]+")?(\\d+)?")),o&&(n=o.exec(l)),n&&(u=n[0].replace(i,"").length,-1!=l.indexOf("(")&&0>t._value&&u++),t._focusin(),r(t.element[0],u)})},_change:function(e){var t=this;t._update(e),e=t._value,t._old!=e&&(t._old=e,t.element.trigger(f),t.trigger(f))},_culture:function(e){return e||h(this.options.culture)},_focusin:function(){var e=this;e._inputWrapper.addClass(C),e._toggleText(!1),e.element[0].focus()},_focusout:function(){var e=this;clearTimeout(e._focusing),e._inputWrapper.removeClass(C).removeClass(S),e._blur()},_format:function(e,t){var n=this._culture(t).numberFormat;return e=e.toLowerCase(),e.indexOf("c")>-1?n=n.currency:e.indexOf("p")>-1&&(n=n.percent),n},_input:function(){var t,n=this,i="k-formatted-value",r=n.element.addClass(v).show()[0],o=r.accessKey,a=n.wrapper;t=a.find(D+i),t[0]||(t=e('<input type="text"/>').insertBefore(r).addClass(i));try{r.setAttribute("type","text")}catch(s){r.type="text"}t[0].tabIndex=r.tabIndex,t[0].style.cssText=r.style.cssText,t.prop("placeholder",n.options.placeholder),o&&(t.attr("accesskey",o),r.accessKey=""),n._text=t.addClass(r.className)},_keydown:function(e){var t=this,n=e.keyCode;t._key=n,n==o.DOWN?t._step(-1):n==o.UP?t._step(1):n==o.ENTER&&t._change(t.element.val())},_keypress:function(e){var t,n,i,a,s,l,c,d,u,h,p;0===e.which||e.ctrlKey||e.keyCode===o.BACKSPACE||e.keyCode===o.ENTER||(t=this,n=t.options.min,i=t.element,a=r(i),s=a[0],l=a[1],c=String.fromCharCode(e.which),d=t._format(t.options.format),u=t._key===o.NUMPAD_DOT,h=i.val(),u&&(c=d[D]),h=h.substring(0,s)+c+h.substring(l),p=t._numericRegex(d).test(h),p&&u?(i.val(h),r(i,s+c.length),e.preventDefault()):(null!==n&&n>=0&&"-"===h.charAt(0)||!p)&&e.preventDefault(),t._key=0)},_numericRegex:function(e){var t=this,n=e[D],i=t.options.decimals;return n===D&&(n="\\"+n),i===F&&(i=e.decimals),0===i?M:(t._separator!==n&&(t._separator=n,t._floatRegExp=RegExp("^(-)?(((\\d+("+n+"\\d*)?)|("+n+"\\d*)))?$")),t._floatRegExp)},_paste:function(e){var t=this,n=e.target,i=n.value;setTimeout(function(){t._parse(n.value)===F&&t._update(i)})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=i._parse(n),(n||"step"!==e)&&(r[e]=n,i.element.attr("aria-value"+e,n).attr(e,n)),t)},_spin:function(e,t){var n=this;t=t||500,clearTimeout(n._spinning),n._spinning=setTimeout(function(){n._spin(e,50)},t),n._step(e)},_step:function(e){var t=this,n=t.element,i=t._parse(n.val())||0;l()!=n[0]&&t._focusin(),i+=t.options.step*e,t._update(t._adjust(i)),t.trigger(_)},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_toggleText:function(e){var t=this;t._text.toggle(e),t.element.toggle(!e)},_parse:function(e,t){return d(e,this._culture(t),this.options.format)},_update:function(e){var t,n=this,r=n.options,o=r.format,a=r.decimals,s=n._culture(),l=n._format(o,s);a===F&&(a=l.decimals),e=n._parse(e,s),t=e!==F,t&&(e=parseFloat(p(e,a))),n._value=e=n._adjust(e),n._placeholder(i.toString(e,o,s)),t?(e=""+e,-1!==e.indexOf("e")&&(e=p(+e,a)),e=e.replace(D,l[D])):e="",n.element.val(e).attr("aria-valuenow",e)
25
+ },_placeholder:function(e){this._text.val(e),u||e||this._text.val(this.options.placeholder)},_wrapper:function(){var t,n=this,i=n.element,r=i[0];t=i.parents(".k-numerictextbox"),t.is("span.k-numerictextbox")||(t=i.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent()),t[0].style.cssText=r.style.cssText,r.style.width="",n.wrapper=t.addClass("k-widget k-numerictextbox").addClass(r.className).css("display",""),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._form=r.on("reset",t._resetHandler))}});a.plugin(R)}(window.kendo.jQuery),function(e){function t(n,i){n.filters&&(n.filters=e.grep(n.filters,function(e){return t(e,i),e.filters?e.filters.length:e.field!=i}))}function n(e){var t,n,i,r,o,a;if(e&&e.length)for(a=[],t=0,n=e.length;n>t;t++)i=e[t],o=i.text||i.value||i,r=null==i.value?i.text||i:i.value,a[t]={text:o,value:r};return a}function i(t,n){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=n}),t.filters.length):t.field!=n})}var r=window.kendo,o=r.ui,a=e.proxy,s="kendoPopup",l="init",c=".kendoFilterMenu",d="Is equal to",u="Is not equal to",h={number:"numerictextbox",date:"datepicker"},p={string:"text",number:"number",date:"date"},f=r.isFunction,g=o.Widget,m='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',v='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',_='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',w='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',y=g.extend({init:function(t,n){var i,o,s,l,d=this,u="string";g.fn.init.call(d,t,n),i=d.operators=n.operators||{},t=d.element,n=d.options,n.appendToElement||(s=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),s[0]||(s=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),s.attr("tabindex",-1).on("click"+c,a(d._click,d))),d.link=s||e(),d.dataSource=n.dataSource,d.field=n.field||t.attr(r.attr("field")),d.model=d.dataSource.reader.model,d._parse=function(e){return e+""},d.model&&d.model.fields&&(l=d.model.fields[d.field],l&&(u=l.type||"string",l.parse&&(d._parse=a(l.parse,l)))),n.values&&(u="enums"),d.type=u,i=i[u]||n.operators[u];for(o in i)break;d._defaultFilter=function(){return{field:d.field,operator:o||"eq",value:""}},d._refreshHandler=a(d.refresh,d),d.dataSource.bind("change",d._refreshHandler),n.appendToElement?d._init():d.refresh()},_init:function(){var t,n=this,i=n.options.ui,o=f(i);n.pane=n.options.pane,n.pane&&(n._isMobile=!0),o||(t=i||h[n.type]),n._isMobile?n._createMobileForm(t):n._createForm(t),n.form.on("submit"+c,a(n._submit,n)).on("reset"+c,a(n._reset,n)),o&&n.form.find(".k-textbox").removeClass("k-textbox").each(function(){i(e(this))}),n.form.find("["+r.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+r.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+r.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+r.attr("role")+"=datepicker]").removeClass("k-textbox"),n.refresh(),n.trigger(l,{field:n.field,container:n.form})},_createForm:function(t){var i=this,o=i.options,l=i.operators||{},d=i.type;l=l[d]||o.operators[d],i.form=e('<form class="k-filter-menu"/>').html(r.template("boolean"===d?m:v)({field:i.field,format:o.format,ns:r.ns,messages:o.messages,extra:o.extra,operators:l,type:d,role:t,values:n(o.values)})),o.appendToElement?(i.element.append(i.form),i.popup=i.element.closest(".k-popup").data(s)):i.popup=i.form[s]({anchor:i.link,open:a(i._open,i),activate:a(i._activate,i),close:function(){i.options.closeCallback&&i.options.closeCallback(i.element)}}).data(s),i.form.on("keydown"+c,a(i._keydown,i))},_createMobileForm:function(t){var i=this,o=i.options,a=i.operators||{},s=i.type;a=a[s]||o.operators[s],i.form=e("<div />").html(r.template("boolean"===s?w:_)({field:i.field,format:o.format,ns:r.ns,messages:o.messages,extra:o.extra,operators:a,type:s,role:t,useRole:!r.support.input.date&&"date"===s||"number"===s,inputType:p[s],values:n(o.values)})),i.view=i.pane.append(i.form.html()),i.form=i.view.element.find("form"),i.view.element.on("click",".k-submit",function(e){i.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){i._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"};e.filterModel=r.observable({logic:"and",filters:[e._defaultFilter(),e._defaultFilter()]}),e.form&&r.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;g.fn.destroy.call(e),e.form&&(r.unbind(e.form),r.destroy(e.form),e.form.unbind(c),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(c),e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,n,i,r,o=this,a=e.filters,s=!1,l=0,c=o.filterModel;for(t=0,n=a.length;n>t;t++)r=a[t],r.field==o.field?(c.set("logic",e.logic),i=c.filters[l],i||(c.filters.push({field:o.field}),i=c.filters[l]),i.set("value",o._parse(r.value)),i.set("operator",r.operator),l++,s=!0):r.filters&&(s=s||o._bind(r));return s},_merge:function(n){var i,r,o,a=this,s=n.logic||"and",l=n.filters,c=a.dataSource.filter()||{filters:[],logic:"and"};for(t(c,a.field),l=e.grep(l,function(e){return""!==e.value&&null!=e.value}),r=0,o=l.length;o>r;r++)i=l[r],i.value=a._parse(i.value);return l.length&&(c.filters.length?(n.filters=l,"and"!==c.logic&&(c.filters=[{logic:c.logic,filters:c.filters}],c.logic="and"),c.filters.push(l.length>1?n:l[0])):(c.filters=l,c.logic=s)),c},filter:function(e){e=this._merge(e),e.filters.length&&this.dataSource.filter(e)},clear:function(){var t=this,n=t.dataSource.filter()||{filters:[]};n.filters=e.grep(n.filters,function(e){return e.filters?(e.filters=i(e.filters,t.field),e.filters.length):e.field!=t.field}),n.filters.length||(n=null),t.dataSource.filter(n)},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(s),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==r.keys.ESC&&this.popup.close()},events:[l],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:d,neq:u,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:d,neq:u,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:d,neq:u,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:d,neq:u}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}});o.plugin(y)}(window.kendo.jQuery),function(e,t){function n(e,t){return e=e.split(" ")[!t+0]||e,e.replace("top","up").replace("bottom","down")}function i(e,t,n){e=e.split(" ")[!t+0]||e;var i={origin:["bottom",n?"right":"left"],position:["top",n?"right":"left"]},r=/left|right/.test(e);return r?(i.origin=["top",e],i.position[1]=c.directions[e].reverse):(i.origin[0]=e,i.position[0]=c.directions[e].reverse),i.origin=i.origin.join(" "),i.position=i.position.join(" "),i}function r(t,n){try{return e.contains(t,n)}catch(i){return!1}}function o(t){t=e(t),t.addClass("k-item").children(x).addClass(P),t.children("a").addClass(T).children(x).addClass(P),t.filter(":not([disabled])").addClass(q),t.filter(".k-separator:empty").append("&nbsp;"),t.filter("li[disabled]").addClass(Y).removeAttr("disabled").attr("aria-disabled",!0),t.filter("[role]").length||t.attr("role","menuitem"),t.children("."+T).length||t.contents().filter(function(){return!(this.nodeName.match(b)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll("<span class='"+T+"'/>"),a(t),s(t)}function a(t){t=e(t),t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove(),t.filter(":has(.k-menu-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=e(this),n=t.parent().parent();t.append("<span class='k-icon "+(n.hasClass(S+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function s(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(I),t.filter(".k-last:not(:last-child)").removeClass(D),t.filter(":first-child").addClass(I),t.filter(":last-child").addClass(D)}var l,c=window.kendo,d=c.ui,u=c._activeElement,h=c.support.touch&&c.support.mobileOS,p="mousedown",f="click",g=e.extend,m=e.proxy,v=e.each,_=c.template,w=c.keys,y=d.Widget,b=/^(ul|a|div)$/i,k=".kendoMenu",x="img",C="open",S="k-menu",T="k-link",D="k-last",A="close",E="timer",I="k-first",P="k-image",M="select",F="zIndex",z="activate",R="deactivate",B="touchstart"+k+" MSPointerDown"+k+" pointerdown"+k,H=c.support.pointers,L=c.support.msPointers,N=L||H,O=H?"pointerover":L?"MSPointerOver":"mouseenter",V=H?"pointerout":L?"MSPointerOut":"mouseleave",U=h||N,W=e(document.documentElement),j="kendoPopup",q="k-state-default",G="k-state-hover",$="k-state-focused",Y="k-state-disabled",Q=".k-menu",K=".k-menu-group",X=K+",.k-animation-container",Z=":not(.k-list) > .k-item",J=".k-item.k-state-disabled",et=".k-item:not(.k-state-disabled)",tt=".k-item:not(.k-state-disabled) > .k-link",nt=":not(.k-item.k-separator)",it=nt+":eq(0)",rt=nt+":last",ot="div:not(.k-animation-container,.k-list-container)",at={2:1,touch:1},st={content:_("<div class='k-content #= groupCssClass() #' tabindex='-1'>#= content(item) #</div>"),group:_("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #</ul>"),itemWrapper:_("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:_("<li class='#= wrapperCssClass(group, item) #' role='menuitem' #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:_("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:_("<span class='#= arrowClass(item, group) #'></span>"),sprite:_("<span class='k-sprite #= spriteCssClass #'></span>"),empty:_("")},lt={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(){return T},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e,t){var n="k-icon";return n+=t.horizontal?" k-i-arrow-s":" k-i-arrow-e"},text:function(e){return e.encoded===!1?e.text:c.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-menu-group"},content:function(e){return e.content?e.content:"&nbsp;"}},ct=y.extend({init:function(t,n){var i=this;y.fn.init.call(i,t,n),t=i.wrapper=i.element,n=i.options,i._initData(n),i._updateClasses(),i._animations(n),i.nextItemZIndex=100,i._tabindex(),i._focusProxy=m(i._focusHandler,i),t.on(B,i._focusProxy).on(f+k,J,!1).on(f+k,et,m(i._click,i)).on("keydown"+k,m(i._keydown,i)).on("focus"+k,m(i._focus,i)).on("focus"+k,".k-content",m(i._focus,i)).on(B+" "+p+k,".k-content",m(i._preventClose,i)).on("blur"+k,m(i._removeHoverItem,i)).on("blur"+k,"[tabindex]",m(i._checkActiveElement,i)).on(O+k,et,m(i._mouseenter,i)).on(V+k,et,m(i._mouseleave,i)).on(O+k+" "+V+k+" "+p+k+" "+f+k,tt,m(i._toggleHover,i)),n.openOnClick&&(i.clicked=!1,i._documentClickHandler=m(i._documentClick,i),e(document).click(i._documentClickHandler)),t.attr("role","menubar"),t[0].id&&(i._ariaId=c.format("{0}_mn_active",t[0].id)),c.notify(i)},events:[C,A,z,R,M],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(e){var t=this;e.dataSource&&(t.angular("cleanup",function(){return{elements:t.element.children()}}),t.element.empty(),t.append(e.dataSource,t.element),t.angular("compile",function(){return{elements:t.element.children()}}))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=g(!0,t,e.animation),"dataSource"in e&&this._initData(e),this._updateClasses(),y.fn.setOptions.call(this,e)},destroy:function(){var t=this;y.fn.destroy.call(t),t.element.off(k),t._documentClickHandler&&e(document).unbind("click",t._documentClickHandler),c.destroy(t.element)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.length?t.find("> .k-menu-group, > .k-animation-container > .k-menu-group"):null);return v(n.items,function(){n.group.append(this),a(this)}),a(t),s(n.group.find(".k-first, .k-last").add(n.items)),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.before(this),a(this),s(this)}),s(t),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.after(this),a(this),s(this)}),s(t),this},_insert:function(t,n,i){var r,a,s,l,c=this;return n&&n.length||(i=c.element),s=e.isPlainObject(t),l={firstLevel:i.hasClass(S),horizontal:i.hasClass(S+"-horizontal"),expanded:!0,length:i.children().length},n&&!i.length&&(i=e(ct.renderGroup({group:l})).appendTo(n)),s||e.isArray(t)?r=e(e.map(s?[t]:t,function(t,n){return"string"==typeof t?e(t).get():e(ct.renderItem({group:l,item:g(t,{index:n})})).get()})):(r="string"==typeof t&&"<"!=t[0]?c.element.find(t):e(t),a=r.find("> ul").addClass("k-menu-group").attr("role","menu"),r=r.filter("li"),r.add(a.find("> li")).each(function(){o(this)})),{items:r,group:i}},remove:function(e){var t,n,i,r;return e=this.element.find(e),t=this,n=e.parentsUntil(t.element,Z),i=e.parent("ul:not(.k-menu)"),e.remove(),i&&!i.children(Z).length&&(r=i.parent(".k-animation-container"),r.length?r.remove():i.remove()),n.length&&(n=n.eq(0),a(n),s(n)),t},open:function(r){var o=this,a=o.options,s="horizontal"==a.orientation,l=a.direction,d=c.support.isRtl(o.wrapper);return r=o.element.find(r),/^(top|bottom|default)$/.test(l)&&(l=d?s?(l+" left").replace("default","bottom"):"left":s?(l+" right").replace("default","bottom"):"right"),r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=e(this).data("kendoPopup");t&&t.close()}),r.each(function(){var r=e(this);clearTimeout(r.data(E)),r.data(E,setTimeout(function(){var u,h,p,f,m,v,_,w,y=r.find(".k-menu-group:first:hidden");y[0]&&o._triggerEvent({item:r[0],type:C})===!1&&(!y.find(".k-menu-group")[0]&&y.children(".k-item").length>1?(h=e(window).height(),p=function(){y.css({maxHeight:h-(y.outerHeight()-y.height())-c.getShadows(y).bottom,overflow:"auto"})},c.support.browser.msie&&7>=c.support.browser.version?setTimeout(p,0):p()):y.css({maxHeight:"",overflow:""}),r.data(F,r.css(F)),r.css(F,o.nextItemZIndex++),u=y.data(j),f=r.parent().hasClass(S),m=f&&s,v=i(l,f,d),_=a.animation.open.effects,w=_!==t?_:"slideIn:"+n(l,f),u?(u=y.data(j),u.options.origin=v.origin,u.options.position=v.position,u.options.animation.open.effects=w):u=y.kendoPopup({activate:function(){o._triggerEvent({item:this.wrapper.parent(),type:z})},deactivate:function(e){e.sender.element.removeData("targetTransform").css({opacity:""}),o._triggerEvent({item:this.wrapper.parent(),type:R})},origin:v.origin,position:v.position,collision:a.popupCollision!==t?a.popupCollision:m?"fit":"fit flip",anchor:r,appendTo:r,animation:{open:g(!0,{effects:w},a.animation.open),close:a.animation.close},close:function(e){var t=e.sender.wrapper.parent();o._triggerEvent({item:t[0],type:A})?e.preventDefault():(t.css(F,t.data(F)),t.removeData(F),U&&(t.removeClass(G),o._removeHoverItem()))}}).data(j),y.removeAttr("aria-hidden"),u.open())},o.options.hoverDelay))}),o},close:function(t,n){var i=this,r=i.element;return t=r.find(t),t.length||(t=r.find(">.k-item")),t.each(function(){var t=e(this);!n&&i._isRootItem(t)&&(i.clicked=!1),clearTimeout(t.data(E)),t.data(E,setTimeout(function(){var e=t.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(j);e&&(e.close(),e.element.attr("aria-hidden",!0))},i.options.hoverDelay))}),i},_toggleDisabled:function(t,n){this.element.find(t).each(function(){e(this).toggleClass(q,n).toggleClass(Y,!n).attr("aria-disabled",!n)})},_toggleHover:function(t){var n=e(c.eventTarget(t)||t.target).closest(Z),i=t.type==O||-1!==p.indexOf(t.type);n.parents("li."+Y).length||n.toggleClass(G,i||"mousedown"==t.type||"click"==t.type),this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var n=this,i=e(t?t.currentTarget:this._hoverItem()),o=n._findRootParent(i)[0];this._closurePrevented||setTimeout(function(){(!document.hasFocus()||!r(o,c._activeElement())&&t&&!r(o,t.currentTarget))&&n.close(o)},0),this._closurePrevented=!1},_removeHoverItem:function(){var e=this._hoverItem();e&&e.hasClass($)&&(e.removeClass($),this._oldHoverItem=null)},_updateClasses:function(){var e,t=this.element,n=".k-menu-init div ul";t.removeClass("k-menu-horizontal k-menu-vertical"),t.addClass("k-widget k-reset k-header k-menu-init "+S).addClass(S+"-"+this.options.orientation),t.find("li > ul").filter(function(){return!c.support.matchesSelector.call(this,n)}).addClass("k-group k-menu-group").attr("role","menu").attr("aria-hidden",t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1"),e=t.find("> li,.k-menu-group > li"),t.removeClass("k-menu-init"),e.each(function(){o(this)})},_mouseenter:function(t){var n=this,i=e(t.currentTarget),o=i.children(".k-animation-container").length||i.children(K).length;t.delegateTarget==i.parents(Q)[0]&&(n.options.openOnClick&&!n.clicked||h||(H||L)&&t.originalEvent.pointerType in at&&n._isRootItem(i.closest(Z))||!r(t.currentTarget,t.relatedTarget)&&o&&n.open(i),(n.options.openOnClick&&n.clicked||U)&&i.siblings().each(m(function(e,t){n.close(t,!0)},n)))},_mouseleave:function(n){var i=this,o=e(n.currentTarget),a=o.children(".k-animation-container").length||o.children(K).length;return o.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]?(n.stopImmediatePropagation(),t):(i.options.openOnClick||h||(H||L)&&n.originalEvent.pointerType in at||r(n.currentTarget,n.relatedTarget||n.target)||!a||r(n.currentTarget,c._activeElement())||i.close(o),t)},_click:function(n){var i,r,o,a=this,s=a.options,l=e(c.eventTarget(n)),d=l[0]?l[0].nodeName.toUpperCase():"",u="INPUT"==d||"SELECT"==d||"BUTTON"==d||"LABEL"==d,h=l.closest("."+T),p=l.closest(Z),f=h.attr("href"),g=l.attr("href"),m=e("<a href='#' />").attr("href"),v=!!f&&f!==m,_=v&&!!f.match(/^#/),w=!!g&&g!==m,y=s.openOnClick&&o&&a._isRootItem(p);if(s.openOnClick||!p.children(ot)[0]){if(p.hasClass(Y))return n.preventDefault(),t;if(n.handled||!a._triggerEvent({item:p[0],type:M})||u||n.preventDefault(),n.handled=!0,r=p.children(X),o=r.is(":visible"),s.closeOnClick&&(!v||_)&&(!r.length||y))return p.removeClass(G).css("height"),a._oldHoverItem=a._findRootParent(p),a.close(h.parentsUntil(a.element,Z)),a.clicked=!1,-1!="MSPointerUp".indexOf(n.type)&&n.preventDefault(),t;v&&n.enterKey&&h[0].click(),(a._isRootItem(p)&&s.openOnClick||c.support.touch||(H||L)&&a._isRootItem(p.closest(Z)))&&(v||u||w||n.preventDefault(),a.clicked=!0,i=r.is(":visible")?A:C,(s.closeOnClick||i!=A)&&a[i](p))}},_documentClick:function(e){r(this.element[0],e.target)||(this.clicked=!1)},_focus:function(n){var i=this,r=n.target,o=i._hoverItem(),a=u();return r==i.wrapper[0]||e(r).is(":kendoFocusable")?(a===n.currentTarget&&(o.length?i._moveHover([],o):i._oldHoverItem||i._moveHover([],i.wrapper.children().first())),t):(n.stopPropagation(),e(r).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass($),i.wrapper.focus(),t)},_keydown:function(e){var n,i,r,o=this,a=e.keyCode,s=o._oldHoverItem,l=c.support.isRtl(o.wrapper);if(e.target==e.currentTarget||a==w.ESC){if(s||(s=o._oldHoverItem=o._hoverItem()),i=o._itemBelongsToVertival(s),r=o._itemHasChildren(s),a==w.RIGHT)n=o[l?"_itemLeft":"_itemRight"](s,i,r);else if(a==w.LEFT)n=o[l?"_itemRight":"_itemLeft"](s,i,r);else if(a==w.DOWN)n=o._itemDown(s,i,r);else if(a==w.UP)n=o._itemUp(s,i,r);else if(a==w.ESC)n=o._itemEsc(s,i);else if(a==w.ENTER||a==w.SPACEBAR)n=s.children(".k-link"),n.length>0&&(o._click({target:n[0],preventDefault:function(){},enterKey:!0}),o._moveHover(s,o._findRootParent(s)));else if(a==w.TAB)return n=o._findRootParent(s),o._moveHover(s,n),o._checkActiveElement(),t;n&&n[0]&&(e.preventDefault(),e.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(e){var t=this.wrapper.hasClass("k-menu-vertical");return e.length?e.parent().hasClass("k-menu-group")||t:t},_itemHasChildren:function(e){return e.length?e.children("ul.k-menu-group, div.k-animation-container").length>0:!1},_moveHover:function(t,n){var i=this,r=i._ariaId;t.length&&n.length&&t.removeClass($),n.length&&(n[0].id&&(r=n[0].id),n.addClass($),i._oldHoverItem=n,r&&(i.element.removeAttr("aria-activedescendant"),e("#"+r).removeAttr("id"),n.attr("id",r),i.element.attr("aria-activedescendant",r)))},_findRootParent:function(e){return this._isRootItem(e)?e:e.parentsUntil(Q,"li.k-item").last()},_isRootItem:function(e){return e.parent().hasClass(S)},_itemRight:function(e,t,n){var i,r,o=this;if(!e.hasClass(Y))return t?n?(o.open(e),i=e.find(".k-menu-group").children().first()):"horizontal"==o.options.orientation&&(r=o._findRootParent(e),o.close(r),i=r.nextAll(it)):(i=e.nextAll(it),i.length||(i=e.prevAll(rt))),i&&!i.length?i=o.wrapper.children(".k-item").first():i||(i=[]),o._moveHover(e,i),i},_itemLeft:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._isRootItem(n)&&"horizontal"==i.options.orientation&&(n=n.prevAll(it))):(n=e.prevAll(it),n.length||(n=e.nextAll(rt))),n.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemDown:function(e,t,n){var i,r=this;if(t)i=e.nextAll(it);else{if(!n||e.hasClass(Y))return;r.open(e),i=e.find(".k-menu-group").children().first()}return!i.length&&e.length?i=e.parent().children().first():e.length||(i=r.wrapper.children(".k-item").first()),r._moveHover(e,i),i},_itemUp:function(e,t){var n,i=this;if(t)return n=e.prevAll(it),!n.length&&e.length?n=e.parent().children().last():e.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemEsc:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._moveHover(e,n),n):e},_triggerEvent:function(e){var t=this;return t.trigger(e.type,{type:e.type,item:e.item})},_focusHandler:function(t){var n=this,i=e(c.eventTarget(t)).closest(Z);setTimeout(function(){n._moveHover([],i),i.children(".k-content")[0]&&i.parent().closest(".k-item").removeClass($)},200)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}});g(ct,{renderItem:function(e){e=g({menu:{},group:{}},e);var t=st.empty,n=e.item;return st.item(g(e,{image:n.imageUrl?st.image:t,sprite:n.spriteCssClass?st.sprite:t,itemWrapper:st.itemWrapper,renderContent:ct.renderContent,arrow:n.items||n.content?st.arrow:t,subGroup:ct.renderGroup},lt))},renderGroup:function(e){return st.group(g({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=g({length:r},e.group);r>n;n++)t+=ct.renderItem(g(e,{group:o,item:g({index:n},i[n])}));return t}},e,lt))},renderContent:function(e){return st.content(g(e,lt))}}),l=ct.extend({init:function(t,n){var i=this;ct.fn.init.call(i,t,n),i.target=e(i.options.target),i._popup(),i._wire()},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[C,A,z,R,M],setOptions:function(t){var n=this;ct.fn.setOptions.call(n,t),n.target.off(n.showOn+k,n._showProxy),n.userEvents&&n.userEvents.destroy(),n.target=e(n.options.target),t.orientation&&n.popup.wrapper[0]&&n.popup.element.unwrap(),n._wire(),ct.fn.setOptions.call(this,t)},destroy:function(){var e=this;e.target.off(e.options.showOn+k),W.off(c.support.mousedown+k,e._closeProxy),e.userEvents&&e.userEvents.destroy(),ct.fn.destroy.call(e)},open:function(n,i){var o=this;return n=e(n)[0],r(o.element[0],e(n)[0])?ct.fn.open.call(o,n):o._triggerEvent({item:o.element,type:C})===!1&&(o.popup.visible()&&o.options.filter&&o.popup.close(!0),i!==t?(o.popup.wrapper.hide(),o.popup.open(n,i)):(o.popup.options.anchor=(n?n:o.popup.anchor)||o.target,o.popup.open()),W.off(o.popup.downEvent,o.popup._mousedownProxy),W.on(c.support.mousedown+k,o._closeProxy)),o},close:function(){var t=this;r(t.element[0],e(arguments[0])[0])?ct.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:A})===!1&&(t.popup.close(),W.off(c.support.mousedown+k,t._closeProxy),t.unbind(M,t._closeTimeoutProxy))},_showHandler:function(e){var t,n=e,i=this,o=i.options;e.event&&(n=e.event,n.pageX=e.x.location,n.pageY=e.y.location),r(i.element[0],e.relatedTarget||e.target)||(i._eventOrigin=n,n.preventDefault(),n.stopImmediatePropagation(),i.element.find("."+$).removeClass($),(o.filter&&c.support.matchesSelector.call(n.currentTarget,o.filter)||!o.filter)&&(o.alignToAnchor?i.open(n.currentTarget):(i.popup.options.anchor=n.currentTarget,i._targetChild?(t=i.target.offset(),i.open(n.pageX-t.left,n.pageY-t.top)):i.open(n.pageX,n.pageY))))},_closeHandler:function(t){var n=this,i=e(t.relatedTarget||t.target),o=i.closest(n.target.selector)[0]==n.target[0],a=i.closest(et).children(X),s=r(n.element[0],i[0]);n._eventOrigin=t,!n.popup.visible()||(3===t.which||!o)&&o||(!n.options.closeOnClick||h||(H||L)&&t.originalEvent.pointerType in at||a[0]||!s)&&s||(s?(this.unbind(M,this._closeTimeoutProxy),n.bind(M,n._closeTimeoutProxy)):n.close())
26
+ },_wire:function(){var e=this,t=e.options,n=e.target;e._showProxy=m(e._showHandler,e),e._closeProxy=m(e._closeHandler,e),e._closeTimeoutProxy=m(e.close,e),n[0]&&(c.support.mobileOS&&"contextmenu"==t.showOn?(e.userEvents=new c.UserEvents(n,{filter:t.filter,allowSelection:!1}),n.on(t.showOn+k,!1),e.userEvents.bind("hold",e._showProxy)):t.filter?n.on(t.showOn+k,t.filter,e._showProxy):n.on(t.showOn+k,e._showProxy))},_triggerEvent:function(n){var i=this,r=e(i.popup.options.anchor)[0],o=i._eventOrigin;return i._eventOrigin=t,i.trigger(n.type,g({type:n.type,item:n.item||this.element[0],target:r},o?{event:o}:{}))},_popup:function(){var e=this;e._triggerProxy=m(e._triggerEvent,e),e.popup=e.element.addClass("k-context-menu").kendoPopup({anchor:e.target||"body",copyAnchorStyles:e.options.copyAnchorStyles,collision:e.options.popupCollision||"fit",animation:e.options.animation,activate:e._triggerProxy,deactivate:e._triggerProxy}).data("kendoPopup"),e._targetChild=r(e.target[0],e.popup.element[0])}}),d.plugin(ct),d.plugin(l)}(window.kendo.jQuery),function(e,t){function n(t){return e.trim(t).replace(/&nbsp;/gi,"")}function i(e,t){var n,i,r,o={};for(n=0,i=e.length;i>n;n++)r=e[n],o[r[t]]=r;return o}function r(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(r(e[t].columns)):n.push(e[t]);return n}var o=window.kendo,a=o.ui,s=e.proxy,l=e.extend,c=e.grep,d=e.map,u=e.inArray,h="k-state-selected",p="asc",f="desc",g="change",m="init",v="select",_="kendoPopup",w="kendoFilterMenu",y="kendoMenu",b=".kendoColumnMenu",k=a.Widget,x=k.extend({init:function(t,n){var i,r=this;k.fn.init.call(r,t,n),t=r.element,n=r.options,r.owner=n.owner,r.dataSource=n.dataSource,r.field=t.attr(o.attr("field")),r.title=t.attr(o.attr("title")),i=t.find(".k-header-column-menu"),i[0]||(i=t.addClass("k-with-icon").prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),r.link=i.attr("tabindex",-1).on("click"+b,s(r._click,r)),r.wrapper=e('<div class="k-column-menu"/>')},_init:function(){var e=this;e.pane=e.options.pane,e.pane&&(e._isMobile=!0),e._isMobile?e._createMobileMenu():e._createMenu(),e._angularItems("compile"),e._sort(),e._columns(),e._filter(),e._lockColumns(),e.trigger(m,{field:e.field,container:e.wrapper})},events:[m],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns",done:"Done",settings:"Column Settings",lock:"Lock",unlock:"Unlock"},filter:"",columns:!0,sortable:!0,filterable:!0,animations:{left:"slide"}},_createMenu:function(){var e=this,t=e.options;e.wrapper.html(o.template(C)({ns:o.ns,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns})),e.popup=e.wrapper[_]({anchor:e.link,open:s(e._open,e),activate:s(e._activate,e),close:function(){e.options.closeCallback&&e.options.closeCallback(e.element)}}).data(_),e.menu=e.wrapper.children()[y]({orientation:"vertical",closeOnClick:!1}).data(y)},_createMobileMenu:function(){var e=this,t=e.options,n=o.template(S)({ns:o.ns,field:e.field,title:e.title||e.field,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns});e.view=e.pane.append(n),e.wrapper=e.view.element.find(".k-column-menu"),e.menu=new T(e.wrapper.children(),{pane:e.pane}),e.view.element.on("click",".k-done",function(t){e.close(),t.preventDefault()}),e.options.lockedColumns&&e.view.bind("show",function(){e._updateLockedColumns()})},_angularItems:function(t){var n=this;n.angular(t,function(){var t=n.wrapper.find(".k-columns-item input["+o.attr("field")+"]").map(function(){return e(this).closest("li")}),i=d(n._ownerColumns(),function(e){return{column:e._originalObject}});return{elements:t,data:i}})},destroy:function(){var e=this;e._angularItems("cleanup"),k.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e._refreshHandler&&e.dataSource.unbind(g,e._refreshHandler),e.options.columns&&e.owner&&e._updateColumnsMenuHandler&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e.menu&&(e.menu.element.off(b),e.menu.destroy()),e.wrapper.off(b),e.popup&&e.popup.destroy(),e.view&&e.view.purge(),e.link.off(b),e.owner=null,e.wrapper=null,e.element=null},close:function(){this.menu.close(),this.popup&&(this.popup.close(),this.popup.element.off("keydown"+b))},_click:function(e){e.preventDefault(),e.stopPropagation();var t=this.options;t.filter&&this.element.is(!t.filter)||(this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_open:function(){var t=this;e(".k-column-menu").not(t.wrapper).each(function(){e(this).data(_).close()}),t.popup.element.on("keydown"+b,function(e){e.keyCode==o.keys.ESC&&t.close()}),t.options.lockedColumns&&t._updateLockedColumns()},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=r(this.owner.columns),t=c(e,function(e){var t=!0,i=n(e.title||"");return(e.menu===!1||!e.field&&!i.length)&&(t=!1),t});return d(t,function(t){return{originalField:t.field,field:t.field||t.title,title:t.title||t.field,hidden:t.hidden,index:u(t,e),locked:!!t.locked,_originalObject:t}})},_sort:function(){var t=this;t.options.sortable&&(t.refresh(),t._refreshHandler=s(t.refresh,t),t.dataSource.bind(g,t._refreshHandler),t.menu.bind(v,function(n){var i,r=e(n.item);r.hasClass("k-sort-asc")?i=p:r.hasClass("k-sort-desc")&&(i=f),i&&(r.parent().find(".k-sort-"+(i==p?f:p)).removeClass(h),t._sortDataSource(r,i),t.close())}))},_sortDataSource:function(e,n){var i,r,o=this,a=o.options.sortable,s=null===a.compare?t:a.compare,l=o.dataSource,c=l.sort()||[];if(e.hasClass(h)&&a&&a.allowUnsort!==!1?(e.removeClass(h),n=t):e.addClass(h),a===!0||"single"===a.mode)c=[{field:o.field,dir:n,compare:s}];else{for(i=0,r=c.length;r>i;i++)if(c[i].field===o.field){c.splice(i,1);break}c.push({field:o.field,dir:n,compare:s})}l.sort(c)},_columns:function(){var t=this;t.options.columns&&(t._updateColumnsMenu(),t._updateColumnsMenuHandler=s(t._updateColumnsMenu,t),t.owner.bind(["columnHide","columnShow"],t._updateColumnsMenuHandler),t.menu.bind(v,function(n){var i,a,s,l=e(n.item),d=r(t.owner.columns);t._isMobile&&n.preventDefault(),l.parent().closest("li.k-columns-item")[0]&&(i=l.find(":checkbox"),i.attr("disabled")||(s=i.attr(o.attr("field")),a=c(d,function(e){return e.field==s||e.title==s})[0],a.hidden===!0?t.owner.showColumn(a):t.owner.hideColumn(a)))}))},_updateColumnsMenu:function(){var e,t,n,i,r,a,s=o.attr("field"),l=o.attr("locked"),h=c(this._ownerColumns(),function(e){return!e.hidden}),p=c(h,function(e){return e.originalField}),f=c(p,function(e){return e.locked===!0}).length,g=c(p,function(e){return e.locked!==!0}).length;for(h=d(h,function(e){return e.field}),a=this.wrapper.find(".k-columns-item input["+s+"]").prop("disabled",!1).prop("checked",!1),e=0,t=a.length;t>e;e++)n=a.eq(e),r="true"===n.attr(l),i=!1,u(n.attr(s),h)>-1&&(i=!0,n.prop("checked",i)),i&&(1==f&&r&&n.prop("disabled",!0),1!=g||r||n.prop("disabled",!0))},_updateColumnsLockedState:function(){var e,t,n,r,a=o.attr("field"),s=o.attr("locked"),l=i(this._ownerColumns(),"field"),c=this.wrapper.find(".k-columns-item input[type=checkbox]");for(e=0,t=c.length;t>e;e++)n=c.eq(e),r=l[n.attr(a)],r&&n.attr(s,r.locked);this._updateColumnsMenu()},_filter:function(){var t=this,n=t.options;n.filterable!==!1&&(t.filterMenu=t.wrapper.find(".k-filterable")[w](l(!0,{},{appendToElement:!0,dataSource:n.dataSource,values:n.values,field:t.field},n.filterable)).data(w),t._isMobile&&t.menu.bind(v,function(n){var i=e(n.item);i.hasClass("k-filter-item")&&t.pane.navigate(t.filterMenu.view,t.options.animations.left)}))},_lockColumns:function(){var t=this;t.menu.bind(v,function(n){var i=e(n.item);i.hasClass("k-lock")?(t.owner.lockColumn(t.field),t.close()):i.hasClass("k-unlock")&&(t.owner.unlockColumn(t.field),t.close())})},_updateLockedColumns:function(){var e,t,n,i,r=this.field,o=this.owner.columns,a=c(o,function(e){return e.field==r||e.title==r})[0];a&&(e=a.locked===!0,t=c(o,function(t){return!t.hidden&&(t.locked&&e||!t.locked&&!e)}).length,n=this.wrapper.find(".k-lock").removeClass("k-state-disabled"),i=this.wrapper.find(".k-unlock").removeClass("k-state-disabled"),(e||1==t)&&n.addClass("k-state-disabled"),e&&1!=t||i.addClass("k-state-disabled"),this._updateColumnsLockedState())},refresh:function(){var e,t,n,i=this,r=i.options.dataSource.sort()||[],o=i.field;for(i.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(h),t=0,n=r.length;n>t;t++)e=r[t],o==e.field&&i.wrapper.find(".k-sort-"+e.dir).addClass(h)}}),C='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li><input type="checkbox" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</li>#}#</ul></li>#if(filterable || lockedColumns){#<li class="k-separator"></li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#if(lockedColumns){#<li class="k-separator"></li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}#</ul>',S='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-column-menu"><div data-#=ns#role="header" class="k-header">${messages.settings}<button class="k-button k-done">#=messages.done#</button></div><div class="k-column-menu k-mobile-list"><ul><li><span class="k-link">${title}</span><ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link k-filterable"><span class="k-sprite k-filter"></span>${messages.filter}</span></li>#}#</ul></li>#if(showColumns){#<li class="k-columns-item"><span class="k-link">${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li class="k-item"><label class="k-label"><input type="checkbox" class="k-check" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</label></li>#}#</ul></li>#}#</ul></div></div>',T=k.extend({init:function(e,t){k.fn.init.call(this,e,t),this.element.on("click"+b,"li:not(.k-separator):not(.k-state-disabled)","_click")},events:[v],_click:function(e){e.preventDefault(),this.trigger(v,{item:e.currentTarget})},close:function(){this.options.pane.navigate("")},destroy:function(){k.fn.destroy.call(this),this.element.off(b)}});a.plugin(x)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="dir",a="asc",s="single",l="field",c="desc",d=".kendoColumnSorter",u=".k-link",h="aria-sort",p=e.proxy,f=r.extend({init:function(e,t){var n,i=this;r.fn.init.call(i,e,t),i._refreshHandler=p(i.refresh,i),i.dataSource=i.options.dataSource.bind("change",i._refreshHandler),n=i.element.find(u),n[0]||(n=i.element.wrapInner('<a class="k-link" href="#"/>').find(u)),i.link=n,i.element.on("click"+d,p(i._click,i))},options:{name:"ColumnSorter",mode:s,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;r.fn.destroy.call(e),e.element.off(d),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var t,i,r,s,d=this,u=d.dataSource.sort()||[],p=d.element,f=p.attr(n.attr(l));for(p.removeAttr(n.attr(o)),p.removeAttr(h),t=0,i=u.length;i>t;t++)r=u[t],f==r.field&&p.attr(n.attr(o),r.dir);s=p.attr(n.attr(o)),p.find(".k-i-arrow-n,.k-i-arrow-s").remove(),s===a?(e('<span class="k-icon k-i-arrow-n" />').appendTo(d.link),p.attr(h,"ascending")):s===c&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(d.link),p.attr(h,"descending"))},_click:function(e){var i,r,d=this,u=d.element,h=u.attr(n.attr(l)),p=u.attr(n.attr(o)),f=d.options,g=null===d.options.compare?t:d.options.compare,m=d.dataSource.sort()||[];if(e.preventDefault(),!f.filter||u.is(f.filter)){if(p=p===a?c:p===c&&f.allowUnsort?t:a,f.mode===s)m=[{field:h,dir:p,compare:g}];else if("multiple"===f.mode){for(i=0,r=m.length;r>i;i++)if(m[i].field===h){m.splice(i,1);break}m.push({field:h,dir:p,compare:g})}this.dataSource.sort(m)}}});i.plugin(f)}(window.kendo.jQuery),function(e,t){function n(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function i(t){t.find(":input:not(:button, ["+s.attr("role")+"=upload], ["+s.attr("skip")+"], [type=file]), select").each(function(){var t=s.attr("bind"),n=this.getAttribute(t)||"",i="checkbox"===this.type||"radio"===this.type?"checked:":"value:",r=this.name;-1===n.indexOf(i)&&r&&(n+=(n.length?",":"")+i+r,e(this).attr(t,n))})}function r(e){var t,i,r=(e.model.fields||e.model)[e.field],o=n(r),a=r?r.validation:{},l=s.attr("type"),c=s.attr("bind"),d={name:e.field};for(t in a)i=a[t],f(t,_)>=0?d[l]=t:h(i)||(d[t]=p(i)?i.value||t:i),d[s.attr(t+"-msg")]=i.message;return f(o,_)>=0&&(d[l]=o),d[c]=("boolean"===o?"checked:":"value:")+e.field,d}function o(e){var t,n,i,r,o,a;if(e&&e.length)for(a=[],t=0,n=e.length;n>t;t++)i=e[t],o=i.text||i.value||i,r=null==i.value?i.text||i:i.value,a[t]={text:o,value:r};return a}function a(e,t){var n,i,r=e?e.validation||{}:{};for(n in r)i=r[n],p(i)&&i.value&&(i=i.value),h(i)&&(t[n]=i)}var s=window.kendo,l=s.ui,c=l.Widget,d=e.extend,u=s.support.browser.msie&&9>s.support.browser.version,h=s.isFunction,p=e.isPlainObject,f=e.inArray,g=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,m='<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',v="change",_=["url","email","number","date","boolean"],w={number:function(t,n){var i=r(n);e('<input type="text"/>').attr(i).appendTo(t).kendoNumericTextBox({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,n){var i=r(n),o=n.format;o&&(o=s._extractFormat(o)),i[s.attr("format")]=o,e('<input type="text"/>').attr(i).appendTo(t).kendoDatePicker({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,n){var i=r(n);e('<input type="text" class="k-input k-textbox"/>').attr(i).appendTo(t)},"boolean":function(t,n){var i=r(n);e('<input type="checkbox" />').attr(i).appendTo(t)},values:function(t,n){var i=r(n);e("<select "+s.attr("text-field")+'="text"'+s.attr("value-field")+'="value"'+s.attr("source")+"='"+s.stringify(o(n.values)).replace(/\'/g,"&apos;")+"'"+s.attr("role")+'="dropdownlist"/>').attr(i).appendTo(t),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},y=c.extend({init:function(t,n){var i=this;n.target&&(n.$angular=n.target.options.$angular),c.fn.init.call(i,t,n),i._validateProxy=e.proxy(i._validate,i),i.refresh()},events:[v],options:{name:"Editable",editors:w,clearContainer:!0,errorTemplate:m},editor:function(e,t){var i=this,r=i.options.editors,o=p(e),a=o?e.field:e,l=i.options.model||{},c=o&&e.values,u=c?"values":n(t),h=o&&e.editor,f=h?e.editor:r[u],m=i.element.find("["+s.attr("container-for")+"="+a.replace(g,"\\$1")+"]");f=f?f:r.string,h&&"string"==typeof e.editor&&(f=function(t){t.append(e.editor)}),m=m.length?m:i.element,f(m,d(!0,{},o?e:{field:a},{model:l}))},_validate:function(t){var n,i=this,r=t.value,o=i._validationEventInProgress,a={},l=s.attr("bind"),c=t.field.replace(g,"\\$1"),d="checked:"+c,u="value:"+c;a[t.field]=t.value,n=e(":input["+l+'*="'+u+'"],:input['+l+'*="'+d+'"]',i.element).filter("["+s.attr("validate")+"!='false']"),n.length>1&&(n=n.filter(function(){var t=e(this),n=t.attr(l).split(","),i=f(u,n)>=0||f(d,n)>=0;return i&&(!t.is(":radio")||t.val()==r)}));try{i._validationEventInProgress=!0,(!i.validatable.validateInput(n)||!o&&i.trigger(v,{values:a}))&&t.preventDefault()}finally{i._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element}}),c.fn.destroy.call(e),e.options.model.unbind("set",e._validateProxy),s.unbind(e.element),e.validatable&&e.validatable.destroy(),s.destroy(e.element),e.element.removeData("kendoValidator")},refresh:function(){var n,r,o,l,c,d,h,f,g=this,m=g.options.fields||[],v=g.options.clearContainer?g.element.empty():g.element,_=g.options.model||{},w={};for(e.isArray(m)||(m=[m]),n=0,r=m.length;r>n;n++)o=m[n],l=p(o),c=l?o.field:o,d=(_.fields||_)[c],a(d,w),g.editor(o,d);if(g.options.target&&g.angular("compile",function(){return{elements:v,data:[{dataItem:_}]}}),!r){h=_.fields||_;for(c in h)a(h[c],w)}i(v),g.validatable&&g.validatable.destroy(),s.bind(v,g.options.model),g.options.model.unbind("set",g._validateProxy),g.options.model.bind("set",g._validateProxy),g.validatable=new s.ui.Validator(v,{validateOnBlur:!1,errorTemplate:g.options.errorTemplate||t,rules:w}),f=v.find(":kendoFocusable").eq(0).focus(),u&&f.focus()}});l.plugin(y)}(window.kendo.jQuery),function(e,t){function n(e){return t!==e}function i(e,t,n){return Math.max(Math.min(parseInt(e,10),1/0===n?n:parseInt(n,10)),parseInt(t,10))}function r(e,t){return function(){var n=this,i=n.wrapper,r=i[0].style,o=n.options;if(!o.isMaximized&&!o.isMinimized)return n.restoreOptions={width:r.width,height:r.height},i.children(x).hide().end().children(b).find(q).parent().hide().eq(0).before(J.action({name:"Restore"})),t.call(n),"maximize"==e?n.wrapper.children(b).find(Y).parent().hide():n.wrapper.children(b).find(Y).parent().show(),n}}function o(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function a(e){var t=this;t.owner=e,t._draggable=new d(e.wrapper,{filter:">"+x,group:e.wrapper.id+"-resizing",dragstart:p(t.dragstart,t),drag:p(t.drag,t),dragend:p(t.dragend,t)}),t._draggable.userEvents.bind("press",p(t.addOverlay,t)),t._draggable.userEvents.bind("release",p(t.removeOverlay,t))}function s(e,t){var n=this;n.owner=e,n._draggable=new d(e.wrapper,{filter:t,group:e.wrapper.id+"-moving",dragstart:p(n.dragstart,n),drag:p(n.drag,n),dragend:p(n.dragend,n),dragcancel:p(n.dragcancel,n)}),n._draggable.userEvents.stopPropagation=!1}var l=window.kendo,c=l.ui.Widget,d=l.ui.Draggable,u=e.isPlainObject,h=l._activeElement,p=e.proxy,f=e.extend,g=e.each,m=l.template,v="body",_=".kendoWindow",w=".k-window",y=".k-window-title",b=y+"bar",k=".k-window-content",x=".k-resize-handle",C=".k-overlay",S="k-content-frame",T="k-loading",D="k-state-hover",A="k-state-focused",E="k-window-maximized",I=":visible",P="hidden",M="cursor",F="open",z="activate",R="deactivate",B="close",H="refresh",L="resize",N="resizeEnd",O="dragstart",V="dragend",U="error",W="overflow",j="zIndex",q=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",G=".k-i-pin",$=".k-i-unpin",Y=G+","+$,Q=".k-window-titlebar .k-window-action",K=".k-window-titlebar .k-i-refresh",X=l.isLocalUrl,Z=c.extend({init:function(i,r){var a,s,d,h,f,g,m,v=this,x={},C=!1,S=r&&r.actions&&!r.actions.length;c.fn.init.call(v,i,r),r=v.options,h=r.position,i=v.element,f=r.content,S&&(r.actions=[]),v.appendTo=e(r.appendTo),v._animations(),f&&!u(f)&&(f=r.content={url:f}),i.find("script").filter(o).remove(),i.parent().is(v.appendTo)||h.top!==t&&h.left!==t||(i.is(I)?(x=i.offset(),C=!0):(s=i.css("visibility"),d=i.css("display"),i.css({visibility:P,display:""}),x=i.offset(),i.css({visibility:s,display:d})),h.top===t&&(h.top=x.top),h.left===t&&(h.left=x.left)),n(r.visible)&&null!==r.visible||(r.visible=i.is(I)),a=v.wrapper=i.closest(w),i.is(".k-content")&&a[0]||(i.addClass("k-window-content k-content"),v._createWindow(i,r),a=v.wrapper=i.closest(w),v._dimensions()),v._position(),r.pinned&&v.pin(!0),f&&v.refresh(f),r.visible&&v.toFront(),g=a.children(k),v._tabindex(g),r.visible&&r.modal&&v._overlay(a.is(I)).css({opacity:.5}),a.on("mouseenter"+_,Q,p(v._buttonEnter,v)).on("mouseleave"+_,Q,p(v._buttonLeave,v)).on("click"+_,"> "+Q,p(v._windowActionHandler,v)),g.on("keydown"+_,p(v._keydown,v)).on("focus"+_,p(v._focus,v)).on("blur"+_,p(v._blur,v)),this._resizable(),this._draggable(),m=i.attr("id"),m&&(m+="_wnd_title",a.children(b).children(y).attr("id",m),g.attr({role:"dialog","aria-labelledby":m})),a.add(a.children(".k-resize-handle,"+b)).on("mousedown"+_,p(v.toFront,v)),v.touchScroller=l.touchScroller(i),v._resizeHandler=p(v._onDocumentResize,v),v._marker=l.guid().substring(0,8),e(window).on("resize"+_+v._marker,v._resizeHandler),r.visible&&(v.trigger(F),v.trigger(z)),l.notify(v)},_buttonEnter:function(t){e(t.currentTarget).addClass(D)},_buttonLeave:function(t){e(t.currentTarget).removeClass(D)},_focus:function(){this.wrapper.addClass(A)},_blur:function(){this.wrapper.removeClass(A)},_dimensions:function(){var e,t,n=this.wrapper,r=this.options,o=r.width,a=r.height,s=r.maxHeight,l=["minWidth","minHeight","maxWidth","maxHeight"];for(this.title(r.title),e=0;l.length>e;e++)t=r[l[e]],t&&1/0!=t&&n.css(l[e],t);s&&1/0!=s&&this.element.css("maxHeight",s),o&&n.width((""+o).indexOf("%")>0?o:i(o,r.minWidth,r.maxWidth)),a&&n.height((""+a).indexOf("%")>0?a:i(a,r.minHeight,r.maxHeight)),r.visible||n.hide()},_position:function(){var e=this.wrapper,t=this.options.position;0===t.top&&(t.top=""+t.top),0===t.left&&(t.left=""+t.left),e.css({top:t.top||"",left:t.left||""})},_animations:function(){var e=this.options;e.animation===!1&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})},_resize:function(){l.resize(this.element.children())},_resizable:function(){var t=this.options.resizable,n=this.wrapper;this.resizing&&(n.off("dblclick"+_).children(x).remove(),this.resizing.destroy(),this.resizing=null),t&&(n.on("dblclick"+_,b,p(function(t){e(t.target).closest(".k-window-action").length||this.toggleMaximization()},this)),g("n e s w se sw ne nw".split(" "),function(e,t){n.append(J.resizeHandle(t))}),this.resizing=new a(this)),n=null},_draggable:function(){var e=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null),e&&(this.dragging=new s(this,e.dragHandle||b))},_actions:function(){var t=this.options.actions,n=this.wrapper.children(b),i=n.find(".k-window-actions");t=e.map(t,function(e){return{name:e}}),i.html(l.render(J.action,t))},setOptions:function(e){c.fn.setOptions.call(this,e),this._animations(),this._dimensions(),this._position(),this._resizable(),this._draggable(),this._actions()},events:[F,z,R,B,H,L,N,O,V,U],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:1/0,maxHeight:1/0,pinned:!1,position:{},content:null,visible:null,height:null,width:null,appendTo:"body"},_closable:function(){return e.inArray("close",e.map(this.options.actions,function(e){return e.toLowerCase()}))>-1},_keydown:function(e){var t,n,r,o,a,s,c=this,d=c.options,u=l.keys,h=e.keyCode,p=c.wrapper,f=10,g=c.options.isMaximized;e.target!=e.currentTarget||c._closing||(h==u.ESC&&c._closable()&&c._close(!1),!d.draggable||e.ctrlKey||g||(t=l.getOffset(p),h==u.UP?n=p.css("top",t.top-f):h==u.DOWN?n=p.css("top",t.top+f):h==u.LEFT?n=p.css("left",t.left-f):h==u.RIGHT&&(n=p.css("left",t.left+f))),d.resizable&&e.ctrlKey&&!g&&(h==u.UP?(n=!0,o=p.height()-f):h==u.DOWN&&(n=!0,o=p.height()+f),h==u.LEFT?(n=!0,r=p.width()-f):h==u.RIGHT&&(n=!0,r=p.width()+f),n&&(a=i(r,d.minWidth,d.maxWidth),s=i(o,d.minHeight,d.maxHeight),isNaN(a)||(p.width(a),c.options.width=a+"px"),isNaN(s)||(p.height(s),c.options.height=s+"px"),c.resize())),n&&e.preventDefault())},_overlay:function(t){var n=this.appendTo.children(C),i=this.wrapper;return n.length||(n=e("<div class='k-overlay' />")),n.insertBefore(i[0]).toggle(t).css(j,parseInt(i.css(j),10)-1),n},_actionForIcon:function(e){var t=/\bk-i-\w+\b/.exec(e[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(n){var i,r;if(!this._closing)return i=e(n.target).closest(".k-window-action").find(".k-icon"),r=this._actionForIcon(i),r?(n.preventDefault(),this[r](),!1):t},_modals:function(){var t=this,n=e(w).filter(function(){var n=e(this),i=t._object(n),r=i&&i.options;return r&&r.modal&&r.visible&&n.is(I)}).sort(function(t,n){return+e(t).css("zIndex")-+e(n).css("zIndex")});return t=null,n},_object:function(e){var t=e.children(k);return t.data("kendoWindow")||t.data("kendo"+this.options.name)},center:function(){var t,n,i=this,r=i.options.position,o=i.wrapper,a=e(window),s=0,l=0;return i.options.isMaximized?i:(i.options.pinned||(s=a.scrollTop(),l=a.scrollLeft()),n=l+Math.max(0,(a.width()-o.width())/2),t=s+Math.max(0,(a.height()-o.height()-parseInt(o.css("paddingTop"),10))/2),o.css({left:n,top:t}),r.top=t,r.left=n,i)},title:function(e){var t,n=this,i=n.wrapper,r=n.options,o=i.children(b),a=o.children(y);return arguments.length?(e===!1?(i.addClass("k-window-titleless"),o.remove()):(o.length?a.html(e):(i.prepend(J.titlebar(r)),n._actions(),o=i.children(b)),t=o.outerHeight(),i.css("padding-top",t),o.css("margin-top",-t)),n.options.title=e,n):a.text()},content:function(e,t){var i=this.wrapper.children(k),r=i.children(".km-scroll-container");return i=r[0]?r:i,n(e)?(this.angular("cleanup",function(){return{elements:i.children()}}),l.destroy(this.element.children()),i.empty().html(e),this.angular("compile",function(){var e,n=[];for(e=i.length;--e>=0;)n.push({dataItem:t});return{elements:i.children(),data:n}}),this):i.html()},open:function(){var t,n,i=this,r=i.wrapper,o=i.options,a=o.animation.open,s=r.children(k);return i.trigger(F)||(i._closing&&r.kendoStop(!0,!0),i._closing=!1,i.toFront(),o.autoFocus&&i.element.focus(),o.visible=!0,o.modal&&(t=i._overlay(!1),t.kendoStop(!0,!0),a.duration&&l.effects.Fade?(n=l.fx(t).fadeIn(),n.duration(a.duration||0),n.endValue(.5),n.play()):t.css("opacity",.5),t.show()),r.is(I)||(s.css(W,P),r.show().kendoStop().kendoAnimate({effects:a.effects,duration:a.duration,complete:p(this._activate,this)}))),o.isMaximized&&(i._documentScrollTop=e(document).scrollTop(),e("html, body").css(W,P)),i},_activate:function(){this.options.autoFocus&&this.element.focus(),this.trigger(z),this.wrapper.children(k).css(W,"")},_removeOverlay:function(n){var i,r=this._modals(),o=this.options,a=o.modal&&!r.length,s=o.modal?this._overlay(!0):e(t),c=o.animation.close;a?!n&&c.duration&&l.effects.Fade?(i=l.fx(s).fadeOut(),i.duration(c.duration||0),i.startValue(.5),i.play()):this._overlay(!1).remove():r.length&&this._object(r.last())._overlay(!0)},_close:function(t){var n=this,i=n.wrapper,r=n.options,o=r.animation.open,a=r.animation.close;if(i.is(I)&&!n.trigger(B,{userTriggered:!t})){if(n._closing)return;n._closing=!0,r.visible=!1,e(w).each(function(t,n){var r=e(n).children(k);n!=i&&r.find("> ."+S).length>0&&r.children(C).remove()}),this._removeOverlay(),i.kendoStop().kendoAnimate({effects:a.effects||o.effects,reverse:a.reverse===!0,duration:a.duration,complete:p(this._deactivate,this)})}n.options.isMaximized&&(e("html, body").css(W,""),n._documentScrollTop&&n._documentScrollTop>0&&e(document).scrollTop(n._documentScrollTop))},_deactivate:function(){this.wrapper.hide().css("opacity",""),this.trigger(R);var e=this._object(this._modals().last());e&&e.toFront()},close:function(){return this._close(!0),this},_actionable:function(t){return e(t).is(Q+","+Q+" .k-icon,:input,a")},_shouldFocus:function(t){var n=h(),i=this.element;return!(!this.options.autoFocus||e(n).is(i)||this._actionable(t)||i.find(n).length&&i.find(t).length)},toFront:function(t){var n,i,r=this,o=r.wrapper,a=o[0],s=+o.css(j),l=s,c=t&&t.target||null;return e(w).each(function(t,n){var i=e(n),r=i.css(j),o=i.children(k);isNaN(r)||(s=Math.max(+r,s)),n!=a&&o.find("> ."+S).length>0&&o.append(J.overlay)}),(!o[0].style.zIndex||s>l)&&o.css(j,s+2),r.element.find("> .k-overlay").remove(),r._shouldFocus(c)&&(r.element.focus(),n=e(window).scrollTop(),i=parseInt(o.position().top,10),i>0&&n>i&&(n>0?e(window).scrollTop(i):o.css("top",n))),o=null,r},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,n=t.options,i=n.minHeight,r=t.restoreOptions;return n.isMaximized||n.isMinimized?(i&&1/0!=i&&t.wrapper.css("min-height",i),t.wrapper.css({position:n.pinned?"fixed":"absolute",left:r.left,top:r.top,width:r.width,height:r.height}).removeClass(E).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(q).parent().show().end().end().find(Y).parent().show(),t.options.width=r.width,t.options.height=r.height,e("html, body").css(W,""),this._documentScrollTop&&this._documentScrollTop>0&&e(document).scrollTop(this._documentScrollTop),n.isMaximized=n.isMinimized=!1,t.resize(),t):t},maximize:r("maximize",function(){var t=this,n=t.wrapper,i=n.position();f(t.restoreOptions,{left:i.left,top:i.top}),n.css({left:0,top:0,position:"fixed"}).addClass(E),this._documentScrollTop=e(document).scrollTop(),e("html, body").css(W,P),t.options.isMaximized=!0,t._onDocumentResize()}),minimize:r("minimize",function(){var e=this;e.wrapper.css({height:"",minHeight:""}),e.element.hide(),e.options.isMinimized=!0}),pin:function(t){var n=this,i=e(window),r=n.wrapper,o=parseInt(r.css("top"),10),a=parseInt(r.css("left"),10);(t||!n.options.pinned&&!n.options.isMaximized)&&(r.css({position:"fixed",top:o-i.scrollTop(),left:a-i.scrollLeft()}),r.children(b).find(G).addClass("k-i-unpin").removeClass("k-i-pin"),n.options.pinned=!0)},unpin:function(){var t=this,n=e(window),i=t.wrapper,r=parseInt(i.css("top"),10),o=parseInt(i.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(i.css({position:"",top:r+n.scrollTop(),left:o+n.scrollLeft()}),i.children(b).find($).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t,n,i=this,r=i.wrapper,o=e(window);i.options.isMaximized&&(t=o.width(),n=o.height()-parseInt(r.css("padding-top"),10),r.css({width:t,height:n}),i.options.width=t,i.options.height=n,i.resize())},refresh:function(t){var i,r,o,a=this,s=a.options,l=e(a.element);return u(t)||(t={url:t}),t=f({},s.content,t),r=n(s.iframe)?s.iframe:t.iframe,o=t.url,o?(n(r)||(r=!X(o)),r?(i=l.find("."+S)[0],i?i.src=o||i.src:l.html(J.contentFrame(f({},s,{content:t}))),l.find("."+S).unbind("load"+_).on("load"+_,p(this._triggerRefresh,this))):a._ajaxRequest(t)):(t.template&&a.content(m(t.template)({})),a.trigger(H)),l.toggleClass("k-window-iframecontent",!!r),a},_triggerRefresh:function(){this.trigger(H)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout),this.wrapper.find(K).removeClass(T)
27
+ },_ajaxError:function(e,t){this.trigger(U,{status:t,xhr:e})},_ajaxSuccess:function(e){return function(t){var n=t;e&&(n=m(e)(t||{})),this.content(n,t),this.element.prop("scrollTop",0),this.trigger(H)}},_showLoading:function(){this.wrapper.find(K).addClass(T)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(p(this._showLoading,this),100),e.ajax(f({type:"GET",dataType:"html",cache:!1,error:p(this._ajaxError,this),complete:p(this._ajaxComplete,this),success:p(this._ajaxSuccess(t.template),this)},t))},destroy:function(){var n=this;n.resizing&&n.resizing.destroy(),n.dragging&&n.dragging.destroy(),n.wrapper.off(_).children(k).off(_).end().find(".k-resize-handle,.k-window-titlebar").off(_),e(window).off("resize"+_+n._marker),clearTimeout(n._loadingIconTimeout),c.fn.destroy.call(n),n.unbind(t),l.destroy(n.wrapper),n._removeOverlay(!0),n.wrapper.empty().remove(),n.wrapper=n.appendTo=n.element=e()},_createWindow:function(){var t,n,i=this.element,r=this.options,o=l.support.isRtl(i);r.scrollable===!1&&i.attr("style","overflow:hidden;"),n=e(J.wrapper(r)),t=i.find("iframe:not(.k-content)").map(function(){var e=this.getAttribute("src");return this.src="",e}),n.toggleClass("k-rtl",o).appendTo(this.appendTo).append(i).find("iframe:not(.k-content)").each(function(e){this.src=t[e]}),n.find(".k-window-title").css(o?"left":"right",n.find(".k-window-actions").outerWidth()+10),i.css("visibility","").show(),i.find("[data-role=editor]").each(function(){var t=e(this).data("kendoEditor");t&&t.refresh()}),n=i=null}}),J={wrapper:m("<div class='k-widget k-window' />"),action:m("<a role='button' href='\\#' class='k-window-action k-link'><span role='presentation' class='k-icon k-i-#= name.toLowerCase() #'>#= name #</span></a>"),titlebar:m("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #</span><div class='k-window-actions' /></div>"),overlay:"<div class='k-overlay' />",contentFrame:m("<iframe frameborder='0' title='#= title #' class='"+S+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),resizeHandle:m("<div class='k-resize-handle k-resize-#= data #'></div>")};a.prototype={addOverlay:function(){this.owner.wrapper.append(J.overlay)},removeOverlay:function(){this.owner.wrapper.find(C).remove()},dragstart:function(t){var n=this,i=n.owner,r=i.wrapper;n.elementPadding=parseInt(r.css("padding-top"),10),n.initialPosition=l.getOffset(r,"position"),n.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-",""),n.initialSize={width:r.width(),height:r.height()},n.containerOffset=l.getOffset(i.appendTo,"position"),r.children(x).not(t.currentTarget).hide(),e(v).css(M,t.currentTarget.css(M))},drag:function(e){var t,n,r,o,a=this,s=a.owner,l=s.wrapper,c=s.options,d=a.resizeDirection,u=a.containerOffset,h=a.initialPosition,p=a.initialSize,f=Math.max(e.x.location,u.left),g=Math.max(e.y.location,u.top);d.indexOf("e")>=0?(t=f-h.left,l.width(i(t,c.minWidth,c.maxWidth))):d.indexOf("w")>=0&&(o=h.left+p.width,t=i(o-f,c.minWidth,c.maxWidth),l.css({left:o-t-u.left,width:t})),d.indexOf("s")>=0?(n=g-h.top-a.elementPadding,l.height(i(n,c.minHeight,c.maxHeight))):d.indexOf("n")>=0&&(r=h.top+p.height,n=i(r-g,c.minHeight,c.maxHeight),l.css({top:r-n-u.top,height:n})),t&&(s.options.width=t+"px"),n&&(s.options.height=n+"px"),s.resize()},dragend:function(t){var n=this,i=n.owner,r=i.wrapper;return r.children(x).not(t.currentTarget).show(),e(v).css(M,""),i.touchScroller&&i.touchScroller.reset(),27==t.keyCode&&r.css(n.initialPosition).css(n.initialSize),i.trigger(N),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},s.prototype={dragstart:function(t){var n=this.owner,i=n.element,r=i.find(".k-window-actions"),o=l.getOffset(n.appendTo);n.trigger(O),n.initialWindowPosition=l.getOffset(n.wrapper,"position"),n.startPosition={left:t.x.client-n.initialWindowPosition.left,top:t.y.client-n.initialWindowPosition.top},n.minLeftPosition=r.length>0?r.outerWidth()+parseInt(r.css("right"),10)-i.outerWidth():20-i.outerWidth(),n.minLeftPosition-=o.left,n.minTopPosition=-o.top,n.wrapper.append(J.overlay).children(x).hide(),e(v).css(M,t.currentTarget.css(M))},drag:function(t){var n=this.owner,i=n.options.position,r=Math.max(t.y.client-n.startPosition.top,n.minTopPosition),o=Math.max(t.x.client-n.startPosition.left,n.minLeftPosition),a={left:o,top:r};e(n.wrapper).css(a),i.top=r,i.left=o},_finishDrag:function(){var t=this.owner;t.wrapper.children(x).toggle(!t.options.isMinimized).end().find(C).remove(),e(v).css(M,"")},dragcancel:function(e){this._finishDrag(),e.currentTarget.closest(w).css(this.owner.initialWindowPosition)},dragend:function(){return this._finishDrag(),this.owner.trigger(V),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},l.ui.plugin(Z)}(window.kendo.jQuery),function(e,t){function n(e){var t,n,i=e.find(k("popover")),r=s.roles;for(t=0,n=i.length;n>t;t++)o.initWidget(i[t],{},r)}function i(e){o.triggeredByInput(e)||e.preventDefault()}function r(t){t.each(function(){o.initWidget(e(this),{},s.roles)})}var o=window.kendo,a=o.mobile,s=a.ui,l=o.attr,c=s.Widget,d=o.ViewClone,u="init",h='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',p="beforeShow",f="show",g="afterShow",m="beforeHide",v="transitionEnd",_="transitionStart",w="hide",y="destroy",b=o.attrValue,k=o.roleSelector,x=o.directiveSelector,C=o.compileMobileDirective,S=c.extend({init:function(t,n){c.fn.init.call(this,t,n),this.params={},e.extend(this,n),this.transition=this.transition||this.defaultTransition,this._id(),this.options.$angular?this._overlay():(this._layout(),this._overlay(),this._scroller(),this._model())},events:[u,p,f,g,m,w,y,_,v],options:{name:"View",title:"",layout:null,getLayout:e.noop,reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,modelScope:window,scroller:{},initWidgets:!0},enable:function(e){t===e&&(e=!0),e?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this),this.trigger(y),c.fn.destroy.call(this),this.scroller&&this.scroller.destroy(),this.options.$angular&&this.element.scope().$destroy(),o.destroy(this.element)},purge:function(){this.destroy(),this.element.remove()},triggerBeforeShow:function(){return this.trigger(p,{view:this})?!1:!0},showStart:function(){var e=this.element;e.css("display",""),this.inited?this._invokeNgController():(this.inited=!0,this.trigger(u,{view:this})),this.layout&&this.layout.attach(this),this._padIfNativeScrolling(),this.trigger(f,{view:this}),o.resize(e)},showEnd:function(){this.trigger(g,{view:this}),this._padIfNativeScrolling()},hideStart:function(){this.trigger(m,{view:this})},hideEnd:function(){var e=this;e.element.hide(),e.trigger(w,{view:e}),e.layout&&e.layout.trigger(w,{view:e,layout:e.layout})},beforeTransition:function(e){this.trigger(_,{type:e})},afterTransition:function(e){this.trigger(v,{type:e})},_padIfNativeScrolling:function(){if(a.appLevelNativeScrolling()){var e=o.support.mobileOS&&o.support.mobileOS.android,t=a.application.os.android||a.application.skin().indexOf("android")>-1,n=e||t?"footer":"header",i=e||t?"header":"footer";this.content.css({paddingTop:this[n].height(),paddingBottom:this[i].height()})}},contentElement:function(){var e=this;return e.options.stretch?e.content:e.scrollerContent},clone:function(){return new d(this)},_scroller:function(){var t=this;a.appLevelNativeScrolling()||(t.options.stretch?t.content.addClass("km-stretched-view"):(t.content.kendoMobileScroller(e.extend(t.options.scroller,{zoom:t.options.zoom,useNative:t.options.useNativeScrolling})),t.scroller=t.content.data("kendoMobileScroller"),t.scrollerContent=t.scroller.scrollElement),o.support.kineticScrollNeeded&&(e(t.element).on("touchmove",".km-header",i),t.options.useNativeScrolling||e(t.element).on("touchmove",".km-content",i)))},_model:function(){var e=this,t=e.element,i=e.options.model;"string"==typeof i&&(i=o.getter(i)(e.options.modelScope)),e.model=i,n(t),e.element.css("display",""),e.options.initWidgets&&(i?o.bind(t,i,s,o.ui,o.dataviz.ui):a.init(t.children())),e.element.css("display","none")},_id:function(){var e=this.element,t=e.attr("id")||"";this.id=b(e,"url")||"#"+t,"#"==this.id&&(this.id=o.guid(),e.attr("id",this.id))},_layout:function(){var e=k("content"),t=this.element;t.addClass("km-view"),this.header=t.children(k("header")).addClass("km-header"),this.footer=t.children(k("footer")).addClass("km-footer"),t.children(e)[0]||t.wrapInner("<div "+l("role")+'="content"></div>'),this.content=t.children(k("content")).addClass("km-content"),this.element.prepend(this.header).append(this.footer),this.layout=this.options.getLayout(this.layout),this.layout&&this.layout.setup(this)},_overlay:function(){this.overlay=e(h).appendTo(this.element)},_invokeNgController:function(){var e,t,n=this.element;this.options.$angular&&(e=n.controller(),t=n.scope(),e&&t.$apply(function(){n.injector().invoke(e.constructor,null,{$scope:t})}))}}),T=c.extend({init:function(e,t){c.fn.init.call(this,e,t),e=this.element,this.header=e.children(this._locate("header")).addClass("km-header"),this.footer=e.children(this._locate("footer")).addClass("km-footer"),this.elements=this.header.add(this.footer),n(e),this.options.$angular||o.mobile.init(this.element.children()),this.element.detach(),this.trigger(u,{layout:this})},_locate:function(e){return this.options.$angular?x(e):k(e)},options:{name:"Layout",id:null,platform:null},events:[u,f,w],setup:function(e){e.header[0]||(e.header=this.header),e.footer[0]||(e.footer=this.footer)},detach:function(e){var t=this;e.header===t.header&&t.header[0]&&e.element.prepend(t.header.detach()[0].cloneNode(!0)),e.footer===t.footer&&t.footer.length&&e.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(e){var t=this,n=t.currentView;n&&t.detach(n),e.header===t.header&&(t.header.detach(),e.element.children(k("header")).remove(),e.element.prepend(t.header)),e.footer===t.footer&&(t.footer.detach(),e.element.children(k("footer")).remove(),e.element.append(t.footer)),t.trigger(f,{layout:t,view:e}),t.currentView=e}}),D=o.Observable,A=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,E="loadStart",I="loadComplete",P="showStart",M="sameViewRequested",F="viewShow",z="viewTypeDetermined",R="after",B=D.extend({init:function(t){var n,i,a,s,l=this;if(D.fn.init.call(l),e.extend(l,t),l.sandbox=e("<div />"),a=l.container,n=l._hideViews(a),l.rootView=n.first(),!l.rootView[0]&&t.rootNeeded)throw i=a[0]==o.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.',Error(i);l.layouts={},l.viewContainer=new o.ViewContainer(l.container),l.viewContainer.bind("accepted",function(e){e.view.params=l.params}),l.viewContainer.bind("complete",function(e){l.trigger(F,{view:e.view})}),l.viewContainer.bind(R,function(){l.trigger(R)}),this.getLayoutProxy=e.proxy(this,"_getLayout"),l._setupLayouts(a),s=a.children(l._locate("modalview drawer")),l.$angular?s.each(function(t,n){C(e(n),function(){})}):r(s),this.bind(this.events,t)},events:[P,R,F,E,I,M,z],destroy:function(){o.destroy(this.container);for(var e in this.layouts)this.layouts[e].destroy()},view:function(){return this.viewContainer.view},showView:function(e,t,n){if(e=e.replace(RegExp("^"+this.remoteViewURLPrefix),""),""===e&&this.remoteViewURLPrefix&&(e="/"),e===this.url)return this.trigger(M),!1;this.trigger(P);var i=this,r=function(n){return i.viewContainer.show(n,t,e)},a=i._findViewElement(e),s=o.widgetInstance(a);return i.url=e,i.params=n,s&&s.reload&&(s.purge(),a=[]),this.trigger(z,{remote:0===a.length,url:e}),a[0]?(s||(s=i._createView(a)),r(s)):(this.serverNavigation?location.href=e:i._loadView(e,r),!0)},append:function(e,t){var n,i,o,a=this.sandbox,s=(t||"").split("?")[0],c=this.container;return A.test(e)&&(e=RegExp.$1),a[0].innerHTML=e,c.append(a.children("script, style")),n=this._hideViews(a),o=n.first(),o.length||(n=o=a.wrapInner("<div data-role=view />").children()),s&&o.hide().attr(l("url"),s),this._setupLayouts(a),i=a.children(this._locate("modalview drawer")),c.append(a.children(this._locate("layout modalview drawer")).add(n)),r(i),this._createView(o)},_locate:function(e){return this.$angular?x(e):k(e)},_findViewElement:function(e){var t,n=e.split("?")[0];return n?(t=this.container.children("["+l("url")+"='"+n+"']"),t[0]||-1!==n.indexOf("/")||(t=this.container.children("#"===n.charAt(0)?n:"#"+n)),t):this.rootView},_createView:function(e){if(this.$angular){var t=this;return C(e,function(e){e.viewOptions={defaultTransition:t.transition,loader:t.loader,container:t.container,getLayout:t.getLayoutProxy}})}return o.initWidget(e,{defaultTransition:this.transition,loader:this.loader,container:this.container,getLayout:this.getLayoutProxy,modelScope:this.modelScope,reload:b(e,"reload")},s.roles)},_getLayout:function(e){return""===e?null:e?this.layouts[e]:this.layouts[this.layout]},_loadView:function(t,n){this._xhr&&this._xhr.abort(),this.trigger(E),this._xhr=e.get(o.absoluteURL(t,this.remoteViewURLPrefix),"html").always(e.proxy(this,"_xhrComplete",n,t))},_xhrComplete:function(e,t,n){var i=!0;"object"==typeof n&&(i=0===n.status&&n.responseText.length>0,n=n.responseText),this.trigger(I),i&&e(this.append(n,t))},_hideViews:function(e){return e.children(this._locate("view splitview")).hide()},_setupLayouts:function(t){var n,i=this;t.children(i._locate("layout")).each(function(){n=i.$angular?C(e(this)):o.initWidget(e(this),{},s.roles);var t=n.options.platform;t&&t!==a.application.os.name?n.destroy():i.layouts[n.options.id]=n})}});o.mobile.ViewEngine=B,s.plugin(S),s.plugin(T)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.mobile.ui,i=n.Widget,r=e.map(t.eventMap,function(e){return e}).join(" ").split(" "),o=i.extend({init:function(t,n){var r=this,o=e('<div class="km-loader"><span class="km-loading km-spin"></span><span class="km-loading-left"></span><span class="km-loading-right"></span></div>');i.fn.init.call(r,o,n),r.container=t,r.captureEvents=!1,r._attachCapture(),o.append(r.options.loading).hide().appendTo(t)},options:{name:"Loader",loading:"<h1>Loading...</h1>",timeout:100},show:function(){var e=this;clearTimeout(e._loading),e.options.loading!==!1&&(e.captureEvents=!0,e._loading=setTimeout(function(){e.element.show()},e.options.timeout))},hide:function(){this.captureEvents=!1,clearTimeout(this._loading),this.element.hide()},changeMessage:function(e){this.options.loading=e,this.element.find(">h1").html(e)},transition:function(){this.captureEvents=!0,this.container.css("pointer-events","none")},transitionDone:function(){this.captureEvents=!1,this.container.css("pointer-events","")},_attachCapture:function(){function e(e){n.captureEvents&&e.preventDefault()}var t,n=this;for(n.captureEvents=!1,t=0;r.length>t;t++)n.container[0].addEventListener(r[t],e,!0)}});n.plugin(o)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile,r=n.roleSelector,o=i.ui,a=o.Widget,s=i.ViewEngine,l=o.View,c=i.ui.Loader,d="external",u="href",h="#!",p="navigate",f="viewShow",g="sameViewRequested",m=n.support.mobileOS,v=m.ios&&!m.appMode&&m.flatVersion>=700,_=/popover|actionsheet|modalview|drawer/,w="#:back",y=n.attrValue,b="button backbutton detailbutton listview-link",k="tab",x=a.extend({init:function(e,t){var i=this;a.fn.init.call(i,e,t),t=i.options,e=i.element,e.addClass("km-pane"),i.options.collapsible&&e.addClass("km-collapsible-pane"),this.history=[],this.historyCallback=function(e,t,n){var r=i.transition;return i.transition=null,v&&n&&(r="none"),i.viewEngine.showView(e,r,t)},this._historyNavigate=function(e){if(e===w){if(1===i.history.length)return;i.history.pop(),e=i.history[i.history.length-1]}else i.history.push(e);i.historyCallback(e,n.parseQueryStringParams(e))},this._historyReplace=function(e){var t=n.parseQueryStringParams(e);i.history[i.history.length-1]=e,i.historyCallback(e,t)},i.loader=new c(e,{loading:i.options.loading}),i.viewEngine=new s({container:e,transition:t.transition,modelScope:t.modelScope,rootNeeded:!t.initial,serverNavigation:t.serverNavigation,remoteViewURLPrefix:t.root||"",layout:t.layout,$angular:t.$angular,loader:i.loader,showStart:function(){i.loader.transition(),i.closeActiveDialogs()},after:function(){i.loader.transitionDone()},viewShow:function(e){i.trigger(f,e)},loadStart:function(){i.loader.show()},loadComplete:function(){i.loader.hide()},sameViewRequested:function(){i.trigger(g)},viewTypeDetermined:function(e){e.remote&&i.options.serverNavigation||i.trigger(p,{url:e.url})}}),this._setPortraitWidth(),n.onResize(function(){i._setPortraitWidth()}),i._setupAppLinks()},closeActiveDialogs:function(){var t=this.element.find(r("actionsheet popover modalview")).filter(":visible");t.each(function(){n.widgetInstance(e(this),o).close()})},navigateToInitial:function(){var e=this.options.initial;e&&this.navigate(e)},options:{name:"Pane",portraitWidth:"",transition:"",layout:"",collapsible:!1,initial:null,modelScope:window,loading:"<h1>Loading...</h1>"},events:[p,f,g],append:function(e){return this.viewEngine.append(e)},destroy:function(){a.fn.destroy.call(this),this.viewEngine.destroy(),this.userEvents.destroy()},navigate:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyNavigate(e)},replace:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyReplace(e)},bindToRouter:function(e){var t=this,i=this.history,r=this.viewEngine;e.bind("init",function(t){var o,a=t.url,s=e.pushState?a:"/";r.rootView.attr(n.attr("url"),s),o=i.length,"/"===a&&o&&(e.navigate(i[o-1],!0),t.preventDefault())}),e.bind("routeMissing",function(e){t.historyCallback(e.url,e.params,e.backButtonPressed)||e.preventDefault()}),e.bind("same",function(){t.trigger(g)}),t._historyNavigate=function(t){e.navigate(t)},t._historyReplace=function(t){e.replace(t)}},hideLoading:function(){this.loader.hide()},showLoading:function(){this.loader.show()},changeLoadingMessage:function(e){this.loader.changeMessage(e)},view:function(){return this.viewEngine.view()},_setPortraitWidth:function(){var e,t=this.options.portraitWidth;t&&(e=n.mobile.application.element.is(".km-vertical")?t:"auto",this.element.css("width",e))},_setupAppLinks:function(){var e=this;this.element.handler(this).on("down",r(k),"_mouseup").on("click",r(k+" "+b),"_appLinkClick"),this.userEvents=new n.UserEvents(this.element,{filter:r(b),tap:function(t){t.event.currentTarget=t.touch.currentTarget,e._mouseup(t.event)}})},_appLinkClick:function(t){var n=e(t.currentTarget).attr("href"),i=n&&"#"!==n[0]&&this.options.serverNavigation;i||y(e(t.currentTarget),"rel")==d||t.preventDefault()},_mouseup:function(r){if(!(r.which>1||r.isDefaultPrevented())){var a=this,s=e(r.currentTarget),l=y(s,"transition"),c=y(s,"rel")||"",p=y(s,"target"),f=s.attr(u),g=v&&0===s[0].offsetHeight,m=f&&"#"!==f[0]&&this.options.serverNavigation;g||m||c===d||t===f||f===h||(s.attr(u,h),setTimeout(function(){s.attr(u,f)}),c.match(_)?(n.widgetInstance(e(f),o).openFor(s),("actionsheet"===c||"drawer"===c)&&r.stopPropagation()):("_top"===p?a=i.application.pane:p&&(a=e("#"+p).data("kendoMobilePane")),a.navigate(f,l)),r.preventDefault())}}});x.wrap=function(e){e.is(r("view"))||(e=e.wrap("<div data-"+n.ns+'role="view" data-stretch="true"></div>').parent());var t=e.wrap('<div class="km-pane-wrapper"><div></div></div>').parent(),i=new x(t);return i.navigate(""),i},o.plugin(x)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.mobile,i=n.ui,r="hide",o="open",a="close",s='<div class="km-popup-wrapper" />',l='<div class="km-popup-arrow" />',c='<div class="km-popup-overlay" />',d="km-up km-down km-left km-right",u=i.Widget,h={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"}},p={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},f={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},g={up:"down",down:"up",left:"right",right:"left"},m=u.extend({init:function(n,i){var o,a,d=this,g=n.closest(".km-modalview-wrapper"),m=n.closest(".km-root").children(".km-pane").first(),v=g[0]?g:m;i.viewport?m=i.viewport:m[0]||(m=window),i.container?v=i.container:v[0]||(v=document.body),o={viewport:m,copyAnchorStyles:!1,autosize:!0,open:function(){d.overlay.show()},activate:e.proxy(d._activate,d),deactivate:function(){d.overlay.hide(),d._apiCall||d.trigger(r),d._apiCall=!1}},u.fn.init.call(d,n,i),n=d.element,i=d.options,n.wrap(s).addClass("km-popup").show(),a=d.options.direction.match(/left|right/)?"horizontal":"vertical",d.dimensions=f[a],d.wrapper=n.parent().css({width:i.width,height:i.height}).addClass("km-popup-wrapper km-"+i.direction).hide(),d.arrow=e(l).prependTo(d.wrapper).hide(),d.overlay=e(c).appendTo(v).hide(),o.appendTo=d.overlay,i.className&&d.overlay.addClass(i.className),d.popup=new t.ui.Popup(d.wrapper,e.extend(!0,o,p,h[i.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[r],show:function(t){this.popup.options.anchor=e(t),this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){u.fn.destroy.call(this),this.popup.destroy(),this.overlay.remove()},target:function(){return this.popup.options.anchor},_activate:function(){var t=this,n=t.options.direction,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=e(o.element).offset(),c=o.flipped?g[n]:n,u=2*t.arrow[i.size](),h=t.element[i.size]()-t.arrow[i.size](),p=e(a)[i.size](),f=s[r]-l[r]+p/2;u>f&&(f=u),f>h&&(f=h),t.wrapper.removeClass(d).addClass("km-"+c),t.arrow.css(r,f).show()}}),v=u.extend({init:function(n,r){var o,s=this;s.initialOpen=!1,u.fn.init.call(s,n,r),o=e.extend({className:"km-popover-root",hide:function(){s.trigger(a)}},this.options.popup),s.popup=new m(s.element,o),s.popup.overlay.on("move",function(e){e.target==s.popup.overlay[0]&&e.preventDefault()}),s.pane=new i.Pane(s.element,e.extend(this.options.pane,{$angular:this.options.$angular})),s.pane.navigateToInitial(),t.notify(s,i)},options:{name:"PopOver",popup:{},pane:{}},events:[o,a],open:function(e){this.popup.show(e),this.initialOpen?this.pane.view()._invokeNgController():(this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},openFor:function(e){this.open(e),this.trigger(o,{target:this.popup.target()})},close:function(){this.popup.hide()},destroy:function(){u.fn.destroy.call(this),this.pane.destroy(),this.popup.destroy(),t.destroy(this.element)}});i.plugin(m),i.plugin(v)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile.ui,r=n.ui.Popup,o='<div class="km-shim"/>',a="hide",s=i.Widget,l=s.extend({init:function(t,i){var l=this,c=n.mobile.application,d=n.support.mobileOS,u=c?c.os.name:d?d.name:"ios",h="ios"===u||"wp"===u||(c?c.os.skin:!1),p="blackberry"===u,f=i.align||(h?"bottom center":p?"center right":"center center"),g=i.position||(h?"bottom center":p?"center right":"center center"),m=i.effect||(h?"slideIn:up":p?"slideIn:left":"fade:in"),v=e(o).handler(l).hide();s.fn.init.call(l,t,i),l.shim=v,t=l.element,i=l.options,i.className&&l.shim.addClass(i.className),i.modal||l.shim.on("up","_hide"),(c?c.element:e(document.body)).append(v),l.popup=new r(l.element,{anchor:v,modal:!0,appendTo:v,origin:f,position:g,animation:{open:{effects:m,duration:i.duration},close:{duration:i.duration}},close:function(e){var t=!1;l._apiCall||(t=l.trigger(a)),t&&e.preventDefault(),l._apiCall=!1},deactivate:function(){v.hide()},open:function(){v.show()}}),n.notify(l)},events:[a],options:{name:"Shim",modal:!1,align:t,position:t,effect:t,duration:200},show:function(){this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){s.fn.destroy.call(this),this.shim.kendoDestroy(),this.popup.destroy(),this.shim.remove()},_hide:function(t){t&&e.contains(this.shim.children().children(".k-popup")[0],t.target)||this.popup.close()}});i.plugin(l)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.support,i=t.mobile.ui,r=i.Shim,o=i.Popup,a=i.Widget,s="open",l="close",c="command",d="li>a",u="actionsheetContext",h='<div class="km-actionsheet-wrapper" />',p=t.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),f=a.extend({init:function(s,l){var c,u,f,g=this,m=n.mobileOS;a.fn.init.call(g,s,l),l=g.options,f=l.type,s=g.element,u="auto"===f?m&&m.tablet:"tablet"===f,c=u?o:r,l.cancelTemplate&&(p=t.template(l.cancelTemplate)),s.addClass("km-actionsheet").append(p({cancel:g.options.cancel})).wrap(h).on("up",d,"_click").on("click",d,t.preventDefault),g.view().bind("destroy",function(){g.destroy()}),g.wrapper=s.parent().addClass(f?" km-actionsheet-"+f:""),g.shim=new c(g.wrapper,e.extend({modal:m.ios&&7>m.majorVersion,className:"km-actionsheet-root"},g.options.popup)),g._closeProxy=e.proxy(g,"_close"),g.shim.bind("hide",g._closeProxy),u&&t.onResize(g._closeProxy),t.notify(g,i)},events:[s,l,c],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,n){var i=this;i.target=e(t),i.context=n,i.shim.show(t)},close:function(){this.context=this.target=null,this.shim.hide()},openFor:function(e){var t=this,n=e.data(u);t.open(e,n),t.trigger(s,{target:e,context:n})},destroy:function(){a.fn.destroy.call(this),t.unbindResize(this._closeProxy),this.shim.destroy()},_click:function(n){var i,r,o,a;n.isDefaultPrevented()||(i=e(n.currentTarget),r=i.data("action"),r&&(o={target:this.target,context:this.context},a=this.options.$angular,a?this.element.injector().get("$parse")(r)(a[0])(o):t.getter(r)(window)(o)),this.trigger(c,{target:this.target,context:this.context,currentTarget:i}),n.preventDefault(),this._close())},_close:function(e){this.trigger(l)?e.preventDefault():this.close()}});i.plugin(f)}(window.kendo.jQuery),function(e,t){function n(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function i(e){var t,n=" ";if(e){if(typeof e===cn)return e;for(t in e)n+=t+'="'+e[t]+'"'}return n}function r(t,n){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",n)}function o(e){var t,n,i={},r={};if(!At(e))for(xt(e)||(e=[e]),t=0,n=e.length;n>t;t++)i[e[t].aggregate]=0,r[e[t].field]=i;return r}function a(t,n,i,r,o){var a,s=n;for(n=e(),o=o||1,a=0;o>a;a++)n=n.add(t.eq(s+a));"number"==typeof i?n[r?"insertBefore":"insertAfter"](t.eq(i)):n.appendTo(i)}function s(t,n,i){return e(t).add(n).find(i)}function l(e,t,n){var i,r,o,a;for(n=xt(n)?n:[n],i=0,r=n.length;r>i;i++)o=n[i],wt(o)&&o.click&&(a=o.name||o.text,t.on(on+Lt,"a.k-grid-"+(a||"").replace(/\s/g,""),{commandName:a},Tt(o.click,e)))}function c(e,t,n){return bt(e,function(e){e=typeof e===cn?{field:e}:e;var i;return(!p(e)||n)&&(e.attributes=U(e.attributes),e.footerAttributes=U(e.footerAttributes),e.headerAttributes=U(e.headerAttributes),i=!0),e.columns&&(e.columns=c(e.columns,t,i)),yt({encoded:t,hidden:i},e)})}function d(e,t){var n=[];return u(e,t,n),n[n.length-1]}function u(e,t,n){var i,r;for(n=n||[],i=0;t.length>i;i++){if(e===t[i])return!0;if(t[i].columns){if(r=n.length,n.push(t[i]),u(e,t[i].columns,n))return!0;n.splice(r,n.length-r)}}return!1}function h(e,t){var n=t?W:U;e.hidden=!t,e.attributes=n(e.attributes),e.footerAttributes=n(e.footerAttributes),e.headerAttributes=n(e.headerAttributes)}function p(e){return f([e]).length>0}function f(e){return kt(e,function(e){var t=!e.hidden;return t&&e.columns&&(t=f(e.columns).length>0),t})}function g(t){return e(t).map(function(){return this.toArray()})}function m(e,t,n){var i=w(M(t)),r=w(F(t)),o=e.rowSpan;e.rowSpan=n?i>r?o-(i-r)||1:o+(r-i):i>r?o+(i-r):o-(r-i)||1}function v(t,n,i,r,o,a,s){var l,c,d=w(t),u=w([n]);d>u&&(l=Array(s+1).join('<th class="k-group-cell k-header">&nbsp;</th>'),c=a.children(":not(.k-filter-row)"),e(Array(d-u+1).join("<tr>"+l+"</tr>")).insertAfter(c.last())),E(a,d-u),y(i,r,o,a)}function _(e,t,n){var i,r,o,a,s;for(n=n||0,o=t,t=H(t),a=0,s=t.length;s>a;a++)i=b(t[a],o),r=e.find(">tr:not(.k-filter-row)").eq(i.row).find(".k-header:not(.k-group-cell,.k-hierarchy-cell)").eq(i.cell),r.attr(ut.attr("index"),n+a);return t.length}function w(e){var t,n,i=1,r=0;for(t=0;e.length>t;t++)e[t].columns&&(n=w(e[t].columns),n>r&&(r=n));return i+r}function y(t,n,i,r){var o,a,s=x(t[0],n),l=i.find(">tr:not(.k-filter-row):eq("+s.row+")>th.k-header"),c=e(),d=s.cell;for(o=0;t.length>o;o++)c=c.add(l.eq(d+o));for(r.find(">tr:not(.k-filter-row)").eq(s.row).append(c),a=[],o=0;t.length>o;o++)t[o].columns&&(a=a.concat(t[o].columns));a.length&&y(a,n,i,r)}function b(e,t,n,i){var r,o;for(n=n||0,i=i||{},i[n]=i[n]||0,o=0;t.length>o;o++){if(t[o]==e){r={cell:i[n],row:n};break}if(t[o].columns&&(r=b(e,t[o].columns,n+1,i)))break;i[n]++}return r}function k(e,t,n,i){var r,o,a;return t.columns?(t=t.columns,t[i?0:t.length-1]):(r=d(t,e),o=r?r.columns:e,a=Ct(t,o),0===a&&i?a++:a!=o.length-1||i?(a>0||0===a&&!i)&&(a+=i?-1:1):a--,t=o[Math.max(a,0)],t&&t!=n&&t.columns?k(e,t,n,i):null)}function x(e,t,n,i){var r,o;for(n=n||0,i=i||{},i[n]=i[n]||0,o=0;t.length>o;o++){if(t[o]==e){r={cell:i[n],row:n};break}if(t[o].columns&&(r=x(e,t[o].columns,n+1,i)))break;t[o].hidden||i[n]++}return r}function C(e){var t=S(M(e));return t.concat(S(F(e)))}function S(e){var t,n=[],i=[];for(t=0;e.length>t;t++)n.push(e[t]),e[t].columns&&(i=i.concat(e[t].columns));return i.length&&(n=n.concat(S(i))),n}function T(e){var t,n,i=0;for(n=0;e.length>n;n++)t=e[n],t.columns?i+=T(t.columns):t.hidden&&i++;return i}function D(e){var t,n,i,r=0;for(n=0,i=e.length;i>n;n++)t=e[n].style.width,t&&-1==t.indexOf("%")&&(r+=parseInt(t,10));return r}function A(e,t){var n,i,r=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(i=0;r.length>i;i++)n=r[i].rowSpan,n>1&&(r[i].rowSpan=n-t||1)}function E(e,t){var n,i=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;i.length>n;n++)i[n].rowSpan+=t}function I(t){var n,i=t.find("tr:not(.k-filter-row)"),r=i.filter(function(){return!e(this).children().length}).remove().length,o=i.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;o.length>n;n++)o[n].rowSpan>1&&(o[n].rowSpan-=r);return i.length-r}function P(e,t,n,i,r){var o,a,s,l=[];for(o=0,s=e.length;s>o;o++)a=n[i]||[],a.push(t.eq(r+o)),n[i]=a,e[o].columns&&(l=l.concat(e[o].columns));l.length&&P(l,t,n,i+1,r+e.length)}function M(e){return kt(e,function(e){return e.locked})}function F(e){return kt(e,function(e){return!e.locked})}function z(e){return kt(e,function(e){return!e.locked&&p(e)})}function R(e){return kt(e,function(e){return e.locked&&p(e)})}function B(e){var t,n=[];for(t=0;e.length>t;t++)e[t].hidden||(e[t].columns?n=n.concat(B(e[t].columns)):n.push(e[t]));return n}function H(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(H(e[t].columns)):n.push(e[t]);return n}function L(t){var n,i=t.find(">tr:not(.k-filter-row)"),r=e();return i.length>1&&(r=i.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.rowSpan>1})),r=r.add(i.last().find("th:not(.k-group-cell,.k-hierarchy-cell)")),n=ut.attr("index"),r.sort(function(t,i){return t=parseInt(e(t).attr(n),10),i=parseInt(e(i).attr(n),10),t>i?1:i>t?-1:0}),r}function N(t){var n,i,r,o,a,s,l,c=t.closest("table"),d=e().add(t),u=t.closest("tr"),h=c.find("tr:not(.k-filter-row)"),p=h.index(u);if(p>0){for(n=h.eq(p-1),i=n.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),r=0,o=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),a=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1}),s=0;a.length>s;s++)r+=a[s].colSpan||1;for(o+=Math.max(r-1,0),r=0,s=0;i.length>s;s++)if(l=i.eq(s),r+=l.attr("colSpan")?l[0].colSpan:1,o>=s&&r>o){d=N(l).add(d);
28
+ break}}return d}function O(t){var n,i,r,o,a,s,l,c,d=t.closest("table"),u=e().add(t),h=t.closest("tr"),p=d.find("tr:not(.k-filter-row)"),f=p.index(h)+t[0].rowSpan,g=ut.attr("colspan");if(p.length-1>=f){for(n=h.next(),i=h.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),r=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),r=r.filter(function(){return!this.rowSpan||1===this.rowSpan}),a=0,o=0;r.length>o;o++)a+=parseInt(r.eq(o).attr(g),10)||1;for(s=n.find("th:not(.k-group-cell,.k-hierarchy-cell)"),l=parseInt(t.attr(g),10)||1,o=0;l>o;)n=s.eq(o+a),u=u.add(O(n)),c=parseInt(n.attr(g),10),c>1&&(l-=c-1),o++}return u}function V(t,n,i){var r,o=t;return gt?t[0].innerHTML=i:(r=document.createElement("div"),r.innerHTML="<table><tbody>"+i+"</tbody></table>",t=r.firstChild.firstChild,n[0].replaceChild(t,o[0]),t=e(t)),t}function U(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",yt({},e,{style:t})}function W(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function j(t,n,i,r){var o,a=t.find(">colgroup"),s=bt(n,function(e){return o=e.width,o&&0!==parseInt(o,10)?ut.format('<col style="width:{0}"/>',typeof o===cn?o:o+"px"):"<col />"});(i||a.find(".k-hierarchy-col").length)&&s.splice(0,0,'<col class="k-hierarchy-col" />'),a.length&&a.remove(),a=e(Array(r+1).join('<col class="k-group-col">')+s.join("")),a.is("colgroup")||(a=e("<colgroup/>").append(a)),t.prepend(a),yn.msie&&8==yn.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function q(e,t){var n,i,r=0;for(n=0,i=t.length;i>n;n++)t[n].locked&&(e.eq(n).insertBefore(e.eq(r)),r++)}function G(e){var t,n,i,r={};for(n=0,i=e.length;i>n;n++)t=e[n],r[t.value]=t.text;return r}function $(e,t,n){var i=n&&n.length&&wt(n[0])&&"value"in n[0],r=i?G(n)[e]:e;return r=null!=r?r:"",t?ut.format(t,r):r}function Y(e,t,n){for(var i,r=0,o=e[r];o;){if(i=n?!0:"none"!==o.style.display,i&&!mn.test(o.className)&&--t<0){o.style.display=n?"":"none";break}o=e[++r]}}function Q(t,n){for(var i,r,o=0,a=t.length;a>o;o+=1)r=t.eq(o),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)-1),i.find("col").eq(n).remove(),r=i.find("tr:first")),Y(r[0].cells,n,!1))}function K(t,n){for(var i,r,o,a=0,s=t.length;s>a;a+=1)r=t.eq(a),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)+1),j(i.find(">form>table"),f(o),!1,0),r=i.find("tr:first")),Y(r[0].cells,n,!0))}function X(e,t,n){n=n||1;var i,r,o;for(r=0,o=e.length;o>r;r++)i=e.eq(r).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+n),i=t.eq(r).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-n)}function Z(e){var t,n,i=0,r=e.find(">colgroup>col");for(t=0,n=r.length;n>t;t+=1)i+=parseInt(r[t].style.width,10);return i}function J(e,t){var n,i,r,o;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(n=e.offsetHeight,i=t.offsetHeight,n>i?(r=t.rows[t.rows.length-1],vn.test(r.className)&&(r=t.rows[t.rows.length-2]),o=n-i):(r=e.rows[e.rows.length-1],vn.test(r.className)&&(r=e.rows[e.rows.length-2]),o=i-n),r.style.height=r.offsetHeight+o+"px")}function et(e,t){var n,i=e.offsetHeight,r=t.offsetHeight;i>r?n=i+"px":r>i&&(n=r+"px"),n&&(e.style.height=t.style.height=n)}function tt(e,t){var n,i,r;if(typeof e===cn&&e===t)return e;if(wt(e)&&e.name===t)return e;if(xt(e))for(n=0,i=e.length;i>n;n++)if(r=e[n],typeof r===cn&&r===t||r.name===t)return r;return null}function nt(t,n){var i,r,o,a=yn.msie;if(n===!0){if(t=e(t),i=!0,i&&(r=t.parent().scrollTop(),o=t.parent().scrollLeft()),a)try{t[0].setActive()}catch(s){t[0].focus()}else t[0].focus();i&&(t.parent().scrollTop(r),t.parent().scrollLeft(o))}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function it(t){var n=e(t.currentTarget),i=n.is("th"),r=this.table.add(this.lockedTable),o=this.thead.parent().add(e(">table",this.lockedHeader)),a=e(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap"),s=n.closest("table")[0];ut.support.touch||a&&n.find(ut.roleSelector("filtercell")).length||(s===r[0]||s===r[1]||s===o[0]||s===o[1])&&(e(t.target).is("a.k-i-collapse, a.k-i-expand")||(this.current(n),(i||!a)&&setTimeout(function(){kn&&e(ut._activeElement()).hasClass("k-widget")||nt(s,!0)}),i&&t.preventDefault()))}function rt(t,n,i,r){if(t=e(t),r){var o=n;n=i,i=o}return n.not(t).length!=n.length?t:n.eq(t[0]==i[0]?0:1)}function ot(e,n,i,r,o){var a,s,l,c=o?"prevAll":"nextAll";if(e){if(a=e.parent()[c](zt).first(),!a[0]&&(o||e.is("th"))||!o&&e[0].rowSpan>1){if(n=rt(n,i,r,o),nt(n),o&&!e.is(".k-header"))return L(n.find("thead:first")).eq(e.index());a=n.find((o?">thead>":">tbody>")+zt).first()}!o&&e[0].colSpan>1&&e.is(".k-header")?e=O(e).eq(1):e.is(".k-header")&&o?(l=N(e),e=l.eq(l.length-2)):(s=e.attr(ut.attr("index")),(s===t||o)&&(s=e.index()),e=a.children().eq(s)),e[0]&&e.is(Rt)||(e=a.children(Rt).first())}else e=i.find(Bt);return e}function at(e,t,n,i,r){var o=n.length>1;return e?e.prevAll(":visible")[0]?e=e.prevAll(Mt).first():o&&(t==n[1]?(nt(n[0]),e=r(e.parent()).children(Mt).last()):t==i[1]&&(nt(i[0]),e=i.eq(0).find("tr>"+Mt).last())):e=n.find(Bt),e}function st(e,t,n,i,r){var o=n.length>1;return e?e.nextAll(":visible")[0]?e=e.nextAll(Mt).first():o&&(t==n[0]?(nt(n[1]),e=r(e.parent()).children(Mt).first()):t==i[0]&&(nt(i[1]),e=i.eq(1).find("tr>"+Mt).first())):e=n.find(Bt),e}function lt(e,t,n,i,r){var o=2==n.length,a=!0,s=r?e.prevAll(Mt+":first"):e.nextAll(":visible:first");return s.length||(s=e.parent(),o&&(a=r&&t==n[0]||!r&&t==n[1],s=i(s)),a&&(s=s[r?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),s=s.children(Mt+(r?":last":":first"))),s}function ct(e,t,i){return'<tr class="k-grouping-row">'+n(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"></a>'+i+"</p></td></tr>"}function dt(e){return'<tr class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var ut=window.kendo,ht=ut.ui,pt=ut.data.DataSource,ft=ht.Groupable,gt=ut.support.tbodyInnerHtml,mt=ut._activeElement,vt=ht.Widget,_t=ut.keys,wt=e.isPlainObject,yt=e.extend,bt=e.map,kt=e.grep,xt=e.isArray,Ct=e.inArray,St=Array.prototype.push,Tt=e.proxy,Dt=ut.isFunction,At=e.isEmptyObject,Et=Math,It="progress",Pt="error",Mt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Ft="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",zt="tr:not(.k-footer-template):visible",Rt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Bt=zt+":first>"+Rt+":first",Ht="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",Lt=".kendoGrid",Nt="edit",Ot="save",Vt="remove",Ut="detailInit",Wt="filterMenuInit",jt="columnMenuInit",qt="change",Gt="columnHide",$t="columnShow",Yt="saveChanges",Qt="dataBound",Kt="detailExpand",Xt="detailCollapse",Zt="k-state-focused",Jt="k-state-selected",en="columnResize",tn="columnReorder",nn="columnLock",rn="columnUnlock",on="click",an="height",sn="tabIndex",ln="function",cn="string",dn="Are you sure you want to delete this record?",un="Delete",hn="Cancel",pn=/(\}|\#)/gi,fn=/#/gi,gn="[\\x20\\t\\r\\n\\f]",mn=RegExp("(^|"+gn+")(k-group-cell|k-hierarchy-cell)("+gn+"|$)"),vn=RegExp("(^|"+gn+")(k-filter-row)("+gn+"|$)"),_n='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>',wn=!1,yn=ut.support.browser,bn=yn.msie&&7==yn.version,kn=yn.msie&&8==yn.version,xn=vt.extend({init:function(e,t){var n=this;vt.fn.init.call(n,e,t),n._refreshHandler=Tt(n.refresh,n),n.setDataSource(t.dataSource),n.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(qt,t._refreshHandler),t.dataSource=e,t.dataSource.bind(qt,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop},destroy:function(){var e=this;vt.fn.destroy.call(e),e.dataSource.unbind(qt,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(Lt),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,n=this,i=ut.support.scrollbar()+1,r=n.element;r.css({width:"auto",overflow:"hidden"}).css(wn?"padding-left":"padding-right",i),n.content=r.children().first(),t=n.wrapper=n.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+Lt+" mousewheel"+Lt,Tt(n._wheelScroll,n)),ut.support.kineticScrollNeeded&&(n.drag=new ut.UserEvents(n.wrapper,{global:!0,start:function(e){e.sender.capture()},move:function(e){n.verticalScrollbar.scrollTop(n.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),n.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:i}).appendTo(r).bind("scroll"+Lt,Tt(n._scroll,n))},_wheelScroll:function(t){if(!t.ctrlKey){var n=this.verticalScrollbar.scrollTop(),i=ut.wheelDeltaY(t);i&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Lt,!1),this.verticalScrollbar.scrollTop(n+-i))}},_scroll:function(e){var t=this,n=e.currentTarget.scrollTop,i=t.dataSource,r=t.itemHeight,o=i.skip()||0,a=t._rangeStart||o,s=t.element.innerHeight(),l=!!(t._scrollbarTop&&t._scrollbarTop>n),c=Et.max(Et.floor(n/r),0),d=Et.max(c+Et.floor(s/r),0);t._scrollTop=n-a*r,t._scrollbarTop=n,t._fetch(c,d,l)||(t.wrapper[0].scrollTop=t._scrollTop)},_fetch:function(e,t,n){var i=this,r=i.dataSource,o=i.itemHeight,a=r.take(),s=i._rangeStart||r.skip()||0,l=Et.floor(e/a)*a,c=!1,d=.33;return s>e?(c=!0,s=Et.max(0,t-a),i._scrollTop=(e-s)*o,i._page(s,a)):t>=s+a&&!n?(c=!0,s=e,i._scrollTop=o,i._page(s,a)):i._fetching||(l+a-a*d>e&&e>a&&r.prefetch(l-a,a),t>l+a*d&&r.prefetch(l+a,a)),c},_page:function(e,t){var n=this,i=n.dataSource;clearTimeout(n._timeout),n._fetching=!0,n._rangeStart=e,i.inRange(e,t)?i.range(e,t):(ut.ui.progress(n.wrapper.parent(),!0),n._timeout=setTimeout(function(){i.range(e,t)},100))},refresh:function(){var e,t,n,i,r=this,o="",a=25e4,s=r.dataSource,l=r._rangeStart,c=ut.support.kineticScrollNeeded?0:ut.support.scrollbar(),d=r.wrapper[0];for(ut.ui.progress(r.wrapper.parent(),!1),clearTimeout(r._timeout),n=r.itemHeight=r.options.itemHeight()||0,i=d.scrollWidth>d.offsetWidth?c:0,e=s.total()*n+i,t=0;t<Et.floor(e/a);t++)o+='<div style="width:1px;height:'+a+'px"></div>';e%a&&(o+='<div style="width:1px;height:'+e%a+'px"></div>'),r.verticalScrollbar.html(o),d.scrollTop=r._scrollTop,r.drag&&r.drag.cancel(),l&&!r._fetching&&(r._rangeStart=s.skip(),1===s.page()&&(r.verticalScrollbar[0].scrollTop=0)),r._fetching=!1}}),Cn={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},Sn=ut.ui.DataBoundWidget.extend({init:function(t,n,i){var r=this;n=xt(n)?{dataSource:n}:n,vt.fn.init.call(r,t,n),i&&(r._events=i),wn=ut.support.isRtl(t),r._element(),r._aria(),r._columns(r.options.columns),r._dataSource(),r._tbody(),r._pageable(),r._thead(),r._groupable(),r._toolbar(),r._setContentHeight(),r._templates(),r._navigatable(),r._selectable(),r._details(),r._editable(),r._attachCustomCommandsEvent(),r.options.autoBind?r.dataSource.fetch():r._footer(),r.lockedContent&&(r.wrapper.addClass("k-grid-lockedcolumns"),r._resizeHandler=function(){r.resize()},e(window).on("resize"+Lt,r._resizeHandler)),ut.notify(r)},events:[qt,"dataBinding","cancel","pdfExport",Qt,Kt,Xt,Ut,Wt,jt,Nt,Ot,Vt,Yt,en,tn,$t,Gt,nn,rn],setDataSource:function(e){var t=this,n=t.options.scrollable;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),n&&(n.virtual?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(0):t.content.scrollLeft(0)),t.options.groupable&&t._groupable(),t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource),t.options.navigatable&&t._navigatable(),t.options.selectable&&t._selectable(),t.options.autoBind&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:hn,confirmation:dn,confirmDelete:un},commands:{create:Cn.create.text,cancel:Cn.cancel.text,save:Cn.save.text,destroy:Cn.destroy.text,edit:Cn.edit.text,update:Cn.update.text,canceledit:Cn.canceledit.text,excel:Cn.excel.text,pdf:Cn.pdf.text}}},destroy:function(){var t,n=this;vt.fn.destroy.call(n),n._resizeHandler&&e(window).off("resize"+Lt,n._resizeHandler),n.pager&&n.pager.element&&n.pager.destroy(),n.pager=null,n.groupable&&n.groupable.element&&n.groupable.element.kendoGroupable("destroy"),n.groupable=null,n.options.reorderable&&n.wrapper.data("kendoReorderable").destroy(),n.selectable&&n.selectable.element&&n.selectable.destroy(),n.selectable=null,n.resizable&&(n.resizable.destroy(),n._resizeUserEvents&&(n._resizeHandleDocumentClickHandler&&e(document).off("click",n._resizeHandleDocumentClickHandler),n._resizeUserEvents.destroy(),n._resizeUserEvents=null),n.resizable=null),n.virtualScrollable&&n.virtualScrollable.element&&n.virtualScrollable.destroy(),n.virtualScrollable=null,n._destroyColumnAttachments(),n._destroyEditable(),n.dataSource&&(n.dataSource.unbind(qt,n._refreshHandler).unbind(It,n._progressHandler).unbind(Pt,n._errorHandler),n._refreshHandler=n._progressHandler=n._errorHandler=null),t=n.element.add(n.wrapper).add(n.table).add(n.thead).add(n.wrapper.find(">.k-grid-toolbar")),n.content&&(t=t.add(n.content).add(n.content.find(">.k-virtual-scrollable-wrap"))),n.lockedHeader&&n._removeLockedContainers(),n.pane&&n.pane.destroy(),n._draggableInstance&&n._draggableInstance.element&&n._draggableInstance.destroy(),n._draggableInstance=null,t.off(Lt),ut.destroy(n.wrapper),n.scrollables=n.thead=n.tbody=n.element=n.table=n.content=n.footer=n.wrapper=n._groupableClickHandler=n._setContentWidthHandler=null},getOptions:function(){var n,i=yt(!0,{},this.options);return i.columns=ut.deepExtend([],this.columns),n=this.dataSource,i.dataSource=e.extend(!0,{},n.options),i.dataSource.page=n.page(),i.dataSource.filter=n.filter(),i.dataSource.pageSize=n.pageSize(),i.dataSource.sort=n.sort(),i.dataSource.group=n.group(),i.dataSource.aggregate=n.aggregate(),i.$angular=t,i},setOptions:function(e){var t,n,i,r=this.getOptions();ut.deepExtend(r,e),t=this.wrapper,n=this._events,i=this.element,this.destroy(),this.options=null,t[0]!==i[0]&&(t.before(i),t.remove()),i.empty(),this.init(i,r,n),this._setEvents(r)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t){return t.children().filter(function(){var t=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var e,t,n,i=ut.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=i.length,t=Array(2*e),n=e;--n>=0;)t[n]=t[n+e]=i[n];i=t}return i},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,t.thead&&(this.angular("cleanup",function(){return{elements:t.thead.get()}}),t.thead.find("th").each(function(){var t=e(this),n=t.data("kendoFilterMenu"),i=t.data("kendoColumnSorter"),r=t.data("kendoColumnMenu");n&&n.destroy(),i&&i.destroy(),r&&r.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,n,i=this,r=H(i.columns||[]);for(t=0,n=r.length;n>t;t++)e=r[t].command,e&&l(i,i.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,n=t.element;n.is("table")||(n=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),n.length||(n=e("<table />").appendTo(t.element))),bn&&n.attr("cellspacing",0),t.table=n.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,n){var i,r,o,a,s,l,c,d=this,u=d.options.columnResizeHandleWidth,h=d.options.scrollable,p=d.resizeHandle,f=this._groups();if(p&&d.lockedContent&&p.data("th")[0]!==n[0]&&(p.remove(),p=null),p||(p=d.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(p)),wn)i=n.position().left,h&&(a=n.closest(".k-grid-header-wrap, .k-grid-header-locked"),s=yn.msie?a.scrollLeft():0,l=yn.webkit?a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft():0,c=yn.mozilla?a[0].scrollWidth-a[0].offsetWidth-(a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft()):0,i-=l-c+s);else{for(i=n[0].offsetWidth,r=L(n.closest("thead")),o=0;r.length>o&&r[o]!=n[0];o++)i+=r[o].offsetWidth;f>0&&(i+=t.find(".k-group-cell:first").outerWidth()*f)}p.css({top:n.position().top,left:i-u,height:n.outerHeight(),width:3*u}).data("th",n).show()},_positionColumnResizeHandle:function(){var t=this,n=t.options.columnResizeHandleWidth,i=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(i).on("mousemove"+Lt,"th",function(i){var o,a,s,l=e(this);l.hasClass("k-group-cell")||l.hasClass("k-hierarchy-cell")||(o=i.clientX,a=e(window).scrollLeft(),s=l.offset().left+(wn?0:this.offsetWidth),o+a>s-n&&s+n>o+a?t._createResizeHandle(l.closest("div"),l):t.resizeHandle?t.resizeHandle.hide():r(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new ut.UserEvents(n.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(n){var i=e(n.target);n.preventDefault(),i.addClass("k-column-active"),t._createResizeHandle(i.closest("div"),i),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=Tt(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,n,i,o,a,s,l,c=this,d=c.options,u=this._isMobile,h=ut.support.mobileOS?0:ut.support.scrollbar();d.resizable&&(t=d.scrollable?c.wrapper.find(".k-grid-header-wrap:first"):c.wrapper,u?c._positionColumnResizeHandleTouch(t):c._positionColumnResizeHandle(t),c.resizable&&c.resizable.destroy(),c.resizable=new ht.Resizable(t.add(c.lockedHeader),{handle:".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:t.data("th").outerHeight()+c.tbody.attr("clientHeight")})},start:function(t){var h,p,f,g;l=e(t.currentTarget).data("th"),u&&c._hideResizeHandle(),h=l.closest("table"),p=e.inArray(l[0],L(l.closest("thead")).filter(":visible")),a=h.parent().hasClass("k-grid-header-locked"),f=a?c.lockedTable:c.table,g=c.footer||e(),c.footer&&c.lockedContent&&(g=c.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),r(c.wrapper,"col-resize"),s=d.scrollable?h.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")").add(f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")).add(g.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")):f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")"),n=t.x.location,i=l.outerWidth(),o=a?f.children("tbody").outerWidth():c.tbody.outerWidth()},resize:function(t){var r,u,p,f,g,m,v=wn?-1:1,_=i+t.x.location*v-n*v;d.scrollable?(a&&c.lockedFooter?r=c.lockedFooter.children("table"):c.footer&&(r=c.footer.find(">.k-grid-footer-wrap>table")),r&&r[0]||(r=e()),u=l.closest("table"),p=a?c.lockedTable:c.table,f=!1,g=c.wrapper.width()-h,m=_,a&&o-i+m>g&&(m=i+(g-o-2*h),0>m&&(m=_),f=!0),m>10&&(s.css("width",m),o&&(m=f?g-2*h:o+t.x.location*v-n*v,p.add(u).add(r).css("width",m),a||(c._footerWidth=m)))):_>10&&s.css("width",_)},resizeend:function(){var e,t,n,o=l.outerWidth();r(c.wrapper,""),i!=o&&(t=c.lockedHeader?c.lockedHeader.find("thead:first tr:first").add(c.thead.find("tr:first")):l.parent(),n=l.attr(ut.attr("index")),n||(n=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(l)),e=H(c.columns)[n],e.width=o,c.trigger(en,{column:e,oldWidth:i,newWidth:o}),c._applyLockedContainersWidth(),c._syncLockedContentHeight(),c._syncLockedHeaderHeight()),c._hideResizeHandle(),l=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:ut.guid(),filter:t.content?".k-grid-header:first "+Ht:"table:first>.k-grid-header "+Ht,drag:function(){t._hideResizeHandle()},hint:function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(ut.attr("title"))||t.attr(ut.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')}}).data("kendoDraggable"))},_reorderable:function(){var t,n=this;n.options.reorderable&&(n.wrapper.data("kendoReorderable")&&n.wrapper.data("kendoReorderable").destroy(),t=function(e,t,i){var r=e[t],o=e[i],a=d(r,n.columns);return e=a?a.columns:n.columns,Ct(o,e)},n.wrapper.kendoReorderable({draggable:n._draggableInstance,dragOverContainers:function(e,i){var r=C(n.columns);return r[e].lockable!==!1&&t(r,e,i)>-1},inSameContainer:function(i){return e(i.source).parent()[0]===e(i.target).parent()[0]&&t(C(n.columns),i.sourceIndex,i.targetIndex)>-1},change:function(e){var i=C(n.columns),r=i[e.oldIndex],o=t(i,e.oldIndex,e.newIndex);n.trigger(tn,{newIndex:o,oldIndex:Ct(r,i),column:r}),n.reorderColumn(o,r,"before"===e.position)}}))},_reorderHeader:function(e,t,n){var i,r,o,l,c=this,d=x(e[0],c.columns),u=x(t,c.columns),h=[];for(i=0;e.length>i;i++)e[i].columns&&(h=h.concat(e[i].columns));r=s(c.lockedHeader,c.thead,"tr:eq("+d.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),o=M(e).length,l=M([t]).length,h.length?(o>0&&0===l?v(e,t,h,c.columns,c.lockedHeader.find("thead"),c.thead,this._groups()):0===o&&l>0&&v(e,t,h,c.columns,c.thead,c.lockedHeader.find("thead"),this._groups()),t=k(c.columns,t,e[0],n),t&&c._reorderHeader(h,t,n)):o!==l&&m(r[d.cell],c.columns,o),a(r,d.cell,u.cell,n,e.length)},_reorderContent:function(t,n,i){var r,o,l,c,d=this,u=e(),h=t[0],p=Ct(h,H(d.columns)),f=Ct(n,H(d.columns)),g=Ct(h,B(d.columns)),m=Ct(n,B(d.columns)),v=M(d.columns).length,_=!!n.locked,w=d.footer||d.wrapper.find(".k-grid-footer"),y=r=m;for(n.hidden&&(_?(m=d.lockedTable.find("colgroup"),y=d.lockedHeader.find("colgroup"),r=e(d.lockedFooter).find(">table>colgroup")):(m=d.tbody.prev(),y=d.thead.prev(),r=w.find(".k-grid-footer-wrap").find(">table>colgroup"))),d._hasFilterRow()&&a(d.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),p,f,i,t.length),a(s(d.lockedHeader,d.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),g,y,i,t.length),d.options.scrollable&&a(s(d.lockedTable,d.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),g,m,i,t.length),w&&w.length&&(a(s(d.lockedFooter,w.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),g,r,i,t.length),a(w.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),p,f,i,t.length)),o=d.tbody.children(":not(.k-grouping-row,.k-detail-row)"),d.lockedTable&&(v>f?p>=v&&X(d.lockedTable.find(">tbody>tr.k-grouping-row"),d.table.find(">tbody>tr.k-grouping-row"),t.length):v>p&&X(d.table.find(">tbody>tr.k-grouping-row"),d.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),u=d.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),l=0,c=o.length;c>l;l+=1)a(s(u[l],o[l],">td:not(.k-group-cell,.k-hierarchy-cell)"),p,f,i,t.length)},reorderColumn:function(e,n,i){var r,o,a=this,s=d(n,a.columns),l=s?s.columns:a.columns,c=Ct(n,l),u=l[e],h=!!u.locked,p=M(a.columns).length;c!==e&&(n.locked||!h||1!=F(a.columns).length)&&(!n.locked||h||1!=p)&&(a._hideResizeHandle(),i===t&&(i=c>e),o=[n],a._reorderHeader(o,u,i),a.lockedHeader&&(I(a.thead),I(a.lockedHeader)),u.columns&&(u=H(u.columns),u=u[i?0:u.length-1]),n.columns&&(o=H(n.columns)),a._reorderContent(o,u,i),r=!!n.locked,r=r!=h,n.locked=h,l.splice(i?e:e+1,0,n),l.splice(e>c?c:c+1,1),a._templates(),a._updateColumnCellIndex(),a._updateTablesWidth(),a._applyLockedContainersWidth(),a._syncLockedHeaderHeight(),a._syncLockedContentHeight(),a._updateFirstColumnClass(),r&&(h?a.trigger(nn,{column:n}):a.trigger(rn,{column:n})))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=_(e,M(this.columns))),_(this.thead,F(this.columns),t)},lockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:kt(n,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=M(n).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:kt(n,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=M(n).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var n=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(n=H(M(this.columns)).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+n},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var n=t.attr(ut.attr("uid"));return this.dataSource.getByUid(n)},_editable:function(){var t,n=this,i=n.selectable&&n.selectable.options.multiple,r=n.options.editable,o=function(){var t=mt(),i=n._editContainer;!i||e.contains(i[0],t)||i[0]===t||e(t).closest(".k-animation-container").length||n.editable.end()&&n.closeCell()};r&&(t=n._editMode(),"incell"===t?r.update!==!1&&n.wrapper.on(on+Lt,"tr:not(.k-grouping-row) > td",function(t){var r=e(this),o=n.lockedTable&&r.closest("table")[0]===n.lockedTable[0];r.hasClass("k-hierarchy-cell")||r.hasClass("k-detail-cell")||r.hasClass("k-group-cell")||r.hasClass("k-edit-cell")||r.has("a.k-grid-delete").length||r.has("button.k-grid-delete").length||r.closest("tbody")[0]!==n.tbody[0]&&!o||e(t.target).is(":input")||(n.editable?n.editable.end()&&(i&&e(mt()).blur(),n.closeCell(),n.editCell(r)):n.editCell(r))}).on("focusin"+Lt,function(){clearTimeout(n.timer),n.timer=null}).on("focusout"+Lt,function(){n.timer=setTimeout(o,1)}):r.update!==!1&&n.wrapper.on(on+Lt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),n.editRow(e(this).closest("tr"))}),r.destroy!==!1?n.wrapper.on(on+Lt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),n.removeRow(e(this).closest("tr"))}):n.wrapper.on(on+Lt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),n._confirmation()||e.preventDefault()}))},editCell:function(t){var n,i,r,o;t=e(t),n=this,i=H(n.columns)[n.cellIndex(t)],r=n._modelForContainer(t),n.closeCell(),!r||r.editable&&!r.editable(i.field)||i.command||!i.field||(n._attachModelChange(r),n._editContainer=t,n.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:i.field,format:i.format,editor:i.editor,values:i.values},model:r,target:n,change:function(e){n.trigger(Ot,{values:e.values,container:t,model:r})&&e.preventDefault()}}).data("kendoEditable"),o=t.parent().addClass("k-grid-edit-row"),n.lockedContent&&et(o[0],n._relatedRow(o).addClass("k-grid-edit-row")[0]),n.trigger(Nt,{container:t,model:r}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),n=e[0].offsetWidth>t[0].clientWidth?ut.support.scrollbar():0;this.lockedContent.height(t.height()-n)},_syncLockedContentHeight:function(){this.lockedTable&&(this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),J(e,t))},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var e=this,t=function(){if(e.editable){var t=e.editView?e.editView.element:e._editContainer;t&&(t.off(on+Lt,"a.k-grid-cancel",e._editCancelClickHandler),t.off(on+Lt,"a.k-grid-update",e._editUpdateClickHandler)),e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView()}};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t);n&&n.unbind(qt,e._modelChangeHandler)},closeCell:function(t){var n,i,r,o,a=this,s=a._editContainer;s&&(n=s.closest("tr").attr(ut.attr("uid")),o=a.dataSource.getByUid(n),t&&a.trigger("cancel",{container:s,model:o})||(s.removeClass("k-edit-cell"),i=H(a.columns)[a.cellIndex(s)],r=s.parent().removeClass("k-grid-edit-row"),a._destroyEditable(),a._displayCell(s,i,o),s.hasClass("k-dirty-cell")&&e('<span class="k-dirty"/>').prependTo(s),a.lockedContent&&et(r.css("height","")[0],a._relatedRow(r).css("height","")[0])))},_displayCell:function(e,t,n){var i=this,r={storage:{},count:0},o=yt({},ut.Template,i.options.templateSettings),a=ut.template(i._cellTmpl(t,r),o);r.count>0&&(a=Tt(a,r.storage)),e.empty().html(a(n)),i.angular("compile",function(){return{elements:e,data:[{dataItem:n}]}})},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var n,i=this,r=i._editMode();"incell"!==r&&i.cancelRow(),t=e(t).hide(),n=i._modelForContainer(t),n&&!i.trigger(Vt,{row:t,model:n})?(i.dataSource.remove(n),("inline"===r||"popup"===r)&&i.dataSource.sync()):"incell"===r&&i._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(n){var i,r,o,a=this;n instanceof ut.data.ObservableObject?i=n:(n=e(n),i=a._modelForContainer(n)),r=a._editMode(),a.cancelRow(),i&&(a._attachModelChange(i),"popup"===r?a._createPopupEditor(i):"inline"===r?a._createInlineEditor(n,i):"incell"===r&&e(n).children(Mt).each(function(){var n=e(this),r=H(a.columns)[n.index()];return i=a._modelForContainer(n),i&&(!i.editable||i.editable(r.field))&&r.field?(a.editCell(n),!1):t}),o=a.editView?a.editView.element:a._editContainer,o&&(this._editCancelClickHandler||(this._editCancelClickHandler=Tt(this._editCancelClick,this)),o.on(on+Lt,"a.k-grid-cancel",this._editCancelClickHandler),this._editUpdateClickHandler||(this._editUpdateClickHandler=Tt(this._editUpdateClick,this)),o.on(on+Lt,"a.k-grid-update",this._editUpdateClickHandler)))
29
+ },_editUpdateClick:function(e){e.preventDefault(),e.stopPropagation(),this.saveRow()},_editCancelClick:function(t){var n,i=this,r=i.options.navigatable,o=i.editable.options.model,a=i.editView?i.editView.element:i._editContainer;t.preventDefault(),t.stopPropagation(),i.trigger("cancel",{container:a,model:o})||(n=i.items().index(e(i.current()).parent()),i.cancelRow(),r&&(i.current(i.items().eq(n).children().filter(Rt).first()),nt(i.table,!0)))},_createPopupEditor:function(n){var i,r,o,a,s,l,c,d,u,h,p,f=this,g="<div "+ut.attr("uid")+'="'+n.uid+'" class="k-popup-edit-form'+(f._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',m=[],v=H(f.columns),_=f.options.editable,w=_.template,y=wt(_)?_.window:{},b=yt({},ut.Template,f.options.templateSettings);if(y=y||{},w)for(typeof w===cn&&(w=window.unescape(w)),g+=ut.template(w,b)(n),o=0,a=v.length;a>o;o++)i=v[o],i.command&&(d=tt(i.command,"edit"),d&&(r=d));else for(o=0,a=v.length;a>o;o++)i=v[o],i.command?i.command&&(d=tt(i.command,"edit"),d&&(r=d)):(g+='<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>",n.editable&&!n.editable(i.field)||!i.field?(h={storage:{},count:0},s=ut.template(f._cellTmpl(i,h),b),h.count>0&&(s=Tt(s,h.storage)),g+='<div class="k-edit-field">'+s(n)+"</div>"):(m.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),g+="<div "+ut.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'));r&&wt(r)&&(r.text&&wt(r.text)&&(l=r.text.update,c=r.text.cancel),r.attr&&(u=r.attr)),f._isMobile?(g+="</div></div>",f.editView=f.pane.append("<div data-"+ut.ns+'role="view" data-'+ut.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+ut.ns+'role="header" class="k-header">'+f._createButton({name:"update",text:l,attr:u})+(y.title||"Edit")+f._createButton({name:"canceledit",text:c,attr:u})+"</div>"+g+"</div>"),p=f._editContainer=f.editView.element.find(".k-popup-edit-form")):(g+='<div class="k-edit-buttons k-state-default">',g+=f._createButton({name:"update",text:l,attr:u})+f._createButton({name:"canceledit",text:c,attr:u}),g+="</div></div></div>",p=f._editContainer=e(g).appendTo(f.wrapper).eq(0).kendoWindow(yt({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),f.trigger("cancel",{container:p,model:n}))return i.preventDefault(),t;var r=f.items().index(e(f.current()).parent());f.cancelRow(),f.options.navigatable&&(f.current(f.items().eq(r).children().filter(Rt).first()),nt(f.table,!0))}}},y))),f.editable=f._editContainer.kendoEditable({fields:m,model:n,clearContainer:!1,target:f}).data("kendoEditable"),f._isMobile&&p.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),f._openPopUpEditor(),f.trigger(Nt,{container:p,model:n})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,n){var i,r,o,a=this,s=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(r=e(this),i=H(a.columns)[a.cellIndex(r)],i.command||!i.field||n.editable&&!n.editable(i.field)){if(i.command&&(o=tt(i.command,"edit"))){r.empty();var t,l,c;wt(o)&&(o.text&&wt(o.text)&&(t=o.text.update,l=o.text.cancel),o.attr&&(c=o.attr)),e(a._createButton({name:"update",text:t,attr:c})+a._createButton({name:"canceledit",text:l,attr:c})).appendTo(r)}}else s.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),r.attr(ut.attr("container-for"),i.field),r.empty()}),a._editContainer=t,a.editable=new ut.ui.Editable(t.addClass("k-grid-edit-row"),{target:a,fields:s,model:n,clearContainer:!1}),t.length>1&&(et(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(Nt,{container:t,model:n})},cancelRow:function(){var e,t=this,n=t._editContainer;n&&(e=t._modelForContainer(n),t._destroyEditable(),t.dataSource.cancelChanges(e),t._displayRow("popup"!==t._editMode()?n:t.tbody.find("["+ut.attr("uid")+"="+e.uid+"]")))},saveRow:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t),i=e.editable;t&&i&&i.end()&&!e.trigger(Ot,{container:t,model:n})&&e.dataSource.sync()},_displayRow:function(t){var n,i,r,o=this,a=o._modelForContainer(t),s=t.hasClass("k-state-selected"),l=t.hasClass("k-alt");a&&(o.lockedContent&&(n=e((l?o.lockedAltRowTemplate:o.lockedRowTemplate)(a)),o._relatedRow(t.last()).replaceWith(n)),o.angular("cleanup",function(){return{elements:t.get()}}),i=e((l?o.altRowTemplate:o.rowTemplate)(a)),t.replaceWith(i),o.angular("compile",function(){return{elements:i.get(),data:[{dataItem:a}]}}),s&&o.options.selectable&&o.select(i.add(n)),n&&et(i[0],n[0]),r=i.next(),r.hasClass("k-detail-row")&&r.is(":visible")&&i.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,n){var i,r,o,a=this;return a._isMobile?(i=ut.template('<ul><li class="km-actionsheet-title">#:title#</li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#</a></li></ul>'),r=e(i(t)).appendTo(a.view.element),o=a._actionSheet=new ut.mobile.ui.ActionSheet(r,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(t){var i=e(t.currentTarget).parent();i.hasClass("km-actionsheet-cancel")||a._removeRow(n)},popup:a._actionSheetPopupOptions}),o.open(n),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,n=t.options.editable,i=n===!0||typeof n===cn?t.options.messages.editable.confirmation:n.confirmation;return i!==!1&&null!=i?(typeof i===ln&&(i=i(t._modelForContainer(e))),t._showMessage({confirmDelete:n.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:n.cancelDelete||t.options.messages.editable.cancelDelete,title:i===!0?t.options.messages.editable.confirmation:i},e)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(Yt)&&e.dataSource.sync()},addRow:function(){var e,t,n,i,r,o,a=this,s=a.dataSource,l=a._editMode(),c=a.options.editable.createAt||"",d=s.pageSize(),u=s.view()||[];(a.editable&&a.editable.end()||!a.editable)&&("incell"!=l&&a.cancelRow(),e=s.indexOf(u[0]),"bottom"==c.toLowerCase()&&(e+=u.length,d&&!s.options.serverPaging&&u.length>=d&&(e-=1)),0>e&&(e=s.page()>s.totalPages()?(s.page()-1)*d:0),t=s.insert(e,{}),n=t.uid,i=a.lockedContent?a.lockedTable:a.table,r=i.find("tr["+ut.attr("uid")+"="+n+"]"),o=r.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(a._firstEditableColumnIndex(r)),"inline"===l&&r.length?a.editRow(r):"popup"===l?a.editRow(t):o.length&&a.editCell(o),"bottom"==c.toLowerCase()&&a.lockedContent&&(a.lockedContent[0].scrollTop=a.content[0].scrollTop=a.content[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,n,i,r=this,o=H(r.columns),a=r._modelForContainer(e);for(n=0,i=o.length;i>n;n++)if(t=o[n],a&&(!a.editable||a.editable(t.field))&&!t.command&&t.field)return n;return-1},_toolbar:function(){var t,n=this,i=n.wrapper,r=n.options.toolbar,o=n.options.editable;r&&(t=n.wrapper.find(".k-grid-toolbar"),t.length||(Dt(r)||(r=typeof r===cn?r:n._toolbarTmpl(r).replace(fn,"\\#"),r=Tt(ut.template(r),n)),t=e('<div class="k-header k-grid-toolbar" />').html(r({})).prependTo(i),n.angular("compile",function(){return{elements:t.get()}})),o&&o.create!==!1&&t.on(on+Lt,".k-grid-add",function(e){e.preventDefault(),n.addRow()}).on(on+Lt,".k-grid-cancel-changes",function(e){e.preventDefault(),n.cancelChanges()}).on(on+Lt,".k-grid-save-changes",function(e){e.preventDefault(),n.saveChanges()}),t.on(on+Lt,".k-grid-excel",function(e){e.preventDefault(),n.saveAsExcel()}),t.on(on+Lt,".k-grid-pdf",function(e){e.preventDefault(),n.saveAsPDF()}))},_toolbarTmpl:function(e){var t,n,i=this,r="";if(xt(e))for(t=0,n=e.length;n>t;t++)r+=i._createButton(e[t]);return r},_createButton:function(e){var n,r=e.template||_n,o=typeof e===cn?e:e.name||e.text,a=Cn[o]?Cn[o].className:"k-grid-"+(o||"").replace(/\s/g,""),s={className:a,text:o,imageClass:"",attr:"",iconClass:""},l=this.options.messages.commands;if(!(o||wt(e)&&e.template))throw Error("Custom commands should have name specified");return wt(e)?(e.className&&Ct(s.className,e.className.split(" "))<0?e.className+=" "+s.className:e.className===t&&(e.className=s.className),"edit"===o&&wt(e.text)&&(e=yt(!0,{},e),e.text=e.text.edit),e.attr&&(wt(e.attr)&&(e.attr=i(e.attr)),typeof e.attr===cn&&(n=e.attr.match(/class="(.+?)"/),n&&Ct(n[1],e.className.split(" "))<0&&(e.className+=" "+n[1]))),s=yt(!0,s,Cn[o],{text:l[o]},e)):s=yt(!0,s,Cn[o],{text:l[o]}),ut.template(r)(s)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;t._groupableClickHandler?t.table.add(t.lockedTable).off(on+Lt,t._groupableClickHandler):t._groupableClickHandler=function(n){var i=e(this),r=i.closest("tr");i.hasClass("k-i-collapse")?t.collapseGroup(r):t.expandGroup(r),n.preventDefault(),n.stopPropagation()},t._isLocked()?t.lockedTable.on(on+Lt,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(on+Lt,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),t._attachGroupable()},_attachGroupable:function(){var t=this,n=t.wrapper,i=t.options.groupable,r=Ht+"["+ut.attr("field")+"]",o=t.content?".k-grid-header:first "+r:"table:first>.k-grid-header "+r;i&&i.enabled!==!1&&(n.has("div.k-grouping-header")[0]||e("<div>&nbsp;</div>").addClass("k-grouping-header").prependTo(n),t.groupable&&t.groupable.destroy(),t.groupable=new ft(n,yt({},i,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:o,filter:o,allowDrag:t.options.reorderable})))},_continuousItems:function(t,n){var i,r,o,a,s,l,c,d;if(this.lockedContent){for(i=this,r=i.table.add(i.lockedTable),o=e(t,r[0]),a=e(t,r[1]),s=n?M(i.columns).length:1,l=n?i.columns.length-s:1,c=[],d=0;o.length>d;d+=s)St.apply(c,o.slice(d,d+s)),St.apply(c,a.splice(0,l));return c}},_selectable:function(){var n,i,r,o,a=this,s=[],l=a._isLocked(),c=a.options.selectable;c&&(a.selectable&&a.selectable.destroy(),c=ut.ui.Selectable.parseOptions(c),n=c.multiple,i=c.cell,a._hasDetails()&&(s[s.length]=".k-detail-row"),(a.options.groupable||a._hasFooters())&&(s[s.length]=".k-grouping-row,.k-group-footer"),s=s.join(","),""!==s&&(s=":not("+s+")"),r=a.table,l&&(r=r.add(a.lockedTable)),o=">"+(i?Ft:"tbody>tr"+s),a.selectable=new ut.ui.Selectable(r,{filter:o,aria:!0,multiple:n,change:function(){a.trigger(qt)},useAllItems:l&&n&&i,relatedTarget:function(t){var n,r,o,s;if(!i&&l){for(r=e(),o=0,s=t.length;s>o;o++)n=a._relatedRow(t[o]),Ct(n[0],t)<0&&(r=r.add(n));return r}},continuousItems:function(){return a._continuousItems(o,i)}}),a.options.navigatable&&r.on("keydown"+Lt,function(o){var s=a.current(),c=o.target;if(o.keyCode===_t.SPACEBAR&&e.inArray(c,r)>-1&&!s.is(".k-edit-cell,.k-header")&&s.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(o.preventDefault(),o.stopPropagation(),s=i?s:s.parent(),l&&!i&&(s=s.add(a._relatedRow(s))),n)if(o.ctrlKey){if(s.hasClass(Jt))return s.removeClass(Jt),a.trigger(qt),t}else a.selectable.clear();else a.selectable.clear();a.selectable.value(s)}}))},_relatedRow:function(t){var n,i,r=this.lockedTable;return t=e(t),r?(n=t.closest(this.table.add(this.lockedTable)),i=n.find(">tbody>tr").index(t),n=n[0]===this.table[0]?r:this.table,n.find(">tbody>tr").eq(i)):t},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(qt)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),i._isLocked()&&(n=n.add(n.map(function(){return i._relatedRow(this)}))),r.value(n),t):r.value()},current:function(e){var n,i=this,r=i.options.scrollable,o=i._current,a=i.table.add(i.thead.parent());return e!==t&&e.length&&(o&&o[0]===e[0]||(o&&(o.removeClass(Zt).removeAttr("id"),a.removeAttr("aria-activedescendant")),e.attr("id",i._cellId),i._current=e.addClass(Zt),a.attr("aria-activedescendant",i._cellId),e.length&&r&&(n=e.closest("table").parent(),n.is(".k-grid-content")?i._scrollTo(e.parent()[0],i.content[0]):n.is(".k-grid-content-locked")&&(i._scrollTo(i._relatedRow(e.parent())[0],i.content[0]),i.lockedContent[0].scrollTop=i.content[0].scrollTop),n.is(".k-grid-content-locked,.k-grid-header-locked")||(r.virtual?i._scrollTo(e[0],i.content.find(">.k-virtual-scrollable-wrap")[0]):i._scrollTo(e[0],i.content[0]))))),i._current},_removeCurrent:function(){this._current&&(this._current.removeClass(Zt),this._current=null)},_scrollTo:function(e,t){var n=e.tagName.toLowerCase(),i="td"===n||"th"===n,r=e[i?"offsetLeft":"offsetTop"],o=e[i?"offsetWidth":"offsetHeight"],a=t[i?"scrollLeft":"scrollTop"],s=t[i?"clientWidth":"clientHeight"],l=r+o,c=0;c=a>r?r:l>a+s?s>=o?l-s:r:a,t[i?"scrollLeft":"scrollTop"]=c},_navigatable:function(){var t=this,n=Tt(t.current,t),i=t.table.add(t.lockedTable),r=t.thead.parent().add(e(">table",t.lockedHeader)),o=(t._isLocked(),i),a=ut.support.isRtl(t.element);t.options.navigatable&&(t.options.scrollable&&(o=i.add(r),r.attr(sn,-1)),o.off("mousedown"+Lt+" focus"+Lt+" focusout"+Lt+" keydown"+Lt),r.on("keydown"+Lt,function(e){e.altKey&&e.keyCode==_t.DOWN&&(n().find(".k-grid-filter, .k-header-column-menu").click(),e.stopImmediatePropagation())}).find("a.k-link").attr("tabIndex",-1),i.attr(sn,Et.max(i.attr(sn)||0,0)).on("mousedown"+Lt+" keydown"+Lt,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}),o.on(ut.support.touch?"touchstart"+Lt:"mousedown"+Lt,zt+">"+Rt,Tt(it,t)).on("focus"+Lt,function(){if(!ut.support.touch){var t=n();t&&t.is(":visible")?t.addClass(Zt):n(e(this).find(Bt)),i.attr(sn,-1),r.attr(sn,-1),e(this).attr(sn,0)}}).on("focusout"+Lt,function(){var e=n();e&&e.removeClass(Zt)}).on("keydown"+Lt,function(o){var s,l,c,d,u,h=o.keyCode,p=!1,f=!o.isDefaultPrevented()&&!e(o.target).is(":button,a,:input,a>.k-icon"),g=t.options.pageable,m=t.dataSource,v="incell"==t._editMode(),_=o.shiftKey,w=Tt(t._relatedRow,t),y=n();if(y&&y.is("th")&&(f=!0),f&&h==_t.UP)n(ot(y,o.currentTarget,i,r,!0)),p=!0;else if(f&&h==_t.DOWN)n(ot(y,o.currentTarget,i,r)),p=!0;else if(f&&h==(a?_t.RIGHT:_t.LEFT))n(at(y,o.currentTarget,i,r,w)),p=!0;else if(f&&h==(a?_t.LEFT:_t.RIGHT))n(st(y,o.currentTarget,i,r,w)),p=!0;else if(f&&g&&_t.PAGEDOWN==h)m.page(m.page()+1),p=!0;else if(f&&g&&_t.PAGEUP==h)m.page(m.page()-1),p=!0;else if(h==_t.ENTER||_t.F2==h){if(y=y?y:i.find(Bt),!y.length)return;e(o.target).is("table")||e.contains(y[0],o.target)||(y=e(o.target).closest("[role=gridcell]")),y.is("th")?(y.find(".k-link").click(),p=!0):y.parent().is(".k-master-row,.k-grouping-row")?(y.parent().find(".k-icon:first").click(),p=!0):(c=y.find(":kendoFocusable:first"),!y.hasClass("k-edit-cell")&&c[0]&&y.hasClass("k-state-focused")?(c.focus(),p=!0):t.options.editable&&!e(o.target).is(":button,.k-button,textarea")&&(d=e(o.target).closest("[role=gridcell]"),d[0]||(d=y),t._handleEditing(d,!1,v?o.currentTarget:i[0]),p=!0))}else _t.ESC==h?(s=mt(),y&&e.contains(y[0],s)&&!y.hasClass("k-edit-cell")&&!y.parent().hasClass("k-grid-edit-row")?(nt(o.currentTarget,!0),p=!0):!t._editContainer||y&&!t._editContainer.has(y[0])&&y[0]!==t._editContainer[0]||(v?t.closeCell(!0):(l=e(y).parent().index(),s&&s.blur(),t.cancelRow(),l>=0&&t.current(i.find(">tbody>tr").eq(l).children().filter(Rt).first())),yn.msie&&9>yn.version&&document.body.focus(),nt(v?o.currentTarget:i[0],!0),p=!0)):_t.TAB==h&&(y=e(y),t.options.editable&&v&&(u=e(mt()).closest(".k-edit-cell"),u[0]&&u[0]!==y[0]&&(y=u)),u=lt(y,o.currentTarget,i,w,_),!y.is("th")&&u.length&&t.options.editable&&v&&(t._handleEditing(y,u,u.closest(i)),p=!0));p&&(o.preventDefault(),o.stopPropagation())}))},_handleEditing:function(n,i,r){var o,a,s=this,l=e(mt()),c=s._editMode(),d=yn.msie,u=d&&9>yn.version,h=s._editContainer;if(r=e(r),a="incell"==c?n.hasClass("k-edit-cell"):n.parent().hasClass("k-grid-edit-row"),s.editable){if(e.contains(h[0],l[0])&&(yn.opera||u?l.change().triggerHandler("blur"):(l.blur(),d&&l.blur())),!s.editable)return nt(r),t;if(!s.editable.end())return s.current("incell"==c?h:h.children().filter(Mt).first()),o=h.find(":kendoFocusable:first")[0],o&&o.focus(),t;"incell"==c?s.closeCell():(s.saveRow(),a=!0)}i&&s.current(i),u&&document.body.focus(),nt(r,!0),(!a&&!i||i)&&("incell"==c?s.editCell(s.current()):s.editRow(s.current().parent()))},_wrapper:function(){var e=this,t=e.table,n=e.options.height,i=e.element;i.is("div")||(i=i.wrap("<div/>").parent()),e.wrapper=i.addClass("k-grid k-widget"),n&&(e.wrapper.css(an,n),t.css(an,"auto")),e._initMobile()},_initMobile:function(){var t,n=this.options,i=this;this._isMobile=n.mobile===!0&&ut.support.mobileOS||"phone"===n.mobile||"tablet"===n.mobile,this._isMobile&&(t=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+ut.ns+'role="view" data-'+ut.ns+'init-widgets="false"></div>').parent(),this.pane=ut.mobile.ui.Pane.wrap(t),this.view=this.pane.view(),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},n.height&&this.pane.element.parent().css(an,n.height),this._editAnimation="slide",this.view.bind("show",function(){i._isLocked()&&(i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight())}))},_tbody:function(){var t,n=this,i=n.table;t=i.find(">tbody"),t.length||(t=e("<tbody/>").appendTo(i)),n.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t,n,i,r,o=this,a=o.options,s=a.scrollable,l=s!==!0&&s.virtual&&!o.virtualScrollable,c=!ut.support.kineticScrollNeeded||l?ut.support.scrollbar():0;s&&(t=o.wrapper.children(".k-grid-header"),t[0]||(t=e('<div class="k-grid-header" />').insertBefore(o.table)),t.css(wn?"padding-left":"padding-right",s.virtual?c+1:c),n=e('<table role="grid" />'),bn&&n.attr("cellspacing",0),n.append(o.thead),t.empty().append(e('<div class="k-grid-header-wrap" />').append(n)),o.content=o.table.parent(),o.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(o.content=o.content.parent()),o.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(o.content=o.table.wrap('<div class="k-grid-content" />').parent()),l&&(o.virtualScrollable=new xn(o.content,{dataSource:o.dataSource,itemHeight:function(){return o._averageRowHeight()}})),o.scrollables=t.children(".k-grid-header-wrap"),i=o.wrapper.find(".k-grid-footer"),i.length&&(o.scrollables=o.scrollables.add(i.children(".k-grid-footer-wrap"))),s.virtual?o.content.find(">.k-virtual-scrollable-wrap").unbind("scroll"+Lt).bind("scroll"+Lt,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}):(o.content.unbind("scroll"+Lt).bind("scroll"+Lt,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}),r=o.content.data("kendoTouchScroller"),r&&r.destroy(),r=ut.touchScroller(o.content),r&&r.movable&&(o.touchScroller=r,r.movable.bind("change",function(e){o.scrollables.scrollLeft(-e.sender.x),o.lockedContent&&o.lockedContent.scrollTop(-e.sender.y)}),o.one(Qt,function(e){e.sender.wrapper.addClass("k-grid-backface")}))))},_setContentWidth:function(){var t,n=this,i="k-grid-content-expander",r='<div class="'+i+'"></div>',o=n.resizable;n.options.scrollable&&n.wrapper.is(":visible")&&(t=n.table.parent().children("."+i),n._setContentWidthHandler=Tt(n._setContentWidth,n),n.dataSource&&n.dataSource.view().length?t[0]&&(t.remove(),o&&o.unbind("resize",n._setContentWidthHandler)):(t[0]||(t=e(r).appendTo(n.table.parent()),o&&o.bind("resize",n._setContentWidthHandler)),n.thead&&t.width(n.thead.width())),n._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var e,t=this.thead.parent(),n=t.parent(),i=this.wrapper[0].clientWidth,r=this._groups(),o=ut.support.scrollbar(),a=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),s=t.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),l=D(a),c=D(s);r>0&&(l+=this.lockedHeader.find(".k-group-cell:first").outerWidth()*r),l>=i&&(l=i-3*o),this.lockedHeader.add(this.lockedContent).width(l),n[0].style.width=n.parent().width()-l-2+"px",t.add(this.table).width(c),this.virtualScrollable&&(i-=o),this.content[0].style.width=i-l-2+"px",this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(l),e=this.footer.find(".k-grid-footer-wrap"),e[0].style.width=n[0].clientWidth+"px",e.children().first().width(c))}},_setContentHeight:function(){var e,t=this,n=t.options,i=t.wrapper.innerHeight(),r=t.wrapper.children(".k-grid-header"),o=ut.support.scrollbar();n.scrollable&&t.wrapper.is(":visible")&&(i-=r.outerHeight(),t.pager&&(i-=t.pager.element.outerHeight()),n.groupable&&(i-=t.wrapper.children(".k-grouping-header").outerHeight()),n.toolbar&&(i-=t.wrapper.children(".k-grid-toolbar").outerHeight()),t.footerTemplate&&(i-=t.wrapper.children(".k-grid-footer").outerHeight()),e=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},e(t.wrapper)&&(i>2*o?(t.lockedContent&&(o=t.table[0].offsetWidth>t.table.parent()[0].clientWidth?o:0,t.lockedContent.height(i-o)),t.content.height(i)):t.content.height(2*o+1)))},_averageRowHeight:function(){var e,t=this,n=t._items(t.tbody).length,i=t._rowHeight;return 0===n?i:(t._rowHeight||(t._rowHeight=i=t.table.outerHeight()/n,t._sum=i,t._measures=1),e=t.table.outerHeight()/n,i!==e&&(t._measures++,t._sum+=e,t._rowHeight=t._sum/t._measures),i)},_dataSource:function(){var e,n=this,i=n.options,r=i.dataSource;r=xt(r)?{data:r}:r,wt(r)&&(yt(r,{table:n.table,fields:n.columns}),e=i.pageable,wt(e)&&e.pageSize!==t&&(r.pageSize=e.pageSize)),n.dataSource&&n._refreshHandler?n.dataSource.unbind(qt,n._refreshHandler).unbind(It,n._progressHandler).unbind(Pt,n._errorHandler):(n._refreshHandler=Tt(n.refresh,n),n._progressHandler=Tt(n._requestStart,n),n._errorHandler=Tt(n._error,n)),n.dataSource=pt.create(r).bind(qt,n._refreshHandler).bind(It,n._progressHandler).bind(Pt,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var n,i,r,o,a,s,l,c,d,u=this,h=u.tbody,p=t.model,f=u.tbody.find("tr["+ut.attr("uid")+"="+p.uid+"]"),g=f.hasClass("k-alt"),m=u._items(h).index(f),v=u.lockedContent;if(v&&(n=u._relatedRow(f)),f.add(n).children(".k-edit-cell").length&&!u.options.rowTemplate)f.add(n).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){i=e(this),r=H(u.columns)[u.cellIndex(i)],r.field===t.field&&(i.hasClass("k-edit-cell")?i.addClass("k-dirty-cell"):(u._displayCell(i,r,p),e('<span class="k-dirty"/>').prependTo(i)))});else if(!f.hasClass("k-grid-edit-row")){for(s=e().add(f),v&&(o=(g?u.lockedAltRowTemplate:u.lockedRowTemplate)(p),s=s.add(n),n.replaceWith(o)),o=(g?u.altRowTemplate:u.rowTemplate)(p),f.replaceWith(o),o=u._items(h).eq(m),v&&(f=f.add(n),n=u._relatedRow(o)[0],et(o[0],n),o=o.add(n)),a=u.options.selectable,a&&f.hasClass("k-state-selected")&&u.select(o),c=s.children(":not(.k-group-cell,.k-hierarchy-cell)"),l=o.children(":not(.k-group-cell,.k-hierarchy-cell)"),m=0,d=u.columns.length;d>m;m++)r=u.columns[m],i=l.eq(m),a&&c.eq(m).hasClass("k-state-selected")&&i.addClass("k-state-selected"),r.field===t.field&&e('<span class="k-dirty"/>').prependTo(i);u.trigger("itemChange",{item:o,data:p,ns:ht})}},_pageable:function(){var t,n=this,i=n.options.pageable;i&&(t=n.wrapper.children("div.k-grid-pager"),t.length||(t=e('<div class="k-pager-wrap k-grid-pager"/>').appendTo(n.wrapper)),n.pager&&n.pager.destroy(),n.pager="object"==typeof i&&i instanceof ut.ui.Pager?i:new ut.ui.Pager(t,yt({},i,{dataSource:n.dataSource})))},_footer:function(){var t,n,i,r,a=this,s=a.dataSource.aggregates(),l="",c=a.footerTemplate,d=a.options,u=a.footer||a.wrapper.find(".k-grid-footer");c?(s=At(s)?o(a.dataSource.aggregate()):s,l=e(a._wrapFooter(c(s))),u.length?(n=l,a.angular("cleanup",function(){return{elements:u.get()}}),u.replaceWith(n),u=a.footer=n):u=a.footer=d.scrollable?d.pageable?l.insertBefore(a.wrapper.children("div.k-grid-pager")):l.appendTo(a.wrapper):l.insertBefore(a.tbody),a.angular("compile",function(){return{elements:u.find("td").get(),data:bt(a.columns,function(e){return{column:e,aggregate:s[e.field]}})}})):u&&!a.footer&&(a.footer=u),u.length&&(d.scrollable&&(t=u.attr("tabindex",-1).children(".k-grid-footer-wrap"),a.scrollables=a.scrollables.filter(function(){return!e(this).is(".k-grid-footer-wrap")}).add(t)),a._footerWidth&&u.find("table").css("width",a._footerWidth),t&&(i=a.content.scrollLeft(),r=d.scrollable!==!0&&d.scrollable.virtual&&!a.virtualScrollable,r&&(i=a.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),t.scrollLeft(i))),a.lockedContent&&(a._appendLockedColumnFooter(),a._applyLockedContainersWidth(),a._syncLockedFooterHeight())},_wrapFooter:function(t){var n=this,i="",r=ut.support.mobileOS?0:ut.support.scrollbar();return n.options.scrollable?(i=e('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(bn?' cellspacing="0"':"")+"><tbody>"+t+"</tbody></table></div></div>"),n._appendCols(i.find("table")),i.css(wn?"padding-left":"padding-right",r),i):'<tfoot class="k-grid-footer">'+t+"</tfoot>"},_columnMenu:function(){var e,n,i,r,o,a,s,l,c,d=this,u=H(d.columns),h=d.options,p=h.columnMenu,f=kt(d.columns,function(e){return e.columns!==t}).length>0,g=this._isMobile,m=function(e){d.trigger(jt,{field:e.field,container:e.container})},v=function(e){nt(e.closest("table"),!0)},_=h.$angular;if(p)for("boolean"==typeof p&&(p={}),a=L(d.thead),s=0,l=a.length;l>s;s++)n=u[s],c=a.eq(s),n.command||!n.field&&!c.attr("data-"+ut.ns+"field")||(e=c.data("kendoColumnMenu"),e&&e.destroy(),r=n.sortable!==!1&&p.sortable!==!1&&h.sortable!==!1?yt({},h.sortable,{compare:(n.sortable||{}).compare}):!1,o=h.filterable&&n.filterable!==!1&&p.filterable!==!1?yt({pane:d.pane},n.filterable,h.filterable):!1,i={dataSource:d.dataSource,values:n.values,columns:p.columns,sortable:r,filterable:o,messages:p.messages,owner:d,closeCallback:v,init:m,pane:d.pane,filter:g?":not(.k-column-active)":"",lockedColumns:!f&&n.lockable!==!1&&M(u).length>0},_&&(i.$angular=_),c.kendoColumnMenu(i))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e,t,n,i,r,o,a,s=this,l=H(s.columns),c=function(e){s.trigger(Wt,{field:e.field,container:e.container})},d=function(e){nt(e.closest("table"),!0)},u=s.options.filterable;if(u&&typeof u.mode==cn&&-1==u.mode.indexOf("menu")&&(u=!1),u&&!s.options.columnMenu)for(t=L(s.thead),i=0,r=t.length;r>i;i++)n=t.eq(i),l[i].filterable===!1||l[i].command||!l[i].field&&!n.attr("data-"+ut.ns+"field")||(e=n.data("kendoFilterMenu"),e&&e.destroy(),o=l[i].filterable,a=yt({},u,o,{dataSource:s.dataSource,values:l[i].values,closeCallback:d,init:c,pane:s.pane}),o&&o.messages&&(a.messages=yt(!0,{},u.messages,o.messages)),n.kendoFilterMenu(a))},_filterRow:function(){var t,n,i,r,o,a,s,l,c,d,u,h,p=this;if(p._hasFilterRow())for(t=H(p.columns),n=p.options.filterable,i=p.thead.find(".k-filter-row"),this._updateHeader(this.dataSource.group().length),r=0;t.length>r;r++)if(a=t[r],s=p.options.filterable.operators,l=!1,c=e("<th/>"),d=a.field,a.hidden&&c.hide(),i.append(c),d&&a.filterable!==!1){if(u=a.filterable&&a.filterable.cell||{},o=p.options.dataSource,o instanceof pt&&(o=p.options.dataSource.options),h=yt(!0,{},n.messages),a.filterable&&yt(!0,h,a.filterable.messages),u.enabled===!1){c.html("&nbsp;");continue}u.dataSource&&(o=u.dataSource,l=!0),a.filterable&&a.filterable.operators&&(s=a.filterable.operators),e("<span/>").attr(ut.attr("field"),d).kendoFilterCell({dataSource:p.dataSource,suggestDataSource:o,customDataSource:l,field:d,messages:h,values:a.values,template:u.template,delay:u.delay,inputWidth:u.inputWidth,suggestionOperator:u.suggestionOperator,minLength:u.minLength,dataTextField:u.dataTextField,operator:u.operator,operators:s,showOperators:u.showOperators}).appendTo(c)}else c.html("&nbsp;")},_sortable:function(){var e,t,n,i,r,o,a=this,s=H(a.columns),l=a.options.sortable;if(l){for(i=L(a.thead),r=0,o=i.length;o>r;r++)e=s[r],e.sortable!==!1&&!e.command&&e.field&&(n=i.eq(r),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr("data-"+ut.ns+"field",e.field).kendoColumnSorter(yt({},l,e.sortable,{dataSource:a.dataSource,aria:!0,filter:":not(.k-column-active)"})));i=null}},_columns:function(t){var n,i,r,o=this,a=o.table,s=a.find("col"),l=o.options.dataSource;if(t=t.length?t:bt(a.find("th"),function(t,n){t=e(t);var i=t.attr(ut.attr("sortable")),r=t.attr(ut.attr("filterable")),o=t.attr(ut.attr("type")),a=t.attr(ut.attr("groupable")),l=t.attr(ut.attr("field")),c=t.attr(ut.attr("menu"));return l||(l=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:l,type:o,sortable:"false"!==i,filterable:"false"!==r,groupable:"false"!==a,menu:c,template:t.attr(ut.attr("template")),width:s.eq(n).css("width")}}),n=!(o.table.find("tbody tr").length>0&&(!l||!l.transport)),o.options.scrollable){if(r=t,i=M(t),t=F(t),i.length>0&&0===t.length)throw Error("There should be at least one non locked columns");q(o.element.find("tr:has(th):first").find("th:not(.k-group-cell)"),r),t=i.concat(t)}o.columns=c(t,n)},_groups:function(){var e=this.dataSource.group();return e?e.length:0},_tmpl:function(e,t,r,o){var a,s,l,c,d=this,u=yt({},ut.Template,d.options.templateSettings),h=t.length,p={storage:{},count:0},f=d._hasDetails(),g=[],m=d._groups();if(!e){for(e="<tr",r&&g.push("k-alt"),f&&g.push("k-master-row"),g.length&&(e+=' class="'+g.join(" ")+'"'),h&&(e+=" "+ut.attr("uid")+'="#='+ut.expr("uid",u.paramName)+'#"'),e+=" role='row'>",m>0&&!o&&(e+=n(m)),f&&(e+='<td class="k-hierarchy-cell"><a class="k-icon k-plus" href="\\#" tabindex="-1"></a></td>'),a=0;h>a;a++)l=t[a],s=l.template,c=typeof s,e+="<td"+i(l.attributes)+" role='gridcell'>",e+=d._cellTmpl(l,p),e+="</td>";e+="</tr>"}return e=ut.template(e,u),p.count>0?Tt(e,p.storage):e},_headerCellText:function(e){var t=this,n=yt({},ut.Template,t.options.templateSettings),i=e.headerTemplate,r=typeof i,o=e.title||e.field||"";return r===ln?o=ut.template(i,n)({}):r===cn&&(o=i),o},_cellTmpl:function(e,t){var n,i,r=this,o=yt({},ut.Template,r.options.templateSettings),a=e.template,s=o.paramName,l=e.field,c="",d=e.format,u=typeof a,h=e.values;if(e.command){if(xt(e.command)){for(n=0,i=e.command.length;i>n;n++)c+=r._createButton(e.command[n]);return c.replace(fn,"\\#")}return r._createButton(e.command).replace(fn,"\\#")}return u===ln?(t.storage["tmpl"+t.count]=a,c+="#=this.tmpl"+t.count+"("+s+")#",t.count++):u===cn?c+=a:h&&h.length&&wt(h[0])&&"value"in h[0]&&l?(c+="#var v ="+ut.stringify(G(h)).replace(fn,"\\#")+"#",c+="#var f = v[",o.useWithBlock||(c+=s+"."),c+=l+"]#",c+="${f != null ? f : ''}"):(c+=e.encoded?"#:":"#=",d&&(c+='kendo.format("'+d.replace(pn,"\\$1")+'",'),l?(l=ut.expr(l,s),c+=l+"==null?'':"+l):c+="''",d&&(c+=")"),c+="#"),c},_templates:function(){var t=this,n=t.options,i=t.dataSource,r=i.group(),o=t.footer||t.wrapper.find(".k-grid-footer"),a=i.aggregate(),s=H(t.columns),l=H(M(t.columns)),c=n.scrollable?H(F(t.columns)):s;if(n.scrollable&&l.length){if(n.rowTemplate||n.altRowTemplate)throw Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(n.rowTemplate,c,!1,!0),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,c,!0,!0),t.lockedRowTemplate=t._tmpl(n.rowTemplate,l),t.lockedAltRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,l,!0)}else t.rowTemplate=t._tmpl(n.rowTemplate,c),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,c,!0);
30
+ t._hasDetails()&&(t.detailTemplate=t._detailTmpl(n.detailTemplate||"")),(t._group&&!At(a)||!At(a)&&!o.length||kt(s,function(e){return e.footerTemplate}).length)&&(t.footerTemplate=t._footerTmpl(s,a,"footerTemplate","k-footer-template")),r&&kt(s,function(e){return e.groupFooterTemplate}).length&&(a=e.map(r,function(e){return e.aggregates}),t.groupFooterTemplate=t._footerTmpl(c,a,"groupFooterTemplate","k-group-footer",l.length),n.scrollable&&l.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(l,a,"groupFooterTemplate","k-group-footer")))},_footerTmpl:function(e,t,r,a,s){var l,c,d,u,h,p=this,f=yt({},ut.Template,p.options.templateSettings),g=f.paramName,m="",v={},_=0,w={},y=p._groups(),b=o(t);for(m+='<tr class="'+a+'">',y>0&&!s&&(m+=n(y)),p._hasDetails()&&(m+='<td class="k-hierarchy-cell">&nbsp;</td>'),l=0,c=e.length;c>l;l++)h=e[l],d=h[r],u=typeof d,m+="<td"+i(h.footerAttributes)+">",d?(u!==ln&&(w=b[h.field]?yt({},f,{paramName:g+"['"+h.field+"']"}):{},d=ut.template(d,w)),v["tmpl"+_]=d,m+="#=this.tmpl"+_+"("+g+")#",_++):m+="&nbsp;",m+="</td>";return m+="</tr>",m=ut.template(m,f),_>0?Tt(m,v):m},_detailTmpl:function(e){var t=this,i="",r=yt({},ut.Template,t.options.templateSettings),o=r.paramName,a={},s=0,l=t._groups(),c=f(H(t.columns)).length,d=typeof e;return i+='<tr class="k-detail-row">',l>0&&(i+=n(l)),i+='<td class="k-hierarchy-cell"></td><td class="k-detail-cell"'+(c?' colspan="'+c+'"':"")+">",d===ln?(a["tmpl"+s]=e,i+="#=this.tmpl"+s+"("+o+")#",s++):i+=e,i+="</td></tr>",i=ut.template(i,r),s>0?Tt(i,a):i},_hasDetails:function(){var e=this;return null!==e.options.detailTemplate||(e._events[Ut]||[]).length},_hasFilterRow:function(){var t=this.options.filterable,n=t&&typeof t.mode==cn&&-1!=t.mode.indexOf("row"),i=this.columns,r=e.grep(i,function(e){return e.filterable===!1});return i.length&&r.length==i.length&&(n=!1),n},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&M(t.columns).length)throw Error("Having both detail template and locked columns is not supported");t.table.on(on+Lt,".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus",function(n){var i,r,o=e(this),a=o.hasClass("k-plus"),s=o.closest("tr.k-master-row"),l=t.detailTemplate,c=t._hasDetails();return o.toggleClass("k-plus",!a).toggleClass("k-minus",a),i=s.next(),c&&!i.hasClass("k-detail-row")&&(r=t.dataItem(s),i=e(l(r)).addClass(s.hasClass("k-alt")?"k-alt":"").insertAfter(s),t.angular("compile",function(){return{elements:i.get(),data:[{dataItem:r}]}}),t.trigger(Ut,{masterRow:s,detailRow:i,data:r,detailCell:i.find(".k-detail-cell")})),t.trigger(a?Kt:Xt,{masterRow:s,detailRow:i}),i.toggle(a),t._current&&t._current.attr("aria-expanded",a),n.preventDefault(),!1})},dataItem:function(t){if(t=e(t)[0],!t)return null;var n,i,r=this.tbody.children(),o=/k-grouping-row|k-detail-row|k-group-footer/,a=t.sectionRowIndex;for(i=a,n=0;a>n;n++)o.test(r[n].className)&&i--;return this._data[i]},expandRow:function(t){e(t).find("> td .k-plus, > td .k-i-expand").click()},collapseRow:function(t){e(t).find("> td .k-minus, > td .k-i-collapse").click()},_createHeaderCells:function(e,n){var r,o,a,s,l,c=this,d="",u=H(c.columns);for(r=0,s=e.length;s>r;r++)o=e[r].column||e[r],a=c._headerCellText(o),l=Ct(o,u),o.command?(d+="<th"+i(o.headerAttributes),n&&!e[r].colSpan&&(d+=" rowspan='"+n+"'"),l>-1&&(d+=ut.attr("index")+"='"+l+"'"),d+=">"+a+"</th>"):(d+="<th role='columnheader' "+ut.attr("field")+"='"+(o.field||"")+"' ",n&&!e[r].colSpan&&(d+=" rowspan='"+n+"'"),e[r].colSpan>1&&(d+='colspan="'+(e[r].colSpan-T(o.columns))+'" ',d+=ut.attr("colspan")+"='"+e[r].colSpan+"'"),o.title&&(d+=ut.attr("title")+'="'+o.title.replace(/'/g,"'")+'" '),o.groupable!==t&&(d+=ut.attr("groupable")+"='"+o.groupable+"' "),o.aggregates&&o.aggregates.length&&(d+=ut.attr("aggregates")+"='"+o.aggregates+"'"),l>-1&&(d+=ut.attr("index")+"='"+l+"'"),d+=i(o.headerAttributes),d+=">"+a+"</th>");return d},_appendLockedColumnContent:function(){var t,n,i,r,o,a=this.columns,s=this.table.find("colgroup"),l=s.find("col:not(.k-group-col,.k-hierarchy-col)"),c=e(),d=0,u=0;for(t=0,n=a.length;n>t;t++)if(a[t].locked)if(p(a[t])){for(r=1,a[t].columns&&(r=H(a[t].columns).length-T(a[t].columns)),r=r||1,o=0;r>o;o++)c=c.add(l.eq(t+u+o-d));u+=r-1}else d++;i=e('<div class="k-grid-content-locked"><table'+(bn?' cellspacing="0"':"")+"><colgroup/><tbody></tbody></table></div>"),s.detach(),i.find("colgroup").append(c),s.insertBefore(this.table.find("tbody")),this.lockedContent=i.insertBefore(this.content),this.lockedTable=i.children("table")},_appendLockedColumnFooter:function(){var t,n,i=this,r=i.footer,o=r.find(".k-footer-template>td"),a=r.find(".k-grid-footer-wrap>table>colgroup>col"),s=e('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"></tr></tbody></table></div>'),l=i._groups(),c=e(),d=e();for(c=c.add(o.filter(".k-group-cell")),t=0,n=H(M(i.columns)).length;n>t;t++)c=c.add(o.eq(t+l));for(d=d.add(a.filter(".k-group-col")),t=0,n=H(R(i.columns)).length;n>t;t++)d=d.add(a.eq(t+l));c.appendTo(s.find("tr")),d.appendTo(s.find("colgroup")),i.lockedFooter=s.prependTo(r)},_appendLockedColumnHeader:function(t){var n,i,r,o,a,s,l,c,d,u,h,f=this,m=this.columns,v=[],_=0,w=e(),y=f._hasFilterRow(),b=0,k=e(),x=0,C=e(),S=f.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),D=f.thead.find("tr:first .k-header:not(.k-group-cell,.k-hierarchy-cell)"),E=f.thead.find(".k-filter-row").find("th:not(.k-group-cell,.k-hierarchy-cell)"),M=0;for(n=0,r=m.length;r>n;n++){if(m[n].locked){if(l=D.eq(n),x=H(m[n].columns||[]).length,p(m[n])){for(m[n].columns&&(c=x-T(m[n].columns)),c=c||1,d=0;c>d;d++)w=w.add(S.eq(n+M+d-_));M+=c-1}for(P([m[n]],O(l),v,0,0),x=x||1,u=0;x>u;u++)k=k.add(E.eq(b+u));b+=x}m[n].columns&&(_+=T(m[n].columns)),p(m[n])||_++}if(v.length){for(i='<div class="k-grid-header-locked" style="width:1px"><table'+(bn?' cellspacing="0"':"")+"><colgroup/><thead>",i+=Array(v.length+1).join("<tr></tr>"),i+=(y?'<tr class="k-filter-row" />':"")+"</thead></table></div>",s=e(i),S=s.find("colgroup"),S.append(f.thead.prev().find("col.k-group-col").add(w)),o=s.find("thead tr:not(.k-filter-row)"),n=0,r=v.length;r>n;n++)C=g(v[n]),o.eq(n).append(f.thead.find("tr:eq("+n+") .k-group-cell").add(C));h=I(this.thead),h>v.length&&A(s,h),a=s.find(".k-filter-row"),a.append(f.thead.find(".k-filter-row .k-group-cell").add(k)),this.lockedHeader=s.prependTo(t),this._syncLockedHeaderHeight()}},_removeLockedContainers:function(){var e=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);ut.destroy(e),e.off(Lt).remove(),this.lockedHeader=this.lockedContent=this.lockedFooter=null,this.selectable=null},_thead:function(){var t,n,i,r,o=this,a=o.columns,s=o._hasDetails()&&a.length,l=o._hasFilterRow(),c="",d=o.table.find(">thead"),u=o.element.find("thead:first").length>0;if(d.length||(d=e("<thead/>").insertBefore(o.tbody)),o.lockedHeader&&o.thead?(n=o.thead.find("tr:has(th):not(.k-filter-row)").html(""),o._removeLockedContainers()):n=o.element.find(u?"thead:first tr:has(th):not(.k-filter-row)":"tr:has(th):first"),!n.length&&(n=d.children().first(),!n.length)){for(i=[{rowSpan:1,cells:[],index:0}],o._prepareColumns(i,a),t=0;i.length>t;t++)c+="<tr>",s&&(c+='<th class="k-hierarchy-cell">&nbsp;</th>'),c+=o._createHeaderCells(i[t].cells,i[t].rowSpan),c+="</tr>";n=e(c)}l&&(r=e("<tr/>"),r.addClass("k-filter-row"),s&&r.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'),d.append(r)),n.children().length?s&&!n.find(".k-hierarchy-cell")[0]&&n.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'):(c="",s&&(c+='<th class="k-hierarchy-cell">&nbsp;</th>'),c+=o._createHeaderCells(a),n.html(c)),n.attr("role","row").find("th").addClass("k-header"),o.options.scrollable||d.addClass("k-grid-header"),n.find("script").remove().end().prependTo(d),o.thead&&o._destroyColumnAttachments(),this.angular("cleanup",function(){return{elements:d.find("th").get()}}),this.angular("compile",function(){return{elements:d.find("th").get(),data:bt(a,function(e){return{column:e}})}}),o.thead=d.attr("role","rowgroup"),o._sortable(),o._filterable(),o._filterRow(),o._scrollable(),o._updateCols(),o._columnMenu(),this.options.scrollable&&M(this.columns).length&&(o._appendLockedColumnHeader(o.thead.closest(".k-grid-header")),o._appendLockedColumnContent(),o.lockedContent.bind("DOMMouseScroll"+Lt+" mousewheel"+Lt,Tt(o._wheelScroll,o)),o._applyLockedContainersWidth()),o._updateFirstColumnClass(),o._resizable(),o._draggable(),o._reorderable(),o.groupable&&o._attachGroupable()},_updateFirstColumnClass:function(){var t,n,i=this,r=i.columns||[],o=i._hasDetails()&&r.length;o||i._groups()||(t=e(),n=i.thead.find(">tr:not(.k-filter-row):not(:first)"),r=F(r),n.length&&r[0]&&!r[0].columns&&(t=t.add(n)),i._isLocked()&&(n=i.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),r=M(i.columns),n.length&&r[0]&&!r[0].columns&&(t=t.add(n))),t.each(function(){var t=e(this).find("th");t.removeClass("k-first"),t.eq(0).addClass("k-first")}))},_prepareColumns:function(e,t,n,i){var r,o,a=i||e[e.length-1],s=e[a.index+1],l=0;for(r=0;t.length>r;r++)o={column:t[r],colSpan:0},a.cells.push(o),t[r].columns&&t[r].columns.length&&(s||(s={rowSpan:0,cells:[],index:e.length},e.push(s)),o.colSpan=t[r].columns.length,this._prepareColumns(e,t[r].columns,o,s),l+=o.colSpan-1,a.rowSpan=e.length-a.index);n&&(n.colSpan+=l)},_wheelScroll:function(t){var n,i,r;t.ctrlKey||(n=this.content,this.options.scrollable.virtual&&(n=this.virtualScrollable.verticalScrollbar),i=n.scrollTop(),r=ut.wheelDeltaY(t),r&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Lt,!1),n.scrollTop(i+-r)))},_isLocked:function(){return null!=this.lockedHeader},_updateCols:function(e){e=e||this.thead.parent().add(this.table),this._appendCols(e,this._isLocked())},_updateLockedCols:function(e){this._isLocked()&&(e=e||this.lockedHeader.find("table").add(this.lockedTable),j(e,B(R(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(e,t){t?j(e,B(z(this.columns)),this._hasDetails(),0):j(e,B(f(this.columns)),this._hasDetails(),this._groups())},_autoColumns:function(e){if(e&&e.toJSON){var t,n=this;e=e.toJSON();for(t in e)n.columns.push({field:t});n._thead(),n._templates()}},_rowsHtml:function(e,t){var n,i,r=this,o="",a=t.rowTemplate,s=t.altRowTemplate;for(n=0,i=e.length;i>n;n++)o+=n%2?s(e[n]):a(e[n]),r._data.push(e[n]);return o},_groupRowHtml:function(e,t,n,i,r,o){var a,s,l=this,c="",d=e.field,u=kt(l.columns,function(e){return e.field==d})[0]||{},h=u.groupHeaderTemplate,p=(u.title||d)+": "+$(e.value,u.format,u.values),f=l._groupAggregatesDefaultObject||{},g=yt(f,e.aggregates),m=yt({},{field:e.field,value:e.value,aggregates:g},e.aggregates[e.field]),v=r.groupFooterTemplate,_=e.items;if(h&&(p=typeof h===ln?h(m):ut.template(h)(m)),c+=i(t,n,p),e.hasSubgroups)for(a=0,s=_.length;s>a;a++)c+=l._groupRowHtml(_[a],o?t:t-1,n+1,i,r,o);else c+=l._rowsHtml(_,r);return v&&(c+=v(g)),c},collapseGroup:function(t){t=e(t);var n,i,r,o,a,s=this.options.groupable,l=s.showFooter,c=l?0:1,d=e();for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?d=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(d=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td:first").attr("aria-expanded",!1),t=t.nextAll("tr"),r=0,o=t.length;o>r&&(a=t.eq(r),i=a.find(".k-group-cell").length,a.hasClass("k-grouping-row")?c++:a.hasClass("k-group-footer")&&c--,!(n>=i||a.hasClass("k-group-footer")&&0>c));r++)a.hide(),d.eq(r).hide()},expandGroup:function(t){t=e(t);var n,i,r,o,a,s=this,l=e(),c=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?l=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(l=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td:first").attr("aria-expanded",!0),t=t.nextAll("tr"),o=0,a=t.length;a>o&&(i=t.eq(o),r=i.find(".k-group-cell").length,!(n>=r));o++)r!=n+1||i.hasClass("k-detail-row")||(i.show(),l.eq(o).show(),i.hasClass("k-grouping-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&s.expandGroup(i),i.hasClass("k-master-row")&&i.find(".k-icon").hasClass("k-minus")&&(i.next().show(),l.eq(o+1).show())),i.hasClass("k-grouping-row")&&c++,i.hasClass("k-group-footer")&&(1==c?(i.show(),l.eq(o).show()):c--)},_updateHeader:function(t){var n=this,i=n._isLocked()?n.lockedHeader.find("thead"):n.thead,r=i.find("tr.k-filter-row").find("th.k-group-cell").length,o=i.find("tr:first").find("th.k-group-cell").length,a=i.children("tr:not(:first)").filter(function(){return!e(this).children(":visible").length});t>o?(e(Array(t-o+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.children("tr:not(.k-filter-row)")),n.element.is(":visible")&&a.find("th.k-group-cell").hide()):o>t&&i.find("tr").each(function(){e(this).find("th.k-group-cell").filter(":eq("+t+"),:gt("+t+")").remove()}),t>r&&e(Array(t-r+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.find(".k-filter-row"))},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,n=this;n._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",n.wrapper).add(n.thead.parent()).add(n.table),n._footerWidth=Z(t.eq(0)),t.width(n._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",n.wrapper).add(n.lockedHeader.find(">table")).add(n.lockedTable),t.width(Z(t.eq(0))))},hideColumn:function(n){var i,r,o,a,l,c,d,u,g,m,v=this,_=0,w=v.footer||v.wrapper.find(".k-grid-footer"),y=v.columns,b=v.lockedHeader?L(v.lockedHeader.find(">table>thead")).filter(":visible").length:0;if(n="number"==typeof n?y[n]:wt(n)?kt(S(y),function(e){return e===n})[0]:kt(S(y),function(e){return e.field===n})[0],n&&p(n)){if(n.columns&&n.columns.length){for(c=x(n,y),h(n,!1),Y(s(e(">table>thead",v.lockedHeader),v.thead,">tr:eq("+c.row+")>th"),c.cell,!1),o=0;n.columns.length>o;o++)this.hideColumn(n.columns[o]);return v.trigger(Gt,{column:n}),t}if(g=Ct(n,f(H(y))),h(n,!1),v._setParentsVisibility(n,!1),v._templates(),v._updateCols(),v._updateLockedCols(),m=v.thead,d=g,v.lockedHeader&&b>g?m=v.lockedHeader.find(">table>thead"):d-=b,i=L(m).filter(":visible").eq(d),i[0].style.display="none",Y(s(e(">table>thead",v.lockedHeader),v.thead,">tr.k-filter-row>th"),g,!1),w[0]&&(v._updateCols(w.find(">.k-grid-footer-wrap>table")),v._updateLockedCols(w.find(">.k-grid-footer-locked>table")),Y(w.find(".k-footer-template>td"),g,!1)),v.lockedTable&&b>g?Q(v.lockedTable.find(">tbody>tr"),g):Q(v.tbody.children(),g-b),v.lockedTable)v._updateTablesWidth(),v._applyLockedContainersWidth(),v._syncLockedContentHeight(),v._syncLockedHeaderHeight(),v._syncLockedFooterHeight();else{for(a=v.thead.prev().find("col"),o=0,u=a.length;u>o;o+=1){if(l=a[o].style.width,!l||-1!=l.indexOf("%")){_=0;break}_+=parseInt(l,10)}r=e(">.k-grid-header table:first,>.k-grid-footer table:first",v.wrapper).add(v.table),v._footerWidth=null,_&&(r.width(_),v._footerWidth=_),yn.msie&&8==yn.version&&(r.css("display","inline-table"),setTimeout(function(){r.css("display","table")},1))}v._updateFirstColumnClass(),v.trigger(Gt,{column:n})}},_setParentsVisibility:function(t,n){var i,r,o,a,l,c=this.columns,d=[],p=n?function(e){return f(e.columns).length&&e.hidden}:function(e){return!f(e.columns).length&&!e.hidden};if(u(t,c,d)&&d.length)for(i=d.length-1;i>=0;i--)r=d[i],o=b(r,c),a=s(e(">table>thead",this.lockedHeader),this.thead,">tr:eq("+o.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(o.cell),p(r)&&(h(r,n),a[0].style.display=n?"":"none"),a.filter("["+ut.attr("colspan")+"]").length&&(l=parseInt(a.attr(ut.attr("colspan")),10),a[0].colSpan=l-T(r.columns)||1)},showColumn:function(n){var i,r,o,a,l,c,d,u,f,g,m,v=this,_=v.columns,w=v.footer||v.wrapper.find(".k-grid-footer"),y=v.lockedHeader?L(v.lockedHeader.find(">table>thead")).length:0;if(n="number"==typeof n?_[n]:wt(n)?kt(S(_),function(e){return e===n})[0]:kt(S(_),function(e){return e.field===n})[0],n&&!p(n)){if(n.columns&&n.columns.length){for(d=x(n,_),h(n,!0),Y(s(e(">table>thead",v.lockedHeader),v.thead,">tr:eq("+d.row+")>th"),d.cell,!0),i=0;n.columns.length>i;i++)this.showColumn(n.columns[i]);return v.trigger($t,{column:n}),t}if(g=Ct(n,H(_)),h(n,!0),v._setParentsVisibility(n,!0),v._templates(),v._updateCols(),v._updateLockedCols(),m=v.thead,c=g,v.lockedHeader&&y>g?m=v.lockedHeader.find(">table>thead"):c-=y,o=L(m).eq(c),o[0].style.display="",Y(s(e(">table>thead",v.lockedHeader),v.thead,">tr.k-filter-row>th"),g,!0),w[0]&&(v._updateCols(w.find(">.k-grid-footer-wrap>table")),v._updateLockedCols(w.find(">.k-grid-footer-locked>table")),Y(w.find(".k-footer-template>td"),g,!0)),v.lockedTable&&y>g?K(v.lockedTable.find(">tbody>tr"),g):K(v.tbody.children(),g-y),v.lockedTable)v._updateTablesWidth(),v._applyLockedContainersWidth(),v._syncLockedContentHeight(),v._syncLockedHeaderHeight();else if(a=e(">.k-grid-header table:first,>.k-grid-footer table:first",v.wrapper).add(v.table),n.width){for(l=0,f=v.thead.prev().find("col"),i=0,r=f.length;r>i;i+=1){if(u=f[i].style.width,u.indexOf("%")>-1){l=0;break}l+=parseInt(u,10)}v._footerWidth=null,l&&(a.width(l),v._footerWidth=l)}else a.width("");v._updateFirstColumnClass(),v.trigger($t,{column:n})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),ut.ui.progress(t,e)},_resize:function(){this.content&&(this._setContentHeight(),this._setContentWidth())},_isActiveInTable:function(){var t=mt();return this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t))},refresh:function(t){var n,i=this,r=i.dataSource.view(),o=i.options.navigatable,a=e(i.current()),s=!1,l=(i.dataSource.group()||[]).length,c=l+B(f(i.columns)).length;t&&"itemchange"===t.action&&i.editable||(t=t||{},i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(i._angularItems("cleanup"),o&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=a.is("th"),n=0,s&&(n=i.thead.find("th:not(.k-group-cell)").index(a))),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(r[0],l)),c=l+i.columns.length),i._group=l>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(l),i._group=l>0),i._renderContent(r,c,l),i._renderLockedContent(r,c,l),i._footer(),i._setContentHeight(),i._setContentWidth(),i.lockedTable&&(i.options.scrollable.virtual?i.content.find(">.k-virtual-scrollable-wrap").trigger("scroll"):i.content.trigger("scroll")),n>=0&&(i._removeCurrent(),i.current(s?i.thead.find("th:not(.k-group-cell)").eq(n):i.table.add(i.lockedTable).find(Bt).first()),i._current&&nt(i._current.closest("table")[0],!0)),i.touchScroller&&i.touchScroller.contentResized(),i.selectable&&i.selectable.resetTouchEvents(),i._angularItems("compile"),i.trigger(Qt)))},_renderContent:function(e,t,n){var i,r,a=this,s="",l=null!=a.lockedContent,c={rowTemplate:a.rowTemplate,altRowTemplate:a.altRowTemplate,groupFooterTemplate:a.groupFooterTemplate};if(t=l?t-B(R(a.columns)).length:t,n>0)for(t=l?t-n:t,a.detailTemplate&&t++,a.groupFooterTemplate&&(a._groupAggregatesDefaultObject=o(a.dataSource.aggregate())),i=0,r=e.length;r>i;i++)s+=a._groupRowHtml(e[i],t,0,l?dt:ct,c,l);else s+=a._rowsHtml(e,c);a.tbody=V(a.tbody,a.table,s)},_renderLockedContent:function(e,t,n){var i,r,o,a="",s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(o=this.lockedTable,n>0)for(t-=f(H(F(this.columns))).length,i=0,r=e.length;r>i;i++)a+=this._groupRowHtml(e[i],t,0,ct,s);else a=this._rowsHtml(e,s);V(o.children("tbody"),o,a),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var n,i,r,o,a=e[0].rows,s=a.length,l=t[0].rows,c=e.add(t),d=c.length,u=[];for(n=0;s>n&&l[n];n++)a[n].style.height&&(a[n].style.height=l[n].style.height=""),i=a[n].offsetHeight,r=l[n].offsetHeight,o=0,i>r?o=i:r>i&&(o=r),u.push(o);for(n=0;d>n;n++)c[n].style.display="none";for(n=0;s>n;n++)u[n]&&(a[n].style.height=l[n].style.height=u[n]+"px");for(n=0;d>n;n++)c[n].style.display=""}});ut.ExcelMixin&&ut.ExcelMixin.extend(Sn.prototype),ut.PDFMixin&&ut.PDFMixin.extend(Sn.prototype),ht.plugin(Sn),ht.plugin(xn)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i="change",r="cancel",o="dataBound",a="dataBinding",s=n.ui.Widget,l=n.keys,c=">*",d="progress",u="error",h="k-state-focused",p="k-state-selected",f="k-edit-item",g="edit",m="remove",v="save",_="click",w=".kendoListView",y=e.proxy,b=n._activeElement,k=n.ui.progress,x=n.data.DataSource,C=n.ui.DataBoundWidget.extend({init:function(t,i){var r=this;i=e.isArray(i)?{dataSource:i}:i,s.fn.init.call(r,t,i),i=r.options,r.wrapper=t=r.element,t[0].id&&(r._itemId=t[0].id+"_lv_active"),r._element(),r._dataSource(),r._templates(),r._navigatable(),r._selectable(),r._pageable(),r._crudHandlers(),r.options.autoBind&&r.dataSource.fetch(),n.notify(r)},events:[i,r,a,o,g,m,v],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(e){s.fn.setOptions.call(this,e),this._templates()},_templates:function(){var e=this.options;this.template=n.template(e.template||""),this.altTemplate=n.template(e.altTemplate||e.template),this.editTemplate=n.template(e.editTemplate||"")},_item:function(e){return this.element.children()[e]()},items:function(){return this.element.children()},dataItem:function(t){var i=n.attr("uid"),r=e(t).closest("["+i+"]").attr(i);return this.dataSource.getByUid(r)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},_unbindDataSource:function(){var e=this;e.dataSource.unbind(i,e._refreshHandler).unbind(d,e._progressHandler).unbind(u,e._errorHandler)},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=y(e.refresh,e),e._progressHandler=y(e._progress,e),e._errorHandler=y(e._error,e)),e.dataSource=x.create(e.options.dataSource).bind(i,e._refreshHandler).bind(d,e._progressHandler).bind(u,e._errorHandler)},_progress:function(){k(this.element,!0)},_error:function(){k(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(e){var i,r,s,l,c,d=this,u=d.dataSource.view(),h="",p=d.template,f=d.altTemplate,g=b();if(e=e||{},"itemchange"===e.action)return d._hasBindingTarget()||d.editable||(i=e.items[0],s=d.items().filter("["+n.attr("uid")+"="+i.uid+"]"),s.length>0&&(l=s.index(),d.angular("cleanup",function(){return{elements:[s]}}),s.replaceWith(p(i)),s=d.items().eq(l),s.attr(n.attr("uid"),i.uid),d.angular("compile",function(){return{elements:[s],data:[{dataItem:i}]}}),d.trigger("itemChange",{item:s,data:i}))),t;if(!d.trigger(a,{action:e.action||"rebind",items:e.items,index:e.index})){for(d._angularItems("cleanup"),d._destroyEditable(),l=0,c=u.length;c>l;l++)h+=l%2?f(u[l]):p(u[l]);for(d.element.html(h),r=d.items(),l=0,c=u.length;c>l;l++)r.eq(l).attr(n.attr("uid"),u[l].uid).attr("role","option").attr("aria-selected","false");d.element[0]===g&&d.options.navigatable&&d.current(r.eq(0)),d._angularItems("compile"),d.trigger(o)}},_pageable:function(){var t,i,r=this,o=r.options.pageable;e.isPlainObject(o)&&(i=o.pagerId,t=e.extend({},o,{dataSource:r.dataSource,pagerId:null}),r.pager=new n.ui.Pager(e("#"+i),t))},_selectable:function(){var e,r,o=this,a=o.options.selectable,s=o.options.navigatable;a&&(e=n.ui.Selectable.parseOptions(a).multiple,o.selectable=new n.ui.Selectable(o.element,{aria:!0,multiple:e,filter:c,change:function(){o.trigger(i)}}),s&&o.element.on("keydown"+w,function(n){if(n.keyCode===l.SPACEBAR){if(r=o.current(),n.target==n.currentTarget&&n.preventDefault(),e)if(n.ctrlKey){if(r&&r.hasClass(p))return r.removeClass(p),t}else o.selectable.clear();else o.selectable.clear();o.selectable.value(r)}}))},current:function(e){var n=this,i=n.element,r=n._current,o=n._itemId;return e===t?r:(r&&r[0]&&(r[0].id===o&&r.removeAttr("id"),r.removeClass(h),i.removeAttr("aria-activedescendant")),e&&e[0]&&(o=e[0].id||o,n._scrollTo(e[0]),i.attr("aria-activedescendant",o),e.addClass(h).attr("id",o)),n._current=e,t)},_scrollTo:function(t){var n,i,r=this,o=!1,a="scroll";"auto"==r.wrapper.css("overflow")||r.wrapper.css("overflow")==a?n=r.wrapper[0]:(n=window,o=!0),i=function(i,r){var s=o?e(t).offset()[i.toLowerCase()]:t["offset"+i],l=t["client"+r],c=e(n)[a+i](),d=e(n)[r.toLowerCase()]();s+l>c+d?e(n)[a+i](s+l-d):c>s&&e(n)[a+i](s)},i("Top","Height"),i("Left","Width")},_navigatable:function(){var t=this,i=t.options.navigatable,r=t.element,o=function(n){t.current(e(n.currentTarget)),e(n.target).is(":button,a,:input,a>.k-icon,textarea")||r.focus()};i&&(t._tabindex(),r.on("focus"+w,function(){var e=t._current;e&&e.is(":visible")||(e=t._item("first")),t.current(e)}).on("focusout"+w,function(){t._current&&t._current.removeClass(h)}).on("keydown"+w,function(i){var o,a,s=i.keyCode,c=t.current(),d=e(i.target),u=!d.is(":button,textarea,a,a>.t-icon,input"),h=d.is(":text"),p=n.preventDefault,g=r.find("."+f),m=b();if(!(!u&&!h&&l.ESC!=s||h&&l.ESC!=s&&l.ENTER!=s))if(l.UP===s||l.LEFT===s)c&&(c=c.prev()),t.current(c&&c[0]?c:t._item("last")),p(i);else if(l.DOWN===s||l.RIGHT===s)c&&(c=c.next()),t.current(c&&c[0]?c:t._item("first")),p(i);else if(l.PAGEUP===s)t.current(null),t.dataSource.page(t.dataSource.page()-1),p(i);else if(l.PAGEDOWN===s)t.current(null),t.dataSource.page(t.dataSource.page()+1),p(i);else if(l.HOME===s)t.current(t._item("first")),p(i);else if(l.END===s)t.current(t._item("last")),p(i);else if(l.ENTER===s)0!==g.length&&(u||h)?(o=t.items().index(g),m&&m.blur(),t.save(),a=function(){t.element.trigger("focus"),t.current(t.items().eq(o))},t.one("dataBound",a)):""!==t.options.editTemplate&&t.edit(c);else if(l.ESC===s){if(g=r.find("."+f),0===g.length)return;o=t.items().index(g),t.cancel(),t.element.trigger("focus"),t.current(t.items().eq(o))}}),r.on("mousedown"+w+" touchstart"+w,c,y(o,t)))},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(i)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),r.value(n),t):r.value()},_destroyEditable:function(){var e=this;e.editable&&(e.editable.destroy(),delete e.editable)},_modelFromElement:function(e){var t=e.attr(n.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(e){var t,i,r,o=this,a=o.editable,s=o.template,l=!0;return a&&(e&&(l=a.end()),l&&(a.element.index()%2&&(s=o.altTemplate),t=o._modelFromElement(a.element),o._destroyEditable(),r=a.element.index(),a.element.replaceWith(s(t)),i=o.items().eq(r),i.attr(n.attr("uid"),t.uid),o._hasBindingTarget()&&n.bind(i,t))),l},edit:function(e){var t,i,r=this,o=r._modelFromElement(e),a=o.uid;r.cancel(),e=r.items().filter("["+n.attr("uid")+"="+a+"]"),i=e.index(),e.replaceWith(r.editTemplate(o)),t=r.items().eq(i).addClass(f).attr(n.attr("uid"),o.uid),r.editable=t.kendoEditable({model:o,clearContainer:!1,errorTemplate:!1,target:r}).data("kendoEditable"),r.trigger(g,{model:o,item:t})},save:function(){var e,t=this,n=t.editable;n&&(n=n.element,e=t._modelFromElement(n),!t.trigger(v,{model:e,item:n})&&t._closeEditable(!0)&&t.dataSource.sync())},remove:function(e){var t=this,n=t.dataSource,i=t._modelFromElement(e);t.trigger(m,{model:i,item:e})||(e.hide(),n.remove(i),n.sync())},add:function(){var e=this,t=e.dataSource,n=t.indexOf((t.view()||[])[0]);0>n&&(n=0),e.cancel(),t.insert(n,{}),e.edit(e.element.children().first())},cancel:function(){var e,t,n=this,i=n.dataSource;n.editable&&(e=n.editable.element,t=n._modelFromElement(e),n.trigger(r,{model:t,container:e})||(i.cancelChanges(t),n._closeEditable(!1)))},_crudHandlers:function(){var t=this,i=_+w;t.element.on(i,".k-edit-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.edit(r),i.preventDefault()}),t.element.on(i,".k-delete-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.remove(r),i.preventDefault()}),t.element.on(i,".k-update-button",function(e){t.save(),e.preventDefault()}),t.element.on(i,".k-cancel-button",function(e){t.cancel(),e.preventDefault()})},destroy:function(){var e=this;s.fn.destroy.call(e),e._unbindDataSource(),e._destroyEditable(),e.element.off(w),e.pager&&e.pager.destroy(),n.destroy(e.element)}});n.ui.plugin(C)}(window.kendo.jQuery),function(e,t){function n(t){return e.map(i(t),function(e){return e.name}).join(", ")}function i(e){var t=e[0];return t.files?r(t.files):[{name:s(t.value),extension:a(t.value),size:null}]}function r(t){return e.map(t,function(e){return o(e)})}function o(e){var t=e.name||e.fileName;return{name:w.htmlEncode(t),extension:a(t),size:e.size||e.fileSize,rawFile:e}}function a(e){var t=e.match(k);return t?t[0]:""}function s(e){var t=e.lastIndexOf("\\");return-1!=t?e.substr(t+1):e}function l(t,n){var i=w.guid();return e.map(t,function(e){return e.uid=n?w.guid():i,e})}function c(t,n,i){var r,o;n._supportsRemove()&&(r=t.data("fileNames"),o=e.map(r,function(e){return e.name}),n._submitRemove(o,i,function(e,i,o){n._removeFileEntry(t),n.trigger(T,{operation:"remove",files:r,response:e,XMLHttpRequest:o})},function(e){n.trigger(D,{operation:"remove",files:r,XMLHttpRequest:e}),b("Server response: "+e.responseText)}))}function d(t,n,i){var r=!1,o="";try{o=e.parseJSON(u(t)),r=!0}catch(a){i()}r&&n(o)}function u(e){return(t===e||""===e)&&(e="{}"),e}function h(e){e.stopPropagation(),e.preventDefault()}function p(e,t,n,i){var r,o;e.on("dragenter"+t,function(){n(),o=new Date,r||(r=setInterval(function(){var e=new Date-o;e>100&&(i(),clearInterval(r),r=null)},100))}).on("dragover"+t,function(){o=new Date})}function f(e){return e.is(".k-file-progress, .k-file-success, .k-file-error")}function g(t){return e(t.target).closest(".k-file")}function m(){var n={},i=e("meta[name=csrf-token]").attr("content"),r=e("meta[name=csrf-param]").attr("content");return e("input[name^='__RequestVerificationToken']").each(function(){n[this.name]=this.value}),r!==t&&i!==t&&(n[r]=i),n}var v,_,w=window.kendo,y=w.ui.Widget,b=w.logToConsole,k=/\.([^\.]+)$/,x=".kendoUpload",C="select",S="upload",T="success",D="error",A="complete",E="cancel",I="progress",P="remove",M=y.extend({init:function(t,n){var i,r,o,a=this;y.fn.init.call(a,t,n),a.name=t.name,a.multiple=a.options.multiple,a.localization=a.options.localization,i=a.element,a.wrapper=i.closest(".k-upload"),0===a.wrapper.length&&(a.wrapper=a._wrapInput(i)),a._activeInput(i),a.toggle(a.options.enabled),r=a._ns=x+"-"+w.guid(),i.closest("form").on("submit"+r,e.proxy(a._onParentFormSubmit,a)).on("reset"+r,e.proxy(a._onParentFormReset,a)),a.options.async.saveUrl?(a._module=a._supportsFormData()?new _(a):new v(a),a._async=!0,o=a.options.files,o.length>0&&a._renderInitialFiles(o)):a._module=new F(a),a._supportsDrop()&&a._setupDropZone(),a.wrapper.on("click",".k-upload-action",e.proxy(a._onFileAction,a)).on("click",".k-upload-selected",e.proxy(a._onUploadSelected,a)),a.element.val()&&a._onInputChange({target:a.element})},events:[C,S,T,D,A,E,I,P],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",uploadSelectedFiles:"Upload files",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done"}},setOptions:function(e){var t=this,n=t.element;y.fn.setOptions.call(t,e),t.multiple=t.options.multiple,n.attr("multiple",t._supportsMultiple()?t.multiple:!1),t.toggle(t.options.enabled)},enable:function(e){e=t===e?!0:e,this.toggle(e)
31
+ },disable:function(){this.toggle(!1)},toggle:function(e){e=t===e?e:!e,this.wrapper.toggleClass("k-state-disabled",e),this.element.prop("disabled",e)},destroy:function(){var t=this;e(document).add(e(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns),e(t.element).off(x),y.fn.destroy.call(t)},_addInput:function(t){if(t[0].nodeType){var n=this,i=t.clone().val("");i.insertAfter(n.element).data("kendoUpload",n),e(n.element).hide().attr("tabindex","-1").removeAttr("id").off(x),n._activeInput(i),n.element.focus()}},_activeInput:function(t){var n=this,i=n.wrapper;n.element=t,t.attr("multiple",n._supportsMultiple()?n.multiple:!1).attr("autocomplete","off").on("click"+x,function(e){i.hasClass("k-state-disabled")&&e.preventDefault()}).on("focus"+x,function(){e(this).parent().addClass("k-state-focused")}).on("blur"+x,function(){e(this).parent().removeClass("k-state-focused")}).on("change"+x,e.proxy(n._onInputChange,n)).on("keydown"+x,e.proxy(n._onInputKeyDown,n))},_onInputKeyDown:function(e){var t=this,n=t.wrapper.find(".k-upload-action:first");e.keyCode===w.keys.TAB&&n.length>0&&(e.preventDefault(),n.focus())},_onInputChange:function(t){var n=this,i=e(t.target),r=l(n._inputFiles(i),n._isAsyncNonBatch()),o=n.trigger(C,{files:r});o?(n._addInput(i),i.remove()):n._module.onSelect({target:i},r)},_onDrop:function(t){var n,i=t.originalEvent.dataTransfer,o=this,a=i.files,s=l(r(a),o._isAsyncNonBatch());h(t),a.length>0&&(n=o.trigger(C,{files:s}),n||o._module.onSelect({target:e(".k-dropzone",o.wrapper)},s))},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var n,i,r=this,o=0;for(t=l(t,!0),o=0;t.length>o;o++)n=t[o],i=r._enqueueFile(n.name,{fileNames:[n]}),i.addClass("k-file-success").data("files",[t[o]]),e(".k-progress",i).width("100%"),e(".k-upload-status",i).prepend("<span class='k-upload-pct'>100%</span>"),r._fileAction(i,P)},_prepareTemplateData:function(e,t){var n=t.fileNames,i={},r=0,o=0;for(o=0;n.length>o;o++)r+=n[o].size;return i.name=e,i.size=r,i.files=t.fileNames,i},_prepareDefaultFileEntryTemplate:function(t,n){var i="",r=e("<li class='k-file'><span class='k-progress'></span><span class='k-icon'></span><span class='k-filename' title='"+t+"'>"+t+"</span><strong class='k-upload-status'></strong></li>");return 1==n.fileNames.length&&n.fileNames[0].extension&&(i=n.fileNames[0].extension.substring(1),e(".k-icon",r).addClass("k-i-"+i)),r},_enqueueFile:function(t,n){var i,r,o,a=this,s=n.fileNames[0].uid,l=e(".k-upload-files",a.wrapper),c=a.options,d=c.template;return 0===l.length&&(l=e("<ul class='k-upload-files k-reset'></ul>").appendTo(a.wrapper),a.options.showFileList||l.hide(),a.wrapper.removeClass("k-upload-empty")),i=e(".k-file",l),d?(o=a._prepareTemplateData(t,n),d=w.template(d),r=e("<li class='k-file'>"+d(o)+"</li>"),r.find(".k-upload-action").addClass("k-button k-button-bare")):r=a._prepareDefaultFileEntryTemplate(t,n),r.attr(w.attr("uid"),s).appendTo(l).data(n),a._async||e(".k-progress",r).width("100%"),!a.multiple&&i.length>0&&a._module.onRemove({target:e(i,a.wrapper)}),r},_removeFileEntry:function(t){var n,i,r=this,o=t.closest(".k-upload-files");t.remove(),n=e(".k-file",o),i=e(".k-file-success, .k-file-error",o),i.length===n.length&&this._hideUploadButton(),0===n.length&&(o.remove(),r.wrapper.addClass("k-upload-empty"),r._hideHeaderUploadstatus())},_fileAction:function(e,t){var n={remove:"k-delete",cancel:"k-cancel",retry:"k-retry"},i={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};n.hasOwnProperty(t)&&(this._clearFileAction(e),this.options.template?e.find(".k-upload-action").addClass("k-button k-button-bare").append("<span class='k-icon "+i[t]+" "+n[t]+"' title='"+this.localization[t]+"'></span>").show():(e.find(".k-upload-status .k-upload-action").remove(),e.find(".k-upload-status").append(this._renderAction(n[t],this.localization[t],i[t]))))},_fileState:function(t,n){var i=this.localization,r={uploading:{text:i.statusUploading},uploaded:{text:i.statusUploaded},failed:{text:i.statusFailed}},o=r[n];o&&e(".k-icon:not(.k-delete, .k-cancel, .k-retry)",t).text(o.text)},_renderAction:function(t,n,i){return e(""!==t?"<button type='button' class='k-button k-button-bare k-upload-action'><span class='k-icon "+i+" "+t+"' title='"+n+"'></span></button>":"<button type='button' class='k-button'>"+n+"</button>")},_clearFileAction:function(t){e(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var n,i,r,o,a=this;return a.wrapper.hasClass("k-state-disabled")||(n=e(t.target).closest(".k-upload-action"),i=n.find(".k-icon"),r=n.closest(".k-file"),o={files:r.data("fileNames")},i.hasClass("k-delete")?a.trigger(P,o)||a._module.onRemove({target:e(r,a.wrapper)},o.data):i.hasClass("k-cancel")?(a.trigger(E,o),a._module.onCancel({target:e(r,a.wrapper)}),this._checkAllComplete(),a._updateHeaderUploadStatus()):i.hasClass("k-retry")&&(e(".k-warning",r).remove(),a._module.onRetry({target:e(r,a.wrapper)}))),!1},_onUploadSelected:function(){var e=this,t=e.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onFileProgress:function(t,n){var i;this.options.template?e(".k-progress",t.target).width(n+"%"):(i=e(".k-upload-pct",t.target),0===i.length&&e(".k-upload-status",t.target).prepend("<span class='k-upload-pct'></span>"),e(".k-upload-pct",t.target).text(n+"%"),e(".k-progress",t.target).width(n+"%")),this.trigger(I,{files:g(t).data("fileNames"),percentComplete:n})},_onUploadSuccess:function(e,t,n){var i=g(e);this._fileState(i,"uploaded"),i.removeClass("k-file-progress").addClass("k-file-success"),this._updateHeaderUploadStatus(),this.trigger(T,{files:i.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:n}),this._supportsRemove()?this._fileAction(i,P):this._clearFileAction(i),this._checkAllComplete()},_onUploadError:function(t,n){var i=g(t),r=e(".k-upload-pct",i);this._fileState(i,"failed"),i.removeClass("k-file-progress").addClass("k-file-error"),e(".k-progress",i).width("100%"),r.length>0?r.empty().removeClass("k-upload-pct").addClass("k-icon k-warning"):e(".k-upload-status",i).prepend("<span class='k-icon k-warning'></span>"),this._updateHeaderUploadStatus(),this._fileAction(i,"retry"),this.trigger(D,{operation:"upload",files:i.data("fileNames"),XMLHttpRequest:n}),b("Server response: "+n.responseText),this._checkAllComplete()},_showUploadButton:function(){var t=e(".k-upload-selected",this.wrapper);0===t.length&&(t=this._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected")),this.wrapper.append(t)},_hideUploadButton:function(){e(".k-upload-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(){var t=this.localization,n=e(".k-dropzone",this.wrapper),i=e(".k-upload-status-total",this.wrapper);0!==i.length&&i.remove(),i='<strong class="k-upload-status k-upload-status-total">'+t.headerStatusUploading+'<span class="k-icon k-loading">'+t.statusUploading+"</span></strong>",n.length>0?n.append(i):e(".k-upload-button",this.wrapper).after(i)},_updateHeaderUploadStatus:function(){var t,n,i,r=this,o=r.localization,a=e(".k-file",r.wrapper).not(".k-file-success, .k-file-error");0===a.length&&(t=e(".k-file.k-file-error",r.wrapper),n=e(".k-upload-status-total",r.wrapper),i=e(".k-icon",n).removeClass("k-loading").addClass(0!==t.length?"k-warning":"k-i-tick").text(0!==t.length?o.statusWarning:o.statusUploaded),n.text(r.localization.headerStatusUploaded).append(i))},_hideHeaderUploadstatus:function(){e(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var n,i=this,r=i.element;t!==this._module.onAbort&&this._module.onAbort(),r.value||(n=e(r),n.attr("disabled","disabled"),window.setTimeout(function(){n.removeAttr("disabled")},0))},_onParentFormReset:function(){e(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return"undefined"!=typeof FormData},_supportsMultiple:function(){var e=this._userAgent().indexOf("Windows")>-1;return!(w.support.browser.opera||w.support.browser.safari&&e)},_supportsDrop:function(){var e=this._userAgent().toLowerCase(),t=/chrome/.test(e),n=!t&&/safari/.test(e),i=n&&/windows/.test(e);return!i&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var t,n,i=this;e(".k-upload-button",this.wrapper).wrap("<div class='k-dropzone'></div>"),t=i._ns,n=e(".k-dropzone",i.wrapper).append(e("<em>"+i.localization.dropFilesHere+"</em>")).on("dragenter"+t,h).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(this._onDrop,this)),p(n,t,function(){n.addClass("k-dropzone-hovered")},function(){n.removeClass("k-dropzone-hovered")}),p(e(document),t,function(){n.addClass("k-dropzone-active"),n.closest(".k-upload").removeClass("k-upload-empty")},function(){n.removeClass("k-dropzone-active"),0===e("li.k-file",n.closest(".k-upload")).length&&n.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,n,i,r){var o=this,a=o.options.async.removeField||"fileNames",s=e.extend(n,m());s[a]=t,jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:u,url:this.options.async.removeUrl,traditional:!0,data:s,success:i,error:r})},_wrapInput:function(e){var t=this,n=t.options;return e.wrap("<div class='k-widget k-upload k-header'><div class='k-button k-upload-button'></div></div>"),n.async.saveUrl||e.closest(".k-upload").addClass("k-upload-sync"),e.closest(".k-upload").addClass("k-upload-empty"),e.closest(".k-button").append("<span>"+this.localization.select+"</span>"),e.closest(".k-upload")},_checkAllComplete:function(){0===e(".k-file.k-file-progress",this.wrapper).length&&this.trigger(A)},_inputFiles:function(e){return i(e)}}),F=function(e){this.name="syncUploadModule",this.element=e.wrapper,this.upload=e,this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")};F.prototype={onSelect:function(t,i){var r,o=this.upload,a=e(t.target);o._addInput(a),r=o._enqueueFile(n(a),{relatedInput:a,fileNames:i}),o._fileAction(r,P)},onRemove:function(e){var t=g(e);t.data("relatedInput").remove(),this.upload._removeFileEntry(t)}},v=function(e){this.name="iframeUploadModule",this.element=e.wrapper,this.upload=e,this.iframes=[]},M._frameId=0,v.prototype={onSelect:function(t,n){var i=this.upload,r=e(t.target),o=this.prepareUpload(r,n);i.options.async.autoUpload?this.performUpload(o):(i._supportsRemove()&&this.upload._fileAction(o,P),i._showUploadButton())},prepareUpload:function(t,i){var r,o,a,s=this.upload,l=e(s.element),c=s.options.async.saveField||t.attr("name");return s._addInput(t),t.attr("name",c),r=this.createFrame(s.name+"_"+M._frameId++),this.registerFrame(r),o=this.createForm(s.options.async.saveUrl,r.attr("name")).append(l),a=s._enqueueFile(n(t),{frame:r,relatedInput:l,fileNames:i}),r.data({form:o,file:a}),a},performUpload:function(t){var n,i,r,o={files:t.data("fileNames")},a=t.data("frame"),s=this.upload;if(s.trigger(S,o))s._removeFileEntry(a.data("file")),this.cleanupFrame(a),this.unregisterFrame(a);else{s._hideUploadButton(),s._showHeaderUploadStatus(),a.appendTo(document.body),n=a.data("form").attr("action",s.options.async.saveUrl).appendTo(document.body),o.data=e.extend({},o.data,m());for(i in o.data)r=n.find("input[name='"+i+"']"),0===r.length&&(r=e("<input>",{type:"hidden",name:i}).prependTo(n)),r.val(o.data[i]);s._fileAction(t,E),s._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),a.one("load",e.proxy(this.onIframeLoad,this)),n[0].submit()}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=f(n);i||t.performUpload(n)})},onIframeLoad:function(t){var n,i=e(t.target);try{n=i.contents().text()}catch(r){n="Error trying to get server response: "+r}this.processResponse(i,n)},processResponse:function(t,n){var i=t.data("file"),r=this,o={responseText:n};d(n,function(n){e.extend(o,{statusText:"OK",status:"200"}),r.upload._onFileProgress({target:e(i,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:e(i,r.upload.wrapper)},n,o),r.cleanupFrame(t),r.unregisterFrame(t)},function(){e.extend(o,{statusText:"error",status:"500"}),r.upload._onUploadError({target:e(i,r.upload.wrapper)},o)})},onCancel:function(t){var n=e(t.target).data("frame");this.stopFrameSubmit(n),this.cleanupFrame(n),this.unregisterFrame(n),this.upload._removeFileEntry(n.data("file"))},onRetry:function(e){var t=g(e);this.performUpload(t)},onRemove:function(e,t){var n=g(e),i=n.data("frame");i?(this.unregisterFrame(i),this.upload._removeFileEntry(n),this.cleanupFrame(i)):c(n,this.upload,t)},onAbort:function(){var t=this.element,n=this;e.each(this.iframes,function(){e("input",this.data("form")).appendTo(t),n.stopFrameSubmit(this[0]),this.data("form").remove(),this.remove()}),this.iframes=[]},createFrame:function(t){return e("<iframe name='"+t+"' id='"+t+"' style='display:none;' />")},createForm:function(t,n){return e("<form enctype='multipart/form-data' method='POST' action='"+t+"' target='"+n+"'/>")},stopFrameSubmit:function(e){t!==e.stop?e.stop():e.document&&e.document.execCommand("Stop")},registerFrame:function(e){this.iframes.push(e)},unregisterFrame:function(t){this.iframes=e.grep(this.iframes,function(e){return e.attr("name")!=t.attr("name")})},cleanupFrame:function(e){var t=e.data("form");e.data("file").data("frame",null),setTimeout(function(){t.remove(),e.remove()},1)}},_=function(e){this.name="formDataUploadModule",this.element=e.wrapper,this.upload=e},_.prototype={onSelect:function(t,n){var i=this.upload,r=this,o=e(t.target),a=this.prepareUpload(o,n);e.each(a,function(){i.options.async.autoUpload?r.performUpload(this):(i._supportsRemove()&&i._fileAction(this,P),i._showUploadButton())})},prepareUpload:function(t,n){var i=this.enqueueFiles(n);return t.is("input")&&(e.each(i,function(){e(this).data("relatedInput",t)}),t.data("relatedFileEntries",i),this.upload._addInput(t)),i},enqueueFiles:function(t){var n,i,r,o,a=this.upload,s=t.length,l=[];if(a.options.async.batch===!0)n=e.map(t,function(e){return e.name}).join(", "),o=a._enqueueFile(n,{fileNames:t}),o.data("files",t),l.push(o);else for(i=0;s>i;i++)r=t[i],n=r.name,o=a._enqueueFile(n,{fileNames:[r]}),o.data("files",[r]),l.push(o);return l},performUpload:function(t){var n,i=this.upload,r=this.createFormData(),o=this.createXHR(),a={files:t.data("fileNames"),XMLHttpRequest:o};if(i.trigger(S,a))this.removeFileEntry(t);else{i._fileAction(t,E),i._hideUploadButton(),i._showHeaderUploadStatus(),a.data=e.extend({},a.data,m());for(n in a.data)r.append(n,a.data[n]);this.populateFormData(r,t.data("files")),i._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),this.postFormData(i.options.async.saveUrl,r,t,o)}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=f(n);i||t.performUpload(n)})},onCancel:function(e){var t=g(e);this.stopUploadRequest(t),this.removeFileEntry(t)},onRetry:function(e){var t=g(e);this.performUpload(t)},onRemove:function(e,t){var n=g(e);n.hasClass("k-file-success")?c(n,this.upload,t):this.removeFileEntry(n)},createXHR:function(){return new XMLHttpRequest},postFormData:function(e,t,n,i){var r=this;n.data("request",i),i.addEventListener("load",function(e){r.onRequestSuccess.call(r,e,n)},!1),i.addEventListener(D,function(e){r.onRequestError.call(r,e,n)},!1),i.upload.addEventListener("progress",function(e){r.onRequestProgress.call(r,e,n)},!1),i.open("POST",e,!0),i.withCredentials=this.upload.options.async.withCredentials,i.send(t)},createFormData:function(){return new FormData},populateFormData:function(e,t){var n,i=this.upload,r=t.length;for(n=0;r>n;n++)e.append(i.options.async.saveField||i.name,t[n].rawFile);return e},onRequestSuccess:function(t,n){function i(){o.upload._onUploadError({target:e(n,o.upload.wrapper)},r)}var r=t.target,o=this;r.status>=200&&299>=r.status?d(r.responseText,function(t){o.upload._onFileProgress({target:e(n,o.upload.wrapper)},100),o.upload._onUploadSuccess({target:e(n,o.upload.wrapper)},t,r),o.cleanupFileEntry(n)},i):i()},onRequestError:function(t,n){var i=t.target;this.upload._onUploadError({target:e(n,this.upload.wrapper)},i)},cleanupFileEntry:function(t){var n=t.data("relatedInput"),i=!0;n&&(e.each(n.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(i=i&&this.hasClass("k-file-success"))}),i&&n.remove())},removeFileEntry:function(e){this.cleanupFileEntry(e),this.upload._removeFileEntry(e)},onRequestProgress:function(t,n){var i=Math.round(100*t.loaded/t.total);this.upload._onFileProgress({target:e(n,this.upload.wrapper)},i)},stopUploadRequest:function(e){e.data("request").abort()}},w.ui.plugin(M)}(window.kendo.jQuery),function(e,t){function n(e,t,n){var i,r;e.on("dragenter"+x,function(){t(),r=new Date,i||(i=setInterval(function(){var e=new Date-r;e>100&&(n(),clearInterval(i),i=null)},100))}).on("dragover"+x,function(){r=new Date})}function i(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function r(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}function o(e,t){var n=e[t];return h(n)?n.from||n.field||t:n}var a,s,l,c,d=window.kendo,u=d.ui.Widget,h=e.isPlainObject,p=e.proxy,f=e.extend,g=d.support.placeholder,m=d.support.browser,v=d.isFunction,_=/(^\/|\/$)/g,w="change",y="apply",b="error",k="click",x=".kendoFileBrowser",C=".kendoBreadcrumbs",S=".kendoSearchBox",T="name",D="size",A="type",E={field:A,dir:"asc"},I=d.template('<li class="k-tile-empty"><strong>${text}</strong></li>'),P='<div class="k-widget k-filebrowser-toolbar k-header k-floatwrap"><div class="k-toolbar-wrap"># if (showUpload) { # <div class="k-widget k-upload"><div class="k-button k-button-icontext k-upload-button"><span class="k-icon k-add"></span>#=messages.uploadFile#<input type="file" name="file" /></div></div># } ## if (showCreate) { #<button type="button" class="k-button k-button-icon"><span class="k-icon k-addfolder" /></button># } ## if (showDelete) { #<button type="button" class="k-button k-button-icon k-state-disabled"><span class="k-icon k-delete" /></button>&nbsp;# } #</div><div class="k-tiles-arrange"><label>#=messages.orderBy#: <select /></label></a></div></div>';f(!0,d.data,{schemas:{filebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),f(!0,d.data,{transports:{filebrowser:d.data.RemoteTransport.extend({init:function(t){d.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),v(this.options[t])?this.options[t].call(this,n):d.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),a=m.msie&&8>m.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},s=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n.element.addClass("k-filebrowser"),n.element.on(k+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-delete)",p(n._deleteClick,n)).on(k+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-addfolder)",p(n._addClick,n)).on("keydown"+x,"li.k-state-selected input",p(n._directoryKeyDown,n)).on("blur"+x,"li.k-state-selected input",p(n._directoryBlur,n)),n._dataSource(),n.refresh(),n.path(n.options.path)},options:{name:"FileBrowser",messages:{uploadFile:"Upload",orderBy:"Arrange by",orderByName:"Name",orderBySize:"Size",directoryNotFound:"A directory with this name was not found.",emptyFolder:"Empty Folder",deleteFile:'Are you sure you want to delete "{0}"?',invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',dropFilesHere:"drop file here to upload",search:"Search"},transport:{},path:"/",fileTypes:"*.*"},events:[b,w,y],destroy:function(){var e=this;u.fn.destroy.call(e),e.dataSource.unbind(b,e._errorHandler),e.element.add(e.list).add(e.toolbar).off(x),d.destroy(e.element)},value:function(){var e,n=this,r=n._selectedItem(),o=n.options.transport.fileUrl;return r&&"f"===r.get(A)?(e=i(n.path(),r.get(T)).replace(_,""),o&&(e=v(o)?o(e):d.format(o,encodeURIComponent(e))),e):t},_selectedItem:function(){var e=this.listView,n=e.select();return n.length?this.dataSource.getByUid(n.attr(d.attr("uid"))):t},_toolbar:function(){var t=this,n=d.template(P),i=t.options.messages,r=[{text:i.orderByName,value:"name"},{text:i.orderBySize,value:"size"}];t.toolbar=e(n({messages:i,showUpload:t.options.transport.uploadUrl,showCreate:t.options.transport.create,showDelete:t.options.transport.destroy})).appendTo(t.element).find(".k-upload input").kendoUpload({multiple:!1,localization:{dropFilesHere:i.dropFilesHere},async:{saveUrl:t.options.transport.uploadUrl,autoUpload:!0},upload:p(t._fileUpload,t),error:function(e){t._error({xhr:e.XMLHttpRequest,status:"error"})}}).end(),t.upload=t.toolbar.find(".k-upload input").data("kendoUpload"),t.arrangeBy=t.toolbar.find(".k-tiles-arrange select").kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){t.orderBy(this.value())}}).data("kendoDropDownList"),t._attachDropzoneEvents()},_attachDropzoneEvents:function(){var t=this;t.options.transport.uploadUrl&&(n(e(document.documentElement),e.proxy(t._dropEnter,t),e.proxy(t._dropLeave,t)),t._scrollHandler=p(t._positionDropzone,t))},_dropEnter:function(){this._positionDropzone(),e(document).on("scroll"+x,this._scrollHandler)},_dropLeave:function(){this._removeDropzone(),e(document).off("scroll"+x,this._scrollHandler)},_positionDropzone:function(){var e=this,t=e.element,n=t.offset();e.toolbar.find(".k-dropzone").addClass("k-filebrowser-dropzone").offset(n).css({width:t[0].clientWidth,height:t[0].clientHeight,lineHeight:t[0].clientHeight+"px"})},_removeDropzone:function(){this.toolbar.find(".k-dropzone").removeClass("k-filebrowser-dropzone").css({width:"",height:"",lineHeight:"",top:"",left:""})},_deleteClick:function(){var e=this,t=e.listView.select(),n=d.format(e.options.messages.deleteFile,t.find("strong").text());t.length&&e._showMessage(n,"confirm")&&e.listView.remove(t)},_addClick:function(){this.createDirectory()},_getFieldName:function(e){return o(this.dataSource.reader.model.fields,e)},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),a=e.files[0].name,s=T,l=D;o.test(a)?(e.data={path:n.path()},t=n._createFile(a),t?n.upload.one("success",function(e){t.set(s,e.response[n._getFieldName(s)]),t.set(l,e.response[n._getFieldName(l)]),n._tiles=n.listView.items().filter("["+d.attr("type")+"=f]")}):e.preventDefault()):(e.preventDefault(),n._showMessage(d.format(i.messages.invalidFileType,a,r)))},_findFile:function(e){var t,n,i,r=this.dataSource.data(),o=A,a=T;for(e=e.toLowerCase(),t=0,i=r.length;i>t;t++)if("f"===r[t].get(o)&&r[t].get(a).toLowerCase()===e){n=r[t];break}return n},_createFile:function(e){var t,n,i=this,r=0,o={},a=A,s=i.dataSource.view(),l=i._findFile(e);if(l&&!i._showMessage(d.format(i.options.messages.overwriteFile,e),"confirm"))return null;if(l)return l;for(t=0,n=s.length;n>t;t++)if("f"===s[t].get(a)){r=t;break}return o[a]="f",o[T]=e,o[D]=0,i.dataSource.insert(++r,o)},createDirectory:function(){var e,t,n=this,i=0,r=A,o=T,a=n.dataSource.data(),s=n._nameDirectory(),l=new n.dataSource.reader.model;for(e=0,t=a.length;t>e;e++)"d"===a[e].get(r)&&(i=e);l.set(r,"d"),l.set(o,s),n.listView.one("dataBound",function(){var e=n.listView.items().filter("["+d.attr("uid")+"="+l.uid+"]"),t=e.find("input");e.length&&this.edit(e),this.element.scrollTop(e.attr("offsetTop")-this.element[0].offsetHeight),setTimeout(function(){t.select()})}).one("save",function(e){var t=e.model.get(o);t?e.model.set(o,n._nameExists(t,l.uid)?n._nameDirectory():t):e.model.set(o,s)}),n.dataSource.insert(++i,l)},_directoryKeyDown:function(e){13==e.keyCode&&e.currentTarget.blur()},_directoryBlur:function(){this.listView.save()},_nameExists:function(e,t){var n,i,r=this.dataSource.data(),o=A,a=T;for(n=0,i=r.length;i>n;n++)if("d"===r[n].get(o)&&r[n].get(a).toLowerCase()===e.toLowerCase()&&r[n].uid!==t)return!0;return!1},_nameDirectory:function(){var t,n,i,r="New folder",o=this.dataSource.data(),a=[],s=A,l=T;for(n=0,i=o.length;i>n;n++)"d"===o[n].get(s)&&o[n].get(l).toLowerCase().indexOf(r.toLowerCase())>-1&&a.push(o[n].get(l));if(e.inArray(r,a)>-1){n=2;do t=r+" ("+n+")",n++;while(e.inArray(t,a)>-1);r=t}return r},orderBy:function(e){this.dataSource.sort([{field:A,dir:"asc"},{field:e,dir:"asc"}])},search:function(e){this.dataSource.filter({field:T,operator:"contains",value:e})},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("dblclick"+x,"li",p(t._dblClick,t)),t.listView=new d.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?t._tiles=this.items().filter("["+d.attr("type")+"=f]"):this.wrapper.append(I({text:t.options.messages.emptyFolder}))},change:p(t._listViewChange,t)})},_dblClick:function(t){var n,r=this,o=e(t.currentTarget);o.hasClass("k-edit-item")&&r._directoryBlur(),o.filter("["+d.attr("type")+"=d]").length?(n=r.dataSource.getByUid(o.attr(d.attr("uid"))),n&&(r.path(i(r.path(),n.get(T))),r.breadcrumbs.value(r.path()))):o.filter("["+d.attr("type")+"=f]").length&&r.trigger(y)},_listViewChange:function(){var e=this._selectedItem();e&&(this.toolbar.find(".k-delete").parent().removeClass("k-state-disabled"),"f"===e.get(A)&&this.trigger(w))},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=f({},E),o={field:T,dir:"asc"},a={type:i.type||"filebrowser",sort:[r,o]};h(i)&&(i.path=p(t.path,t),a.transport=i),h(n.schema)?a.schema=n.schema:i.type&&h(d.data.schemas[i.type])&&(e=d.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(b,t._errorHandler):t._errorHandler=p(t._error,t),t.dataSource=d.data.DataSource.create(a).bind(b,t._errorHandler)},_navigation:function(){var t=this,n=e('<div class="k-floatwrap"><input/><input/></div>').appendTo(this.element);t.breadcrumbs=n.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs"),t.searchBox=n.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(e){var t,n=this;n.trigger(b,e)||(t=e.xhr.status,"error"==e.status?"404"==t?n._showMessage(n.options.messages.directoryNotFound):"0"!=t&&n._showMessage("Error! The requested URL returned "+t+" - "+e.xhr.statusText):"timeout"==t&&n._showMessage("Error! Server timeout."))},_showMessage:function(e,t){return window[t||"alert"](e)},refresh:function(){var e=this;e._navigation(),e._toolbar(),e._content()},_editTmpl:function(){var e='<li class="k-tile k-state-selected" '+d.attr("uid")+'="#=uid#" ';return e+=d.attr("type")+'="${'+A+'}">',e+="#if("+A+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-loading"></span></div>',e+="#}#",e+="#if("+A+' == "d") { #',e+='<input class="k-input" '+d.attr("bind")+'="value:'+T+'"/>',e+="#}#",e+="</li>",p(d.template(e),{sizeFormatter:r})},_itemTmpl:function(){var e='<li class="k-tile" '+d.attr("uid")+'="#=uid#" ';return e+=d.attr("type")+'="${'+A+'}">',e+="#if("+A+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-file"></span></div>',e+="#}#",e+="<strong>${"+T+"}</strong>",e+="#if("+A+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+D+")}</span> #}#",e+="</li>",p(d.template(e),{sizeFormatter:r})},path:function(e){var n=this,i=n._path||"";return e!==t?(n._path=e.replace(_,"")+"/",n.dataSource.read({path:n._path}),t):(i&&(i=i.replace(_,"")),"/"===i||""===i?"":i+"/")}}),l=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),g&&n.element.attr("placeholder",n.options.label),n._wrapper(),n.element.on("keydown"+S,p(n._keydown,n)).on("change"+S,p(n._updateValue,n)),n.wrapper.on(k+S,"a",p(n._click,n)),g||n.element.on("focus"+S,p(n._focus,n)).on("blur"+S,p(n._blur,n))},options:{name:"SearchBox",label:"Search",value:""},events:[w],destroy:function(){var e=this;e.wrapper.add(e.element).add(e.label).off(S),u.fn.destroy.call(e)},_keydown:function(e){13===e.keyCode&&this._updateValue()},_click:function(e){e.preventDefault(),this._updateValue()},_updateValue:function(){var e=this,t=e.element.val();t!==e.value()&&(e.value(t),e.trigger(w))},_blur:function(){this._updateValue(),this._toggleLabel()},_toggleLabel:function(){g||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,n=t.parents(".k-search-wrap");t[0].style.width="",t.addClass("k-input"),n.length||(n=t.wrap(e('<div class="k-widget k-search-wrap k-textbox"/>')).parent(),g||e('<label style="display:block">'+this.options.label+"</label>").insertBefore(t),e('<a href="#" class="k-icon k-i-search k-search"/>').appendTo(n)),this.wrapper=n,this.label=n.find(">label")},value:function(e){var n=this;return e!==t?(n.options.value=e,n.element.val(e),n._toggleLabel(),t):n.options.value}}),c=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n._wrapper(),n.wrapper.on("focus"+C,"input",p(n._focus,n)).on("blur"+C,"input",p(n._blur,n)).on("keydown"+C,"input",p(n._keydown,n)).on(k+C,"a.k-i-arrow-n:first",p(n._rootClick,n)).on(k+C,"a:not(.k-i-arrow-n)",p(n._click,n)),n.value(n.options.value)},options:{name:"Breadcrumbs",gap:50},events:[w],destroy:function(){var e=this;u.fn.destroy.call(e),e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(C)},_update:function(e){e="/"===(e||"").charAt(0)?e:"/"+(e||""),e!==this.value()&&(this.value(e),this.trigger(w))},_click:function(t){t.preventDefault(),this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").addBack()))},_rootClick:function(e){e.preventDefault(),this._update("")},_focus:function(){var e=this,t=e.element;e.overlay.hide(),e.element.val(e.value()),setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var e=this,t=e.element,n=t.val().replace(/\/{2,}/g,"/");e.overlay.show(),t.val(""),e._update(n)}},_keydown:function(e){var t=this;13===e.keyCode&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var t,n=this.element,i=n.parents(".k-breadcrumbs");n[0].style.width="",n.addClass("k-input"),i.length||(i=n.wrap(e('<div class="k-widget k-breadcrumbs k-textbox"/>')).parent()),t=i.find(".k-breadcrumbs-wrap"),t.length||(t=e('<div class="k-breadcrumbs-wrap"/>').appendTo(i)),this.wrapper=i,this.overlay=t},refresh:function(){var n,i,r,o,a="",s=this.value();for(s!==t&&s.match(/^\//)||(s="/"+(s||"")),n=s.split("/"),r=0,o=n.length;o>r;r++)i=n[r],i&&(a||(a+='<a href="#" class="k-icon k-i-arrow-n">root</a>'),a+='<a class="k-link" href="#">'+n[r]+"</a>",a+='<span class="k-icon k-i-arrow-e">&gt;</span>');this.overlay.empty().append(e(a)),this._adjustSectionWidth()},_adjustSectionWidth:function(){var t,n=this,i=n.wrapper,r=i.width()-n.options.gap,o=n.overlay.find("a");o.each(function(n){t=e(this),t.parent().width()>r&&(n==o.length-1?t.width(r):t.prev().addBack().hide())})},value:function(e){return e!==t?(this._value=e.replace(/\/{2,}/g,"/"),this.refresh(),t):this._value
32
+ },_path:function(t){return"/"+e.map(t,function(t){return e(t).text()}).join("/")}}),d.ui.plugin(s),d.ui.plugin(c),d.ui.plugin(l)}(window.kendo.jQuery),function(e,t){function n(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function i(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}var r,o,a=window.kendo,s=a.ui.FileBrowser,l=e.isPlainObject,c=e.proxy,d=e.extend,u=a.support.browser,h=a.isFunction,p=/(^\/|\/$)/g,f="error",g=".kendoImageBrowser",m="name",v="size",_="type",w={field:_,dir:"asc"},y=a.template('<li class="k-tile-empty"><strong>${text}</strong></li>');d(!0,a.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),d(!0,a.data,{transports:{imagebrowser:a.data.RemoteTransport.extend({init:function(t){a.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),h(this.options[t])?this.options[t].call(this,n):a.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),r=u.msie&&8>u.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},o=s.extend({init:function(e,t){var n=this;t=t||{},s.fn.init.call(n,e,t),n.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var e,i=this,r=i._selectedItem(),o=i.options.transport.imageUrl;return r&&"f"===r.get(_)?(e=n(i.path(),r.get(m)).replace(p,""),o&&(e=h(o)?o(e):a.format(o,encodeURIComponent(e))),e):t},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),s=e.files[0].name,l=m,c=v;o.test(s)?(e.data={path:n.path()},t=n._createFile(s),t?(t._uploading=!0,n.upload.one("success",function(e){delete t._uploading,t.set(l,e.response[n._getFieldName(l)]),t.set(c,e.response[n._getFieldName(c)]),n._tiles=n.listView.items().filter("["+a.attr("type")+"=f]"),n._scroll()})):e.preventDefault()):(e.preventDefault(),n._showMessage(a.format(i.messages.invalidFileType,s,r)))},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("scroll"+g,c(t._scroll,t)).on("dblclick"+g,"li",c(t._dblClick,t)),t.listView=new a.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?(t._tiles=this.items().filter("["+a.attr("type")+"=f]"),t._scroll()):this.wrapper.append(y({text:t.options.messages.emptyFolder}))},change:c(t._listViewChange,t)})},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=d({},w),o={field:m,dir:"asc"},s={type:i.type||"imagebrowser",sort:[r,o]};l(i)&&(i.path=c(t.path,t),s.transport=i),l(n.schema)?s.schema=n.schema:i.type&&l(a.data.schemas[i.type])&&(e=a.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(f,t._errorHandler):t._errorHandler=c(t._error,t),t.dataSource=a.data.DataSource.create(s).bind(f,t._errorHandler)},_loadImage:function(t){var n=this,i=e(t),r=n.dataSource.getByUid(i.attr(a.attr("uid"))),o=r.get(m),s=n.options.transport.thumbnailUrl,l=e("<img />",{alt:o}),c="?";r._uploading||(l.hide().on("load"+g,function(){e(this).prev().remove().end().addClass("k-image").fadeIn()}),i.find(".k-loading").after(l),h(s)?s=s(n.path(),encodeURIComponent(o)):(s.indexOf("?")>=0&&(c="&"),s=s+c+"path="+n.path()+encodeURIComponent(o)),l.attr("src",s),t.loaded=!0)},_scroll:function(){var e=this;e.options.transport&&e.options.transport.thumbnailUrl&&(clearTimeout(e._timeout),e._timeout=setTimeout(function(){var n=e.list.outerHeight(),i=e.list.scrollTop(),o=i+n;e._tiles.each(function(){var n=r(this),a=n+this.offsetHeight;return(n>=i&&o>n||a>=i&&o>a)&&e._loadImage(this),n>o?!1:t}),e._tiles=e._tiles.filter(function(){return!this.loaded})},250))},_itemTmpl:function(){var e=this,t='<li class="k-tile" '+a.attr("uid")+'="#=uid#" ';return t+=a.attr("type")+'="${'+_+'}">',t+="#if("+_+' == "d") { #',t+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',t+="#}else{#",t+=e.options.transport&&e.options.transport.thumbnailUrl?'<div class="k-thumb"><span class="k-icon k-loading"></span></div>':'<div class="k-thumb"><span class="k-icon k-file"></span></div>',t+="#}#",t+="<strong>${"+m+"}</strong>",t+="#if("+_+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+v+")}</span> #}#",t+="</li>",c(a.template(t),{sizeFormatter:i})}}),a.ui.plugin(o)}(window.kendo.jQuery),function(e,t){var n,i,r,o,a=window.kendo,s=a.Class,l=a.ui.Widget,c=a.support.mobileOS,d=a.support.browser,u=e.extend,h=e.proxy,p=a.deepExtend,f=".kendoEditor",g=a.keys,m=s.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return a.template(e.template,{useWithBlock:!1})(e)}}),v={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span unselectable="on" class="k-tool-icon #= data.cssClass #">#= data.title #</span></a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /></span>',separatorTemplate:'<span class="k-separator" />',formatByName:function(t,n){for(var i=0;n.length>i;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},registerTool:function(e,t){var n=t.options;n&&n.template&&(n.template.options.cssClass="k-"+e),t.name||(t.options.name=e,t.name=e.toLowerCase()),b.defaultTools[e]=t},registerFormat:function(e,t){b.fn.options.formats[e]=t}},_={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertFile:"Insert file",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",imageWidth:"Width (px)",imageHeight:"Height (px)",fileWebAddress:"Web address",fileTitle:"Title",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogCancel:"Cancel",createTable:"Create table",createTableHint:"Create a {0} x {1} table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column"},w=!c||c.ios&&c.flatVersion>=500||!c.ios&&t!==document.documentElement.contentEditable,y={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},b=l.extend({init:function(t,n){var i,r,o,s,c=this,d=a.ui.editor;w&&(l.fn.init.call(c,t,n),c.options=p({},c.options,n),t=c.element,s=d.Dom.name(t[0]),t.closest("form").on("submit"+f,function(){c.update()}),o=u({},c.options),o.editor=c,"textarea"==s?(c._wrapTextarea(),r=c.wrapper.find(".k-editor-toolbar"),t[0].id&&r.attr("aria-controls",t[0].id)):(c.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),o.popup=!0,r=e('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(t)),c.toolbar=new d.Toolbar(r[0],o),c.toolbar.bindTo(c),"textarea"==s&&setTimeout(function(){var e=c.wrapper[0].style.height,t=parseInt(e,10),n=c.wrapper.height();e.indexOf("px")>0&&!isNaN(t)&&n>t&&c.wrapper.height(t-(n-t))}),c._initializeContentElement(c),c.keyboard=new d.Keyboard([new d.TypingHandler(c),new d.BackspaceHandler(c),new d.SystemHandler(c)]),c.clipboard=new d.Clipboard(this),c.undoRedoStack=new d.UndoRedoStack,i=n&&n.value?n.value:c.textarea?t.val().replace(/[\r\n\v\f\t ]+/gi," "):t[0].innerHTML,c.value(i),e(document).on("mousedown",h(c._endTyping,c)).on("mouseup",h(c._mouseup,c)),a.notify(c))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){d.msie||a.ui.editor.Dom.ensureTrailingBreaks(this.body),this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_wrapTextarea:function(){var t=this,n=t.element,i=n[0].style.width,r=n[0].style.height,o=v.editorWrapperTemplate,a=e(o).insertBefore(n).width(i).height(r),s=a.find(".k-editable-area");n.attr("autocomplete","off").appendTo(s).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=a},_createContentElement:function(t){var n,i,r,o=this,s=o.textarea,l=o.options.domain,c=l||document.domain,d="",u='javascript:""';return(l||c!=location.hostname)&&(d='<script>document.domain="'+c+'"</script>',u="javascript:document.write('"+d+"')"),s.hide(),n=e("<iframe />",{frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").insertBefore(s),n.src=u,i=n.contentWindow||n,r=i.document||n.contentDocument,e(n).one("load",function(){o.toolbar.decorateFrom(r.body)}),r.open(),r.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(a.support.isRtl(s)?"direction:rtl;":"")+"}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{table-layout:fixed;width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}</style>"+d+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script>"+e.map(t,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),r.close(),i},_blur:function(){var e=this.textarea,t=e?e.val():this._oldValue,n=this.options.encoded?this.encodedValue():this.value();this.update(),e&&e.trigger("blur"),n!=t&&this.trigger("change")},_initializeContentElement:function(){var n,i,r=this;r.textarea?(r.window=r._createContentElement(r.options.stylesheets),n=r.document=r.window.contentDocument||r.window.document,r.body=n.body,i=r.window,e(n).on("mouseup"+f,h(r._mouseup,r))):(r.window=window,n=r.document=document,r.body=r.element[0],i=r.body,r.toolbar.decorateFrom(r.body)),e(i).on("blur"+f,h(this._blur,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(o){}a.support.touch&&e(n).on("selectionchange"+f,h(this._selectionChange,this)).on("keydown"+f,function(){a._activeElement()!=n.body&&r.window.focus()}),e(r.body).on("keydown"+f,function(e){var n,i,o,a,s,l;return e.keyCode===g.F10?(setTimeout(h(r.toolbar.focus,r.toolbar),100),e.preventDefault(),t):((e.keyCode==g.LEFT||e.keyCode==g.RIGHT)&&(n=r.getRange(),i=e.keyCode==g.LEFT,o=n[i?"startContainer":"endContainer"],a=n[i?"startOffset":"endOffset"],s=i?-1:1,i&&(a-=1),a+s>0&&3==o.nodeType&&""==o.nodeValue[a]&&(n.setStart(o,a+s),n.collapse(!0),r.selectRange(n))),(l=r.keyboard.toolFromShortcut(r.toolbar.tools,e))?(e.preventDefault(),/^(undo|redo)$/.test(l)||r.keyboard.endTyping(!0),r.trigger("keydown",e),r.exec(l),!1):(r.keyboard.clearTimeout(),r.keyboard.keydown(e),t))}).on("keyup"+f,function(t){var n=[8,9,33,34,35,36,37,38,39,40,40,45,46];(e.inArray(t.keyCode,n)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&r._selectionChange(),r.keyboard.keyup(t)}).on("mousedown"+f,function(t){if(r._selectionStarted=!0,!d.gecko){var n=e(t.target);(2==t.which||1==t.which&&t.ctrlKey)&&n.is("a[href]")&&window.open(n.attr("href"),"_new")}}).on("click"+f,function(e){var t,n=a.ui.editor.Dom;"img"===n.name(e.target)&&(t=r.createRange(),t.selectNode(e.target),r.selectRange(t))}).on("cut"+f+" paste"+f,function(e){r.clipboard["on"+e.type](e)}).on("focusin"+f,function(){e(this).addClass("k-state-active"),r.toolbar.show(),r.textarea&&r.selectRange(r.getRange())}).on("focusout"+f,function(){setTimeout(function(){var t=a._activeElement(),n=r.body,i=r.toolbar;t==n||e.contains(n,t)||e(t).is(".k-editortoolbar-dragHandle")||i.focused()||(e(n).removeClass("k-state-active"),i.hide())},10)})},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},refresh:function(){var e=this;e.textarea&&(e.textarea.val(e.value()),e.wrapper.find("iframe").remove(),e._initializeContentElement(e),e.value(e.textarea.val()))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:_,formats:{},encoded:!0,domain:null,serialization:{entities:!0,scripts:!1},stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],y.basic,y.alignment,y.lists,y.indenting,y.links,["insertImage"],y.tables)},destroy:function(){var t=this;l.fn.destroy.call(t),e(t.window).add(t.document).add(t.body).add(t.wrapper).add(t.element.closest("form")).off(f),e(document).off("mousedown",h(t._endTyping,t)).off("mouseup",h(t._mouseup,t)),t._focusOutside(),t.toolbar.destroy(),a.destroy(t.wrapper)},_focusOutside:function(){if(a.support.browser.msie&&this.textarea){var t=e("<input style='position:absolute;left:-10px;top:-10px;width:1px;height:1px;font-size:0;border:0;' />").appendTo(document.body).focus();t.blur().remove()}},state:function(e){var t,n,i=b.defaultTools[e],r=i&&(i.options.finder||i.finder),o=a.ui.editor.RangeUtils;return r?(t=this.getRange(),n=o.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),r.getFormat?r.getFormat(n):r.isFormatted(n)):!1},value:function(e){var n=this.body,i=a.ui.editor,r=i.Serializer.domToXhtml(n,this.options.serialization);return e===t?r:(e!=r&&(i.Serializer.htmlToDom(e,n),d.msie||a.ui.editor.Dom.ensureTrailingBreaks(this.body),this.selectionRestorePoint=null,this.update(),this.toolbar.refreshTools()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,i=this.body;(n==i||e.contains(i,n))&&(this.selectionRestorePoint=new a.ui.editor.RestorePoint(t))},_focusBody:function(){var e,t=this.body,n=this.wrapper&&this.wrapper.find("iframe")[0],i=this.document.documentElement,r=a._activeElement();r!=t&&r!=n&&(e=i.scrollTop,t.focus(),i.scrollTop=e)},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){e=e||this.options.encoded?this.encodedValue():this.value(),this.textarea?this.textarea.val(e):this._oldValue=e},encodedValue:function(){return a.ui.editor.Dom.encode(this.value())},createRange:function(e){return a.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return a.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this._focusBody();var t=this.getSelection();t.removeAllRanges(),t.addRange(e),this.saveSelection(e)},getRange:function(){var e=this.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return a.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e,t){this.clipboard.paste(e,t)},exec:function(e,n){var i,r,o,a=this,s=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if(e=e.toLowerCase(),a.keyboard.isTypingInProgress()||a.restoreSelection(),r=a.toolbar.toolById(e),!r)for(o in b.defaultTools)if(o.toLowerCase()==e){r=b.defaultTools[o];break}if(r){if(i=a.getRange(),r.command&&(s=r.command(u({range:i},n))),a.trigger("execute",{name:e,command:s}),/^(undo|redo)$/i.test(e))a.undoRedoStack[e]();else if(s&&(s.managesUndoRedo||a.undoRedoStack.push(s),s.editor=a,s.exec(),s.async))return s.change=h(a._selectionChange,a),t;a._selectionChange()}}});b.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},a.ui.plugin(b),n=s.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title})},command:function(e){return new this.options.command(e)},update:e.noop}),n.exec=function(e,t,n){e.exec(t,{value:n})},i=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new a.ui.editor.FormatCommand(u(e,{formatter:t.options.formatter}))},update:function(e,t){var n=this.options.finder.isFormatted(t);e.toggleClass("k-state-selected",n),e.attr("aria-pressed",n)}}),v.registerTool("separator",new n({template:new m({template:v.separatorTemplate})})),r=d.msie&&9>d.version?"":"",o='<br class="k-br" />',d.msie&&(10>d.version?o="":11>d.version&&(o=" ")),u(a.ui,{editor:{ToolTemplate:m,EditorUtils:v,Tool:n,FormatTool:i,_bomFill:r,emptyElementContent:o}})}(window.jQuery),function(e){function t(e){var t,n,i={};for(t=0,n=e.length;n>t;t++)i[e[t]]=!0;return i}var n,i,r,o,a,s,l,c,d,u,h=window.kendo,p=e.map,f=e.extend,g=h.support.browser,m="style",v="float",_="cssFloat",w="styleFloat",y="class",b="k-marker",k=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),x="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),C=x.concat(["ul","ol","li"]),S=t(C),T="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),D=t(T),A=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),E=function(e){1==e.nodeType&&e.normalize()};g.msie&&g.version>=8&&(E=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,u.remove(t)),t=n}}),n=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,r=/\ufeff/g,o=/^(\s+|\ufeff)$/,s="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),l=/[<>\&]/g,c=/[\u00A0-\u2666<>\&]/g,d={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",913:"Alpha",914:"Beta",915:"Gamma",916:"Delta",917:"Epsilon",918:"Zeta",919:"Eta",920:"Theta",921:"Iota",922:"Kappa",923:"Lambda",924:"Mu",925:"Nu",926:"Xi",927:"Omicron",928:"Pi",929:"Rho",931:"Sigma",932:"Tau",933:"Upsilon",934:"Phi",935:"Chi",936:"Psi",937:"Omega",945:"alpha",946:"beta",947:"gamma",948:"delta",949:"epsilon",950:"zeta",951:"eta",952:"theta",953:"iota",954:"kappa",955:"lambda",956:"mu",957:"nu",958:"xi",959:"omicron",960:"pi",961:"rho",962:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},u={block:S,inline:D,findNodeIndex:function(e,t){var n=0;if(!e)return-1;for(;;){if(e=e.previousSibling,!e)break;t&&3==e.nodeType||n++}return n},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!u.isDataNode(t)&&(e.contains(t,u.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return u.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(u.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return u.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n=e.cloneNode(!1),i="",r=e;r.nextSibling&&3==r.nextSibling.nodeType&&r.nextSibling.nodeValue;)i+=r.nextSibling.nodeValue,r=r.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=i,u.insertAfter(n,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==v&&(i=e[h.support.cssFloat?_:w]),"object"==typeof i){if(!u.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return u.parentOfType(e,C)||e.ownerDocument.body},blockParents:function(t){var n,i,r,o=[];for(n=0,i=t.length;i>n;n++)r=u.parentOfType(t[n],u.blockElements),r&&e.inArray(r,o)<0&&o.push(r);return o},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:E,blockElements:C,nonListBlockElements:x,inlineElements:T,empty:k,fillAttrs:A,toHex:function(e){var t=i.exec(e);return t?"#"+p(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e,t){var n=!t||t.entities?c:l;return e.replace(n,function(e){var t=e.charCodeAt(0),n=d[t];return n?"&"+n+";":e})},stripBom:function(e){return(e||"").replace(r,"")},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||u.is(e,"br")&&("k-br"==e.className||t._moz_dirty||t._moz_editor_bogus_node)},emptyNode:function(t){var n=e.grep(t.childNodes,function(e){return u.is(e,"br")?!1:u.insignificant(e)?!1:3==e.nodeType&&o.test(e.nodeValue)?!1:u.is(e,"p")&&u.emptyNode(e)?!1:!0});return!n.length},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!u.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=u.lastTextNode(t))return n;return n},is:function(e,t){return u.name(e)==t},isMarker:function(e){return e.className==b},isWhitespace:function(e){return n.test(e.nodeValue)},isBlock:function(e){return S[u.name(e)]},isEmpty:function(e){return k[u.name(e)]},isInline:function(e){return D[u.name(e)]},scrollContainer:function(e){var t=u.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=h.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,r=e(u.isDataNode(t)?t.parentNode:t),o=u.windowFromDocument(t.ownerDocument),a=o.innerHeight,s=u.scrollContainer(t.ownerDocument);"br"==u.name(r[0])&&(r=r.parent()),n=r.offset().top,i=r[0].offsetHeight,i+n>s.scrollTop+a&&(s.scrollTop=i+n-a)},persistScrollTop:function(e){a=u.scrollContainer(e).scrollTop},restoreScrollTop:function(e){u.scrollContainer(e).scrollTop=a},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},removeTextSiblings:function(e){for(var t=e.parentNode;e.nextSibling&&3==e.nextSibling.nodeType;)t.removeChild(e.nextSibling);for(;e.previousSibling&&3==e.previousSibling.nodeType;)t.removeChild(e.previousSibling)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],u.isDataNode(n)?(u.stripBom(n.nodeValue).length||u.remove(n),u.isWhitespace(n)&&u.insertBefore(n,e)):n.className!=b&&(u.trim(n),n.childNodes.length||u.isEmpty(n)||u.remove(n));return e},closest:function(e,t){for(;e&&u.name(e)!=t;)e=e.parentNode;return e},sibling:function(e,t){do e=e[t];while(e&&1!=e.nodeType);return e},next:function(e){return u.sibling(e,"nextSibling")},prev:function(e){return u.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!u.ofType(e,t));return e},ofType:function(t,n){return e.inArray(u.name(t),n)>=0},changeTag:function(e,t,n){var i,r,o,a,s,l=u.create(e.ownerDocument,t),c=e.attributes;if(!n)for(i=0,r=c.length;r>i;i++)s=c[i],s.specified&&(o=s.nodeName,a=s.nodeValue,o==y?l.className=a:o==m?l.style.cssText=e.style.cssText:l.setAttribute(o,a));for(;e.firstChild;)l.appendChild(e.firstChild);return u.insertBefore(l,e),u.remove(e),l},editableParent:function(e){for(;e&&(3==e.nodeType||"true"!==e.contentEditable);)e=e.parentNode;return e},wrap:function(e,t){return u.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return u.attr(e.createElement(t),n)},attr:function(e,t){t=f({},t),t&&m in t&&(u.style(e,t.style),delete t.style);for(var n in t)null===t[n]?(e.removeAttribute(n),delete t[n]):"className"==n&&(e[n]=t[n]);return f(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(e,t){for(var n in t)n==v&&(n=h.support.cssFloat?_:w),e.style[n]="";""===e.style.cssText&&e.removeAttribute(m)},inlineStyle:function(t,n,i){var r,o=e(u.create(t.ownerDocument,n,i));return t.appendChild(o[0]),r=p(s,function(e){return g.msie&&"line-height"==e&&"1px"==o.css(e)?"line-height:1.5":e+":"+o.css(e)}).join(";"),o.remove(),r},getEffectiveBackground:function(e){var t=e.css("background-color");return t.indexOf("rgba(0, 0, 0, 0")<0&&"transparent"!==t?t:"html"===e[0].tagName.toLowerCase()?"Window":u.getEffectiveBackground(e.parent())},removeClass:function(t,n){var i,r,o=" "+t.className+" ",a=n.split(" ");for(i=0,r=a.length;r>i;i++)o=o.replace(" "+a[i]+" "," ");o=e.trim(o),o.length?t.className=o:t.removeAttribute(y)},commonAncestor:function(){var e,t,n,i,r,o=arguments.length,a=[],s=1/0,l=null;if(!o)return null;if(1==o)return arguments[0];for(e=0;o>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==o)return a[0][0];for(e=0;s>e;e++){for(i=a[0][e],r=1;o>r;r++)if(i!=a[r][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,r;return n=1==t.length?u.parentOfType(t[0],["ul","ol"]):u.commonAncestor.apply(null,t),n||(n=u.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),u.isInline(n)&&(n=u.blockParentOrBody(n)),i=p(t,u.editableParent),r=u.commonAncestor(i)[0],e.contains(n,r)&&(n=r),n},closestEditable:function(t,n){var i=u.parentOfType(t,n),r=u.editableParent(t);return i&&r&&e.contains(i,r)?i=r:!i&&r&&(i=r),i},closestEditableOfType:function(e,t){var n=u.closestEditable(e,t);return n&&u.ofType(n,t)?n:void 0},filter:function(e,t,n){for(var i,r=0,o=t.length,a=[];o>r;r++)i=u.name(t[r]),(!n&&i==e||n&&i!=e)&&a.push(t[r]);return a},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,r=0;
33
+ if(i)for(;i>r;r++)u.ensureTrailingBreak(n[r]);else u.ensureTrailingBreak(t)},ensureTrailingBreak:function(e){var t,n=e.lastChild,i=n&&u.name(n);(!i||"br"!=i&&"img"!=i||"br"==i&&"k-br"!=n.className)&&(t=e.ownerDocument.createElement("br"),t.className="k-br",e.appendChild(t))}},h.ui.editor.Dom=u}(window.kendo.jQuery),function(e,t){var n,i,r=window.kendo,o=r.ui.editor,a=o.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),c=/"/g,d=/<br[^>]*>/i,u=/^\d+(\.\d*)?(px)?$/i,h=/<p><\/p>/i,p=/([\w|\-]+)\s*:\s*([^;]+);?/i,f=/^sizzle-\d+/i,g=/^k-script-/i,m=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,v=document.createElement("div");v.innerHTML=" <hr>",n=3===v.firstChild.nodeType,v=null,i={toEditableHtml:function(e){var t='<br class="k-br">';return e=e||"",e.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<telerik:script$1>$2</telerik:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(m,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,t+"<$1").replace(/<\/(table|blockquote)>$/i,"</$1>"+t)},_fillEmptyElements:function(t){e(t).find("p").each(function(){var t,n=e(this);if(/^\s*$/g.test(n.text())&&!n.find("img,input").length){for(t=this;t.firstChild&&3!=t.firstChild.nodeType;)t=t.firstChild;1!=t.nodeType||a.empty[a.name(t)]||(t.innerHTML=r.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,r=e.getElementsByTagName("ol");for(t=0;r.length>t;t++)n=r[t],i=n.getAttribute("start"),n.setAttribute("start",1),i?n.setAttribute("start",i):n.removeAttribute(i)},_preventScriptExecution:function(t){e(t).find("*").each(function(){var e,t,n,i,r=this.attributes;for(t=0,n=r.length;n>t;t++)e=r[t],i=e.nodeName,e.specified&&/^on/i.test(i)&&(this.removeAttribute(i),this.setAttribute("k-script-"+i,e.nodeValue))})},htmlToDom:function(t,n){var o,s,l=r.support.browser,c=l.msie,d=c&&9>l.version;return t=i.toEditableHtml(t),d&&(t="<br/>"+t,o="originalsrc",s="originalhref",t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,s+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,o+'="$1"')),n.innerHTML=t,d?(a.remove(n.firstChild),e(n).find("telerik\\:script,script,link,img,a").each(function(){var e=this;e[s]&&(e.setAttribute("href",e[s]),e.removeAttribute(s)),e[o]&&(e.setAttribute("src",e[o]),e.removeAttribute(o))})):c&&(a.normalize(n),i._resetOrderedLists(n)),i._preventScriptExecution(n),i._fillEmptyElements(n),i._removeSystemElements(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,o){function s(t){var n,i,r,o,s=e.trim,l=s(t).split(";"),d=l.length;for(n=0,d=l.length;d>n;n++)l[n].length&&(i=p.exec(l[n]),i&&(r=s(i[1].toLowerCase()),o=s(i[2]),"font-size-adjust"!=r&&"font-stretch"!=r&&(r.indexOf("color")>=0?o=a.toHex(o):r.indexOf("font")>=0?o=o.replace(c,"'"):/\burl\(/g.test(o)&&(o=o.replace(c,"")),b.push(r),b.push(":"),b.push(o),b.push(";"))))}function m(n){var i,l,c,d,h,p,m,v,_,w=[],y=n.attributes;for(a.is(n,"img")&&(m=n.style.width,v=n.style.height,_=e(n),m&&u.test(m)&&(_.attr("width",parseInt(m,10)),a.unstyle(n,{width:t})),v&&u.test(v)&&(_.attr("height",parseInt(v,10)),a.unstyle(n,{height:t}))),l=0,c=y.length;c>l;l++)i=y[l],d=i.nodeName,h=i.nodeValue,p=i.specified,"value"==d&&"value"in n&&n.value?p=!0:"type"==d&&"text"==h?p=!0:"class"!=d||h?f.test(d)?p=!1:"complete"==d?p=!1:"altHtml"==d?p=!1:"start"==d&&(a.is(n,"ul")||a.is(n,"ol"))?p=!1:d.indexOf("_moz")>=0?p=!1:g.test(d)&&(p=!!o.scripts):p=!1,p&&w.push(i);if(w.length)for(w.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),l=0,c=w.length;c>l;l++)i=w[l],d=i.nodeName,h=i.nodeValue,("class"!=d||"k-table"!=h)&&(d=d.replace(g,""),b.push(" "),b.push(d),b.push('="'),"style"==d?s(h||n.style.cssText):b.push("src"==d||"href"==d?r.htmlEncode(n.getAttribute(d,2)):a.fillAttrs[d]?d:h),b.push('"'))}function v(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)w(i,t,n)}function _(e){return e.nodeValue.replace(/\ufeff/g,"")}function w(e,i,r){var s,l,c,d,u,h=e.nodeType;if(1==h){if(s=a.name(e),!s||a.insignificant(e))return;if(a.isInline(e)&&1==e.childNodes.length&&3==e.firstChild.nodeType&&!_(e.firstChild))return;if(!o.scripts&&"telerik:script"==s)return;if(l=k[s])return l.start(e),v(e,!1,l.skipEncoding),l.end(e),t;b.push("<"),b.push(s),m(e),a.empty[s]?b.push(" />"):(b.push(">"),v(e,i||a.is(e,"pre")),b.push("</"),b.push(s),b.push(">"))}else 3==h?(d=_(e),!i&&n&&(c=e.parentNode,u=e.previousSibling,u||(u=(a.isInline(c)?c:e).previousSibling),(!u||""===u.innerHTML||a.isBlock(u))&&(d=d.replace(/^[\r\n\v\f\t ]+/,"")),d=d.replace(/ +/," ")),b.push(r?d:a.encode(d,o))):4==h?(b.push("<![CDATA["),b.push(e.data),b.push("]]>")):8==h&&(e.data.indexOf("[CDATA[")<0?(b.push("<!--"),b.push(e.data),b.push("-->")):(b.push("<!"),b.push(e.data),b.push(">")))}function y(e){var t=e.childNodes.length,n=t&&3==e.firstChild.nodeType;return n&&(1==t||2==t&&a.insignificant(e.lastChild))}var b=[],k={"telerik:script":{start:function(e){b.push("<script"),m(e),b.push(">")},end:function(){b.push("</script>")},skipEncoding:!0},b:{start:function(){b.push("<strong>")},end:function(){b.push("</strong>")}},i:{start:function(){b.push("<em>")},end:function(){b.push("</em>")}},u:{start:function(){b.push('<span style="text-decoration:underline;">')},end:function(){b.push("</span>")}},iframe:{start:function(e){b.push("<iframe"),m(e),b.push(">")},end:function(){b.push("</iframe>")}},font:{start:function(e){var t,n,i;b.push('<span style="'),t=e.getAttribute("color"),n=l[e.getAttribute("size")],i=e.getAttribute("face"),t&&(b.push("color:"),b.push(a.toHex(t)),b.push(";")),i&&(b.push("font-face:"),b.push(i),b.push(";")),n&&(b.push("font-size:"),b.push(n),b.push(";")),b.push('">')},end:function(){b.push("</span>")}}};return o=o||{},y(i)?a.encode(_(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),o):(v(i),b=b.join(""),""===b.replace(d,"").replace(h,"")?"":b)}},s(o,{Serializer:i})}(window.kendo.jQuery),function(e){function t(e,t,n,i){var r,o,a,s;if(e==t)return i-n;for(r=t;r&&r.parentNode!=e;)r=r.parentNode;if(r)return p(r)-n;for(r=e;r&&r.parentNode!=t;)r=r.parentNode;if(r)return i-p(r)-1;for(o=h.commonAncestor(e,t),a=e;a&&a.parentNode!=o;)a=a.parentNode;for(a||(a=o),s=t;s&&s.parentNode!=o;)s=s.parentNode;return s||(s=o),a==s?0:p(s)-p(a)}function n(e,n){function i(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}i(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!h.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function r(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),h.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function o(e,t,n){var i,r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],a=0,s=f(r),l=s?r:r.childNodes[o]||null,c=s?r.parentNode:r,d=t.ownerDocument,u=d.body.createTextRange();(3==r.nodeType||4==r.nodeType)&&(a=o),c||(c=d.body),"img"==c.nodeName.toLowerCase()?(u.moveToElementText(c),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(i=c.insertBefore(h.create(d,"a"),l),u.moveToElementText(i),h.remove(i),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,i){var r,o,a,s,l,c,d,u=h.create(t.ownerDocument,"a"),g=e.duplicate(),m=i?"StartToStart":"StartToEnd",v=!1;u.innerHTML="",g.collapse(i),o=g.parentElement(),h.isAncestorOrSelf(n,o)||(o=n);do v?o.insertBefore(u,u.previousSibling):(o.appendChild(u),v=!0),g.moveToElementText(u);while((r=g.compareEndPoints(m,e))>0&&u.previousSibling);a=u.nextSibling,-1==r&&f(a)?(g.setEndPoint(i?"EndToStart":"EndToEnd",e),h.remove(u),c=[a,g.text.length]):(s=!i&&u.previousSibling,l=i&&u.nextSibling,f(l)?c=[l,0]:f(s)?c=[s,s.length]:(d=p(u),c=o.nextSibling&&d==o.childNodes.length-1?[o.nextSibling,0]:[o,d]),h.remove(u)),t[i?"setStart":"setEnd"].apply(t,c)}var s=window.kendo,l=s.Class,c=e.extend,d=s.ui.editor,u=s.support.browser,h=d.Dom,p=h.findNodeIndex,f=h.isDataNode,g=h.findClosestAncestor,m=h.getNodeLength,v=h.normalize,_={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new b(e.document)},selectionFromRange:function(e){var t=T.documentFromRange(e);return _.selectionFromDocument(t)},selectionFromDocument:function(e){return _.selectionFromWindow(h.windowFromDocument(e))}},w=l.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,p(e))},setStartAfter:function(e){this.setStart(e.parentNode,p(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,p(e))},setEndAfter:function(e){this.setEnd(e.parentNode,p(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(g(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new y(t))},cloneContents:function(){var e=T.documentFromRange(this);return function t(n){for(var i,r=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),r.appendChild(i);return r}(new y(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(g(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=T.documentFromRange(t),function i(n){for(var r,o=e.createDocumentFragment();r=n.next();)n.hasPartialSubtree()?(r=r.cloneNode(!1),r.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),o.appendChild(r);return o}(new y(n))},insertNode:function(e){var t=this;f(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&h.splitDataNode(t.startContainer,t.startOffset),h.insertAfter(e,t.startContainer)):h.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new w(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return("#text"==e?this.startContainer.nodeValue:e)+"("+this.startOffset+") : "+("#text"==t?this.endContainer.nodeValue:t)+"("+this.endOffset+")"}}),y=l.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||f(t.startContainer)?g(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||f(t.endContainer)?g(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,f(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,r,o,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;f(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,i=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),a._current.deleteData(t,i)):(r=a._current.parentNode,!e||a.range.startContainer!=r&&a.range.endContainer!=r||(o=p(a._current),r==e.startContainer&&e.startOffset>=o&&(e.startOffset-=1),r==e.endContainer&&e.endOffset>o&&(e.endOffset-=1)),h.remove(a._current))},hasPartialSubtree:function(){return!f(this._current)&&(h.isAncestorOrSelf(this._current,this.range.startContainer)||h.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),h.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),h.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new y(t)}}),b=l.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();o(t,e,!1),o(t,e,!0),t.select()},removeAllRanges:function(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,o,s,l,c,d=new w(this.ownerDocument),u=this.ownerDocument.selection;try{if(e=u.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return d}catch(h){return d}if("Control"==u.type)d.selectNode(e.item(0));else if(n=r(e),a(e,d,n,!0),a(e,d,n,!1),9==d.startContainer.nodeType&&d.setStart(d.endContainer,d.startOffset),9==d.endContainer.nodeType&&d.setEnd(d.startContainer,d.endOffset),0===e.compareEndPoints("StartToEnd",e)&&d.collapse(!1),i=d.startContainer,o=d.endContainer,s=this.ownerDocument.body,!(d.collapsed||0!==d.startOffset||d.endOffset!=m(d.endContainer)||i==o&&f(i)&&i.parentNode==s)){for(l=!1,c=!1;0===p(i)&&i==i.parentNode.firstChild&&i!=s;)i=i.parentNode,l=!0;for(;p(o)==m(o.parentNode)-1&&o==o.parentNode.lastChild&&o!=s;)o=o.parentNode,c=!0;i==s&&o==s&&l&&c&&(d.setStart(i,0),d.setEnd(o,m(s)))}return d}}),k=l.extend({init:function(e){this.enumerate=function(){function t(e){if(h.is(e,"img")||3==e.nodeType&&(!h.isWhitespace(e)||""==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new y(e).traverse(t),n}}}),x=l.extend({init:function(e,t){var n=this;n.range=e,n.rootNode=T.documentFromRange(e),n.body=t||n.getEditable(e),"body"!=h.name(n.body)&&(n.rootNode=n.body),n.html=n.body.innerHTML,n.startContainer=n.nodeToPath(e.startContainer),n.endContainer=n.nodeToPath(e.endContainer),n.startOffset=n.offset(e.startContainer,e.startOffset),n.endOffset=n.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,i=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||i!=t)&&n++,i=t;return n},getEditable:function(e){for(var t=e.commonAncestorContainer;t&&(3==t.nodeType||t.attributes&&!t.attributes.contentEditable);)t=t.parentNode;return t},restoreHtml:function(){this.body.innerHTML=this.html},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,i){for(var r=this.rootNode,o=n.length,a=i;o--;)r=r.childNodes[n[o]];for(;r&&3==r.nodeType&&a>r.nodeValue.length;)a-=r.nodeValue.length,r=r.nextSibling;r&&a>=0&&e[t?"setStart":"setEnd"](r,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),C=l.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=h.create(T.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,i,r,o=this,a=o.caret.previousSibling,s=0;a&&(s=f(a)?a.nodeValue.length:p(a)),t=o.caret.parentNode,n=a?p(a):0,h.remove(o.caret),v(t),i=t.childNodes[n],f(i)?e.setStart(i,s):i?(r=h.lastTextNode(i),r?e.setStart(r,r.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](i)):(u.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,r=this,o=e.collapsed&&!T.isExpandable(e),a=T.documentFromRange(e);return t&&e.collapsed&&(r.addCaret(e),e=T.expand(e)),n=e.cloneRange(),n.collapse(!1),r.end=h.create(a,"span",{className:"k-marker"}),n.insertNode(r.end),n=e.cloneRange(),n.collapse(!0),r.start=r.end.cloneNode(!0),n.insertNode(r.start),r._removeDeadMarkers(r.start,r.end),o&&(i=a.createTextNode(""),h.insertAfter(i.cloneNode(),r.start),h.insertBefore(i,r.end)),e.setStartBefore(r.start),e.setEndAfter(r.end),v(e.commonAncestorContainer),e},_removeDeadMarkers:function(e,t){e.previousSibling&&""==e.previousSibling.nodeValue&&h.remove(e.previousSibling),t.nextSibling&&""==t.nextSibling.nodeValue&&h.remove(t.nextSibling)},remove:function(e){var t,n,i,r,o,a,s,l,c,d,u,g,m,_=this,w=_.start,y=_.end;for(v(e.commonAncestorContainer);!w.nextSibling&&w.parentNode;)w=w.parentNode;for(;!y.previousSibling&&y.parentNode;)y=y.parentNode;if(t=w.previousSibling&&3==w.previousSibling.nodeType&&w.nextSibling&&3==w.nextSibling.nodeType,n=y.previousSibling&&3==y.previousSibling.nodeType&&y.nextSibling&&3==y.nextSibling.nodeType,i=t&&n,w=w.nextSibling,y=y.previousSibling,r=!1,o=!1,w==_.end&&(o=!!_.start.previousSibling,w=y=_.start.previousSibling||_.end.nextSibling,r=!0),h.remove(_.start),h.remove(_.end),!w||!y)return e.selectNodeContents(e.commonAncestorContainer),void e.collapse(!0);if(a=r?f(w)?w.nodeValue.length:w.childNodes.length:0,s=f(y)?y.nodeValue.length:y.childNodes.length,3==w.nodeType)for(;w.previousSibling&&3==w.previousSibling.nodeType;)w=w.previousSibling,a+=w.nodeValue.length;if(3==y.nodeType)for(;y.previousSibling&&3==y.previousSibling.nodeType;)y=y.previousSibling,s+=y.nodeValue.length;for(l=p(w),c=w.parentNode,d=p(y),u=y.parentNode,g=w;g.previousSibling;g=g.previousSibling)3==g.nodeType&&3==g.previousSibling.nodeType&&l--;for(m=y;m.previousSibling;m=m.previousSibling)3==m.nodeType&&3==m.previousSibling.nodeType&&d--;v(c),3==w.nodeType&&(w=c.childNodes[l]),v(u),3==y.nodeType&&(y=u.childNodes[d]),r?(3==w.nodeType?e.setStart(w,a):e[o?"setStartAfter":"setStartBefore"](w),e.collapse(!0)):(3==w.nodeType?e.setStart(w,a):e.setStartBefore(w),3==y.nodeType?e.setEnd(y,s):e.setEndAfter(y)),_.caret&&_.removeCaret(e)}}),S=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,T={nodes:function(e){var t=T.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=T.textNodes(e),t.length||(t=h.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new k(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return u.msie&&9>u.version?new w(e):e.createRange()},selectRange:function(e){var t,n=T.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=_.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return s.format("{0}:{1} - {2}:{3}",h.name(e.startContainer),e.startOffset,h.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var r,o=e.cloneRange();o.collapse(i),o[i?"setStartBefore":"setEndAfter"](t),r=o.extractContents(),n&&(r=h.trim(r)),h[i?"insertBefore":"insertAfter"](r,t)}i(!0),i(!1)},mapAll:function(t,n){var i=[];return new y(t).traverse(function(t){var r=n(t);r&&e.inArray(r,i)<0&&i.push(r)}),i},getAll:function(e,t){var n=t;return"string"==typeof t&&(t=function(e){return h.is(e,n)}),T.mapAll(e,function(e){return t(e)?e:void 0})},getMarkers:function(e){return T.getAll(e,function(e){return"k-marker"==e.className})},image:function(e){var t=T.getAll(e,"img");return 1==t.length?t[0]:void 0},wrapSelectedElements:function(e){function t(e,t){var n,i=h.getNodeLength(t);if(e==i)return!0;for(n=e;i>n;n++)if(!h.insignificant(t.childNodes[n]))return!1;return!0}for(var n=h.editableParent(e.startContainer),i=h.editableParent(e.endContainer);0===e.startOffset&&e.startContainer!=n;)e.setStart(e.startContainer.parentNode,h.findNodeIndex(e.startContainer));for(;t(e.endOffset,e.endContainer)&&e.endContainer!=i;)e.setEnd(e.endContainer.parentNode,h.findNodeIndex(e.endContainer)+1);return e},expand:function(e){var t,n,i,r,o=e.cloneRange(),a=o.startContainer.childNodes[0===o.startOffset?0:o.startOffset-1],s=o.endContainer.childNodes[o.endOffset];return f(a)&&f(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(i=t.split("").reverse().join("").search(S),r=n.search(S),i&&r?(r=-1==r?n.length:r,i=-1==i?0:t.length-i,o.setStart(a,i),o.setEnd(s,r),o):o):o):o},isExpandable:function(e){var t,n,i,r,o,a,s=e.startContainer,l=T.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(i=n.substring(0,t.startOffset),r=n.substring(t.startOffset),o=0,a=0,i&&(o=i.split("").reverse().join("").search(S)),r&&(a=r.search(S)),o&&a):!1)}};c(d,{SelectionUtils:_,W3CRange:w,RangeIterator:y,W3CSelection:b,RangeEnumerator:k,RestorePoint:x,Marker:C,RangeUtils:T})}(window.kendo.jQuery),function(e){function t(e,t){var n=e.selectionRestorePoint=new d(e.getRange()),i=new f(t,n);return i.editor=e,e.undoRedoStack.push(i),n}var n=window.kendo,i=n.Class,r=n.ui.editor,o=r.EditorUtils,a=o.registerTool,s=r.Dom,l=r.Tool,c=r.ToolTemplate,d=r.RestorePoint,u=r.Marker,h=e.extend,p=i.extend({init:function(e){this.options=e,this.restorePoint=new d(e.range),this.marker=new u,this.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),this.editor.selectRange(e)},undo:function(){var e=this.restorePoint;e.restoreHtml(),this.editor.selectRange(e.toRange())},redo:function(){this.exec()},createDialog:function(t,i){var r=this.editor;return e(t).appendTo(document.body).kendoWindow(h({},r.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",n.support.isRtl(r.wrapper)).end()},exec:function(){var e=this.lockRange(!0);this.formatter.editor=this.editor,this.formatter.toggle(e),this.releaseRange(e)}}),f=i.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,this.editor.selectRange(this.startRestorePoint.toRange())}}),g=p.extend({init:function(e){p.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e,t=this.editor,n=this.options,i=n.range,r=t.body,o=new d(i,r),a=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(a,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new f(o,new d(t.getRange(),r)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),m=l.extend({initialize:function(e,t){var n=t.editor,i=this.options,o=i.items?i.items:n.options.insertHtml;new r.SelectBox(e,{dataSource:o,dataTextField:"text",dataValueField:"value",change:function(){l.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new g(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),v=i.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),_=i.extend({init:function(e){this.editor=e},keydown:function(n){var i,r=this,o=r.editor,a=o.keyboard,s=a.isTypingKey(n),l=h(e.Event(),n);return r.editor.trigger("keydown",l),l.isDefaultPrevented()?(n.preventDefault(),!0):l.isDefaultPrevented()||!s||a.isTypingInProgress()?!1:(i=o.getRange(),r.startRestorePoint=new d(i),a.startTyping(function(){r.endRestorePoint=t(o,r.startRestorePoint)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),w=i.extend({init:function(e){this.editor=e},keydown:function(e){var i,r,o,a,l;if(e.keyCode===n.keys.BACKSPACE){if(i=this.editor,r=i.getRange(),o=n.support.browser.msie?"":'<br _moz_dirty="" />',r.collapsed)return;e.preventDefault(),a=new d(r),l=r.commonAncestorContainer,/t(able|body|r)/i.test(s.name(l))&&r.selectNode(s.closest(l,"table")),r.deleteContents(),l=r.commonAncestorContainer,"p"===s.name(l)&&""===l.innerHTML&&(l.innerHTML=o,r.setStart(l,0),r.collapse(!0),i.selectRange(r)),t(i,a)}},keyup:function(){}}),y=i.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){this.startRestorePoint=this.endRestorePoint=t(this.editor,this.startRestorePoint)},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new d(n.getRange()),!0):i.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(){var e=this;return e.systemCommandIsInProgress&&e.changed()?(e.systemCommandIsInProgress=!1,e.createUndoCommand(),!0):!1}}),b=i.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||229==e},toolFromShortcut:function(t,n){var i,r,o=String.fromCharCode(n.keyCode);for(i in t)if(r=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(r.key==o||r.key==n.keyCode)&&r.ctrl==n.ctrlKey&&r.alt==n.altKey&&r.shift==n.shiftKey)return i},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress&&this.onEndTyping&&this.onEndTyping(),this.typingInProgress=!1},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,i=this.handlers;for(n=0;i.length>n&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),k=i.extend({init:function(e){this.editor=e,this.cleaners=[new C,new S,new T]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=s.create(n,"div"),r=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)r.appendChild(i.firstChild);return r},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_startModification:function(){var e,t,n=this.editor;if(!this._inProgress)return this._inProgress=!0,e=n.getRange(),t=new d(e),s.persistScrollTop(n.document),{range:e,restorePoint:t}},_endModification:function(e){t(this.editor,e.restorePoint),this.editor._selectionChange(),this._inProgress=!1},_contentModification:function(e,t){var n=this,i=n.editor,r=n._startModification();r&&(e.call(n,i,r.range),setTimeout(function(){t.call(n,i,r.range),n._endModification(r)}))},oncut:function(){this._contentModification(e.noop,e.noop)},_fileToDataURL:function(t,n){var i=t.getAsFile(),r=new FileReader;r.onload=n||e.noop,r.readAsDataURL(i)},_triggerPaste:function(e,t){var n={html:e||""};n.html=n.html.replace(/\ufeff/g,""),this.editor.trigger("paste",n),this.paste(n.html,t||{})},_handleImagePaste:function(e){var t,n,i,r;if("FileReader"in window&&(t=this,n=e.clipboardData||e.originalEvent.clipboardData,i=n&&(n.items||n.files),i&&i.length&&/^image\//i.test(i[0].type)&&(r=t._startModification())))return this._fileToDataURL(i[0],function(e){t._triggerPaste('<img src="'+e.target.result+'" />'),t._endModification(r)}),!0},onpaste:function(t){this._handleImagePaste(t)||this._contentModification(function(i,r){var o,a,l,c=s.create(i.document,"div",{className:"k-paste-container",innerHTML:""}),d=n.support.browser;i.body.appendChild(c),d.msie&&11>d.version?(t.preventDefault(),o=i.createRange(),o.selectNodeContents(c),i.selectRange(o),a=i.document.body.createTextRange(),a.moveToElementText(c),e(i.body).unbind("paste"),a.execCommand("Paste"),e(i.body).bind("paste",e.proxy(this.onpaste,this))):(l=i.createRange(),l.selectNodeContents(c),i.selectRange(l)),r.deleteContents()},function(t,n){var i,r="";t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&s.is(e,"br")&&s.remove(e),r+=this.innerHTML}),i.remove(),this._triggerPaste(r,{clean:!0})})},splittableParent:function(e,t){var n,i;if(e)return s.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,s.isInline(n))for(;n.parentNode!=i&&!s.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var i,o,a,l,c,d,p,f,g,m,v,_=this.editor;for(n=h({clean:!1,split:!0},n),i=0,o=this.cleaners.length;o>i;i++)this.cleaners[i].applicable(t)&&(t=this.cleaners[i].clean(t));if(n.clean&&(t=t.replace(/(<