fomantic-ui 2.9.0-beta.259 → 2.9.0-beta.261

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +1 -1
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +1 -1
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +1 -1
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +1 -1
  41. package/dist/components/feed.css +1 -1
  42. package/dist/components/feed.min.css +1 -1
  43. package/dist/components/flag.css +1 -1
  44. package/dist/components/flag.min.css +1 -1
  45. package/dist/components/form.css +1 -1
  46. package/dist/components/form.js +9 -2
  47. package/dist/components/form.min.css +1 -1
  48. package/dist/components/form.min.js +2 -2
  49. package/dist/components/grid.css +1 -1
  50. package/dist/components/grid.min.css +1 -1
  51. package/dist/components/header.css +1 -1
  52. package/dist/components/header.min.css +1 -1
  53. package/dist/components/icon.css +1 -1
  54. package/dist/components/icon.min.css +1 -1
  55. package/dist/components/image.css +1 -1
  56. package/dist/components/image.min.css +1 -1
  57. package/dist/components/input.css +1 -1
  58. package/dist/components/input.min.css +1 -1
  59. package/dist/components/item.css +1 -1
  60. package/dist/components/item.min.css +1 -1
  61. package/dist/components/label.css +1 -1
  62. package/dist/components/label.min.css +1 -1
  63. package/dist/components/list.css +1 -1
  64. package/dist/components/list.min.css +1 -1
  65. package/dist/components/loader.css +1 -1
  66. package/dist/components/loader.min.css +1 -1
  67. package/dist/components/message.css +1 -1
  68. package/dist/components/message.min.css +1 -1
  69. package/dist/components/modal.css +1 -1
  70. package/dist/components/modal.js +1 -1
  71. package/dist/components/modal.min.css +1 -1
  72. package/dist/components/modal.min.js +1 -1
  73. package/dist/components/nag.css +1 -1
  74. package/dist/components/nag.js +1 -1
  75. package/dist/components/nag.min.css +1 -1
  76. package/dist/components/nag.min.js +1 -1
  77. package/dist/components/placeholder.css +1 -1
  78. package/dist/components/placeholder.min.css +1 -1
  79. package/dist/components/popup.css +1 -1
  80. package/dist/components/popup.js +1 -1
  81. package/dist/components/popup.min.css +1 -1
  82. package/dist/components/popup.min.js +1 -1
  83. package/dist/components/progress.css +1 -1
  84. package/dist/components/progress.js +1 -1
  85. package/dist/components/progress.min.css +1 -1
  86. package/dist/components/progress.min.js +1 -1
  87. package/dist/components/rail.css +1 -1
  88. package/dist/components/rail.min.css +1 -1
  89. package/dist/components/rating.css +1 -1
  90. package/dist/components/rating.js +1 -1
  91. package/dist/components/rating.min.css +1 -1
  92. package/dist/components/rating.min.js +1 -1
  93. package/dist/components/reset.css +1 -1
  94. package/dist/components/reset.min.css +1 -1
  95. package/dist/components/reveal.css +1 -1
  96. package/dist/components/reveal.min.css +1 -1
  97. package/dist/components/search.css +1 -1
  98. package/dist/components/search.js +1 -1
  99. package/dist/components/search.min.css +1 -1
  100. package/dist/components/search.min.js +1 -1
  101. package/dist/components/segment.css +1 -1
  102. package/dist/components/segment.min.css +1 -1
  103. package/dist/components/shape.css +1 -1
  104. package/dist/components/shape.js +1 -1
  105. package/dist/components/shape.min.css +1 -1
  106. package/dist/components/shape.min.js +1 -1
  107. package/dist/components/sidebar.css +1 -1
  108. package/dist/components/sidebar.js +1 -1
  109. package/dist/components/sidebar.min.css +1 -1
  110. package/dist/components/sidebar.min.js +1 -1
  111. package/dist/components/site.css +1 -1
  112. package/dist/components/site.js +1 -1
  113. package/dist/components/site.min.css +1 -1
  114. package/dist/components/site.min.js +1 -1
  115. package/dist/components/slider.js +1 -1
  116. package/dist/components/slider.min.js +1 -1
  117. package/dist/components/state.js +1 -1
  118. package/dist/components/state.min.js +1 -1
  119. package/dist/components/statistic.css +1 -1
  120. package/dist/components/statistic.min.css +1 -1
  121. package/dist/components/step.css +1 -1
  122. package/dist/components/step.min.css +1 -1
  123. package/dist/components/sticky.css +1 -1
  124. package/dist/components/sticky.js +1 -1
  125. package/dist/components/sticky.min.css +1 -1
  126. package/dist/components/sticky.min.js +1 -1
  127. package/dist/components/tab.css +1 -1
  128. package/dist/components/tab.js +1 -1
  129. package/dist/components/tab.min.css +1 -1
  130. package/dist/components/tab.min.js +1 -1
  131. package/dist/components/table.css +1 -1
  132. package/dist/components/table.min.css +1 -1
  133. package/dist/components/text.css +1 -1
  134. package/dist/components/text.min.css +1 -1
  135. package/dist/components/toast.css +1 -1
  136. package/dist/components/toast.js +1 -1
  137. package/dist/components/toast.min.css +1 -1
  138. package/dist/components/toast.min.js +1 -1
  139. package/dist/components/transition.css +1 -1
  140. package/dist/components/transition.js +1 -1
  141. package/dist/components/transition.min.css +1 -1
  142. package/dist/components/transition.min.js +1 -1
  143. package/dist/components/visibility.js +1 -1
  144. package/dist/components/visibility.min.js +1 -1
  145. package/dist/semantic.css +49 -49
  146. package/dist/semantic.js +33 -26
  147. package/dist/semantic.min.css +1 -1
  148. package/dist/semantic.min.js +2 -2
  149. package/package.json +1 -1
  150. package/src/definitions/behaviors/form.js +8 -1
  151. package/src/themes/material/globals/site.variables +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Accordion
2
+ * # Fomantic-UI 2.9.0-beta.261 - Accordion
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Accordion
2
+ * # Fomantic-UI 2.9.0-beta.261 - Accordion
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Accordion
2
+ * # Fomantic-UI 2.9.0-beta.261 - Accordion
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Ad
2
+ * # Fomantic-UI 2.9.0-beta.261 - Ad
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Ad
2
+ * # Fomantic-UI 2.9.0-beta.261 - Ad
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - API
2
+ * # Fomantic-UI 2.9.0-beta.261 - API
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Breadcrumb
2
+ * # Fomantic-UI 2.9.0-beta.261 - Breadcrumb
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Breadcrumb
2
+ * # Fomantic-UI 2.9.0-beta.261 - Breadcrumb
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Button
2
+ * # Fomantic-UI 2.9.0-beta.261 - Button
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Button
2
+ * # Fomantic-UI 2.9.0-beta.261 - Button
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Calendar
2
+ * # Fomantic-UI 2.9.0-beta.261 - Calendar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Calendar
2
+ * # Fomantic-UI 2.9.0-beta.261 - Calendar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Calendar
2
+ * # Fomantic-UI 2.9.0-beta.261 - Calendar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Card
2
+ * # Fomantic-UI 2.9.0-beta.261 - Card
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Card
2
+ * # Fomantic-UI 2.9.0-beta.261 - Card
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Checkbox
2
+ * # Fomantic-UI 2.9.0-beta.261 - Checkbox
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Checkbox
2
+ * # Fomantic-UI 2.9.0-beta.261 - Checkbox
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Checkbox
2
+ * # Fomantic-UI 2.9.0-beta.261 - Checkbox
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Comment
2
+ * # Fomantic-UI 2.9.0-beta.261 - Comment
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Comment
2
+ * # Fomantic-UI 2.9.0-beta.261 - Comment
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Container
2
+ * # Fomantic-UI 2.9.0-beta.261 - Container
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Container
2
+ * # Fomantic-UI 2.9.0-beta.261 - Container
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Dimmer
2
+ * # Fomantic-UI 2.9.0-beta.261 - Dimmer
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Dimmer
2
+ * # Fomantic-UI 2.9.0-beta.261 - Dimmer
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Dimmer
2
+ * # Fomantic-UI 2.9.0-beta.261 - Dimmer
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Divider
2
+ * # Fomantic-UI 2.9.0-beta.261 - Divider
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Divider
2
+ * # Fomantic-UI 2.9.0-beta.261 - Divider
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Dropdown
2
+ * # Fomantic-UI 2.9.0-beta.261 - Dropdown
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Dropdown
2
+ * # Fomantic-UI 2.9.0-beta.261 - Dropdown
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Dropdown
2
+ * # Fomantic-UI 2.9.0-beta.261 - Dropdown
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Video
2
+ * # Fomantic-UI 2.9.0-beta.261 - Video
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Embed
2
+ * # Fomantic-UI 2.9.0-beta.261 - Embed
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Video
2
+ * # Fomantic-UI 2.9.0-beta.261 - Video
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Feed
2
+ * # Fomantic-UI 2.9.0-beta.261 - Feed
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Feed
2
+ * # Fomantic-UI 2.9.0-beta.261 - Feed
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Flag
2
+ * # Fomantic-UI 2.9.0-beta.261 - Flag
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Flag
2
+ * # Fomantic-UI 2.9.0-beta.261 - Flag
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Form
2
+ * # Fomantic-UI 2.9.0-beta.261 - Form
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Form Validation
2
+ * # Fomantic-UI 2.9.0-beta.261 - Form Validation
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -131,6 +131,11 @@ $.fn.form = function(parameters) {
131
131
  $reset = $module.find(selector.reset);
132
132
  },
133
133
 
134
+ refreshEvents: function() {
135
+ module.removeEvents();
136
+ module.bindEvents();
137
+ },
138
+
134
139
  submit: function() {
135
140
  module.verbose('Submitting form', $module);
136
141
  submitting = true;
@@ -391,7 +396,6 @@ $.fn.form = function(parameters) {
391
396
  $module.off(eventNamespace);
392
397
  $field.off(eventNamespace);
393
398
  $submit.off(eventNamespace);
394
- $field.off(eventNamespace);
395
399
  },
396
400
 
397
401
  event: {
@@ -864,9 +868,11 @@ $.fn.form = function(parameters) {
864
868
  }
865
869
  });
866
870
  module.debug('Adding rules', newValidation.rules, validation);
871
+ module.refreshEvents();
867
872
  },
868
873
  fields: function(fields) {
869
874
  validation = $.extend(true, {}, validation, module.get.fieldsFromShorthand(fields));
875
+ module.refreshEvents();
870
876
  },
871
877
  prompt: function(identifier, errors, internal) {
872
878
  var
@@ -963,6 +969,7 @@ $.fn.form = function(parameters) {
963
969
  $.each(fields, function(index, field) {
964
970
  module.remove.rule(field);
965
971
  });
972
+ module.refreshEvents();
966
973
  },
967
974
  // alias
968
975
  rules: function(field, rules) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Form
2
+ * # Fomantic-UI 2.9.0-beta.261 - Form
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.259
2
+ * # Fomantic UI - 2.9.0-beta.261
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -8,4 +8,4 @@
8
8
  * http://opensource.org/licenses/MIT
9
9
  *
10
10
  */
11
- !function(O,$,I,L){"use strict";O.isFunction=O.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},$=void 0!==$&&$.Math==Math?$:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.form=function(C){var w,V=O(this),A=V.selector||"",D=(new Date).getTime(),F=[],R=C,S=arguments[1],T="string"==typeof R,j=[].slice.call(arguments,1);return V.each(function(){var n,f,t,e,p,s,m,g,h,r,c,i,a,l,u,v,d=O(this),b=this,y=[],x=!1,o=!1,k=!1,E=["clean","clean"];(v={initialize:function(){v.get.settings(),T?(u===L&&v.instantiate(),v.invoke(R)):(u!==L&&(u.invoke("destroy"),v.refresh()),v.verbose("Initializing form validation",d,p),v.bindEvents(),v.set.defaults(),p.autoCheckRequired&&v.set.autoCheck(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v),u=v,d.data(a,v)},destroy:function(){v.verbose("Destroying previous module",u),v.removeEvents(),d.removeData(a)},refresh:function(){v.verbose("Refreshing selector cache"),n=d.find(g.field),f=d.find(g.group),t=d.find(g.message),d.find(g.prompt),e=d.find(g.submit),d.find(g.clear),d.find(g.reset)},submit:function(){v.verbose("Submitting form",d),o=!0,d.submit()},attachEvents:function(e,t){t=t||"submit",O(e).on("click"+l,function(e){v[t](),e.preventDefault()})},bindEvents:function(){v.verbose("Attaching form events"),d.on("submit"+l,v.validate.form).on("blur"+l,g.field,v.event.field.blur).on("click"+l,g.submit,v.submit).on("click"+l,g.reset,v.reset).on("click"+l,g.clear,v.clear),p.keyboardShortcuts&&d.on("keydown"+l,g.field,v.event.field.keydown),n.each(function(e,t){var n=O(t),r=n.prop("type"),i=v.get.changeEvent(r,n);n.on(i+l,v.event.field.change)}),p.preventLeaving&&O($).on("beforeunload"+l,v.event.beforeUnload),n.on("change click keyup keydown blur",function(e){v.determine.isDirty()}),d.on("dirty"+l,function(e){p.onDirty.call()}),d.on("clean"+l,function(e){p.onClean.call()})},clear:function(){n.each(function(e,t){var n=O(t),r=n.parent(),i=n.closest(f),a=i.find(g.prompt),o=n.closest(g.uiCalendar),l=n.data(m.defaultValue)||"",s=r.is(g.uiCheckbox),u=r.is(g.uiDropdown)&&v.can.useElement("dropdown"),c=0<o.length&&v.can.useElement("calendar");i.hasClass(h.error)&&(v.verbose("Resetting error on field",i),i.removeClass(h.error),a.remove()),u?(v.verbose("Resetting dropdown value",r,l),r.dropdown("clear",!0)):s?n.prop("checked",!1):c?o.calendar("clear"):(v.verbose("Resetting field value",n,l),n.val(""))}),v.remove.states()},reset:function(){n.each(function(e,t){var n=O(t),r=n.parent(),i=n.closest(f),a=n.closest(g.uiCalendar),o=i.find(g.prompt),l=n.data(m.defaultValue),s=r.is(g.uiCheckbox),u=r.is(g.uiDropdown)&&v.can.useElement("dropdown"),c=0<a.length&&v.can.useElement("calendar"),d=i.hasClass(h.error);l!==L&&(d&&(v.verbose("Resetting error on field",i),i.removeClass(h.error),o.remove()),u?(v.verbose("Resetting dropdown value",r,l),r.dropdown("restore defaults",!0)):s?(v.verbose("Resetting checkbox value",r,l),n.prop("checked",l)):c?a.calendar("set date",l):(v.verbose("Resetting field value",n,l),n.val(l)))}),v.remove.states()},determine:{isValid:function(){var n=!0;return O.each(s,function(e,t){v.validate.field(t,e,!0)||(n=!1)}),n},isDirty:function(e){var i=!1;n.each(function(e,t){var n,r=O(t);n=0<r.filter(g.checkbox).length?v.is.checkboxDirty(r):v.is.fieldDirty(r),r.data(p.metadata.isDirty,n),i|=n}),i?v.set.dirty():v.set.clean()}},is:{bracketedRule:function(e){return e.type&&e.type.match(p.regExp.bracket)},shorthandRules:function(e){return"string"==typeof e||Array.isArray(e)},empty:function(e){return!e||0===e.length||(e.is(g.checkbox)?!e.is(":checked"):v.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(e,n){var r=!0;return e?(v.verbose("Checking if field is valid",e),v.validate.field(s[e],e,!!n)):(v.verbose("Checking if form is valid"),O.each(s,function(e,t){v.is.valid(e,n)||(r=!1)}),r)},dirty:function(){return k},clean:function(){return!k},fieldDirty:function(e){var t=e.data(m.defaultValue);null==t?t="":Array.isArray(t)&&(t=t.toString());var n=e.val();null==n?n="":Array.isArray(n)&&(n=n.toString());var r=/^(true|false)$/i;return r.test(t)&&r.test(n)?!new RegExp("^"+t+"$","i").test(n):n!==t},checkboxDirty:function(e){return e.data(m.defaultValue)!==e.is(":checked")},justDirty:function(){return"dirty"===E[0]},justClean:function(){return"clean"===E[0]}},removeEvents:function(){d.off(l),n.off(l),e.off(l),n.off(l)},event:{field:{keydown:function(e){var t=O(this),n=e.which,r=t.is(g.input),i=t.is(g.checkbox),a=0<t.closest(g.uiDropdown).length,o=13;n==27&&(v.verbose("Escape key pressed blurring field"),t[0].blur()),e.ctrlKey||n!=o||!r||a||i||(x||(t.one("keyup"+l,v.event.field.keyup),v.submit(),v.debug("Enter pressed on input submitting form"),e.preventDefault()),x=!0)},keyup:function(){x=!1},blur:function(e){var t=O(this),n=t.closest(f),r=v.get.validation(t);r&&("blur"==p.on||n.hasClass(h.error)&&p.revalidate)&&(v.debug("Revalidating field",t,r),v.validate.field(r),p.inline||v.validate.form(!1,!0))},change:function(e){var t=O(this),n=t.closest(f),r=v.get.validation(t);r&&("change"==p.on||n.hasClass(h.error)&&p.revalidate)&&(clearTimeout(v.timer),v.timer=setTimeout(function(){v.debug("Revalidating field",t,r),v.validate.field(r),p.inline||v.validate.form(!1,!0)},p.delay))}},beforeUnload:function(e){if(v.is.dirty()&&!o)return(e=e||$.event)&&(e.returnValue=p.text.leavingMessage),p.text.leavingMessage}},get:{ancillaryValue:function(e){return!(!e.type||!e.value&&!v.is.bracketedRule(e))&&(e.value!==L?e.value:e.type.match(p.regExp.bracket)[1]+"")},ruleName:function(e){return v.is.bracketedRule(e)?e.type.replace(e.type.match(p.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":v.get.inputEvent()},inputEvent:function(){return I.createElement("input").oninput!==L?"input":I.createElement("input").onpropertychange!==L?"propertychange":"keyup"},fieldsFromShorthand:function(e){var r={};return O.each(e,function(n,e){Array.isArray(e)||"object"!=typeof e?("string"==typeof e&&(e=[e]),r[n]={rules:[]},O.each(e,function(e,t){r[n].rules.push({type:t})})):r[n]=e}),r},prompt:function(e,t){var n,r,i,a=v.get.ruleName(e),o=v.get.ancillaryValue(e),l=v.get.field(t.identifier),s=l.val(),u=O.isFunction(e.prompt)?e.prompt(s):e.prompt||p.prompt[a]||p.text.unspecifiedRule,c=-1!==u.search("{value}"),d=-1!==u.search("{name}");return o&&0<=["integer","decimal","number"].indexOf(a)&&0<=o.indexOf("..")&&(i=o.split("..",2),e.prompt||(u+=(""===i[0]?p.prompt.maxValue.replace(/\{ruleValue\}/g,"{max}"):""===i[1]?p.prompt.minValue.replace(/\{ruleValue\}/g,"{min}"):p.prompt.range).replace(/\{name\}/g," "+p.text.and)),u=(u=u.replace(/\{min\}/g,i[0])).replace(/\{max\}/g,i[1])),c&&(u=u.replace(/\{value\}/g,l.val())),d&&(r=1==(n=l.closest(g.group).find("label").eq(0)).length?n.text():l.prop("placeholder")||p.text.unspecifiedField,u=u.replace(/\{name\}/g,r)),u=(u=u.replace(/\{identifier\}/g,t.identifier)).replace(/\{ruleValue\}/g,o),e.prompt||v.verbose("Using default validation prompt for type",u,a),u},settings:function(){if(O.isPlainObject(C)){var e=Object.keys(C);0<e.length&&(C[e[0]].identifier!==L&&C[e[0]].rules!==L)?(p=O.extend(!0,{},O.fn.form.settings,S),s=O.extend(!0,{},O.fn.form.settings.defaults,C),v.error(p.error.oldSyntax,b),v.verbose("Extending settings from legacy parameters",s,p)):(C.fields&&(C.fields=v.get.fieldsFromShorthand(C.fields)),p=O.extend(!0,{},O.fn.form.settings,C),s=O.extend(!0,{},O.fn.form.settings.defaults,p.fields),v.verbose("Extending settings",s,p))}else p=O.extend(!0,{},O.fn.form.settings),s=O.extend(!0,{},O.fn.form.settings.defaults),v.verbose("Using default form validation",s,p);i=p.namespace,m=p.metadata,g=p.selector,h=p.className,r=p.regExp,c=p.error,a="module-"+i,l="."+i,((u=d.data(a))||v).refresh()},field:function(e){var t;return v.verbose("Finding field with identifier",e),e=v.escape.string(e),0<(t=n.filter("#"+e)).length?t:0<(t=n.filter('[name="'+e+'"]')).length?t:0<(t=n.filter('[name="'+e+'[]"]')).length?t:0<(t=n.filter("[data-"+m.validate+'="'+e+'"]')).length?t:O("<input/>")},fields:function(e){var n=O();return O.each(e,function(e,t){n=n.add(v.get.field(t))}),n},validation:function(r){var i,a;return!!s&&(O.each(s,function(e,n){a=n.identifier||e,O.each(v.get.field(a),function(e,t){if(t==r[0])return n.identifier=a,i=n,!1})}),i||!1)},value:function(e){var t=[];return t.push(e),v.get.values.call(b,t)[e]},values:function(e){var t=Array.isArray(e)?v.get.fields(e):n,m={};return t.each(function(e,t){var n=O(t),r=n.closest(g.uiCalendar),i=n.prop("name"),a=n.val(),o=n.is(g.checkbox),l=n.is(g.radio),s=-1!==i.indexOf("[]"),u=0<r.length&&v.can.useElement("calendar"),c=!!o&&n.is(":checked");if(i)if(s)i=i.replace("[]",""),m[i]||(m[i]=[]),o?c?m[i].push(a||!0):m[i].push(!1):m[i].push(a);else if(l)m[i]!==L&&!1!==m[i]||(m[i]=!!c&&(a||!0));else if(o)m[i]=!!c&&(a||!0);else if(u){var d=r.calendar("get date");if(null!==d){if("date"==p.dateHandling)m[i]=d;else if("input"==p.dateHandling)m[i]=r.calendar("get input date");else if("formatter"==p.dateHandling){var f=r.calendar("setting","type");switch(f){case"date":m[i]=p.formatter.date(d);break;case"datetime":m[i]=p.formatter.datetime(d);break;case"time":m[i]=p.formatter.time(d);break;case"month":m[i]=p.formatter.month(d);break;case"year":m[i]=p.formatter.year(d);break;default:v.debug("Wrong calendar mode",r,f),m[i]=""}}}else m[i]=""}else m[i]=a}),m},dirtyFields:function(){return n.filter(function(e,t){return O(t).data(m.isDirty)})}},has:{field:function(e){return v.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=v.escape.string(e))&&v.error(c.identifier,e),0<n.filter("#"+e).length||(0<n.filter('[name="'+e+'"]').length||0<n.filter("[data-"+m.validate+'="'+e+'"]').length)}},can:{useElement:function(e){return O.fn[e]!==L||(v.error(c.noElement.replace("{element}",e)),!1)}},escape:{string:function(e){return(e=String(e)).replace(r.escape,"\\$&")}},add:{rule:function(e,t){v.add.field(e,t)},field:function(n,e){s[n]!==L&&s[n].rules!==L||(s[n]={rules:[]});var r={rules:[]};v.is.shorthandRules(e)?(e=Array.isArray(e)?e:[e],O.each(e,function(e,t){r.rules.push({type:t})})):r.rules=e.rules,O.each(r.rules,function(e,t){0==O.grep(s[n].rules,function(e){return e.type==t.type}).length&&s[n].rules.push(t)}),v.debug("Adding rules",r.rules,s)},fields:function(e){s=O.extend(!0,{},s,v.get.fieldsFromShorthand(e))},prompt:function(e,t,n){var r=v.get.field(e).closest(f),i=r.children(g.prompt),a=0!==i.length;t="string"==typeof t?[t]:t,v.verbose("Adding field error state",e),n||r.addClass(h.error),p.inline&&(a||(i=O("<div/>").addClass(h.label)).appendTo(r),i.html(p.templates.prompt(t)),a?v.verbose("Inline errors are disabled, no inline error added",e):p.transition&&v.can.useElement("transition")&&d.transition("is supported")?(v.verbose("Displaying error with css transition",p.transition),i.transition(p.transition+" in",p.duration)):(v.verbose("Displaying error with fallback javascript animation"),i.fadeIn(p.duration)))},errors:function(e){v.debug("Adding form error messages",e),v.set.error(),t.html(p.templates.error(e))}},remove:{errors:function(){v.debug("Removing form error messages"),t.empty()},states:function(){d.removeClass(h.error).removeClass(h.success),p.inline||v.remove.errors(),v.determine.isDirty()},rule:function(n,e){var r=Array.isArray(e)?e:[e];if(s[n]!==L&&Array.isArray(s[n].rules))return e===L?(v.debug("Removed all rules"),void(s[n].rules=[])):void O.each(s[n].rules,function(e,t){t&&-1!==r.indexOf(t.type)&&(v.debug("Removed rule",t.type),s[n].rules.splice(e,1))})},field:function(e){var t=Array.isArray(e)?e:[e];O.each(t,function(e,t){v.remove.rule(t)})},rules:function(e,n){Array.isArray(e)?O.each(e,function(e,t){v.remove.rule(t,n)}):v.remove.rule(e,n)},fields:function(e){v.remove.field(e)},prompt:function(e){var t=v.get.field(e).closest(f),n=t.children(g.prompt);t.removeClass(h.error),p.inline&&n.is(":visible")&&(v.verbose("Removing prompt for field",e),p.transition&&v.can.useElement("transition")&&d.transition("is supported")?n.transition(p.transition+" out",p.duration,function(){n.remove()}):n.fadeOut(p.duration,function(){n.remove()}))}},set:{success:function(){d.removeClass(h.error).addClass(h.success)},defaults:function(){n.each(function(e,t){var n=O(t),r=n.parent(),i=0<n.filter(g.checkbox).length,a=r.is(g.uiDropdown)&&v.can.useElement("dropdown"),o=n.closest(g.uiCalendar),l=0<o.length&&v.can.useElement("calendar"),s=i?n.is(":checked"):n.val();a?r.dropdown("save defaults"):l&&o.calendar("refresh"),n.data(m.defaultValue,s),n.data(m.isDirty,!1)})},error:function(){d.removeClass(h.success).addClass(h.error)},value:function(e,t){var n={};return n[e]=t,v.set.values.call(b,n)},values:function(e){O.isEmptyObject(e)||O.each(e,function(e,t){var n,r=v.get.field(e),i=r.parent(),a=r.closest(g.uiCalendar),o=Array.isArray(t),l=i.is(g.uiCheckbox)&&v.can.useElement("checkbox"),s=i.is(g.uiDropdown)&&v.can.useElement("dropdown"),u=r.is(g.radio)&&l,c=0<a.length&&v.can.useElement("calendar");0<r.length&&(o&&l?(v.verbose("Selecting multiple",t,r),i.checkbox("uncheck"),O.each(t,function(e,t){n=r.filter('[value="'+t+'"]'),i=n.parent(),0<n.length&&i.checkbox("check")})):u?(v.verbose("Selecting radio value",t,r),r.filter('[value="'+t+'"]').parent(g.uiCheckbox).checkbox("check")):l?(v.verbose("Setting checkbox value",t,i),!0===t||1===t||"on"===t?i.checkbox("check"):i.checkbox("uncheck"),"string"==typeof t&&r.val(t)):s?(v.verbose("Setting dropdown value",t,i),i.dropdown("set selected",t)):c?a.calendar("set date",t):(v.verbose("Setting field value",t,r),r.val(t)))})},dirty:function(){v.verbose("Setting state dirty"),k=!0,E[0]=E[1],E[1]="dirty",v.is.justClean()&&d.trigger("dirty")},clean:function(){v.verbose("Setting state clean"),k=!1,E[0]=E[1],E[1]="clean",v.is.justDirty()&&d.trigger("clean")},asClean:function(){v.set.defaults(),v.set.clean()},asDirty:function(){v.set.defaults(),v.set.dirty()},autoCheck:function(){v.debug("Enabling auto check on required fields"),n.each(function(e,t){var n=O(t),r=O(t).closest(f),i=0<n.filter(g.checkbox).length,a=n.prop("required")||r.hasClass(h.required)||r.parent().hasClass(h.required),o=n.is(":disabled")||r.hasClass(h.disabled)||r.parent().hasClass(h.disabled),l=v.get.validation(n),s=!!l&&0!==O.grep(l.rules,function(e){return"empty"==e.type}),u=l.identifier||n.attr("id")||n.attr("name")||n.data(m.validate);!a||o||s||u===L||(i?(v.verbose("Adding 'checked' rule on field",u),v.add.rule(u,"checked")):(v.verbose("Adding 'empty' rule on field",u),v.add.rule(u,"empty")))})},optional:function(n,r){r=!1!==r,O.each(s,function(e,t){n!=e&&n!=t.identifier||(t.optional=r)})}},validate:{form:function(e,t){var n=v.get.values();if(x)return!1;if(y=[],v.determine.isValid()){if(v.debug("Form has no validation errors, submitting"),v.set.success(),p.inline||v.remove.errors(),!0!==t)return p.onSuccess.call(b,e,n)}else{if(v.debug("Form has errors"),o=!1,v.set.error(),p.inline||v.add.errors(y),e&&d.data("moduleApi")!==L&&e.stopImmediatePropagation(),p.errorFocus&&!0!==t){var r,i=!0;"string"==typeof p.errorFocus?(i=(r=O(p.errorFocus)).is("[tabindex]"))||r.attr("tabindex",-1):r=f.filter("."+h.error).first().find(g.field),r.focus(),i||r.removeAttr("tabindex")}if(!0!==t)return p.onFailure.call(b,y,n)}},field:function(r,e,i){i=i===L||i,"string"==typeof r&&(v.verbose("Validating field",r),r=s[e=r]);var a=r.identifier||e,t=v.get.field(a),n=!!r.depends&&v.get.field(r.depends),o=!0,l=[];return r.identifier||(v.debug("Using field name as identifier",a),r.identifier=a),!t.filter(":not(:disabled)").length?v.debug("Field is disabled. Skipping",a):r.optional&&v.is.blank(t)?v.debug("Field is optional and blank. Skipping",a):r.depends&&v.is.empty(n)?v.debug("Field depends on another value that is not present or empty. Skipping",n):r.rules!==L&&(i&&t.closest(f).removeClass(h.error),O.each(r.rules,function(e,t){if(v.has.field(a)){var n=v.validate.rule(r,t,!0)||[];0<n.length&&(v.debug("Field is invalid",a,t.type),l.push(v.get.prompt(t,r)),o=!1,i&&O(n).closest(f).addClass(h.error))}})),o?(i&&(v.remove.prompt(a,l),p.onValid.call(t)),!0):(i&&(y=y.concat(l),v.add.prompt(a,l,!0),p.onInvalid.call(t,l)),!1)},rule:function(e,n,t){function r(e){var t=u?O(e).filter(":checked").val():O(e).val();return t=t===L||""===t||null===t?"":p.shouldTrim&&!1!==n.shouldTrim||n.shouldTrim?String(t+"").trim():String(t+""),l.call(e,t,a,d)}var i=v.get.field(e.identifier),a=v.get.ancillaryValue(n),o=v.get.ruleName(n),l=p.rules[o],s=[],u=i.is(g.checkbox);if(O.isFunction(l))return u?r(i)||(s=i):O.each(i,function(e,t){r(t)||s.push(t)}),t?s:!(0<s.length);v.error(c.noRule,o)}},setting:function(e,t){if(O.isPlainObject(e))O.extend(!0,p,e);else{if(t===L)return p[e];p[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,v,e);else{if(t===L)return v[e];v[e]=t}},debug:function(){!p.silent&&p.debug&&(p.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,p.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),v.verbose.apply(console,arguments)))},error:function(){p.silent||(v.error=Function.prototype.bind.call(console.error,console,p.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=(new Date).getTime())-(D||t),D=t,F.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:b,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var e=p.name+":",n=0;D=!1,clearTimeout(v.performance.timer),O.each(F,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",A&&(e+=" '"+A+"'"),1<V.length&&(e+=" ("+V.length+")"),(console.group!==L||console.table!==L)&&0<F.length&&(console.groupCollapsed(e),console.table?console.table(F):O.each(F,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),F=[]}},invoke:function(r,e,t){var i,a,n,o=u;return e=e||j,t=b||t,"string"==typeof r&&o!==L&&(r=r.split(/[\. ]/),i=r.length-1,O.each(r,function(e,t){var n=e!=i?t+r[e+1].charAt(0).toUpperCase()+r[e+1].slice(1):r;if(O.isPlainObject(o[n])&&e!=i)o=o[n];else{if(o[n]!==L)return a=o[n],!1;if(!O.isPlainObject(o[t])||e==i)return o[t]!==L&&(a=o[t]),!1;o=o[t]}})),O.isFunction(a)?n=a.apply(t,e):a!==L&&(n=a),Array.isArray(w)?w.push(n):w!==L?w=[w,n]:n!==L&&(w=n),a}}).initialize()}),w!==L?w:this},O.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,shouldTrim:!0,transition:"scale",duration:200,autoCheckRequired:!1,preventLeaving:!1,errorFocus:!0,dateHandling:"date",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},onDirty:function(){},onClean:function(){},metadata:{defaultValue:"default",validate:"validate",isDirty:"isDirty"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|:,=@]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{and:"and",unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field",leavingMessage:"There are unsaved changes on this page which will be discarded if you continue."},prompt:{range:"{name} must be in a range from {min} to {max}",maxValue:"{name} must have a maximum value of {ruleValue}",minValue:"{name} must have a minimum value of {ruleValue}",empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',group:".field",input:'input:not([type="file"])',message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown",uiCalendar:".ui.calendar"},className:{error:"error",label:"ui basic red pointing prompt label",pressed:"down",success:"success",required:"required",disabled:"disabled"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noElement:"This module requires ui {element}"},templates:{error:function(e){var n='<ul class="list">';return O.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"},prompt:function(e){if(1===e.length)return e[0];var n='<ul class="ui list">';return O.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"}},formatter:{date:function(e){return Intl.DateTimeFormat("en-GB").format(e)},datetime:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},time:function(e){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},month:function(e){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(e)},year:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(e)}},rules:{empty:function(e){return!(e===L||""===e||Array.isArray(e)&&0===e.length)},checked:function(){return 0<O(this).filter(":checked").length},email:function(e){return O.fn.form.settings.regExp.email.test(e)},url:function(e){return O.fn.form.settings.regExp.url.test(e)},regExp:function(e,t){if(t instanceof RegExp)return e.match(t);var n,r=t.match(O.fn.form.settings.regExp.flags);return r&&(t=2<=r.length?r[1]:t,n=3<=r.length?r[2]:""),e.match(new RegExp(t,n))},minValue:function(e,t){return O.fn.form.settings.rules.range(e,t+"..","number")},maxValue:function(e,t){return O.fn.form.settings.rules.range(e,".."+t,"number")},integer:function(e,t){return O.fn.form.settings.rules.range(e,t,"integer")},range:function(e,t,n){var r,i,a;return"string"==typeof n&&(n=O.fn.form.settings.regExp[n]),n instanceof RegExp||(n=O.fn.form.settings.regExp.integer),t&&-1===["",".."].indexOf(t)&&(-1==t.indexOf("..")?n.test(t)&&(r=i=t-0):(a=t.split("..",2),n.test(a[0])&&(r=a[0]-0),n.test(a[1])&&(i=a[1]-0))),n.test(e)&&(r===L||r<=e)&&(i===L||e<=i)},decimal:function(e,t){return O.fn.form.settings.rules.range(e,t,"decimal")},number:function(e,t){return O.fn.form.settings.rules.range(e,t,"number")},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return(e="string"==typeof e?e.toLowerCase():e)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(e,t){return e!=t},contains:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t,"i"))},containsExactly:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t))},doesntContain:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t,"i"))},doesntContainExactly:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t))},minLength:function(e,t){return e!==L&&e.length>=t},exactLength:function(e,t){return e!==L&&e.length==t},maxLength:function(e,t){return e!==L&&e.length<=t},match:function(e,t,n){var r,i;return 0<(i=n.find('[data-validate="'+t+'"]')).length?r=i.val():0<(i=n.find("#"+t)).length?r=i.val():0<(i=n.find('[name="'+t+'"]')).length?r=i.val():0<(i=n.find('[name="'+t+'[]"]')).length&&(r=i),r!==L&&e.toString()==r.toString()},different:function(e,t,n){var r,i;return 0<(i=n.find('[data-validate="'+t+'"]')).length?r=i.val():0<(i=n.find("#"+t)).length?r=i.val():0<(i=n.find('[name="'+t+'"]')).length?r=i.val():0<(i=n.find('[name="'+t+'[]"]')).length&&(r=i),r!==L&&e.toString()!==r.toString()},creditCard:function(n,e){var t,r,i={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},a={},o=!1,l="string"==typeof e&&e.split(",");if("string"==typeof n&&0!==n.length){if(n=n.replace(/[\s\-]/g,""),l&&(O.each(l,function(e,t){(r=i[t])&&(a={length:-1!==O.inArray(n.length,r.length),pattern:-1!==n.search(r.pattern)}).length&&a.pattern&&(o=!0)}),!o))return!1;if((t={number:-1!==O.inArray(n.length,i.unionPay.length),pattern:-1!==n.search(i.unionPay.pattern)}).number&&t.pattern)return!0;for(var s=n.length,u=0,c=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],d=0;s--;)d+=c[u][parseInt(n.charAt(s),10)],u^=1;return d%10==0&&0<d}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document);
11
+ !function(O,$,I,L){"use strict";O.isFunction=O.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},$=void 0!==$&&$.Math==Math?$:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.form=function(C){var w,V=O(this),A=V.selector||"",D=(new Date).getTime(),F=[],R=C,S=arguments[1],T="string"==typeof R,j=[].slice.call(arguments,1);return V.each(function(){var n,f,t,e,p,s,m,g,h,r,c,i,a,l,u,v,d=O(this),b=this,y=[],x=!1,o=!1,k=!1,E=["clean","clean"];(v={initialize:function(){v.get.settings(),T?(u===L&&v.instantiate(),v.invoke(R)):(u!==L&&(u.invoke("destroy"),v.refresh()),v.verbose("Initializing form validation",d,p),v.bindEvents(),v.set.defaults(),p.autoCheckRequired&&v.set.autoCheck(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v),u=v,d.data(a,v)},destroy:function(){v.verbose("Destroying previous module",u),v.removeEvents(),d.removeData(a)},refresh:function(){v.verbose("Refreshing selector cache"),n=d.find(g.field),f=d.find(g.group),t=d.find(g.message),d.find(g.prompt),e=d.find(g.submit),d.find(g.clear),d.find(g.reset)},refreshEvents:function(){v.removeEvents(),v.bindEvents()},submit:function(){v.verbose("Submitting form",d),o=!0,d.submit()},attachEvents:function(e,t){t=t||"submit",O(e).on("click"+l,function(e){v[t](),e.preventDefault()})},bindEvents:function(){v.verbose("Attaching form events"),d.on("submit"+l,v.validate.form).on("blur"+l,g.field,v.event.field.blur).on("click"+l,g.submit,v.submit).on("click"+l,g.reset,v.reset).on("click"+l,g.clear,v.clear),p.keyboardShortcuts&&d.on("keydown"+l,g.field,v.event.field.keydown),n.each(function(e,t){var n=O(t),r=n.prop("type"),i=v.get.changeEvent(r,n);n.on(i+l,v.event.field.change)}),p.preventLeaving&&O($).on("beforeunload"+l,v.event.beforeUnload),n.on("change click keyup keydown blur",function(e){v.determine.isDirty()}),d.on("dirty"+l,function(e){p.onDirty.call()}),d.on("clean"+l,function(e){p.onClean.call()})},clear:function(){n.each(function(e,t){var n=O(t),r=n.parent(),i=n.closest(f),a=i.find(g.prompt),o=n.closest(g.uiCalendar),l=n.data(m.defaultValue)||"",s=r.is(g.uiCheckbox),u=r.is(g.uiDropdown)&&v.can.useElement("dropdown"),c=0<o.length&&v.can.useElement("calendar");i.hasClass(h.error)&&(v.verbose("Resetting error on field",i),i.removeClass(h.error),a.remove()),u?(v.verbose("Resetting dropdown value",r,l),r.dropdown("clear",!0)):s?n.prop("checked",!1):c?o.calendar("clear"):(v.verbose("Resetting field value",n,l),n.val(""))}),v.remove.states()},reset:function(){n.each(function(e,t){var n=O(t),r=n.parent(),i=n.closest(f),a=n.closest(g.uiCalendar),o=i.find(g.prompt),l=n.data(m.defaultValue),s=r.is(g.uiCheckbox),u=r.is(g.uiDropdown)&&v.can.useElement("dropdown"),c=0<a.length&&v.can.useElement("calendar"),d=i.hasClass(h.error);l!==L&&(d&&(v.verbose("Resetting error on field",i),i.removeClass(h.error),o.remove()),u?(v.verbose("Resetting dropdown value",r,l),r.dropdown("restore defaults",!0)):s?(v.verbose("Resetting checkbox value",r,l),n.prop("checked",l)):c?a.calendar("set date",l):(v.verbose("Resetting field value",n,l),n.val(l)))}),v.remove.states()},determine:{isValid:function(){var n=!0;return O.each(s,function(e,t){v.validate.field(t,e,!0)||(n=!1)}),n},isDirty:function(e){var i=!1;n.each(function(e,t){var n,r=O(t);n=0<r.filter(g.checkbox).length?v.is.checkboxDirty(r):v.is.fieldDirty(r),r.data(p.metadata.isDirty,n),i|=n}),i?v.set.dirty():v.set.clean()}},is:{bracketedRule:function(e){return e.type&&e.type.match(p.regExp.bracket)},shorthandRules:function(e){return"string"==typeof e||Array.isArray(e)},empty:function(e){return!e||0===e.length||(e.is(g.checkbox)?!e.is(":checked"):v.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(e,n){var r=!0;return e?(v.verbose("Checking if field is valid",e),v.validate.field(s[e],e,!!n)):(v.verbose("Checking if form is valid"),O.each(s,function(e,t){v.is.valid(e,n)||(r=!1)}),r)},dirty:function(){return k},clean:function(){return!k},fieldDirty:function(e){var t=e.data(m.defaultValue);null==t?t="":Array.isArray(t)&&(t=t.toString());var n=e.val();null==n?n="":Array.isArray(n)&&(n=n.toString());var r=/^(true|false)$/i;return r.test(t)&&r.test(n)?!new RegExp("^"+t+"$","i").test(n):n!==t},checkboxDirty:function(e){return e.data(m.defaultValue)!==e.is(":checked")},justDirty:function(){return"dirty"===E[0]},justClean:function(){return"clean"===E[0]}},removeEvents:function(){d.off(l),n.off(l),e.off(l)},event:{field:{keydown:function(e){var t=O(this),n=e.which,r=t.is(g.input),i=t.is(g.checkbox),a=0<t.closest(g.uiDropdown).length,o=13;n==27&&(v.verbose("Escape key pressed blurring field"),t[0].blur()),e.ctrlKey||n!=o||!r||a||i||(x||(t.one("keyup"+l,v.event.field.keyup),v.submit(),v.debug("Enter pressed on input submitting form"),e.preventDefault()),x=!0)},keyup:function(){x=!1},blur:function(e){var t=O(this),n=t.closest(f),r=v.get.validation(t);r&&("blur"==p.on||n.hasClass(h.error)&&p.revalidate)&&(v.debug("Revalidating field",t,r),v.validate.field(r),p.inline||v.validate.form(!1,!0))},change:function(e){var t=O(this),n=t.closest(f),r=v.get.validation(t);r&&("change"==p.on||n.hasClass(h.error)&&p.revalidate)&&(clearTimeout(v.timer),v.timer=setTimeout(function(){v.debug("Revalidating field",t,r),v.validate.field(r),p.inline||v.validate.form(!1,!0)},p.delay))}},beforeUnload:function(e){if(v.is.dirty()&&!o)return(e=e||$.event)&&(e.returnValue=p.text.leavingMessage),p.text.leavingMessage}},get:{ancillaryValue:function(e){return!(!e.type||!e.value&&!v.is.bracketedRule(e))&&(e.value!==L?e.value:e.type.match(p.regExp.bracket)[1]+"")},ruleName:function(e){return v.is.bracketedRule(e)?e.type.replace(e.type.match(p.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":v.get.inputEvent()},inputEvent:function(){return I.createElement("input").oninput!==L?"input":I.createElement("input").onpropertychange!==L?"propertychange":"keyup"},fieldsFromShorthand:function(e){var r={};return O.each(e,function(n,e){Array.isArray(e)||"object"!=typeof e?("string"==typeof e&&(e=[e]),r[n]={rules:[]},O.each(e,function(e,t){r[n].rules.push({type:t})})):r[n]=e}),r},prompt:function(e,t){var n,r,i,a=v.get.ruleName(e),o=v.get.ancillaryValue(e),l=v.get.field(t.identifier),s=l.val(),u=O.isFunction(e.prompt)?e.prompt(s):e.prompt||p.prompt[a]||p.text.unspecifiedRule,c=-1!==u.search("{value}"),d=-1!==u.search("{name}");return o&&0<=["integer","decimal","number"].indexOf(a)&&0<=o.indexOf("..")&&(i=o.split("..",2),e.prompt||(u+=(""===i[0]?p.prompt.maxValue.replace(/\{ruleValue\}/g,"{max}"):""===i[1]?p.prompt.minValue.replace(/\{ruleValue\}/g,"{min}"):p.prompt.range).replace(/\{name\}/g," "+p.text.and)),u=(u=u.replace(/\{min\}/g,i[0])).replace(/\{max\}/g,i[1])),c&&(u=u.replace(/\{value\}/g,l.val())),d&&(r=1==(n=l.closest(g.group).find("label").eq(0)).length?n.text():l.prop("placeholder")||p.text.unspecifiedField,u=u.replace(/\{name\}/g,r)),u=(u=u.replace(/\{identifier\}/g,t.identifier)).replace(/\{ruleValue\}/g,o),e.prompt||v.verbose("Using default validation prompt for type",u,a),u},settings:function(){if(O.isPlainObject(C)){var e=Object.keys(C);0<e.length&&(C[e[0]].identifier!==L&&C[e[0]].rules!==L)?(p=O.extend(!0,{},O.fn.form.settings,S),s=O.extend(!0,{},O.fn.form.settings.defaults,C),v.error(p.error.oldSyntax,b),v.verbose("Extending settings from legacy parameters",s,p)):(C.fields&&(C.fields=v.get.fieldsFromShorthand(C.fields)),p=O.extend(!0,{},O.fn.form.settings,C),s=O.extend(!0,{},O.fn.form.settings.defaults,p.fields),v.verbose("Extending settings",s,p))}else p=O.extend(!0,{},O.fn.form.settings),s=O.extend(!0,{},O.fn.form.settings.defaults),v.verbose("Using default form validation",s,p);i=p.namespace,m=p.metadata,g=p.selector,h=p.className,r=p.regExp,c=p.error,a="module-"+i,l="."+i,((u=d.data(a))||v).refresh()},field:function(e){var t;return v.verbose("Finding field with identifier",e),e=v.escape.string(e),0<(t=n.filter("#"+e)).length?t:0<(t=n.filter('[name="'+e+'"]')).length?t:0<(t=n.filter('[name="'+e+'[]"]')).length?t:0<(t=n.filter("[data-"+m.validate+'="'+e+'"]')).length?t:O("<input/>")},fields:function(e){var n=O();return O.each(e,function(e,t){n=n.add(v.get.field(t))}),n},validation:function(r){var i,a;return!!s&&(O.each(s,function(e,n){a=n.identifier||e,O.each(v.get.field(a),function(e,t){if(t==r[0])return n.identifier=a,i=n,!1})}),i||!1)},value:function(e){var t=[];return t.push(e),v.get.values.call(b,t)[e]},values:function(e){var t=Array.isArray(e)?v.get.fields(e):n,m={};return t.each(function(e,t){var n=O(t),r=n.closest(g.uiCalendar),i=n.prop("name"),a=n.val(),o=n.is(g.checkbox),l=n.is(g.radio),s=-1!==i.indexOf("[]"),u=0<r.length&&v.can.useElement("calendar"),c=!!o&&n.is(":checked");if(i)if(s)i=i.replace("[]",""),m[i]||(m[i]=[]),o?c?m[i].push(a||!0):m[i].push(!1):m[i].push(a);else if(l)m[i]!==L&&!1!==m[i]||(m[i]=!!c&&(a||!0));else if(o)m[i]=!!c&&(a||!0);else if(u){var d=r.calendar("get date");if(null!==d){if("date"==p.dateHandling)m[i]=d;else if("input"==p.dateHandling)m[i]=r.calendar("get input date");else if("formatter"==p.dateHandling){var f=r.calendar("setting","type");switch(f){case"date":m[i]=p.formatter.date(d);break;case"datetime":m[i]=p.formatter.datetime(d);break;case"time":m[i]=p.formatter.time(d);break;case"month":m[i]=p.formatter.month(d);break;case"year":m[i]=p.formatter.year(d);break;default:v.debug("Wrong calendar mode",r,f),m[i]=""}}}else m[i]=""}else m[i]=a}),m},dirtyFields:function(){return n.filter(function(e,t){return O(t).data(m.isDirty)})}},has:{field:function(e){return v.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=v.escape.string(e))&&v.error(c.identifier,e),0<n.filter("#"+e).length||(0<n.filter('[name="'+e+'"]').length||0<n.filter("[data-"+m.validate+'="'+e+'"]').length)}},can:{useElement:function(e){return O.fn[e]!==L||(v.error(c.noElement.replace("{element}",e)),!1)}},escape:{string:function(e){return(e=String(e)).replace(r.escape,"\\$&")}},add:{rule:function(e,t){v.add.field(e,t)},field:function(n,e){s[n]!==L&&s[n].rules!==L||(s[n]={rules:[]});var r={rules:[]};v.is.shorthandRules(e)?(e=Array.isArray(e)?e:[e],O.each(e,function(e,t){r.rules.push({type:t})})):r.rules=e.rules,O.each(r.rules,function(e,t){0==O.grep(s[n].rules,function(e){return e.type==t.type}).length&&s[n].rules.push(t)}),v.debug("Adding rules",r.rules,s),v.refreshEvents()},fields:function(e){s=O.extend(!0,{},s,v.get.fieldsFromShorthand(e)),v.refreshEvents()},prompt:function(e,t,n){var r=v.get.field(e).closest(f),i=r.children(g.prompt),a=0!==i.length;t="string"==typeof t?[t]:t,v.verbose("Adding field error state",e),n||r.addClass(h.error),p.inline&&(a||(i=O("<div/>").addClass(h.label)).appendTo(r),i.html(p.templates.prompt(t)),a?v.verbose("Inline errors are disabled, no inline error added",e):p.transition&&v.can.useElement("transition")&&d.transition("is supported")?(v.verbose("Displaying error with css transition",p.transition),i.transition(p.transition+" in",p.duration)):(v.verbose("Displaying error with fallback javascript animation"),i.fadeIn(p.duration)))},errors:function(e){v.debug("Adding form error messages",e),v.set.error(),t.html(p.templates.error(e))}},remove:{errors:function(){v.debug("Removing form error messages"),t.empty()},states:function(){d.removeClass(h.error).removeClass(h.success),p.inline||v.remove.errors(),v.determine.isDirty()},rule:function(n,e){var r=Array.isArray(e)?e:[e];if(s[n]!==L&&Array.isArray(s[n].rules))return e===L?(v.debug("Removed all rules"),void(s[n].rules=[])):void O.each(s[n].rules,function(e,t){t&&-1!==r.indexOf(t.type)&&(v.debug("Removed rule",t.type),s[n].rules.splice(e,1))})},field:function(e){var t=Array.isArray(e)?e:[e];O.each(t,function(e,t){v.remove.rule(t)}),v.refreshEvents()},rules:function(e,n){Array.isArray(e)?O.each(e,function(e,t){v.remove.rule(t,n)}):v.remove.rule(e,n)},fields:function(e){v.remove.field(e)},prompt:function(e){var t=v.get.field(e).closest(f),n=t.children(g.prompt);t.removeClass(h.error),p.inline&&n.is(":visible")&&(v.verbose("Removing prompt for field",e),p.transition&&v.can.useElement("transition")&&d.transition("is supported")?n.transition(p.transition+" out",p.duration,function(){n.remove()}):n.fadeOut(p.duration,function(){n.remove()}))}},set:{success:function(){d.removeClass(h.error).addClass(h.success)},defaults:function(){n.each(function(e,t){var n=O(t),r=n.parent(),i=0<n.filter(g.checkbox).length,a=r.is(g.uiDropdown)&&v.can.useElement("dropdown"),o=n.closest(g.uiCalendar),l=0<o.length&&v.can.useElement("calendar"),s=i?n.is(":checked"):n.val();a?r.dropdown("save defaults"):l&&o.calendar("refresh"),n.data(m.defaultValue,s),n.data(m.isDirty,!1)})},error:function(){d.removeClass(h.success).addClass(h.error)},value:function(e,t){var n={};return n[e]=t,v.set.values.call(b,n)},values:function(e){O.isEmptyObject(e)||O.each(e,function(e,t){var n,r=v.get.field(e),i=r.parent(),a=r.closest(g.uiCalendar),o=Array.isArray(t),l=i.is(g.uiCheckbox)&&v.can.useElement("checkbox"),s=i.is(g.uiDropdown)&&v.can.useElement("dropdown"),u=r.is(g.radio)&&l,c=0<a.length&&v.can.useElement("calendar");0<r.length&&(o&&l?(v.verbose("Selecting multiple",t,r),i.checkbox("uncheck"),O.each(t,function(e,t){n=r.filter('[value="'+t+'"]'),i=n.parent(),0<n.length&&i.checkbox("check")})):u?(v.verbose("Selecting radio value",t,r),r.filter('[value="'+t+'"]').parent(g.uiCheckbox).checkbox("check")):l?(v.verbose("Setting checkbox value",t,i),!0===t||1===t||"on"===t?i.checkbox("check"):i.checkbox("uncheck"),"string"==typeof t&&r.val(t)):s?(v.verbose("Setting dropdown value",t,i),i.dropdown("set selected",t)):c?a.calendar("set date",t):(v.verbose("Setting field value",t,r),r.val(t)))})},dirty:function(){v.verbose("Setting state dirty"),k=!0,E[0]=E[1],E[1]="dirty",v.is.justClean()&&d.trigger("dirty")},clean:function(){v.verbose("Setting state clean"),k=!1,E[0]=E[1],E[1]="clean",v.is.justDirty()&&d.trigger("clean")},asClean:function(){v.set.defaults(),v.set.clean()},asDirty:function(){v.set.defaults(),v.set.dirty()},autoCheck:function(){v.debug("Enabling auto check on required fields"),n.each(function(e,t){var n=O(t),r=O(t).closest(f),i=0<n.filter(g.checkbox).length,a=n.prop("required")||r.hasClass(h.required)||r.parent().hasClass(h.required),o=n.is(":disabled")||r.hasClass(h.disabled)||r.parent().hasClass(h.disabled),l=v.get.validation(n),s=!!l&&0!==O.grep(l.rules,function(e){return"empty"==e.type}),u=l.identifier||n.attr("id")||n.attr("name")||n.data(m.validate);!a||o||s||u===L||(i?(v.verbose("Adding 'checked' rule on field",u),v.add.rule(u,"checked")):(v.verbose("Adding 'empty' rule on field",u),v.add.rule(u,"empty")))})},optional:function(n,r){r=!1!==r,O.each(s,function(e,t){n!=e&&n!=t.identifier||(t.optional=r)})}},validate:{form:function(e,t){var n=v.get.values();if(x)return!1;if(y=[],v.determine.isValid()){if(v.debug("Form has no validation errors, submitting"),v.set.success(),p.inline||v.remove.errors(),!0!==t)return p.onSuccess.call(b,e,n)}else{if(v.debug("Form has errors"),o=!1,v.set.error(),p.inline||v.add.errors(y),e&&d.data("moduleApi")!==L&&e.stopImmediatePropagation(),p.errorFocus&&!0!==t){var r,i=!0;"string"==typeof p.errorFocus?(i=(r=O(p.errorFocus)).is("[tabindex]"))||r.attr("tabindex",-1):r=f.filter("."+h.error).first().find(g.field),r.focus(),i||r.removeAttr("tabindex")}if(!0!==t)return p.onFailure.call(b,y,n)}},field:function(r,e,i){i=i===L||i,"string"==typeof r&&(v.verbose("Validating field",r),r=s[e=r]);var a=r.identifier||e,t=v.get.field(a),n=!!r.depends&&v.get.field(r.depends),o=!0,l=[];return r.identifier||(v.debug("Using field name as identifier",a),r.identifier=a),!t.filter(":not(:disabled)").length?v.debug("Field is disabled. Skipping",a):r.optional&&v.is.blank(t)?v.debug("Field is optional and blank. Skipping",a):r.depends&&v.is.empty(n)?v.debug("Field depends on another value that is not present or empty. Skipping",n):r.rules!==L&&(i&&t.closest(f).removeClass(h.error),O.each(r.rules,function(e,t){if(v.has.field(a)){var n=v.validate.rule(r,t,!0)||[];0<n.length&&(v.debug("Field is invalid",a,t.type),l.push(v.get.prompt(t,r)),o=!1,i&&O(n).closest(f).addClass(h.error))}})),o?(i&&(v.remove.prompt(a,l),p.onValid.call(t)),!0):(i&&(y=y.concat(l),v.add.prompt(a,l,!0),p.onInvalid.call(t,l)),!1)},rule:function(e,n,t){function r(e){var t=u?O(e).filter(":checked").val():O(e).val();return t=t===L||""===t||null===t?"":p.shouldTrim&&!1!==n.shouldTrim||n.shouldTrim?String(t+"").trim():String(t+""),l.call(e,t,a,d)}var i=v.get.field(e.identifier),a=v.get.ancillaryValue(n),o=v.get.ruleName(n),l=p.rules[o],s=[],u=i.is(g.checkbox);if(O.isFunction(l))return u?r(i)||(s=i):O.each(i,function(e,t){r(t)||s.push(t)}),t?s:!(0<s.length);v.error(c.noRule,o)}},setting:function(e,t){if(O.isPlainObject(e))O.extend(!0,p,e);else{if(t===L)return p[e];p[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,v,e);else{if(t===L)return v[e];v[e]=t}},debug:function(){!p.silent&&p.debug&&(p.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,p.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),v.verbose.apply(console,arguments)))},error:function(){p.silent||(v.error=Function.prototype.bind.call(console.error,console,p.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=(new Date).getTime())-(D||t),D=t,F.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:b,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var e=p.name+":",n=0;D=!1,clearTimeout(v.performance.timer),O.each(F,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",A&&(e+=" '"+A+"'"),1<V.length&&(e+=" ("+V.length+")"),(console.group!==L||console.table!==L)&&0<F.length&&(console.groupCollapsed(e),console.table?console.table(F):O.each(F,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),F=[]}},invoke:function(r,e,t){var i,a,n,o=u;return e=e||j,t=b||t,"string"==typeof r&&o!==L&&(r=r.split(/[\. ]/),i=r.length-1,O.each(r,function(e,t){var n=e!=i?t+r[e+1].charAt(0).toUpperCase()+r[e+1].slice(1):r;if(O.isPlainObject(o[n])&&e!=i)o=o[n];else{if(o[n]!==L)return a=o[n],!1;if(!O.isPlainObject(o[t])||e==i)return o[t]!==L&&(a=o[t]),!1;o=o[t]}})),O.isFunction(a)?n=a.apply(t,e):a!==L&&(n=a),Array.isArray(w)?w.push(n):w!==L?w=[w,n]:n!==L&&(w=n),a}}).initialize()}),w!==L?w:this},O.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,shouldTrim:!0,transition:"scale",duration:200,autoCheckRequired:!1,preventLeaving:!1,errorFocus:!0,dateHandling:"date",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},onDirty:function(){},onClean:function(){},metadata:{defaultValue:"default",validate:"validate",isDirty:"isDirty"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|:,=@]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{and:"and",unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field",leavingMessage:"There are unsaved changes on this page which will be discarded if you continue."},prompt:{range:"{name} must be in a range from {min} to {max}",maxValue:"{name} must have a maximum value of {ruleValue}",minValue:"{name} must have a minimum value of {ruleValue}",empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',group:".field",input:'input:not([type="file"])',message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown",uiCalendar:".ui.calendar"},className:{error:"error",label:"ui basic red pointing prompt label",pressed:"down",success:"success",required:"required",disabled:"disabled"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noElement:"This module requires ui {element}"},templates:{error:function(e){var n='<ul class="list">';return O.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"},prompt:function(e){if(1===e.length)return e[0];var n='<ul class="ui list">';return O.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"}},formatter:{date:function(e){return Intl.DateTimeFormat("en-GB").format(e)},datetime:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},time:function(e){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},month:function(e){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(e)},year:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(e)}},rules:{empty:function(e){return!(e===L||""===e||Array.isArray(e)&&0===e.length)},checked:function(){return 0<O(this).filter(":checked").length},email:function(e){return O.fn.form.settings.regExp.email.test(e)},url:function(e){return O.fn.form.settings.regExp.url.test(e)},regExp:function(e,t){if(t instanceof RegExp)return e.match(t);var n,r=t.match(O.fn.form.settings.regExp.flags);return r&&(t=2<=r.length?r[1]:t,n=3<=r.length?r[2]:""),e.match(new RegExp(t,n))},minValue:function(e,t){return O.fn.form.settings.rules.range(e,t+"..","number")},maxValue:function(e,t){return O.fn.form.settings.rules.range(e,".."+t,"number")},integer:function(e,t){return O.fn.form.settings.rules.range(e,t,"integer")},range:function(e,t,n){var r,i,a;return"string"==typeof n&&(n=O.fn.form.settings.regExp[n]),n instanceof RegExp||(n=O.fn.form.settings.regExp.integer),t&&-1===["",".."].indexOf(t)&&(-1==t.indexOf("..")?n.test(t)&&(r=i=t-0):(a=t.split("..",2),n.test(a[0])&&(r=a[0]-0),n.test(a[1])&&(i=a[1]-0))),n.test(e)&&(r===L||r<=e)&&(i===L||e<=i)},decimal:function(e,t){return O.fn.form.settings.rules.range(e,t,"decimal")},number:function(e,t){return O.fn.form.settings.rules.range(e,t,"number")},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return(e="string"==typeof e?e.toLowerCase():e)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(e,t){return e!=t},contains:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t,"i"))},containsExactly:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t))},doesntContain:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t,"i"))},doesntContainExactly:function(e,t){return t=t.replace(O.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t))},minLength:function(e,t){return e!==L&&e.length>=t},exactLength:function(e,t){return e!==L&&e.length==t},maxLength:function(e,t){return e!==L&&e.length<=t},match:function(e,t,n){var r,i;return 0<(i=n.find('[data-validate="'+t+'"]')).length?r=i.val():0<(i=n.find("#"+t)).length?r=i.val():0<(i=n.find('[name="'+t+'"]')).length?r=i.val():0<(i=n.find('[name="'+t+'[]"]')).length&&(r=i),r!==L&&e.toString()==r.toString()},different:function(e,t,n){var r,i;return 0<(i=n.find('[data-validate="'+t+'"]')).length?r=i.val():0<(i=n.find("#"+t)).length?r=i.val():0<(i=n.find('[name="'+t+'"]')).length?r=i.val():0<(i=n.find('[name="'+t+'[]"]')).length&&(r=i),r!==L&&e.toString()!==r.toString()},creditCard:function(n,e){var t,r,i={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},a={},o=!1,l="string"==typeof e&&e.split(",");if("string"==typeof n&&0!==n.length){if(n=n.replace(/[\s\-]/g,""),l&&(O.each(l,function(e,t){(r=i[t])&&(a={length:-1!==O.inArray(n.length,r.length),pattern:-1!==n.search(r.pattern)}).length&&a.pattern&&(o=!0)}),!o))return!1;if((t={number:-1!==O.inArray(n.length,i.unionPay.length),pattern:-1!==n.search(i.unionPay.pattern)}).number&&t.pattern)return!0;for(var s=n.length,u=0,c=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],d=0;s--;)d+=c[u][parseInt(n.charAt(s),10)],u^=1;return d%10==0&&0<d}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Grid
2
+ * # Fomantic-UI 2.9.0-beta.261 - Grid
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Grid
2
+ * # Fomantic-UI 2.9.0-beta.261 - Grid
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Header
2
+ * # Fomantic-UI 2.9.0-beta.261 - Header
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Header
2
+ * # Fomantic-UI 2.9.0-beta.261 - Header
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.259 - Icon
2
+ * # Fomantic-UI 2.9.0-beta.261 - Icon
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *