alchemy_cms 4.1.2 → 4.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/Bug_report.md +0 -5
  3. data/.rubocop.yml +4 -1
  4. data/.travis.yml +3 -3
  5. data/CHANGELOG.md +29 -10
  6. data/Gemfile +5 -7
  7. data/README.md +114 -62
  8. data/Rakefile +2 -2
  9. data/alchemy_cms.gemspec +5 -5
  10. data/app/assets/images/alchemy/icon.svg +1 -1
  11. data/app/assets/javascripts/alchemy/admin.js +2 -0
  12. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +0 -24
  13. data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +11 -9
  14. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +7 -24
  15. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +9 -8
  16. data/app/assets/javascripts/alchemy/alchemy.fixed_elements.js +38 -0
  17. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +2 -4
  18. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +1 -1
  19. data/app/assets/stylesheets/alchemy/_mixins.scss +2 -1
  20. data/app/assets/stylesheets/alchemy/_variables.scss +7 -2
  21. data/app/assets/stylesheets/alchemy/admin.scss +2 -1
  22. data/app/assets/stylesheets/alchemy/archive.scss +18 -4
  23. data/app/assets/stylesheets/alchemy/buttons.scss +1 -1
  24. data/app/assets/stylesheets/alchemy/dialogs.scss +1 -1
  25. data/app/assets/stylesheets/alchemy/elements.scss +154 -90
  26. data/app/assets/stylesheets/alchemy/filter_field.scss +30 -0
  27. data/app/assets/stylesheets/alchemy/flatpickr.scss +839 -0
  28. data/app/assets/stylesheets/alchemy/forms.scss +5 -1
  29. data/app/assets/stylesheets/alchemy/frame.scss +6 -14
  30. data/app/assets/stylesheets/alchemy/navigation.scss +109 -98
  31. data/app/assets/stylesheets/alchemy/search.scss +11 -29
  32. data/app/assets/stylesheets/alchemy/tables.scss +0 -23
  33. data/app/assets/stylesheets/alchemy/tags.scss +4 -27
  34. data/app/assets/stylesheets/alchemy/toolbar.scss +12 -2
  35. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +4 -33
  36. data/app/controllers/alchemy/admin/attachments_controller.rb +1 -12
  37. data/app/controllers/alchemy/admin/contents_controller.rb +2 -24
  38. data/app/controllers/alchemy/admin/elements_controller.rb +11 -49
  39. data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
  40. data/app/controllers/alchemy/admin/pictures_controller.rb +1 -14
  41. data/app/controllers/alchemy/api/contents_controller.rb +1 -1
  42. data/app/controllers/alchemy/api/elements_controller.rb +1 -1
  43. data/app/controllers/alchemy/api/pages_controller.rb +1 -1
  44. data/app/controllers/concerns/alchemy/admin/archive_overlay.rb +20 -0
  45. data/app/helpers/alchemy/admin/base_helper.rb +8 -18
  46. data/app/helpers/alchemy/admin/elements_helper.rb +55 -85
  47. data/app/helpers/alchemy/admin/pictures_helper.rb +0 -23
  48. data/app/helpers/alchemy/elements_helper.rb +80 -120
  49. data/app/helpers/alchemy/pages_helper.rb +5 -24
  50. data/app/models/alchemy/content.rb +0 -1
  51. data/app/models/alchemy/content/factory.rb +33 -57
  52. data/app/models/alchemy/element.rb +46 -66
  53. data/app/models/alchemy/element/element_contents.rb +2 -2
  54. data/app/models/alchemy/page.rb +34 -4
  55. data/app/models/alchemy/page/page_elements.rb +30 -122
  56. data/app/serializers/alchemy/attachment_serializer.rb +0 -2
  57. data/app/serializers/alchemy/content_serializer.rb +0 -2
  58. data/app/serializers/alchemy/element_serializer.rb +0 -3
  59. data/app/serializers/alchemy/essence_boolean_serializer.rb +0 -2
  60. data/app/serializers/alchemy/essence_date_serializer.rb +0 -2
  61. data/app/serializers/alchemy/essence_file_serializer.rb +0 -2
  62. data/app/serializers/alchemy/essence_html_serializer.rb +0 -2
  63. data/app/serializers/alchemy/essence_link_serializer.rb +0 -2
  64. data/app/serializers/alchemy/essence_picture_serializer.rb +0 -2
  65. data/app/serializers/alchemy/essence_richtext_serializer.rb +0 -2
  66. data/app/serializers/alchemy/essence_select_serializer.rb +0 -2
  67. data/app/serializers/alchemy/essence_text_serializer.rb +0 -2
  68. data/app/serializers/alchemy/legacy_element_serializer.rb +0 -3
  69. data/app/serializers/alchemy/page_serializer.rb +2 -8
  70. data/app/serializers/alchemy/page_tree_serializer.rb +1 -1
  71. data/app/serializers/alchemy/picture_serializer.rb +0 -2
  72. data/app/views/alchemy/admin/clipboard/index.html.erb +2 -2
  73. data/app/views/alchemy/admin/clipboard/insert.js.erb +9 -12
  74. data/app/views/alchemy/admin/contents/create.js.erb +4 -30
  75. data/app/views/alchemy/admin/elements/_element.html.erb +27 -12
  76. data/app/views/alchemy/admin/elements/_element_toolbar.html.erb +1 -1
  77. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +0 -10
  78. data/app/views/alchemy/admin/elements/create.js.erb +12 -12
  79. data/app/views/alchemy/admin/elements/fold.js.erb +1 -1
  80. data/app/views/alchemy/admin/elements/index.html.erb +20 -19
  81. data/app/views/alchemy/admin/elements/publish.js.erb +5 -0
  82. data/app/views/alchemy/admin/elements/trash.js.erb +4 -1
  83. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -7
  84. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +0 -22
  85. data/app/views/alchemy/admin/pages/_publication_fields.html.erb +2 -4
  86. data/app/views/alchemy/admin/pages/edit.html.erb +1 -1
  87. data/app/views/alchemy/admin/pages/index.html.erb +14 -10
  88. data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
  89. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +1 -1
  90. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +7 -5
  91. data/app/views/alchemy/admin/partials/_routes.html.erb +0 -1
  92. data/app/views/alchemy/admin/partials/_search_form.html.erb +6 -4
  93. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +6 -3
  94. data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
  95. data/app/views/alchemy/admin/trash/index.html.erb +8 -7
  96. data/app/views/alchemy/elements/_editor_not_found.html.erb +1 -1
  97. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +4 -19
  98. data/app/views/layouts/alchemy/admin.html.erb +1 -0
  99. data/bin/rspec +0 -5
  100. data/config/alchemy/config.yml +3 -0
  101. data/config/brakeman.ignore +1 -1
  102. data/config/locales/alchemy.en.yml +6 -12
  103. data/config/routes.rb +1 -5
  104. data/db/migrate/20180226123013_alchemy_four_point_zero.rb +0 -29
  105. data/db/migrate/20180519204655_add_fixed_to_alchemy_elements.rb +6 -0
  106. data/lib/alchemy/admin/locale.rb +1 -1
  107. data/lib/alchemy/cache_digests/template_tracker.rb +4 -27
  108. data/lib/alchemy/elements_finder.rb +111 -0
  109. data/lib/alchemy/errors.rb +0 -4
  110. data/lib/alchemy/modules.rb +49 -18
  111. data/lib/alchemy/tasks/tidy.rb +3 -40
  112. data/lib/alchemy/test_support/controller_requests.rb +1 -1
  113. data/lib/alchemy/test_support/essence_shared_examples.rb +1 -1
  114. data/lib/alchemy/test_support/factories/attachment_factory.rb +5 -3
  115. data/lib/alchemy/test_support/factories/content_factory.rb +4 -4
  116. data/lib/alchemy/test_support/factories/dummy_user_factory.rb +5 -5
  117. data/lib/alchemy/test_support/factories/element_factory.rb +12 -7
  118. data/lib/alchemy/test_support/factories/essence_text_factory.rb +1 -1
  119. data/lib/alchemy/test_support/factories/language_factory.rb +13 -13
  120. data/lib/alchemy/test_support/factories/page_factory.rb +18 -17
  121. data/lib/alchemy/test_support/factories/picture_factory.rb +6 -4
  122. data/lib/alchemy/test_support/factories/site_factory.rb +6 -6
  123. data/lib/alchemy/tinymce.rb +1 -1
  124. data/lib/alchemy/upgrader/four_point_two.rb +68 -0
  125. data/lib/alchemy/upgrader/tasks/cells_migration.rb +41 -0
  126. data/lib/alchemy/upgrader/tasks/cells_upgrader.rb +146 -0
  127. data/lib/alchemy/upgrader/tasks/picture_gallery_migration.rb +65 -0
  128. data/lib/alchemy/upgrader/tasks/picture_gallery_upgrader.rb +195 -0
  129. data/lib/alchemy/version.rb +1 -1
  130. data/lib/alchemy_cms.rb +1 -0
  131. data/lib/rails/generators/alchemy/elements/elements_generator.rb +1 -0
  132. data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +0 -3
  133. data/lib/rails/generators/alchemy/elements/templates/editor.html.haml +0 -3
  134. data/lib/rails/generators/alchemy/elements/templates/editor.html.slim +0 -3
  135. data/lib/rails/generators/alchemy/elements/templates/view.html.erb +3 -14
  136. data/lib/rails/generators/alchemy/elements/templates/view.html.haml +3 -10
  137. data/lib/rails/generators/alchemy/elements/templates/view.html.slim +3 -10
  138. data/lib/tasks/alchemy/tidy.rake +1 -23
  139. data/lib/tasks/alchemy/upgrade.rake +44 -1
  140. data/vendor/assets/javascripts/flatpickr/flatpickr.min.js +2 -0
  141. data/vendor/assets/javascripts/tinymce/license.txt +0 -0
  142. data/vendor/assets/javascripts/tinymce/tinymce.min.js +2 -2
  143. metadata +25 -31
  144. data/app/assets/stylesheets/alchemy/jquery.datetimepicker.scss +0 -478
  145. data/app/models/alchemy/cell.rb +0 -95
  146. data/app/models/alchemy/page/page_cells.rb +0 -69
  147. data/app/serializers/alchemy/cell_serializer.rb +0 -19
  148. data/app/views/alchemy/admin/contents/new.html.erb +0 -11
  149. data/app/views/alchemy/admin/contents/order.js.erb +0 -3
  150. data/app/views/alchemy/admin/elements/_add_picture.html.erb +0 -14
  151. data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +0 -24
  152. data/bin/spring +0 -16
  153. data/lib/alchemy/test_support/factories/cell_factory.rb +0 -9
  154. data/vendor/assets/javascripts/date-formatter.js +0 -161
  155. data/vendor/assets/javascripts/jquery_plugins/jquery.datetimepicker.full.min.js +0 -2
@@ -0,0 +1,195 @@
1
+ require 'thor'
2
+ require 'alchemy/upgrader'
3
+
4
+ module Alchemy::Upgrader::Tasks
5
+ class PictureGalleryUpgrader < Thor
6
+ include Thor::Actions
7
+
8
+ GALLERY_PICTURES_ERB_REGEXP = /<%.*element.contents.gallery_pictures.*/
9
+ GALLERY_PICTURES_HAML_REGEXP = /-.*element.contents.gallery_pictures.*/
10
+ GALLERY_PICTURES_EDITOR_REGEXP = /.*render_picture_gallery_editor.*/
11
+
12
+ no_tasks do
13
+ def convert_picture_galleries
14
+ config = read_config
15
+ unless config
16
+ puts "\nNo elements config found. Skipping."
17
+ return
18
+ end
19
+
20
+ elements_with_picture_gallery, all_other_elements = config.partition do |e|
21
+ e['picture_gallery']
22
+ end
23
+
24
+ if elements_with_picture_gallery.empty?
25
+ puts "No elements with `picture_gallery` found. Skipping."
26
+ return
27
+ end
28
+
29
+ convert_to_nestable_elements(elements_with_picture_gallery, all_other_elements)
30
+ backup_config
31
+ write_config(all_other_elements)
32
+ find_gallery_pictures_rendering
33
+ remove_gallery_pictures_editor
34
+
35
+ puts "Generate new element partials for nestable elements"
36
+ system "rails g alchemy:elements --skip"
37
+ end
38
+ end
39
+
40
+ private
41
+
42
+ def read_config
43
+ print "1. Reading `config/alchemy/elements.yml` ... "
44
+
45
+ old_config_file = Rails.root.join('config', 'alchemy', 'elements.yml')
46
+ config = YAML.load_file(old_config_file)
47
+
48
+ if config
49
+ puts "done.\n"
50
+ end
51
+
52
+ config
53
+ end
54
+
55
+ def convert_to_nestable_elements(elements_with_picture_gallery, all_other_elements)
56
+ print '2. Converting picture gallery elements into `nestable_elements` ... '
57
+
58
+ elements_with_picture_gallery.inject(all_other_elements) do |elements, old_element|
59
+ if old_element.fetch('nestable_elements', []).any?
60
+ elements << modify_old_element(old_element.dup, gallery_element: true)
61
+ elements << add_picture_gallery_for(old_element["name"])
62
+ elements << build_new_picture_element_for(old_element["name"], 'picture_gallery')
63
+ else
64
+ elements << modify_old_element(old_element.dup, gallery_element: false)
65
+ elements << build_new_picture_element_for(old_element["name"])
66
+ end
67
+ end
68
+
69
+ puts 'done.'
70
+ end
71
+
72
+ def backup_config
73
+ print "3. Copy existing config file to `config/alchemy/elements.yml.old` ... "
74
+
75
+ FileUtils.copy Rails.root.join('config', 'alchemy', 'elements.yml'),
76
+ Rails.root.join('config', 'alchemy', 'elements.yml.old')
77
+
78
+ puts "done.\n"
79
+ end
80
+
81
+ def write_config(config)
82
+ print '4. Writing new `config/alchemy/elements.yml` ... '
83
+
84
+ File.open(Rails.root.join('config', 'alchemy', 'elements.yml'), "w") do |f|
85
+ f.write config.to_yaml.sub("---\n", "").gsub("\n-", "\n\n-")
86
+ end
87
+
88
+ puts "done.\n"
89
+ end
90
+
91
+ def find_gallery_pictures_rendering
92
+ puts '5. Find element views that use gallery pictures:'
93
+
94
+ erb_snippet = <<-ERB
95
+ <%- element.nested_elements.available.each do |nested_element| -%>
96
+ <%= render_element(nested_element) %>
97
+ <%- end -%>
98
+ ERB
99
+ erb_views = erb_element_partials(:view).select do |view|
100
+ next if File.read(view).match(GALLERY_PICTURES_ERB_REGEXP).nil?
101
+ inject_into_file view,
102
+ "<%# TODO: Remove next block and render element.nested_elements.published instead %>\n",
103
+ before: GALLERY_PICTURES_ERB_REGEXP
104
+ true
105
+ end
106
+
107
+ haml_slim_snippet = <<-HAMLSLIM
108
+ - element.nested_elements.available.each do |nested_element|
109
+ = render_element(nested_element)
110
+ HAMLSLIM
111
+ haml_views = haml_slim_element_partials(:view).select do |view|
112
+ next if File.read(view).match(GALLERY_PICTURES_HAML_REGEXP).nil?
113
+ inject_into_file view,
114
+ "-# TODO: Remove next block and render element.nested_elements.published instead\n",
115
+ before: GALLERY_PICTURES_HAML_REGEXP
116
+ true
117
+ end
118
+
119
+ if erb_views.any?
120
+ puts "- Found #{erb_views.length} ERB element views that render gallery pictures.\n"
121
+ puts " Please replace `element.contents.gallery_pictures` with:"
122
+ puts erb_snippet
123
+ elsif haml_views.any?
124
+ puts "- Found #{haml_views.length} HAML/SLIM element views render gallery pictures.\n"
125
+ puts " Please replace `element.contents.gallery_pictures` with:"
126
+ puts haml_slim_snippet
127
+ else
128
+ puts "- No element views found that render gallery pictures.\n"
129
+ end
130
+ end
131
+
132
+ def remove_gallery_pictures_editor
133
+ puts '6. Remove gallery pictures editor from your element editors:'
134
+
135
+ (erb_element_partials(:editor) + haml_slim_element_partials(:editor)).each do |editor|
136
+ next if File.read(editor).match(GALLERY_PICTURES_EDITOR_REGEXP).nil?
137
+ gsub_file editor, GALLERY_PICTURES_EDITOR_REGEXP, ''
138
+ end
139
+ end
140
+
141
+ def modify_old_element(element, gallery_element:)
142
+ if gallery_element
143
+ nestable_element = "#{element['name']}_picture_gallery"
144
+ else
145
+ nestable_element = "#{element['name']}_picture"
146
+ end
147
+ element.delete('picture_gallery')
148
+ element['nestable_elements'] ||= []
149
+ element['nestable_elements'] << nestable_element
150
+ element
151
+ end
152
+
153
+ def add_picture_gallery_for(element_name)
154
+ {
155
+ "name" => "#{element_name}_picture_gallery",
156
+ "nestable_elements" => ["#{element_name}_picture_gallery_picture"]
157
+ }
158
+ end
159
+
160
+ def build_new_picture_element_for(element_name, gallery_element_name = nil)
161
+ image_options = parse_image_options_from_editor_view(element_name)
162
+ settings = {}
163
+ if image_options[0]
164
+ settings["crop"] = image_options[0] == 'true'
165
+ end
166
+ settings["size"] = image_options[1] if image_options[1]
167
+ element = {
168
+ 'name' => [element_name, gallery_element_name, 'picture'].compact.join('_'),
169
+ 'compact' => true,
170
+ 'contents' => [{
171
+ 'name' => 'picture',
172
+ 'type' => 'EssencePicture'
173
+ }]
174
+ }
175
+ element['contents'][0]['settings'] = settings if settings.present?
176
+ element
177
+ end
178
+
179
+ def parse_image_options_from_editor_view(element_name)
180
+ partial_path = Dir.glob(Rails.root.join('app', 'views', 'alchemy', 'elements', "_#{element_name}_editor.html.*")).first
181
+ partial = File.read(partial_path)
182
+ crop_option = partial.match(/.*render_picture_gallery_editor.*crop(\:|\s?=>)\s?(true|false).*/).try(:[], 2)
183
+ size_option = partial.match(/.*render_picture_gallery_editor.*size(\:|\s?=>)\s?["'](\d*x\d*)["'].*/).try(:[], 2)
184
+ [crop_option, size_option]
185
+ end
186
+
187
+ def erb_element_partials(kind)
188
+ Dir.glob(Rails.root.join('app', 'views', 'alchemy', 'elements', "*_#{kind}.html.erb"))
189
+ end
190
+
191
+ def haml_slim_element_partials(kind)
192
+ Dir.glob(Rails.root.join('app', 'views', 'alchemy', 'elements', "*_#{kind}.html.{haml,slim}"))
193
+ end
194
+ end
195
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "4.1.2"
4
+ VERSION = "4.2.0.rc1"
5
5
 
6
6
  def self.version
7
7
  VERSION
@@ -33,6 +33,7 @@ require_relative 'alchemy/config'
33
33
  require_relative 'alchemy/configuration_methods'
34
34
  require_relative 'alchemy/controller_actions'
35
35
  require_relative 'alchemy/deprecation'
36
+ require_relative 'alchemy/elements_finder'
36
37
  require_relative 'alchemy/errors'
37
38
  require_relative 'alchemy/essence'
38
39
  require_relative 'alchemy/filetypes'
@@ -9,6 +9,7 @@ module Alchemy
9
9
  def create_partials
10
10
  @elements = load_alchemy_yaml('elements.yml')
11
11
  return unless @elements
12
+
12
13
  @elements.each do |element|
13
14
  @element = element
14
15
  @contents = element["contents"] || []
@@ -1,8 +1,5 @@
1
1
  <%- if @contents.any? || @element['picture_gallery'] -%>
2
2
  <%%= element_editor_for(element) do |el| -%>
3
- <%- if @element['picture_gallery'] -%>
4
- <%%= render_picture_gallery_editor(element, max_images: nil, crop: true) %>
5
- <%- end -%>
6
3
  <%- @contents.each do |content| -%>
7
4
  <%%= el.edit :<%= content["name"] %> %>
8
5
  <%- end -%>
@@ -1,8 +1,5 @@
1
1
  <%- if @contents.any? || @element['picture_gallery'] -%>
2
2
  = element_editor_for(element) do |el|
3
- <%- if @element['picture_gallery'] -%>
4
- = render_picture_gallery_editor(element, max_images: nil, crop: true)
5
- <%- end -%>
6
3
  <%- @contents.each do |content| -%>
7
4
  = el.edit :<%= content["name"] %>
8
5
  <%- end -%>
@@ -1,8 +1,5 @@
1
1
  <%- if @contents.any? || @element['picture_gallery'] -%>
2
2
  = element_editor_for(element) do |el|
3
- <%- if @element['picture_gallery'] -%>
4
- = render_picture_gallery_editor(element, max_images: nil, crop: true)
5
- <%- end -%>
6
3
  <%- @contents.each do |content| -%>
7
4
  = el.edit :<%= content["name"] %>
8
5
  <%- end -%>
@@ -1,14 +1,5 @@
1
- <%%- cache(element) do -%>
2
- <%%= element_view_for(element) do |el| -%>
3
- <%- if @element["picture_gallery"] -%>
4
- <div class="<%= @element_name %>_images">
5
- <%%- element.contents.gallery_pictures.each do |image| -%>
6
- <div class="<%= @element_name %>_image <%%= image.essence.css_class %>">
7
- <%%= render_essence_view(image, size: '160x120') %>
8
- </div>
9
- <%%- end -%>
10
- </div>
11
- <%- end -%>
1
+ <%%- cache(<%= @element_name %>_view) do -%>
2
+ <%%= element_view_for(<%= @element_name %>_view) do |el| -%>
12
3
  <%- @contents.each do |content| -%>
13
4
  <%- if @contents.length > 1 -%>
14
5
  <div class="<%= content["name"] %>">
@@ -19,9 +10,7 @@
19
10
  <%- end -%>
20
11
  <%- end -%>
21
12
  <%- if @element['nestable_elements'].present? -%>
22
- <%% element.nested_elements.available.each do |nested_element| %>
23
- <%%= render_element(nested_element) %>
24
- <%% end %>
13
+ <%%= render <%= @element_name %>_view.nested_elements.available %>
25
14
  <%- end -%>
26
15
  <%%- end -%>
27
16
  <%%- end -%>
@@ -1,11 +1,5 @@
1
- - cache(element) do
2
- = element_view_for(element) do |el|
3
- <%- if @element["picture_gallery"] -%>
4
- .<%= @element_name %>_images
5
- - element.contents.gallery_pictures.each do |image|
6
- .<%= @element_name %>_image{class: image.essence.css_class}
7
- = render_essence_view(image, size: "160x120")
8
- <%- end -%>
1
+ - cache(<%= @element_name -%>_view) do
2
+ = element_view_for(<%= @element_name -%>_view) do |el|
9
3
  <%- @contents.each do |content| -%>
10
4
  <%- if @contents.length > 1 -%>
11
5
  .<%= content["name"] %>
@@ -15,6 +9,5 @@
15
9
  <%- end -%>
16
10
  <%- end -%>
17
11
  <%- if @element['nestable_elements'].present? -%>
18
- - element.nested_elements.available.each do |nested_element|
19
- = render_element(nested_element)
12
+ = render <%= @element_name -%>_view.nested_elements.available
20
13
  <%- end -%>
@@ -1,11 +1,5 @@
1
- - cache(element) do
2
- = element_view_for(element) do |el|
3
- <%- if @element["picture_gallery"] -%>
4
- .<%= @element_name %>_images
5
- - element.contents.gallery_pictures.each do |image|
6
- .<%= @element_name %>_image class=image.essence.css_class
7
- = render_essence_view(image, size: "160x120")
8
- <%- end -%>
1
+ - cache(<%= @element_name -%>_view) do
2
+ = element_view_for(<%= @element_name -%>_view) do |el|
9
3
  <%- @contents.each do |content| -%>
10
4
  <%- if @contents.length > 1 -%>
11
5
  .<%= content["name"] %>
@@ -15,6 +9,5 @@
15
9
  <%- end -%>
16
10
  <%- end -%>
17
11
  <%- if @element['nestable_elements'].present? -%>
18
- - element.nested_elements.available.each do |nested_element|
19
- = render_element(nested_element)
12
+ = render <%= @element_name -%>_view.nested_elements.available
20
13
  <%- end -%>
@@ -4,27 +4,11 @@ namespace :alchemy do
4
4
  namespace :tidy do
5
5
  desc "Tidy up Alchemy database."
6
6
  task :up do
7
- Rake::Task['alchemy:tidy:cells'].invoke
8
7
  Rake::Task['alchemy:tidy:element_positions'].invoke
9
8
  Rake::Task['alchemy:tidy:content_positions'].invoke
10
9
  Rake::Task['alchemy:tidy:remove_orphaned_records'].invoke
11
10
  end
12
11
 
13
- desc "Creates missing cells for pages."
14
- task cells: :environment do
15
- if !File.exist? Rails.root.join('config/alchemy/cells.yml')
16
- puts "No page cell definitions found."
17
- else
18
- cells = Alchemy::Cell.definitions
19
- page_layouts = Alchemy::PageLayout.all
20
- if cells && page_layouts
21
- Alchemy::Tidy.create_missing_cells(page_layouts, cells)
22
- else
23
- puts "No page layouts or cell definitions found."
24
- end
25
- end
26
- end
27
-
28
12
  desc "Fixes element positions."
29
13
  task element_positions: [:environment] do
30
14
  Alchemy::Tidy.update_element_positions
@@ -35,18 +19,12 @@ namespace :alchemy do
35
19
  Alchemy::Tidy.update_content_positions
36
20
  end
37
21
 
38
- desc "Remove orphaned records (cells, elements, contents)."
22
+ desc "Remove orphaned records (elements & contents)."
39
23
  task remove_orphaned_records: [:environment] do
40
- Rake::Task['alchemy:tidy:remove_orphaned_cells'].invoke
41
24
  Rake::Task['alchemy:tidy:remove_orphaned_elements'].invoke
42
25
  Rake::Task['alchemy:tidy:remove_orphaned_contents'].invoke
43
26
  end
44
27
 
45
- desc "Remove orphaned cells."
46
- task remove_orphaned_cells: [:environment] do
47
- Alchemy::Tidy.remove_orphaned_cells
48
- end
49
-
50
28
  desc "Remove orphaned elements."
51
29
  task remove_orphaned_elements: [:environment] do
52
30
  Alchemy::Tidy.remove_orphaned_elements
@@ -5,7 +5,8 @@ namespace :alchemy do
5
5
  desc "Upgrades your app to AlchemyCMS v#{Alchemy::VERSION}."
6
6
  task upgrade: [
7
7
  'alchemy:upgrade:prepare',
8
- 'alchemy:upgrade:4.1:run', 'alchemy:upgrade:4.1:todo'
8
+ 'alchemy:upgrade:4.1:run', 'alchemy:upgrade:4.1:todo',
9
+ 'alchemy:upgrade:4.2:run', 'alchemy:upgrade:4.2:todo'
9
10
  ] do
10
11
  Alchemy::Upgrader.display_todos
11
12
  end
@@ -56,5 +57,47 @@ namespace :alchemy do
56
57
  Alchemy::Upgrader::FourPointOne.alchemy_4_1_todos
57
58
  end
58
59
  end
60
+
61
+ desc 'Upgrade Alchemy to v4.2'
62
+ task '4.2' => [
63
+ 'alchemy:upgrade:prepare',
64
+ 'alchemy:upgrade:4.2:run',
65
+ 'alchemy:upgrade:4.2:todo'
66
+ ] do
67
+ Alchemy::Upgrader.display_todos
68
+ end
69
+
70
+ namespace '4.2' do
71
+ task run: [
72
+ 'alchemy:upgrade:4.2:convert_picture_galleries',
73
+ 'alchemy:upgrade:4.2:migrate_picture_galleries',
74
+ 'alchemy:upgrade:4.2:convert_cells',
75
+ 'alchemy:upgrade:4.2:migrate_cells'
76
+ ]
77
+
78
+ desc 'Convert `picture_gallery` element definitions to `nestable_elements`.'
79
+ task convert_picture_galleries: [:environment] do
80
+ Alchemy::Upgrader::FourPointTwo.convert_picture_galleries
81
+ end
82
+
83
+ desc 'Migrate `picture_gallery` elements to `nestable_elements`.'
84
+ task migrate_picture_galleries: [:environment] do
85
+ Alchemy::Upgrader::FourPointTwo.migrate_picture_galleries
86
+ end
87
+
88
+ desc 'Convert cells config to fixed nestable elements.'
89
+ task convert_cells: [:environment] do
90
+ Alchemy::Upgrader::FourPointTwo.convert_cells
91
+ end
92
+
93
+ desc 'Migrate existing cells to fixed nestable elements.'
94
+ task migrate_cells: ['alchemy:install:migrations', 'db:migrate'] do
95
+ Alchemy::Upgrader::FourPointTwo.migrate_cells
96
+ end
97
+
98
+ task :todo do
99
+ Alchemy::Upgrader::FourPointTwo.alchemy_4_2_todos
100
+ end
101
+ end
59
102
  end
60
103
  end
@@ -0,0 +1,2 @@
1
+ /* flatpickr v4.5.2,, @license MIT */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.flatpickr=t()}(this,function(){"use strict";var X=function(e){return("0"+e).slice(-2)},ee=function(e){return!0===e?1:0};function te(n,a,i){var o;return void 0===i&&(i=!1),function(){var e=this,t=arguments;null!==o&&clearTimeout(o),o=window.setTimeout(function(){o=null,i||n.apply(e,t)},a),i&&!o&&n.apply(e,t)}}var ne=function(e){return e instanceof Array?e:[e]},e=function(){},ae=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},w={D:e,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*ee(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t){var n=parseInt(t);return new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0)},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:e,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},w:e,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},ie={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},l={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[l.w(e,t,n)]},F:function(e,t,n){return ae(l.n(e,t,n)-1,!1,t)},G:function(e,t,n){return X(l.h(e,t,n))},H:function(e){return X(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[ee(11<e.getHours())]},M:function(e,t){return ae(e.getMonth(),!0,t)},S:function(e){return X(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return X(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return X(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return X(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},oe={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(3<t&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},re=function(e){var t=e.config,o=void 0===t?C:t,n=e.l10n,r=void 0===n?oe:n;return function(a,e,t){var i=t||r;return void 0!==o.formatDate?o.formatDate(a,e,i):e.split("").map(function(e,t,n){return l[e]&&"\\"!==n[t-1]?l[e](a,i,o):"\\"!==e?e:""}).join("")}},le=function(e){var t=e.config,D=void 0===t?C:t,n=e.l10n,b=void 0===n?oe:n;return function(e,t,n,a){if(0===e||e){var i,o=a||b,r=e;if(e instanceof Date)i=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)i=new Date(e);else if("string"==typeof e){var l=t||(D||C).dateFormat,c=String(e).trim();if("today"===c)i=new Date,n=!0;else if(/Z$/.test(c)||/GMT$/.test(c))i=new Date(e);else if(D&&D.parseDate)i=D.parseDate(e,l);else{i=D&&D.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var d,s=[],u=0,f=0,m="";u<l.length;u++){var g=l[u],p="\\"===g,h="\\"===l[u-1]||p;if(ie[g]&&!h){m+=ie[g];var v=new RegExp(m).exec(e);v&&(d=!0)&&s["Y"!==g?"push":"unshift"]({fn:w[g],val:v[++f]})}else p||(m+=".");s.forEach(function(e){var t=e.fn,n=e.val;return i=t(i,n,o)||i})}i=d?i:void 0}}if(i instanceof Date&&!isNaN(i.getTime()))return!0===n&&i.setHours(0,0,0,0),i;D.errorHandler(new Error("Invalid date provided: "+r))}}};function ce(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var de=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},se={DAY:864e5},ue=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],C={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function fe(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function me(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function ge(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function pe(e,t){var n=me("div","numInputWrapper"),a=me("input","numInput "+e),i=me("span","arrowUp"),o=me("span","arrowDown");if(a.type="text",a.pattern="\\d*",void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}"function"!=typeof Object.assign&&(Object.assign=function(n){if(!n)throw TypeError("Cannot convert undefined or null to object");for(var e=arguments.length,a=new Array(1<e?e-1:0),t=1;t<e;t++)a[t-1]=arguments[t];for(var i=function(){var t=a[o];t&&Object.keys(t).forEach(function(e){return n[e]=t[e]})},o=0;o<a.length;o++)i();return n});var he=300;function r(d,s){var h={config:Object.assign({},ve.defaultConfig),l10n:oe};function u(e){return e.bind(h)}function t(){var t=h.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame(function(){if(h.calendarContainer.style.visibility="hidden",h.calendarContainer.style.display="block",void 0!==h.daysContainer){var e=(h.days.offsetWidth+1)*t.showMonths;h.daysContainer.style.width=e+"px",h.calendarContainer.style.width=e+(void 0!==h.weekWrapper?h.weekWrapper.offsetWidth:0)+"px",h.calendarContainer.style.removeProperty("visibility"),h.calendarContainer.style.removeProperty("display")}})}function f(e){if(0!==h.selectedDates.length){void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==h.amPM&&e.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[ee(h.amPM.textContent===h.l10n.amPM[0])]);var a=parseFloat(n.getAttribute("data-min")),i=parseFloat(n.getAttribute("data-max")),o=parseFloat(n.getAttribute("data-step")),r=parseInt(n.value,10),l=e.delta||(t?38===e.which?1:-1:0),c=r+o*l;if(void 0!==n.value&&2===n.value.length){var d=n===h.hourElement,s=n===h.minuteElement;c<a?(c=i+c+ee(!d)+(ee(d)&&ee(!h.amPM)),s&&v(void 0,-1,h.hourElement)):i<c&&(c=n===h.hourElement?c-i-ee(!h.amPM):a,s&&v(void 0,1,h.hourElement)),h.amPM&&d&&(1===o?c+r===23:Math.abs(c-r)>o)&&(h.amPM.textContent=h.l10n.amPM[ee(h.amPM.textContent===h.l10n.amPM[0])]),n.value=X(c)}}(e);var t=h._input.value;m(),Z(),h._input.value!==t&&h._debouncedChange()}}function m(){if(void 0!==h.hourElement&&void 0!==h.minuteElement){var e,t,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(h.minuteElement.value,10)||0)%60,i=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(e=n,t=h.amPM.textContent,n=e%12+12*ee(t===h.l10n.amPM[1]));var o=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===ce(h.latestSelectedDateObj,h.config.minDate,!0);if(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===ce(h.latestSelectedDateObj,h.config.maxDate,!0)){var r=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate;(n=Math.min(n,r.getHours()))===r.getHours()&&(a=Math.min(a,r.getMinutes())),a===r.getMinutes()&&(i=Math.min(i,r.getSeconds()))}if(o){var l=void 0!==h.config.minTime?h.config.minTime:h.config.minDate;(n=Math.max(n,l.getHours()))===l.getHours()&&(a=Math.max(a,l.getMinutes())),a===l.getMinutes()&&(i=Math.max(i,l.getSeconds()))}c(n,a,i)}}function i(e){var t=e||h.latestSelectedDateObj;t&&c(t.getHours(),t.getMinutes(),t.getSeconds())}function a(){var e=h.config.defaultHour,t=h.config.defaultMinute,n=h.config.defaultSeconds;if(void 0!==h.config.minDate){var a=h.config.minDate.getHours(),i=h.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=h.config.minDate.getSeconds())}if(void 0!==h.config.maxDate){var o=h.config.maxDate.getHours(),r=h.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=h.config.maxDate.getSeconds())}c(e,t,n)}function c(e,t,n){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(e%24,t,n||0,0),h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=X(h.config.time_24hr?e:(12+e)%12+12*ee(e%12==0)),h.minuteElement.value=X(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[ee(12<=e)]),void 0!==h.secondElement&&(h.secondElement.value=X(n)))}function n(e){var t=parseInt(e.target.value)+(e.delta||0);(1<t/1e3||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&_(t)}function o(t,n,a,i){return n instanceof Array?n.forEach(function(e){return o(t,e,a,i)}):t instanceof Array?t.forEach(function(e){return o(e,n,a,i)}):(t.addEventListener(n,a,i),void h._handlers.push({element:t,event:n,handler:a,options:i}))}function r(t){return function(e){1===e.which&&t(e)}}function g(){q("onChange")}function l(e){var t=void 0!==e?h.parseDate(e):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate<h.now?h.config.maxDate:h.now);try{void 0!==t&&(h.currentYear=t.getFullYear(),h.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,h.config.errorHandler(e)}h.redraw()}function p(e){~e.target.className.indexOf("arrow")&&v(e,e.target.classList.contains("arrowUp")?1:-1)}function v(e,t,n){var a=e&&e.target,i=n||a&&a.parentNode&&a.parentNode.firstChild,o=$("increment");o.delta=t,i&&i.dispatchEvent(o)}function D(e,t,n,a){var i,o=N(t,!0),r=me("span","flatpickr-day "+e,t.getDate().toString());return r.dateObj=t,r.$i=a,r.setAttribute("aria-label",h.formatDate(t,h.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===ce(t,h.now)&&((h.todayDateElem=r).classList.add("today"),r.setAttribute("aria-current","date")),o?(r.tabIndex=-1,z(t)&&(r.classList.add("selected"),h.selectedDateElem=r,"range"===h.config.mode&&(fe(r,"startRange",h.selectedDates[0]&&0===ce(t,h.selectedDates[0],!0)),fe(r,"endRange",h.selectedDates[1]&&0===ce(t,h.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("disabled"),"range"===h.config.mode&&(i=t,!("range"!==h.config.mode||h.selectedDates.length<2)&&0<=ce(i,h.selectedDates[0])&&ce(i,h.selectedDates[1])<=0&&!z(t)&&r.classList.add("inRange")),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+h.config.getWeek(t)+"</span>"),q("onDayCreate",r),r}function b(e){e.focus(),"range"===h.config.mode&&P(e)}function w(e){for(var t=0<e?0:h.config.showMonths-1,n=0<e?h.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=h.daysContainer.children[a],o=0<e?0:i.children.length-1,r=0<e?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&N(c.dateObj))return c}}function C(e,t){var n=F(document.activeElement||document.body),a=void 0!==e?e:n?document.activeElement:void 0!==h.selectedDateElem&&F(h.selectedDateElem)?h.selectedDateElem:void 0!==h.todayDateElem&&F(h.todayDateElem)?h.todayDateElem:w(0<t?1:-1);return void 0===a?h._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():h.currentMonth,a=0<t?h.config.showMonths:-1,i=0<t?1:-1,o=n-h.currentMonth;o!=a;o+=i)for(var r=h.daysContainer.children[o],l=n-h.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,c=r.children.length,d=l;0<=d&&d<c&&d!=(0<t?c:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&N(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return b(s)}h.changeMonth(i),C(w(i),0)}(a,t):b(a)}function y(e,t){for(var n=(new Date(e,t,1).getDay()-h.l10n.firstDayOfWeek+7)%7,a=h.utils.getDaysInMonth((t-1+12)%12),i=h.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=1<h.config.showMonths,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",d=a+1-n,s=0;d<=a;d++,s++)o.appendChild(D(l,new Date(e,t-1,d),d,s));for(d=1;d<=i;d++,s++)o.appendChild(D("",new Date(e,t,d),d,s));for(var u=i+1;u<=42-n&&(1===h.config.showMonths||s%7!=0);u++,s++)o.appendChild(D(c,new Date(e,t+1,u%i),u,s));var f=me("div","dayContainer");return f.appendChild(o),f}function M(){if(void 0!==h.daysContainer){ge(h.daysContainer),h.weekNumbers&&ge(h.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<h.config.showMonths;t++){var n=new Date(h.currentYear,h.currentMonth,1);n.setMonth(h.currentMonth+t),e.appendChild(y(n.getFullYear(),n.getMonth()))}h.daysContainer.appendChild(e),h.days=h.daysContainer.firstChild,"range"===h.config.mode&&1===h.selectedDates.length&&P()}}function x(){var e=me("div","flatpickr-month"),t=window.document.createDocumentFragment(),n=me("span","cur-month"),a=pe("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&i.setAttribute("data-min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(i.setAttribute("data-max",h.config.maxDate.getFullYear().toString()),i.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear());var o=me("div","flatpickr-current-month");return o.appendChild(n),o.appendChild(a),t.appendChild(o),e.appendChild(t),{container:e,yearElement:i,monthElement:n}}function E(){ge(h.monthNav),h.monthNav.appendChild(h.prevMonthNav);for(var e=h.config.showMonths;e--;){var t=x();h.yearElements.push(t.yearElement),h.monthElements.push(t.monthElement),h.monthNav.appendChild(t.container)}h.monthNav.appendChild(h.nextMonthNav)}function T(){h.weekdayContainer?ge(h.weekdayContainer):h.weekdayContainer=me("div","flatpickr-weekdays");for(var e=h.config.showMonths;e--;){var t=me("div","flatpickr-weekdaycontainer");h.weekdayContainer.appendChild(t)}return k(),h.weekdayContainer}function k(){var e=h.l10n.firstDayOfWeek,t=h.l10n.weekdays.shorthand.concat();0<e&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e)));for(var n=h.config.showMonths;n--;)h.weekdayContainer.children[n].innerHTML="\n <span class=flatpickr-weekday>\n "+t.join("</span><span class=flatpickr-weekday>")+"\n </span>\n "}function I(e,t){void 0===t&&(t=!0);var n=t?e:e-h.currentMonth;n<0&&!0===h._hidePrevMonthArrow||0<n&&!0===h._hideNextMonthArrow||(h.currentMonth+=n,(h.currentMonth<0||11<h.currentMonth)&&(h.currentYear+=11<h.currentMonth?1:-1,h.currentMonth=(h.currentMonth+12)%12,q("onYearChange")),M(),q("onMonthChange"),G())}function O(e){return!(!h.config.appendTo||!h.config.appendTo.contains(e))||h.calendarContainer.contains(e)}function S(t){if(h.isOpen&&!h.config.inline){var e=O(t.target),n=t.target===h.input||t.target===h.altInput||h.element.contains(t.target)||t.path&&t.path.indexOf&&(~t.path.indexOf(h.input)||~t.path.indexOf(h.altInput)),a="blur"===t.type?n&&t.relatedTarget&&!O(t.relatedTarget):!n&&!e,i=!h.config.ignoredFocusElements.some(function(e){return e.contains(t.target)});a&&i&&(h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}}function _(e){if(!(!e||h.config.minDate&&e<h.config.minDate.getFullYear()||h.config.maxDate&&e>h.config.maxDate.getFullYear())){var t=e,n=h.currentYear!==t;h.currentYear=t||h.currentYear,h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth)),n&&(h.redraw(),q("onYearChange"))}}function N(e,t){void 0===t&&(t=!0);var n=h.parseDate(e,void 0,t);if(h.config.minDate&&n&&ce(n,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&n&&0<ce(n,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime))return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===n)return!1;for(var a,i=0<h.config.enable.length,o=i?h.config.enable:h.config.disable,r=0;r<o.length;r++){if("function"==typeof(a=o[r])&&a(n))return i;if(a instanceof Date&&void 0!==n&&a.getTime()===n.getTime())return i;if("string"==typeof a&&void 0!==n){var l=h.parseDate(a,void 0,!0);return l&&l.getTime()===n.getTime()?i:!i}if("object"==typeof a&&void 0!==n&&a.from&&a.to&&n.getTime()>=a.from.getTime()&&n.getTime()<=a.to.getTime())return i}return!i}function F(e){return void 0!==h.daysContainer&&(-1===e.className.indexOf("hidden")&&h.daysContainer.contains(e))}function A(e){var t=e.target===h._input,n=h.config.allowInput,a=h.isOpen&&(!n||!t),i=h.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return h.setDate(h._input.value,!0,e.target===h.altInput?h.config.altFormat:h.config.dateFormat),e.target.blur();h.open()}else if(O(e.target)||a||i){var o=!!h.timeContainer&&h.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?f():B(e);break;case 27:e.preventDefault(),R();break;case 8:case 46:t&&!h.config.allowInput&&(e.preventDefault(),h.clear());break;case 37:case 39:if(o)h.hourElement&&h.hourElement.focus();else if(e.preventDefault(),void 0!==h.daysContainer&&(!1===n||F(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(I(r),C(w(1),0)):C(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;h.daysContainer&&void 0!==e.target.$i?e.ctrlKey?(_(h.currentYear-l),C(w(1),0)):o||C(void 0,7*l):h.config.enableTime&&(!o&&h.hourElement&&h.hourElement.focus(),f(e),h._debouncedChange());break;case 9:if(!o){h.element.focus();break}var c=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].filter(function(e){return e}),d=c.indexOf(e.target);if(-1!==d){var s=c[d+(e.shiftKey?-1:1)];void 0!==s?(e.preventDefault(),s.focus()):h.element.focus()}}}if(void 0!==h.amPM&&e.target===h.amPM)switch(e.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0],m(),Z();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1],m(),Z()}q("onKeyDown",e)}function P(o){if(1===h.selectedDates.length&&(!o||o.classList.contains("flatpickr-day")&&!o.classList.contains("disabled"))){for(var r=o?o.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),l=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),e=Math.min(r,h.selectedDates[0].getTime()),t=Math.max(r,h.selectedDates[0].getTime()),n=h.daysContainer.lastChild.lastChild.dateObj.getTime(),c=!1,d=0,s=0,a=e;a<n;a+=se.DAY)N(new Date(a),!0)||(c=c||e<a&&a<t,a<l&&(!d||d<a)?d=a:l<a&&(!s||a<s)&&(s=a));for(var u=0;u<h.config.showMonths;u++)for(var f=h.daysContainer.children[u],m=h.daysContainer.children[u-1],i=function(e,t){var n=f.children[e],a=n.dateObj.getTime(),i=0<d&&a<d||0<s&&s<a;return i?(n.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){n.classList.remove(e)}),"continue"):c&&!i?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){n.classList.remove(e)}),void(void 0!==o&&(o.classList.add(r<h.selectedDates[0].getTime()?"startRange":"endRange"),!f.contains(o)&&0<u&&m&&m.lastChild.dateObj.getTime()>=a||(l<r&&a===l?n.classList.add("startRange"):r<l&&a===l&&n.classList.add("endRange"),d<=a&&(0===s||a<=s)&&de(a,l,r)&&n.classList.add("inRange")))))},g=0,p=f.children.length;g<p;g++)i(g)}}function j(){!h.isOpen||h.config.static||h.config.inline||L()}function Y(a){return function(e){var t=h.config["_"+a+"Date"]=h.parseDate(e,h.config.dateFormat),n=h.config["_"+("min"===a?"max":"min")+"Date"];void 0!==t&&(h["min"===a?"minDateHasTime":"maxDateHasTime"]=0<t.getHours()||0<t.getMinutes()||0<t.getSeconds()),h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(e){return N(e)}),h.selectedDates.length||"min"!==a||i(t),Z()),h.daysContainer&&(W(),void 0!==t?h.currentYearElement[a]=t.getFullYear().toString():h.currentYearElement.removeAttribute(a),h.currentYearElement.disabled=!!n&&void 0!==t&&n.getFullYear()===t.getFullYear())}}function H(){"object"!=typeof h.config.locale&&void 0===ve.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale)),h.l10n=Object.assign({},ve.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?ve.l10ns[h.config.locale]:void 0),ie.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")",h.formatDate=re(h),h.parseDate=le({config:h.config,l10n:h.l10n})}function L(e){if(void 0!==h.calendarContainer){q("onPreCalendarPosition");var t=e||h._positionElement,n=Array.prototype.reduce.call(h.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=h.calendarContainer.offsetWidth,i=h.config.position.split(" "),o=i[0],r=1<i.length?i[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===o||"below"!==o&&c<n&&l.top>n,s=window.pageYOffset+l.top+(d?-n-2:t.offsetHeight+2);if(fe(h.calendarContainer,"arrowTop",!d),fe(h.calendarContainer,"arrowBottom",d),!h.config.inline){var u=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),f=window.document.body.offsetWidth-l.right,m=u+a>window.document.body.offsetWidth;fe(h.calendarContainer,"rightMost",m),h.config.static||(h.calendarContainer.style.top=s+"px",m?(h.calendarContainer.style.left="auto",h.calendarContainer.style.right=f+"px"):(h.calendarContainer.style.left=u+"px",h.calendarContainer.style.right="auto"))}}}function W(){h.config.noCalendar||h.isMobile||(G(),M())}function R(){h._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function B(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=h.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()<h.currentMonth||a.getMonth()>h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;if(h.selectedDateElem=n,"single"===h.config.mode)h.selectedDates=[a];else if("multiple"===h.config.mode){var o=z(a);o?h.selectedDates.splice(parseInt(o),1):h.selectedDates.push(a)}else"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1),h.selectedDates.push(a),0!==ce(a,h.selectedDates[0],!0)&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(m(),i){var r=h.currentYear!==a.getFullYear();h.currentYear=a.getFullYear(),h.currentMonth=a.getMonth(),r&&q("onYearChange"),q("onMonthChange")}if(G(),M(),Z(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),i||"range"===h.config.mode||1!==h.config.showMonths?h.selectedDateElem&&h.selectedDateElem.focus():b(n),void 0!==h.hourElement&&setTimeout(function(){return void 0!==h.hourElement&&h.hourElement.select()},451),h.config.closeOnSelect){var l="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime;(l||c)&&R()}g()}}h.parseDate=le({config:h.config,l10n:h.l10n}),h._handlers=[],h._bind=o,h._setHoursFromDate=i,h._positionCalendar=L,h.changeMonth=I,h.changeYear=_,h.clear=function(e){void 0===e&&(e=!0);h.input.value="",void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[],h.latestSelectedDateObj=void 0,!(h.showTimeInput=!1)===h.config.enableTime&&a();h.redraw(),e&&q("onChange")},h.close=function(){h.isOpen=!1,h.isMobile||(h.calendarContainer.classList.remove("open"),h._input.classList.remove("active"));q("onClose")},h._createElement=me,h.destroy=function(){void 0!==h.config&&q("onDestroy");for(var e=h._handlers.length;e--;){var t=h._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config.static&&h.calendarContainer.parentNode){var n=h.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete h[e]}catch(e){}})},h.isEnabled=N,h.jumpToDate=l,h.open=function(e,t){void 0===t&&(t=h._positionElement);if(!0===h.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==h.mobileInput&&(h.mobileInput.focus(),h.mobileInput.click()),void q("onOpen");if(h._input.disabled||h.config.inline)return;var n=h.isOpen;h.isOpen=!0,n||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),q("onOpen"),L(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&(h.setDate(void 0!==h.config.minDate?new Date(h.config.minDate.getTime()):new Date,!1),a(),Z()),!1!==h.config.allowInput||void 0!==e&&h.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))},h.redraw=W,h.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(h.config,e):(h.config[e]=t,void 0!==K[e]?K[e].forEach(function(e){return e()}):-1<ue.indexOf(e)&&(h.config[e]=ne(t)));h.redraw(),l(),Z(!1)},h.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=h.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return h.clear(t);J(e,n),h.showTimeInput=0<h.selectedDates.length,h.latestSelectedDateObj=h.selectedDates[0],h.redraw(),l(),i(),Z(t),t&&q("onChange")},h.toggle=function(e){if(!0===h.isOpen)return h.close();h.open(e)};var K={locale:[H,k],showMonths:[E,t,T]};function J(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return h.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[h.parseDate(e,t)];else if("string"==typeof e)switch(h.config.mode){case"single":case"time":n=[h.parseDate(e,t)];break;case"multiple":n=e.split(h.config.conjunction).map(function(e){return h.parseDate(e,t)});break;case"range":n=e.split(h.l10n.rangeSeparator).map(function(e){return h.parseDate(e,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));h.selectedDates=n.filter(function(e){return e instanceof Date&&N(e,!1)}),"range"===h.config.mode&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function U(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?h.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:h.parseDate(e.from,void 0),to:h.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function q(e,t){if(void 0!==h.config){var n=h.config[e];if(void 0!==n&&0<n.length)for(var a=0;n[a]&&a<n.length;a++)n[a](h.selectedDates,h.input.value,h,t);"onChange"===e&&(h.input.dispatchEvent($("change")),h.input.dispatchEvent($("input")))}}function $(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function z(e){for(var t=0;t<h.selectedDates.length;t++)if(0===ce(h.selectedDates[t],e))return""+t;return!1}function G(){h.config.noCalendar||h.isMobile||!h.monthNav||(h.yearElements.forEach(function(e,t){var n=new Date(h.currentYear,h.currentMonth,1);n.setMonth(h.currentMonth+t),h.monthElements[t].textContent=ae(n.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ",e.value=n.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYear<h.config.minDate.getFullYear()),h._hideNextMonthArrow=void 0!==h.config.maxDate&&(h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth+1>h.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function V(t){return h.selectedDates.map(function(e){return h.formatDate(e,t)}).filter(function(e,t,n){return"range"!==h.config.mode||h.config.enableTime||n.indexOf(e)===t}).join("range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator)}function Z(e){if(void 0===e&&(e=!0),0===h.selectedDates.length)return h.clear(e);void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):""),h.input.value=V(h.config.dateFormat),void 0!==h.altInput&&(h.altInput.value=V(h.config.altFormat)),!1!==e&&q("onValueUpdate")}function Q(e){e.preventDefault();var t=h.prevMonthNav.contains(e.target),n=h.nextMonthNav.contains(e.target);t||n?I(t?-1:1):0<=h.yearElements.indexOf(e.target)?e.target.select():e.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):e.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}return function(){h.element=h.input=d,h.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=Object.assign({},s,JSON.parse(JSON.stringify(d.dataset||{}))),n={};h.config.parseDate=t.parseDate,h.config.formatDate=t.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(e){h.config._enable=U(e)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(e){h.config._disable=U(e)}});var a="time"===t.mode;t.dateFormat||!t.enableTime&&!a||(n.dateFormat=t.noCalendar||a?"H:i"+(t.enableSeconds?":S":""):ve.defaultConfig.dateFormat+" H:i"+(t.enableSeconds?":S":"")),t.altInput&&(t.enableTime||a)&&!t.altFormat&&(n.altFormat=t.noCalendar||a?"h:i"+(t.enableSeconds?":S K":" K"):ve.defaultConfig.altFormat+" h:i"+(t.enableSeconds?":S":"")+" K"),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:Y("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:Y("max")});var i=function(t){return function(e){h.config["min"===t?"_minTime":"_maxTime"]=h.parseDate(e,"H:i")}};Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:i("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:i("max")}),"time"===t.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),Object.assign(h.config,n,t);for(var o=0;o<e.length;o++)h.config[e[o]]=!0===h.config[e[o]]||"true"===h.config[e[o]];ue.filter(function(e){return void 0!==h.config[e]}).forEach(function(e){h.config[e]=ne(h.config[e]||[]).map(u)}),h.isMobile=!h.config.disableMobile&&!h.config.inline&&"single"===h.config.mode&&!h.config.disable.length&&!h.config.enable.length&&!h.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var r=0;r<h.config.plugins.length;r++){var l=h.config.plugins[r](h)||{};for(var c in l)-1<ue.indexOf(c)?h.config[c]=ne(l[c]).map(u).concat(h.config[c]):void 0===t[c]&&(h.config[c]=l[c])}q("onParseConfig")}(),H(),function(){if(h.input=h.config.wrap?d.querySelector("[data-input]"):d,!h.input)return h.config.errorHandler(new Error("Invalid input element specified"));h.input._type=h.input.type,h.input.type="text",h.input.classList.add("flatpickr-input"),h._input=h.input,h.config.altInput&&(h.altInput=me(h.input.nodeName,h.input.className+" "+h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling)),h.config.allowInput||h._input.setAttribute("readonly","readonly"),h._positionElement=h.config.positionElement||h._input}(),function(){h.selectedDates=[],h.now=h.parseDate(h.config.now)||new Date;var e=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);e&&J(e,h.config.dateFormat);var t=0<h.selectedDates.length?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()<h.now.getTime()?h.config.maxDate:h.now;h.currentYear=t.getFullYear(),h.currentMonth=t.getMonth(),0<h.selectedDates.length&&(h.latestSelectedDateObj=h.selectedDates[0]),void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i")),void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i")),h.minDateHasTime=!!h.config.minDate&&(0<h.config.minDate.getHours()||0<h.config.minDate.getMinutes()||0<h.config.minDate.getSeconds()),h.maxDateHasTime=!!h.config.maxDate&&(0<h.config.maxDate.getHours()||0<h.config.maxDate.getMinutes()||0<h.config.maxDate.getSeconds()),Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(e){h._showTimeInput=e,h.calendarContainer&&fe(h.calendarContainer,"showTimeInput",e),h.isOpen&&L()}})}(),h.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=h.currentMonth),void 0===t&&(t=h.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[e]}},h.isMobile||function(){var e=window.document.createDocumentFragment();if(h.calendarContainer=me("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(e.appendChild((h.monthNav=me("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=me("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=me("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,E(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(e){h.__hidePrevMonthArrow!==e&&(fe(h.prevMonthNav,"disabled",e),h.__hidePrevMonthArrow=e)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(e){h.__hideNextMonthArrow!==e&&(fe(h.nextMonthNav,"disabled",e),h.__hideNextMonthArrow=e)}}),h.currentYearElement=h.yearElements[0],G(),h.monthNav)),h.innerContainer=me("div","flatpickr-innerContainer"),h.config.weekNumbers){var t=function(){h.calendarContainer.classList.add("hasWeeks");var e=me("div","flatpickr-weekwrapper");e.appendChild(me("span","flatpickr-weekday",h.l10n.weekAbbreviation));var t=me("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;h.innerContainer.appendChild(n),h.weekNumbers=a,h.weekWrapper=n}h.rContainer=me("div","flatpickr-rContainer"),h.rContainer.appendChild(T()),h.daysContainer||(h.daysContainer=me("div","flatpickr-days"),h.daysContainer.tabIndex=-1),M(),h.rContainer.appendChild(h.daysContainer),h.innerContainer.appendChild(h.rContainer),e.appendChild(h.innerContainer)}h.config.enableTime&&e.appendChild(function(){h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=me("div","flatpickr-time"),h.timeContainer.tabIndex=-1;var e=me("span","flatpickr-time-separator",":"),t=pe("flatpickr-hour");h.hourElement=t.getElementsByTagName("input")[0];var n=pe("flatpickr-minute");if(h.minuteElement=n.getElementsByTagName("input")[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=X(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(h.config.defaultHour)),h.minuteElement.value=X(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("data-step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("data-step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("data-min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("data-max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("data-min","0"),h.minuteElement.setAttribute("data-max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(n),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds){h.timeContainer.classList.add("hasSeconds");var a=pe("flatpickr-second");h.secondElement=a.getElementsByTagName("input")[0],h.secondElement.value=X(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("data-step",h.minuteElement.getAttribute("data-step")),h.secondElement.setAttribute("data-min",h.minuteElement.getAttribute("data-min")),h.secondElement.setAttribute("data-max",h.minuteElement.getAttribute("data-max")),h.timeContainer.appendChild(me("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(a)}return h.config.time_24hr||(h.amPM=me("span","flatpickr-am-pm",h.l10n.amPM[ee(11<(h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour))]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}()),fe(h.calendarContainer,"rangeMode","range"===h.config.mode),fe(h.calendarContainer,"animate",!0===h.config.animate),fe(h.calendarContainer,"multiMonth",1<h.config.showMonths),h.calendarContainer.appendChild(e);var i=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;if((h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!i&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)){var o=me("div","flatpickr-wrapper");h.element.parentNode&&h.element.parentNode.insertBefore(o,h.element),o.appendChild(h.element),h.altInput&&o.appendChild(h.altInput),o.appendChild(h.calendarContainer)}h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(t){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+t+"]"),function(e){return o(e,"click",h[t])})}),h.isMobile)return function(){var e=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=me("input",h.input.className+" flatpickr-mobile"),h.mobileInput.step=h.input.getAttribute("step")||"any",h.mobileInput.tabIndex=1,h.mobileInput.type=e,h.mobileInput.disabled=h.input.disabled,h.mobileInput.required=h.input.required,h.mobileInput.placeholder=h.input.placeholder,h.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",0<h.selectedDates.length&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr)),h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d")),h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d")),h.input.type="hidden",void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(e){}o(h.mobileInput,"change",function(e){h.setDate(e.target.value,!1,h.mobileFormatStr),q("onChange"),q("onClose")})}();var e=te(j,50);h._debouncedChange=te(g,he),h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&o(h.daysContainer,"mouseover",function(e){"range"===h.config.mode&&P(e.target)}),o(window.document.body,"keydown",A),h.config.static||o(h._input,"keydown",A),h.config.inline||h.config.static||o(window,"resize",e),void 0!==window.ontouchstart?o(window.document,"click",S):o(window.document,"mousedown",r(S)),o(window.document,"focus",S,{capture:!0}),!0===h.config.clickOpens&&(o(h._input,"focus",h.open),o(h._input,"mousedown",r(h.open))),void 0!==h.daysContainer&&(o(h.monthNav,"mousedown",r(Q)),o(h.monthNav,["keyup","increment"],n),o(h.daysContainer,"mousedown",r(B))),void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(o(h.timeContainer,["increment"],f),o(h.timeContainer,"blur",f,{capture:!0}),o(h.timeContainer,"mousedown",r(p)),o([h.hourElement,h.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==h.secondElement&&o(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&o(h.amPM,"mousedown",r(function(e){f(e),g()})))}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&i(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),Z(!1)),t(),h.showTimeInput=0<h.selectedDates.length||h.config.noCalendar;var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&e&&L(),q("onReady")}(),h}function n(e,t){for(var n=Array.prototype.slice.call(e),a=[],i=0;i<n.length;i++){var o=n[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=r(o,t||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return n(this,e)},HTMLElement.prototype.flatpickr=function(e){return n([this],e)});var ve=function(e,t){return e instanceof NodeList?n(e,t):n("string"==typeof e?window.document.querySelectorAll(e):[e],t)};return ve.defaultConfig=C,ve.l10ns={en:Object.assign({},oe),default:Object.assign({},oe)},ve.localize=function(e){ve.l10ns.default=Object.assign({},ve.l10ns.default,e)},ve.setDefaults=function(e){ve.defaultConfig=Object.assign({},ve.defaultConfig,e)},ve.parseDate=le({}),ve.formatDate=re({}),ve.compareDates=ce,"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(e){return n(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=ve),ve});
@@ -1,2 +1,2 @@
1
- // 4.7.5 (2018-01-22)
2
- !function(){"use strict";var e,t,n,r,o,i,a,s,u,c,l,f,d,m,p,g,h,v=function(e){return function(){return e}},y={noop:function(){},noarg:function(e){return function(){return e()}},compose:function(e,t){return function(){return e(t.apply(null,arguments))}},constant:v,identity:function(e){return e},tripleEquals:function(e,t){return e===t},curry:function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}},not:function(e){return function(){return!e.apply(null,arguments)}},die:function(e){return function(){throw new Error(e)}},apply:function(e){return e()},call:function(e){e()},never:v(!1),always:v(!0)},b=y.never,C=y.always,x=function(){return w},w=(r={fold:function(e,t){return e()},is:b,isSome:b,isNone:C,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},or:n,orThunk:t,map:x,ap:x,each:function(){},bind:x,flatten:x,exists:b,forall:C,filter:x,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:y.constant("none()")},Object.freeze&&Object.freeze(r),r),N=function(e){var t=function(){return e},n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:C,isNone:b,getOr:t,getOrThunk:t,getOrDie:t,or:n,orThunk:n,map:function(t){return N(t(e))},ap:function(t){return t.fold(x,function(t){return N(t(e))})},each:function(t){t(e)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(e)?o:w},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(b,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},E={some:N,none:x,from:function(e){return null===e||e===undefined?w:N(e)}},S=(o=Array.prototype.indexOf)===undefined?function(e,t){return D(e,t)}:function(e,t){return o.call(e,t)},k=function(e,t){return S(e,t)>-1},T=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},A=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},_=function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n,e)},B=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},R=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return E.some(n);return E.none()},D=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},O=Array.prototype.push,P=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);O.apply(t,e[n])}return t},I=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},L=Array.prototype.slice,M={map:T,each:A,eachr:_,partition:function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},filter:B,groupBy:function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var s=e[i],u=t(s);u!==n&&(r.push(o),o=[]),n=u,o.push(s)}return 0!==o.length&&r.push(o),r},indexOf:function(e,t){var n=S(e,t);return-1===n?E.none():E.some(n)},foldr:function(e,t,n){return _(e,function(e){n=t(n,e)}),n},foldl:function(e,t,n){return A(e,function(e){n=t(n,e)}),n},find:function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return E.some(o)}return E.none()},findIndex:R,flatten:P,bind:function(e,t){var n=T(e,t);return P(n)},forall:I,exists:function(e,t){return R(e,t).isSome()},contains:k,equal:function(e,t){return e.length===t.length&&I(e,function(e,n){return e===t[n]})},reverse:function(e){var t=L.call(e,0);return t.reverse(),t},chunk:function(e,t){for(var n=[],r=0;r<e.length;r+=t){var o=e.slice(r,r+t);n.push(o)}return n},difference:function(e,t){return B(e,function(e){return!k(t,e)})},mapToObject:function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n},pure:function(e){return[e]},sort:function(e,t){var n=L.call(e,0);return n.sort(t),n},range:function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},head:function(e){return 0===e.length?E.none():E.some(e[0])},last:function(e){return 0===e.length?E.none():E.some(e[e.length-1])}},F="undefined"!=typeof window?window:Function("return this;")(),z=function(e,t){for(var n=t!==undefined&&null!==t?t:F,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n},U=function(e,t){var n=e.split(".");return z(n,t)},V=function(e,t){var n=U(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},H=function(){return V("URL")},q=function(e){return H().createObjectURL(e)},j=function(e){H().revokeObjectURL(e)},$=navigator,W=$.userAgent,K=function(e){return"matchMedia"in window&&matchMedia(e).matches};d=/Android/.test(W),a=(a=!(i=/WebKit/.test(W))&&/MSIE/gi.test(W)&&/Explorer/gi.test($.appName))&&/MSIE (\w+)\./.exec(W)[1],s=-1!==W.indexOf("Trident/")&&(-1!==W.indexOf("rv:")||-1!==$.appName.indexOf("Netscape"))&&11,u=-1!==W.indexOf("Edge/")&&!a&&!s&&12,a=a||s||u,c=!i&&!s&&/Gecko/.test(W),l=-1!==W.indexOf("Mac"),f=/(iPad|iPhone)/.test(W),m="FormData"in window&&"FileReader"in window&&"URL"in window&&!!q,p=K("only screen and (max-device-width: 480px)")&&(d||f),g=K("only screen and (min-width: 800px)")&&(d||f),h=-1!==W.indexOf("Windows Phone"),u&&(i=!1);var X,Y,G,J,Q,Z,ee,te,ne,re,oe,ie,ae,se,ue,ce,le,fe,de,me={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:d,contentEditable:!f||m||parseInt(W.match(/AppleWebKit\/(\d*)/)[1],10)>=534,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:window.getSelection&&"Range"in window,documentMode:a&&!u?document.documentMode||7:10,fileApi:m,ceFalse:!1===a||a>8,cacheSuffix:"",container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||a>11,desktop:!p&&!g,windowsPhone:h},pe=window.Promise?window.Promise:function(){function e(e,t){return function(){e.apply(t,arguments)}}var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],u(t,e(i,this),e(a,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function o(e){var t=this;null!==this._state?r(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void e.reject(o)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)}):this._deferreds.push(e)}function i(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void u(e(n,t),e(i,this),e(a,this))}this._state=!0,this._value=t,s.call(this)}catch(r){a.call(this,r)}}function a(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)o.call(this,this._deferreds[e]);this._deferreds=null}function u(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return n.prototype["catch"]=function(e){return this.then(null,e)},n.prototype.then=function(e,t){var r=this;return new n(function(n,i){o.call(r,new function(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}(e,t,n,i))})},n.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&t(arguments[0])?arguments[0]:arguments);return new n(function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){o(i,e)},n)}e[i]=a,0==--r&&t(e)}catch(u){n(u)}}for(var i=0;i<e.length;i++)o(i,e[i])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,n){n(e)})},n.race=function(e){return new n(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},n}(),ge=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},he=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},ve=function(e,t){var n,r;return(r=function(){var r=arguments;clearTimeout(n),n=ge(function(){e.apply(this,r)},t)}).stop=function(){clearTimeout(n)},r},ye={requestAnimationFrame:function(e,t){X?X.then(e):X=new pe(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:ge,setInterval:he,setEditorTimeout:function(e,t,n){return ge(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=he(function(){e.removed?clearInterval(r):t()},n)},debounce:ve,throttle:ve,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},be=/^(?:mouse|contextmenu)|click/,Ce={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},xe=function(){return!1},we=function(){return!0},Ne=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ee=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Se=function(e,t){var n,r,o,i,a,s,u=t||{};for(n in e)Ce[n]||(u[n]=e[n]);if(u.target||(u.target=u.srcElement||document),me.experimentalShadowDom&&(u.target=(r=e,o=u.target,a=o,(i=r.path)&&i.length>0&&(a=i[0]),r.deepPath&&(i=r.deepPath())&&i.length>0&&(a=i[0]),a)),e&&be.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var c=u.target.ownerDocument||document,l=c.documentElement,f=c.body;u.pageX=e.clientX+(l&&l.scrollLeft||f&&f.scrollLeft||0)-(l&&l.clientLeft||f&&f.clientLeft||0),u.pageY=e.clientY+(l&&l.scrollTop||f&&f.scrollTop||0)-(l&&l.clientTop||f&&f.clientTop||0)}return u.preventDefault=function(){u.isDefaultPrevented=we,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},u.stopPropagation=function(){u.isPropagationStopped=we,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},u.stopImmediatePropagation=function(){u.isImmediatePropagationStopped=we,u.stopPropagation()},0==((s=u).isDefaultPrevented===we||s.isDefaultPrevented===xe)&&(u.isDefaultPrevented=xe,u.isPropagationStopped=xe,u.isImmediatePropagationStopped=xe),"undefined"==typeof u.metaKey&&(u.metaKey=!1),u},ke=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},s=function(){i()&&(Ee(r,"readystatechange",s),a())},u=function(){try{r.documentElement.doScroll("left")}catch(e){return void ye.setTimeout(u)}a()};!r.addEventListener||me.ie&&me.ie<11?(Ne(r,"readystatechange",s),r.documentElement.doScroll&&e.self===e.top&&u()):i()?a():Ne(e,"DOMContentLoaded",a),Ne(e,"load",a)}},Te=function(){var e,t,n,r,o,i=this,a={};t="mce-data-"+(+new Date).toString(32),r="onmouseenter"in document.documentElement,n="onfocusin"in document.documentElement,o={mouseenter:"mouseover",mouseleave:"mouseout"},e=1,i.domLoaded=!1,i.events=a;var s=function(e,t){var n,r,o,i,s=a[t];if(n=s&&s[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};i.bind=function(u,c,l,f){var d,m,p,g,h,v,y,b=window,C=function(e){s(Se(e||b.event),d)};if(u&&3!==u.nodeType&&8!==u.nodeType){for(u[t]?d=u[t]:(d=e++,u[t]=d,a[d]={}),f=f||u,p=(c=c.split(" ")).length;p--;)v=C,h=y=!1,"DOMContentLoaded"===(g=c[p])&&(g="ready"),i.domLoaded&&"ready"===g&&"complete"===u.readyState?l.call(f,Se({type:g})):(r||(h=o[g])&&(v=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Se(e||b.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,s(e,d))}),n||"focusin"!==g&&"focusout"!==g||(y=!0,h="focusin"===g?"focus":"blur",v=function(e){(e=Se(e||b.event)).type="focus"===e.type?"focusin":"focusout",s(e,d)}),(m=a[d][g])?"ready"===g&&i.domLoaded?l({type:g}):m.push({func:l,scope:f}):(a[d][g]=m=[{func:l,scope:f}],m.fakeName=h,m.capture=y,m.nativeHandler=v,"ready"===g?ke(u,v,i):Ne(u,h||g,v,y)));return u=m=0,l}},i.unbind=function(e,n,r){var o,s,u,c,l,f;if(!e||3===e.nodeType||8===e.nodeType)return i;if(o=e[t]){if(f=a[o],n){for(u=(n=n.split(" ")).length;u--;)if(s=f[l=n[u]]){if(r)for(c=s.length;c--;)if(s[c].func===r){var d=s.nativeHandler,m=s.fakeName,p=s.capture;(s=s.slice(0,c).concat(s.slice(c+1))).nativeHandler=d,s.fakeName=m,s.capture=p,f[l]=s}r&&0!==s.length||(delete f[l],Ee(e,s.fakeName||l,s.nativeHandler,s.capture))}}else{for(l in f)s=f[l],Ee(e,s.fakeName||l,s.nativeHandler,s.capture);f={}}for(l in f)return i;delete a[o];try{delete e[t]}catch(g){e[t]=null}}return i},i.fire=function(e,n,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return i;(r=Se(null,r)).type=n,r.target=e;do{(o=e[t])&&s(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!r.isPropagationStopped());return i},i.clean=function(e){var n,r,o=i.unbind;if(!e||3===e.nodeType||8===e.nodeType)return i;if(e[t]&&o(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(o(e),n=(r=e.getElementsByTagName("*")).length;n--;)(e=r[n])[t]&&o(e);return i},i.destroy=function(){a={}},i.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};(Te.Event=new Te).bind(window,"ready",function(){});var Ae="sizzle"+-new Date,_e=window.document,Be=0,Re=0,De=ft(),Oe=ft(),Pe=ft(),Ie=function(e,t){return e===t&&(ie=!0),0},Le=typeof undefined,Me=1<<31,Fe={}.hasOwnProperty,ze=[],Ue=ze.pop,Ve=ze.push,He=ze.push,qe=ze.slice,je=ze.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},$e="[\\x20\\t\\r\\n\\f]",We="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Ke="\\["+$e+"*("+We+")(?:"+$e+"*([*^$|!~]?=)"+$e+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+We+"))|)"+$e+"*\\]",Xe=":("+We+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Ke+")*)|.*)\\)|)",Ye=new RegExp("^"+$e+"+|((?:^|[^\\\\])(?:\\\\.)*)"+$e+"+$","g"),Ge=new RegExp("^"+$e+"*,"+$e+"*"),Je=new RegExp("^"+$e+"*([>+~]|"+$e+")"+$e+"*"),Qe=new RegExp("="+$e+"*([^\\]'\"]*?)"+$e+"*\\]","g"),Ze=new RegExp(Xe),et=new RegExp("^"+We+"$"),tt={ID:new RegExp("^#("+We+")"),CLASS:new RegExp("^\\.("+We+")"),TAG:new RegExp("^("+We+"|[*])"),ATTR:new RegExp("^"+Ke),PSEUDO:new RegExp("^"+Xe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+$e+"*(even|odd|(([+-]|)(\\d*)n|)"+$e+"*(?:([+-]|)"+$e+"*(\\d+)|))"+$e+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+$e+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+$e+"*((?:-\\d)?\\d*)"+$e+"*\\)|)(?=[^-]|$)","i")},nt=/^(?:input|select|textarea|button)$/i,rt=/^h\d$/i,ot=/^[^{]+\{\s*\[native \w/,it=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,at=/[+~]/,st=/'|\\/g,ut=new RegExp("\\\\([\\da-f]{1,6}"+$e+"?|("+$e+")|.)","ig"),ct=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{He.apply(ze=qe.call(_e.childNodes),_e.childNodes),ze[_e.childNodes.length].nodeType}catch(yC){He={apply:ze.length?function(e,t){Ve.apply(e,qe.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var lt=function(e,t,n,r){var o,i,a,s,u,c,l,f,d,m;if((t?t.ownerDocument||t:_e)!==se&&ae(t),t=t||se,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(ce&&!r){if(o=it.exec(e))if(a=o[1]){if(9===s){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&de(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return He.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&G.getElementsByClassName)return He.apply(n,t.getElementsByClassName(a)),n}if(G.qsa&&(!le||!le.test(e))){if(f=l=Ae,d=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=ee(e),(l=t.getAttribute("id"))?f=l.replace(st,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",u=c.length;u--;)c[u]=f+bt(c[u]);d=at.test(e)&&vt(t.parentNode)||t,m=c.join(",")}if(m)try{return He.apply(n,d.querySelectorAll(m)),n}catch(p){}finally{l||t.removeAttribute("id")}}}return ne(e.replace(Ye,"$1"),t,n,r)};function ft(){var e=[];return function t(n,r){return e.push(n+" ")>J.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function dt(e){return e[Ae]=!0,e}function mt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Me)-(~e.sourceIndex||Me);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pt(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function gt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return dt(function(t){return t=+t,dt(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function vt(e){return e&&typeof e.getElementsByTagName!==Le&&e}for(Y in G=lt.support={},Z=lt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},ae=lt.setDocument=function(e){var t,n=e?e.ownerDocument||e:_e,r=n.defaultView;return n!==se&&9===n.nodeType&&n.documentElement?(se=n,ue=n.documentElement,ce=!Z(n),r&&r!==function(e){try{return e.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",function(){ae()},!1):r.attachEvent&&r.attachEvent("onunload",function(){ae()})),G.attributes=!0,G.getElementsByTagName=!0,G.getElementsByClassName=ot.test(n.getElementsByClassName),G.getById=!0,J.find.ID=function(e,t){if(typeof t.getElementById!==Le&&ce){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},J.filter.ID=function(e){var t=e.replace(ut,ct);return function(e){return e.getAttribute("id")===t}},J.find.TAG=G.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Le)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},J.find.CLASS=G.getElementsByClassName&&function(e,t){if(ce)return t.getElementsByClassName(e)},fe=[],le=[],G.disconnectedMatch=!0,le=le.length&&new RegExp(le.join("|")),fe=fe.length&&new RegExp(fe.join("|")),t=ot.test(ue.compareDocumentPosition),de=t||ot.test(ue.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Ie=t?function(e,t){if(e===t)return ie=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!G.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===_e&&de(_e,e)?-1:t===n||t.ownerDocument===_e&&de(_e,t)?1:oe?je.call(oe,e)-je.call(oe,t):0:4&r?-1:1)}:function(e,t){if(e===t)return ie=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,s=[e],u=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:oe?je.call(oe,e)-je.call(oe,t):0;if(i===a)return mt(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)u.unshift(r);for(;s[o]===u[o];)o++;return o?mt(s[o],u[o]):s[o]===_e?-1:u[o]===_e?1:0},n):se},lt.matches=function(e,t){return lt(e,null,null,t)},lt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==se&&ae(e),t=t.replace(Qe,"='$1']"),G.matchesSelector&&ce&&(!fe||!fe.test(t))&&(!le||!le.test(t)))try{var n=(void 0).call(e,t);if(n||G.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(yC){}return lt(t,se,null,[e]).length>0},lt.contains=function(e,t){return(e.ownerDocument||e)!==se&&ae(e),de(e,t)},lt.attr=function(e,t){(e.ownerDocument||e)!==se&&ae(e);var n=J.attrHandle[t.toLowerCase()],r=n&&Fe.call(J.attrHandle,t.toLowerCase())?n(e,t,!ce):undefined;return r!==undefined?r:G.attributes||!ce?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},lt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},lt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(ie=!G.detectDuplicates,oe=!G.sortStable&&e.slice(0),e.sort(Ie),ie){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return oe=null,e},Q=lt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Q(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Q(t);return n},(J=lt.selectors={cacheLength:50,createPseudo:dt,match:tt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ut,ct),e[3]=(e[3]||e[4]||e[5]||"").replace(ut,ct),"~="===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]||lt.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]&&lt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return tt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Ze.test(n)&&(t=ee(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ut,ct).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=De[e+" "];return t||(t=new RegExp("(^|"+$e+")"+e+"("+$e+"|$)"))&&De(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Le&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=lt.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,d,m,p,g=i!==a?"nextSibling":"previousSibling",h=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!u&&!s;if(h){if(i){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?h.firstChild:h.lastChild],a&&y){for(m=(c=(l=h[Ae]||(h[Ae]={}))[e]||[])[0]===Be&&c[1],d=c[0]===Be&&c[2],f=m&&h.childNodes[m];f=++m&&f&&f[g]||(d=m=0)||p.pop();)if(1===f.nodeType&&++d&&f===t){l[e]=[Be,m,d];break}}else if(y&&(c=(t[Ae]||(t[Ae]={}))[e])&&c[0]===Be)d=c[1];else for(;(f=++m&&f&&f[g]||(d=m=0)||p.pop())&&((s?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(y&&((f[Ae]||(f[Ae]={}))[e]=[Be,d]),f!==t)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=J.pseudos[e]||J.setFilters[e.toLowerCase()]||lt.error("unsupported pseudo: "+e);return r[Ae]?r(t):r.length>1?(n=[e,e,"",t],J.setFilters.hasOwnProperty(e.toLowerCase())?dt(function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=je.call(e,i[a])]=!(n[o]=i[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:dt(function(e){var t=[],n=[],r=te(e.replace(Ye,"$1"));return r[Ae]?dt(function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:dt(function(e){return function(t){return lt(e,t).length>0}}),contains:dt(function(e){return e=e.replace(ut,ct),function(t){return(t.textContent||t.innerText||Q(t)).indexOf(e)>-1}}),lang:dt(function(e){return et.test(e||"")||lt.error("unsupported lang: "+e),e=e.replace(ut,ct).toLowerCase(),function(t){var n;do{if(n=ce?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===ue},focus:function(e){return e===se.activeElement&&(!se.hasFocus||se.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!J.pseudos.empty(e)},header:function(e){return rt.test(e.nodeName)},input:function(e){return nt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[n<0?n+t:n]}),even:ht(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ht(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=J.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})J.pseudos[Y]=pt(Y);for(Y in{submit:!0,reset:!0})J.pseudos[Y]=gt(Y);function yt(){}function bt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Ct(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=Re++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var s,u,c=[Be,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||o){if((s=(u=t[Ae]||(t[Ae]={}))[r])&&s[0]===Be&&s[1]===i)return c[2]=s[2];if(u[r]=c,c[2]=e(t,n,a))return!0}}}function xt(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n,r,o){for(var i,a=[],s=0,u=e.length,c=null!=t;s<u;s++)(i=e[s])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(s)));return a}function Nt(e,t,n,r,o,i){return r&&!r[Ae]&&(r=Nt(r)),o&&!o[Ae]&&(o=Nt(o,i)),dt(function(i,a,s,u){var c,l,f,d=[],m=[],p=a.length,g=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)lt(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),h=!e||!i&&t?g:wt(g,d,e,s,u),v=n?o||(i?e:p||r)?[]:a:h;if(n&&n(h,v,s,u),r)for(c=wt(v,m),r(c,[],s,u),l=c.length;l--;)(f=c[l])&&(v[m[l]]=!(h[m[l]]=f));if(i){if(o||e){if(o){for(c=[],l=v.length;l--;)(f=v[l])&&c.push(h[l]=f);o(null,v=[],c,u)}for(l=v.length;l--;)(f=v[l])&&(c=o?je.call(i,f):d[l])>-1&&(i[c]=!(a[c]=f))}}else v=wt(v===a?v.splice(p,v.length):v),o?o(null,a,v,u):He.apply(a,v)})}function Et(e){for(var t,n,r,o=e.length,i=J.relative[e[0].type],a=i||J.relative[" "],s=i?1:0,u=Ct(function(e){return e===t},a,!0),c=Ct(function(e){return je.call(t,e)>-1},a,!0),l=[function(e,n,r){return!i&&(r||n!==re)||((t=n).nodeType?u(e,n,r):c(e,n,r))}];s<o;s++)if(n=J.relative[e[s].type])l=[Ct(xt(l),n)];else{if((n=J.filter[e[s].type].apply(null,e[s].matches))[Ae]){for(r=++s;r<o&&!J.relative[e[r].type];r++);return Nt(s>1&&xt(l),s>1&&bt(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(Ye,"$1"),n,s<r&&Et(e.slice(s,r)),r<o&&Et(e=e.slice(r)),r<o&&bt(e))}l.push(n)}return xt(l)}yt.prototype=J.filters=J.pseudos,J.setFilters=new yt,ee=lt.tokenize=function(e,t){var n,r,o,i,a,s,u,c=Oe[e+" "];if(c)return t?0:c.slice(0);for(a=e,s=[],u=J.preFilter;a;){for(i in n&&!(r=Ge.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(o=[])),n=!1,(r=Je.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Ye," ")}),a=a.slice(n.length)),J.filter)!(r=tt[i].exec(a))||u[i]&&!(r=u[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?lt.error(e):Oe(e,s).slice(0)},te=lt.compile=function(e,t){var n,r,o,i,a,s,u=[],c=[],l=Pe[e+" "];if(!l){for(t||(t=ee(e)),n=t.length;n--;)(l=Et(t[n]))[Ae]?u.push(l):c.push(l);(l=Pe(e,(r=c,i=(o=u).length>0,a=r.length>0,s=function(e,t,n,s,u){var c,l,f,d=0,m="0",p=e&&[],g=[],h=re,v=e||a&&J.find.TAG("*",u),y=Be+=null==h?1:Math.random()||.1,b=v.length;for(u&&(re=t!==se&&t);m!==b&&null!=(c=v[m]);m++){if(a&&c){for(l=0;f=r[l++];)if(f(c,t,n)){s.push(c);break}u&&(Be=y)}i&&((c=!f&&c)&&d--,e&&p.push(c))}if(d+=m,i&&m!==d){for(l=0;f=o[l++];)f(p,g,t,n);if(e){if(d>0)for(;m--;)p[m]||g[m]||(g[m]=Ue.call(s));g=wt(g)}He.apply(s,g),u&&!e&&g.length>0&&d+o.length>1&&lt.uniqueSort(s)}return u&&(Be=y,re=h),p},i?dt(s):s))).selector=e}return l},ne=lt.select=function(e,t,n,r){var o,i,a,s,u,c="function"==typeof e&&e,l=!r&&ee(e=c.selector||e);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&G.getById&&9===t.nodeType&&ce&&J.relative[i[1].type]){if(!(t=(J.find.ID(a.matches[0].replace(ut,ct),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=tt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!J.relative[s=a.type]);)if((u=J.find[s])&&(r=u(a.matches[0].replace(ut,ct),at.test(i[0].type)&&vt(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&bt(i)))return He.apply(n,r),n;break}}return(c||te(e,l))(r,t,!ce,n,at.test(e)&&vt(t.parentNode)||t),n},G.sortStable=Ae.split("").sort(Ie).join("")===Ae,G.detectDuplicates=!!ie,ae(),G.sortDetached=!0;var St=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},kt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},Tt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},At={isArray:St,toArray:function(e){var t,n,r=e;if(!St(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:kt,map:function(e,t){var n=[];return kt(e,function(r,o){n.push(t(r,o,e))}),n},filter:function(e,t){var n=[];return kt(e,function(r,o){t&&!t(r,o,e)||n.push(r)}),n},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:Tt,find:function(e,t,n){var r=Tt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},_t=/^\s*|\s*$/g,Bt=function(e){return null===e||e===undefined?"":(""+e).replace(_t,"")},Rt=function(e,t){return t?!("array"!==t||!At.isArray(e))||typeof e===t:e!==undefined},Dt=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),At.each(e,function(e,o){if(!1===t.call(r,e,o,n))return!1;Dt(e,t,n,r)}))},Ot={trim:Bt,isArray:At.isArray,is:Rt,toArray:At.toArray,makeMap:function(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:At.each,map:At.map,grep:At.filter,inArray:At.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s,u=arguments;for(n=1,r=u.length;n<r;n++)for(o in t=u[n])t.hasOwnProperty(o)&&(s=t[o])!==undefined&&(e[o]=s);return e},create:function(e,t,n){var r,o,i,a,s,u=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=u.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],u.extend(o[i].prototype,t),e[5]&&(r=u.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],s=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],s.apply(this,arguments)},o[i].prototype[i]=o[i],u.each(r,function(e,t){o[i].prototype[t]=r[t]}),u.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),u.each(t["static"],function(e,t){o[i][t]=e})}},walk:Dt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Rt(e,"array")?e:At.map(e.split(t||","),Bt)},_addCacheSuffix:function(e){var t=me.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Pt=document,It=Array.prototype.push,Lt=Array.prototype.slice,Mt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ft=Te.Event,zt=Ot.makeMap("children,contents,next,prev"),Ut=function(e){return void 0!==e},Vt=function(e){return"string"==typeof e},Ht=function(e,t){var n,r,o;for(o=(t=t||Pt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},qt=function(e,t,n,r){var o;if(Vt(t))t=Ht(t,rn(e[0]));else if(t.length&&!t.nodeType){if(t=Qt.makeArray(t),r)for(o=t.length-1;o>=0;o--)qt(e,t[o],n,r);else for(o=0;o<t.length;o++)qt(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},jt=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},$t=function(e,t,n){var r,o;return t=Qt(t)[0],e.each(function(){var e=this;n&&r===e.parentNode?o.appendChild(e):(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e),o.appendChild(e))}),e},Wt=Ot.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Kt=Ot.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Xt={"for":"htmlFor","class":"className",readonly:"readOnly"},Yt={"float":"cssFloat"},Gt={},Jt={},Qt=function(e,t){return new Qt.fn.init(e,t)},Zt=/^\s*|\s*$/g,en=function(e){return null===e||e===undefined?"":(""+e).replace(Zt,"")},tn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},nn=function(e,t){var n=[];return tn(e,function(e,r){t(r,e)&&n.push(r)}),n},rn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Pt};Qt.fn=Qt.prototype={constructor:Qt,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return Qt(e).attr(t);o.context=t=document}if(Vt(e)){if(o.selector=e,!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Mt.exec(e)))return Qt(t).find(e);if(n[1])for(r=Ht(e,rn(t)).firstChild;r;)It.call(o,r),r=r.nextSibling;else{if(!(r=rn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Ot.toArray(this)},add:function(e,t){var n,r,o=this;if(Vt(e))return o.add(Qt(e));if(!1!==t)for(n=Qt.unique(o.toArray().concat(Qt.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else It.apply(o,Qt.makeArray(e));return o},attr:function(e,t){var n,r=this;if("object"==typeof e)tn(e,function(e,t){r.attr(e,t)});else{if(!Ut(t)){if(r[0]&&1===r[0].nodeType){if((n=Gt[e])&&n.get)return n.get(r[0],e);if(Kt[e])return r.prop(e)?e:undefined;null===(t=r[0].getAttribute(e,2))&&(t=undefined)}return t}this.each(function(){var n;if(1===this.nodeType){if((n=Gt[e])&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Xt[e]||e))tn(e,function(e,t){n.prop(e,t)});else{if(!Ut(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(e,t){var n,r,o=this,i=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof e)tn(e,function(e,t){o.css(e,t)});else if(Ut(t))e=i(e),"number"!=typeof t||Wt[e]||(t=t.toString()+"px"),o.each(function(){var n=this.style;if((r=Jt[e])&&r.set)r.set(this,t);else{try{this.style[Yt[e]||e]=t}catch(o){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e))}});else{if(n=o[0],(r=Jt[e])&&r.get)return r.get(n);if(n.ownerDocument.defaultView)try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(s){return undefined}else if(n.currentStyle)return n.currentStyle[i(e)]}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Ft.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(Ut(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){Qt(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(Ut(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return qt(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return qt(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?qt(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?qt(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return Qt(e).append(this),this},prependTo:function(e){return Qt(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return $t(this,e)},wrapAll:function(e){return $t(this,e,!0)},wrapInner:function(e){return this.each(function(){Qt(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){Qt(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),Qt(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?tn(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var o,i;(i=jt(r,e))!==t&&(o=r.className,i?r.className=en((" "+o+" ").replace(" "+e+" "," ")):r.className+=o?" "+e:e)}),n)},hasClass:function(e){return jt(this[0],e)},each:function(e){return tn(this,e)},on:function(e,t){return this.each(function(){Ft.bind(this,e,t)})},off:function(e,t){return this.each(function(){Ft.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Ft.fire(this,e.type,e):Ft.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Qt(Lt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)Qt.find(e,this[t],r);return Qt(r)},filter:function(e){return Qt("function"==typeof e?nn(this.toArray(),function(t,n){return e(n,t)}):Qt.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof Qt&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&Qt(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode}}),Qt(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:It,sort:[].sort,splice:[].splice},Ot.extend(Qt,{extend:Ot.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Ot.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Ot.isArray,each:tn,trim:en,grep:nn,find:lt,expr:lt.selectors,unique:lt.uniqueSort,text:lt.getText,contains:lt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?Qt.find.matchesSelector(t[0],e)?[t[0]]:[]:Qt.find.matches(e,t)}});var on=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof Qt&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&Qt(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},an=function(e,t,n,r){var o=[];for(r instanceof Qt&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&Qt(e).is(r))break}o.push(e)}return o},sn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};tn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return on(e,"parentNode")},next:function(e){return sn(e,"nextSibling",1)},prev:function(e){return sn(e,"previousSibling",1)},children:function(e){return an(e.firstChild,"nextSibling",1)},contents:function(e){return Ot.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){Qt.fn[e]=function(n){var r=[];return this.each(function(){var e=t.call(r,this,n,r);e&&(Qt.isArray(e)?r.push.apply(r,e):r.push(e))}),this.length>1&&(zt[e]||(r=Qt.unique(r)),0===e.indexOf("parents")&&(r=r.reverse())),r=Qt(r),n?r.filter(n):r}}),tn({parentsUntil:function(e,t){return on(e,"parentNode",t)},nextUntil:function(e,t){return an(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return an(e,"previousSibling",1,t).slice(1)}},function(e,t){Qt.fn[e]=function(n,r){var o=[];return this.each(function(){var e=t.call(o,this,n,o);e&&(Qt.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=Qt.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=Qt(o),r?o.filter(r):o}}),Qt.fn.is=function(e){return!!e&&this.filter(e).length>0},Qt.fn.init.prototype=Qt.fn,Qt.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return Qt.extend(n,this),n};var un=function(e,t,n){tn(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})};me.ie&&me.ie<8&&(un(Gt,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),un(Gt,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),me.ie&&me.ie<9&&(Yt["float"]="styleFloat",un(Jt,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),Qt.attrHooks=Gt,Qt.cssHooks=Jt;var cn,ln,fn,dn,mn=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(null,arguments)),t}},pn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return hn(r(1),r(2))},gn=function(){return hn(0,0)},hn=function(e,t){return{major:e,minor:t}},vn={nu:hn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?gn():pn(e,n)},unknown:gn},yn="Firefox",bn=function(e,t){return function(){return t===e}},Cn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:bn("Edge",t),isChrome:bn("Chrome",t),isIE:bn("IE",t),isOpera:bn("Opera",t),isFirefox:bn(yn,t),isSafari:bn("Safari",t)}},xn={unknown:function(){return Cn({current:undefined,version:vn.unknown()})},nu:Cn,edge:y.constant("Edge"),chrome:y.constant("Chrome"),ie:y.constant("IE"),opera:y.constant("Opera"),firefox:y.constant(yn),safari:y.constant("Safari")},wn="Windows",Nn="Android",En="Solaris",Sn="FreeBSD",kn=function(e,t){return function(){return t===e}},Tn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:kn(wn,t),isiOS:kn("iOS",t),isAndroid:kn(Nn,t),isOSX:kn("OSX",t),isLinux:kn("Linux",t),isSolaris:kn(En,t),isFreeBSD:kn(Sn,t)}},An={unknown:function(){return Tn({current:undefined,version:vn.unknown()})},nu:Tn,windows:y.constant(wn),ios:y.constant("iOS"),android:y.constant(Nn),linux:y.constant("Linux"),osx:y.constant("OSX"),solaris:y.constant(En),freebsd:y.constant(Sn)},_n=function(e,t){var n=String(t).toLowerCase();return M.find(e,function(e){return e.search(n)})},Bn=function(e,t){return _n(e,t).map(function(e){var n=vn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Rn=function(e,t){return _n(e,t).map(function(e){var n=vn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Dn=function(e,t){return-1!==e.indexOf(t)},On=function(e){return e.replace(/^\s+|\s+$/g,"")},Pn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,In=function(e){return function(t){return Dn(t,e)}},Ln=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Dn(e,"edge/")&&Dn(e,"chrome")&&Dn(e,"safari")&&Dn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pn],search:function(e){return Dn(e,"chrome")&&!Dn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Dn(e,"msie")||Dn(e,"trident")}},{name:"Opera",versionRegexes:[Pn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:In("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:In("firefox")},{name:"Safari",versionRegexes:[Pn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Dn(e,"safari")||Dn(e,"mobile/"))&&Dn(e,"applewebkit")}}],Mn=[{name:"Windows",search:In("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Dn(e,"iphone")||Dn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:In("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:In("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:In("linux"),versionRegexes:[]},{name:"Solaris",search:In("sunos"),versionRegexes:[]},{name:"FreeBSD",search:In("freebsd"),versionRegexes:[]}],Fn={browsers:y.constant(Ln),oses:y.constant(Mn)},zn=function(e){var t,n,r,o,i,a,s,u,c,l,f,d=Fn.browsers(),m=Fn.oses(),p=Bn(d,e).fold(xn.unknown,xn.nu),g=Rn(m,e).fold(An.unknown,An.nu);return{browser:p,os:g,deviceType:(n=p,r=e,o=(t=g).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,s=t.isAndroid()&&4===t.version.major,u=o||a||s&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!u,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:y.constant(o),isiPhone:y.constant(i),isTablet:y.constant(u),isPhone:y.constant(l),isTouch:y.constant(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:y.constant(f)})}},Un={detect:mn(function(){var e=navigator.userAgent;return zn(e)})},Vn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:y.constant(e)}},Hn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return Vn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Vn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Vn(n)},fromDom:Vn,fromPoint:function(e,t,n){return E.from(e.dom().elementFromPoint(t,n)).map(Vn)}},qn=8,jn=9,$n=1,Wn=3,Kn=function(e){return e.dom().nodeName.toLowerCase()},Xn=function(e){return e.dom().nodeType},Yn=function(e){return function(t){return Xn(t)===e}},Gn=Yn($n),Jn=Yn(Wn),Qn=Yn(jn),Zn={name:Kn,type:Xn,value:function(e){return e.dom().nodeValue},isElement:Gn,isText:Jn,isDocument:Qn,isComment:function(e){return Xn(e)===qn||"#comment"===Kn(e)}},er=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(t)===e}},tr={isString:er("string"),isObject:er("object"),isArray:er("array"),isNull:er("null"),isBoolean:er("boolean"),isUndefined:er("undefined"),isFunction:er("function"),isNumber:er("number")},nr=(cn=Object.keys)===undefined?function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}:cn,rr=function(e,t){for(var n=nr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},or=function(e,t){var n={};return rr(e,function(r,o){var i=t(r,o,e);n[i.k]=i.v}),n},ir=function(e,t){var n=[];return rr(e,function(e,r){n.push(t(e,r))}),n},ar=function(e){return ir(e,function(e){return e})},sr={bifilter:function(e,t){var n={},r={};return rr(e,function(e,o){(t(e,o)?n:r)[o]=e}),{t:n,f:r}},each:rr,map:function(e,t){return or(e,function(e,n,r){return{k:n,v:t(e,n,r)}})},mapToArray:ir,tupleMap:or,find:function(e,t){for(var n=nr(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return E.some(a)}return E.none()},keys:nr,values:ar,size:function(e){return ar(e).length}},ur=function(e,t,n){if(!(tr.isString(n)||tr.isBoolean(n)||tr.isNumber(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},cr=function(e,t,n){ur(e.dom(),t,n)},lr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},fr=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},dr={clone:function(e){return M.foldl(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:cr,setAll:function(e,t){var n=e.dom();sr.each(t,function(e,t){ur(n,t,e)})},get:lr,has:fr,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(e,t,n){Zn.isElement(e)&&Zn.isElement(t)&&M.each(n,function(n){var r,o,i;o=t,fr(r=e,i=n)&&!fr(o,i)&&cr(o,i,lr(r,i))})}},mr=mn(function(){return pr(Hn.fromDom(document))}),pr=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return Hn.fromDom(t)},gr={body:mr,getBody:pr,inBody:function(e){var t=Zn.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},hr=function(e){return e.style!==undefined},vr=function(e,t,n){if(!tr.isString(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);hr(e)&&e.style.setProperty(t,n)},yr=function(e,t){return hr(e)?e.style.getPropertyValue(t):""},br=function(e,t){var n=e.dom();sr.each(t,function(e,t){vr(n,t,e)})},Cr=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||gr.inBody(e)?r:yr(n,t);return null===o?undefined:o},xr=function(){var e=arguments;return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return M.each(e,function(e,n){r[e]=y.constant(t[n])}),r}},wr=function(e,t){var n=[],r=function(e){return n.push(e),t(e)},o=t(e);do{o=o.bind(r)}while(o.isSome());return n},Nr=function(){return V("Node")},Er=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Sr=function(e,t){return Er(e,t,Nr().DOCUMENT_POSITION_CONTAINED_BY)},kr=$n,Tr=jn,Ar=function(e){return e.nodeType!==kr&&e.nodeType!==Tr||0===e.childElementCount},_r={all:function(e,t){var n=t===undefined?document:t.dom();return Ar(n)?[]:M.map(n.querySelectorAll(e),Hn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==kr)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Ar(n)?E.none():E.from(n.querySelector(e)).map(Hn.fromDom)}},Br=function(e,t){return e.dom()===t.dom()},Rr=Un.detect().browser.isIE()?function(e,t){return Sr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Dr={eq:Br,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return M.exists(t,y.curry(Br,e))},contains:Rr,is:_r.is},Or=function(e){return Hn.fromDom(e.dom().ownerDocument)},Pr=function(e){var t=e.dom();return E.from(t.parentNode).map(Hn.fromDom)},Ir=function(e){var t=e.dom();return E.from(t.previousSibling).map(Hn.fromDom)},Lr=function(e){var t=e.dom();return E.from(t.nextSibling).map(Hn.fromDom)},Mr=function(e){var t=e.dom();return M.map(t.childNodes,Hn.fromDom)},Fr=function(e,t){var n=e.dom().childNodes;return E.from(n[t]).map(Hn.fromDom)},zr=xr("element","offset"),Ur={owner:Or,defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return Hn.fromDom(t)},documentElement:function(e){var t=Or(e);return Hn.fromDom(t.dom().documentElement)},parent:Pr,findIndex:function(e){return Pr(e).bind(function(t){var n=Mr(t);return M.findIndex(n,function(t){return Dr.eq(e,t)})})},parents:function(e,t){for(var n=tr.isFunction(t)?t:y.constant(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Hn.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(e){return Pr(e).map(Mr).map(function(t){return M.filter(t,function(t){return!Dr.eq(e,t)})}).getOr([])},prevSibling:Ir,offsetParent:function(e){var t=e.dom();return E.from(t.offsetParent).map(Hn.fromDom)},prevSiblings:function(e){return M.reverse(wr(e,Ir))},nextSibling:Lr,nextSiblings:function(e){return wr(e,Lr)},children:Mr,child:Fr,firstChild:function(e){return Fr(e,0)},lastChild:function(e){return Fr(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=Mr(e);return n.length>0&&t<n.length?zr(n[t],0):zr(e,t)}},Vr=Un.detect().browser,Hr=function(e){return M.find(e,Zn.isElement)},qr=function(e,t,n){var r,o,i,a=0,s=0,u=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Cr(Hn.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(u.documentElement.scrollLeft||e.scrollLeft)-u.documentElement.clientLeft,y:s=o.top+(u.documentElement.scrollTop||e.scrollTop)-u.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,s+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,s-=r.scrollTop||0,r=r.parentNode;s+=(i=Hn.fromDom(t),Vr.isFirefox()&&"table"===Zn.name(i)?Hr(Ur.children(i)).filter(function(e){return"caption"===Zn.name(e)}).bind(function(e){return Hr(Ur.nextSiblings(e)).map(function(t){var n=t.dom().offsetTop,r=e.dom().offsetTop,o=e.dom().offsetHeight;return n<=r?-o:0})}).getOr(0):0)}return{x:a,y:s}},jr=function(e){var t=E.none(),n=[],r=function(e){o()?a(e):n.push(e)},o=function(){return t.isSome()},i=function(e){M.each(e,a)},a=function(e){t.each(function(t){setTimeout(function(){e(t)},0)})};return e(function(e){t=E.some(e),i(n),n=[]}),{get:r,map:function(e){return jr(function(t){r(function(n){t(e(n))})})},isReady:o}},$r={nu:jr,pure:function(e){return jr(function(t){t(e)})}},Wr=function(e){return function(){var t=Array.prototype.slice.call(arguments),n=this;setTimeout(function(){e.apply(n,t)},0)}},Kr=function(e){var t=function(t){e(Wr(t))};return{map:function(e){return Kr(function(n){t(function(t){var r=e(t);n(r)})})},bind:function(e){return Kr(function(n){t(function(t){e(t).get(n)})})},anonBind:function(e){return Kr(function(n){t(function(t){e.get(n)})})},toLazy:function(){return $r.nu(t)},get:t}},Xr={nu:Kr,pure:function(e){return Kr(function(t){t(e)})}},Yr=function(e,t){return t(function(t){var n=[],r=0;0===e.length?t([]):M.each(e,function(o,i){var a;o.get((a=i,function(o){n[a]=o,++r>=e.length&&t(n)}))})})},Gr=function(e){return Yr(e,Xr.nu)},Jr=Gr,Qr=function(e){return{is:function(t){return e===t},isValue:y.constant(!0),isError:y.constant(!1),getOr:y.constant(e),getOrThunk:y.constant(e),getOrDie:y.constant(e),or:function(t){return Qr(e)},orThunk:function(t){return Qr(e)},fold:function(t,n){return n(e)},map:function(t){return Qr(t(e))},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return E.some(e)}}},Zr=function(e){return{is:y.constant(!1),isValue:y.constant(!1),isError:y.constant(!0),getOr:y.identity,getOrThunk:function(e){return e()},getOrDie:function(){return y.die(e)()},or:function(e){return e},orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return Zr(e)},each:y.noop,bind:function(t){return Zr(e)},exists:y.constant(!1),forall:y.constant(!0),toOption:E.none}},eo={value:Qr,error:Zr},to=function(e,t){var n=e,r=function(e,n,r,o){var i,a;if(e){if(!o&&e[n])return e[n];if(e!==t){if(i=e[r])return i;for(a=e.parentNode;a&&a!==t;a=a.parentNode)if(i=a[r])return i}}};this.current=function(){return n},this.next=function(e){return n=r(n,"firstChild","nextSibling",e)},this.prev=function(e){return n=r(n,"lastChild","previousSibling",e)},this.prev2=function(e){return n=function(e,n,r,o){var i,a,s;if(e){if(i=e[r],t&&i===t)return;if(i){if(!o)for(s=i[n];s;s=s[n])if(!s[n])return s;return i}if((a=e.parentNode)&&a!==t)return a}}(n,"lastChild","previousSibling",e)}},no=function(e){var t;return function(n){return(t=t||M.mapToObject(e,y.constant(!0))).hasOwnProperty(Zn.name(n))}},ro=no(["h1","h2","h3","h4","h5","h6"]),oo=no(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),io={isBlock:oo,isInline:function(e){return Zn.isElement(e)&&!oo(e)},isHeading:ro,isTextBlock:no(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),isList:no(["ul","ol","dl"]),isListItem:no(["li","dd","dt"]),isVoid:no(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),isTableSection:no(["thead","tbody","tfoot"]),isTableCell:no(["td","th"]),isBr:function(e){return Zn.isElement(e)&&"br"===Zn.name(e)}},ao=function(e){return function(t){return!!t&&t.nodeType===e}},so=ao(1),uo=function(e){var t=e.toLowerCase().split(" ");return function(e){var n,r;if(e&&e.nodeType)for(r=e.nodeName.toLowerCase(),n=0;n<t.length;n++)if(r===t[n])return!0;return!1}},co=function(e){return function(t){if(so(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},lo=ao(3),fo=ao(8),mo=ao(9),po=uo("br"),go=co("true"),ho=co("false"),vo={isText:lo,isElement:so,isComment:fo,isDocument:mo,isBr:po,isContentEditableTrue:go,isContentEditableFalse:ho,matchNodeNames:uo,hasPropValue:function(e,t){return function(n){return so(n)&&n[e]===t}},hasAttribute:function(e,t){return function(t){return so(t)&&t.hasAttribute(e)}},hasAttributeValue:function(e,t){return function(n){return so(n)&&n.getAttribute(e)===t}},matchStyleValues:function(e,t){var n=t.toLowerCase().split(" ");return function(t){var r;if(so(t))for(r=0;r<n.length;r++)if(t.ownerDocument.defaultView.getComputedStyle(t,null).getPropertyValue(e)===n[r])return!0;return!1}},isBogus:function(e){return so(e)&&e.hasAttribute("data-mce-bogus")}},yo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},bo=function(e,t){var n,r=t.childNodes;if(!vo.isElement(t)||!yo(t)){for(n=r.length-1;n>=0;n--)bo(e,r[n]);if(!1===vo.isDocument(t)){if(vo.isText(t)&&t.nodeValue.length>0){var o=Ot.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||o>0)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,s=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&s))return}else if(vo.isElement(t)&&(1===(r=t.childNodes).length&&yo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||io.isVoid(Hn.fromDom(t))))return;e.remove(t)}var i,a,s;return t}},Co={trimNode:bo},xo=Ot.makeMap,wo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,No=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Eo=/[<>&\"\']/g,So=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,ko={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};fn={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},dn={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};var To=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),fn[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};ln=To("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var Ao={encodeRaw:function(e,t){return e.replace(t?wo:No,function(e){return fn[e]||e})},encodeAllRaw:function(e){return(""+e).replace(Eo,function(e){return fn[e]||e})},encodeNumeric:function(e,t){return e.replace(t?wo:No,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":fn[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||ln,e.replace(t?wo:No,function(e){return fn[e]||n[e]||e})},getEncodeFunc:function(e,t){return t=To(t)||ln,(e=xo(e.replace(/\+/g,","))).named&&e.numeric?function(e,n){return e.replace(n?wo:No,function(e){return fn[e]!==undefined?fn[e]:t[e]!==undefined?t[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:e.named?t?function(e,n){return Ao.encodeNamed(e,n,t)}:Ao.encodeNamed:e.numeric?Ao.encodeNumeric:Ao.encodeRaw},decode:function(e){return e.replace(So,function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):ko[t]||String.fromCharCode(t):dn[e]||ln[e]||(n=e,(r=Hn.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},_o={},Bo={},Ro=Ot.makeMap,Do=Ot.each,Oo=Ot.extend,Po=Ot.explode,Io=Ot.inArray,Lo=function(e,t){return(e=Ot.trim(e))?e.split(t||" "):[]},Mo=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),Do(e,function(e,r){n[r]=n[r.toUpperCase()]="map"===t?Ro(e,/[, ]/):Po(e,/[, ]/)})),n},Fo=function(e){var t,n,r,o,i,a,s,u,c,l,f,d,m,p,g,h,v,y,b,C,x,w,N,E={},S={},k={},T=[],A={},_={},B=function(t,n,r){var o=e[t];return o?o=Ro(o,/[, ]/,Ro(o.toUpperCase(),/[, ]/)):(o=_o[t])||(o=Ro(n," ",Ro(n.toUpperCase()," ")),o=Oo(o,r),_o[t]=o),o};p=(e=e||{}).schema,x={},w=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(n=n||[],t=t||"","string"==typeof n&&(n=Lo(n)),r=(e=Lo(e)).length;r--;)i={attributes:a(o=Lo([g,t].join(" "))),attributesOrder:o,children:a(n,Bo)},x[e[r]]=i},N=function(e,t){var n,r,o,i;for(n=(e=Lo(e)).length,t=Lo(t);n--;)for(r=x[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])},r=_o[p]?_o[p]:(g="id accesskey class dir lang style tabindex title role",h="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",v="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==p&&(g+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",h+=" article aside details dialog figure header footer hgroup section nav",v+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==p&&(g+=" xml:lang",v=[v,C="acronym applet basefont big font strike tt"].join(" "),Do(Lo(C),function(e){w(e,"",v)}),h=[h,b="center dir isindex noframes"].join(" "),y=[h,v].join(" "),Do(Lo(b),function(e){w(e,"",y)})),y=y||[h,v].join(" "),w("html","manifest","head body"),w("head","","base command link meta noscript script style title"),w("title hr noscript br"),w("base","href target"),w("link","href rel media hreflang type sizes hreflang"),w("meta","name http-equiv content charset"),w("style","media type scoped"),w("script","src async defer type charset"),w("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",y),w("address dt dd div caption","",y),w("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",v),w("blockquote","cite",y),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",y),w("dl","","dt dd"),w("a","href target rel media hreflang type",v),w("q","cite",v),w("ins del","cite datetime",y),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",y),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[y,"param"].join(" ")),w("param","name value"),w("map","name",[y,"area"].join(" ")),w("area","alt coords shape href target rel media hreflang type"),w("table","border","caption colgroup thead tfoot tbody tr"+("html4"===p?" col":"")),w("colgroup","span","col"),w("col","span"),w("tbody thead tfoot","","tr"),w("tr","","td th"),w("td","colspan rowspan headers",y),w("th","colspan rowspan headers scope abbr",y),w("form","accept-charset action autocomplete enctype method name novalidate target",y),w("fieldset","disabled form name",[y,"legend"].join(" ")),w("label","form for",v),w("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),w("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===p?y:v),w("select","disabled form multiple name required size","option optgroup"),w("optgroup","disabled label","option"),w("option","disabled label selected value"),w("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),w("menu","type label",[y,"li"].join(" ")),w("noscript","",y),"html4"!==p&&(w("wbr"),w("ruby","",[v,"rt rp"].join(" ")),w("figcaption","",y),w("mark rt rp summary bdi","",v),w("canvas","width height",y),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[y,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[y,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[v,"option"].join(" ")),w("article section nav aside header footer","",y),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[y,"figcaption"].join(" ")),w("time","datetime",v),w("dialog","open",y),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",v),w("progress","value max",v),w("meter","value min max low high optimum",v),w("details","open",[y,"summary"].join(" ")),w("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==p&&(N("script","language xml:space"),N("style","xml:space"),N("object","declare classid code codebase codetype archive standby align border hspace vspace"),N("embed","align name hspace vspace"),N("param","valuetype type"),N("a","charset name rev shape coords"),N("br","clear"),N("applet","codebase archive code object alt name width height align hspace vspace"),N("img","name longdesc align border hspace vspace"),N("iframe","longdesc frameborder marginwidth marginheight scrolling align"),N("font basefont","size color face"),N("input","usemap align"),N("select","onchange"),N("textarea"),N("h1 h2 h3 h4 h5 h6 div p legend caption","align"),N("ul","type compact"),N("li","type"),N("ol dl menu dir","compact"),N("pre","width xml:space"),N("hr","align noshade size width"),N("isindex","prompt"),N("table","summary width frame rules cellspacing cellpadding align bgcolor"),N("col","width align char charoff valign"),N("colgroup","width align char charoff valign"),N("thead","align char charoff valign"),N("tr","align char charoff valign bgcolor"),N("th","axis align char charoff valign nowrap bgcolor width height"),N("form","accept"),N("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),N("tfoot","align char charoff valign"),N("tbody","align char charoff valign"),N("area","nohref"),N("body","background bgcolor text link vlink alink")),"html4"!==p&&(N("input button select textarea","autofocus"),N("input textarea","placeholder"),N("a","download"),N("link script img","crossorigin"),N("iframe","sandbox seamless allowfullscreen")),Do(Lo("a form meter progress dfn"),function(e){x[e]&&delete x[e].children[e]}),delete x.caption.children.table,delete x.script,_o[p]=x,x),!1===e.verify_html&&(e.valid_elements="*[*]"),t=Mo(e.valid_styles),n=Mo(e.invalid_styles,"map"),u=Mo(e.valid_classes,"map"),o=B("whitespace_elements","pre script noscript style textarea video audio iframe object code"),i=B("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=B("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),s=B("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=B("non_empty_elements","td th iframe video audio object script pre code",a),f=B("move_caret_before_on_enter_elements","table",l),d=B("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),c=B("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",d),m=B("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Do((e.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){_[e]=new RegExp("</"+e+"[^>]*>","gi")});var R=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},D=function(e){var t,n,r,o,i,a,s,u,c,l,f,d,m,p,g,h,v,y,b,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=Lo(e,","),S["@"]&&(h=S["@"].attributes,v=S["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(p=i[1],c=i[2],g=i[3],u=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===p&&(a.paddEmpty=!0),"-"===p&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(y in h)d[y]=h[y];m.push.apply(m,v)}if(u)for(r=0,o=(u=Lo(u,"|")).length;r<o;r++)if(i=x.exec(u[r])){if(s={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),p=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),s.required=!0),"-"===f){delete d[l],m.splice(Io(m,l),1);continue}p&&("="===p&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),s.defaultValue=b),":"===p&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),s.forcedValue=b),"<"===p&&(s.validValues=Ro(b,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],s.pattern=R(l),a.attributePatterns.push(s)):(d[l]||m.push(l),d[l]=s)}h||"@"!==c||(h=d,v=m),g&&(a.outputName=c,S[g]=a),w.test(c)?(a.pattern=R(c),T.push(a)):S[c]=a}},O=function(e){S={},T=[],D(e),Do(r,function(e,t){k[t]=e.children})},P=function(e){var t=/^(~)?(.+)$/;e&&(_o.text_block_elements=_o.block_elements=null,Do(Lo(e,","),function(e){var n=t.exec(e),r="~"===n[1],o=r?"span":"div",i=n[2];if(k[i]=k[o],A[i]=o,r||(c[i.toUpperCase()]={},c[i]={}),!S[i]){var a=S[o];delete(a=Oo({},a)).removeEmptyAttrs,delete a.removeEmpty,S[i]=a}Do(k,function(e,t){e[o]&&(k[t]=e=Oo({},k[t]),e[i]=e[o])})}))},I=function(t){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;_o[e.schema]=null,t&&Do(Lo(t,","),function(e){var t,r,o=n.exec(e);o&&(r=o[1],t=r?k[o[2]]:k[o[2]]={"#comment":{}},t=k[o[2]],Do(Lo(o[3],"|"),function(e){"-"===r?delete t[e]:t[e]={}}))})},L=function(e){var t,n=S[e];if(n)return n;for(t=T.length;t--;)if((n=T[t]).pattern.test(e))return n};return e.valid_elements?O(e.valid_elements):(Do(r,function(e,t){S[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},k[t]=e.children}),"html5"!==e.schema&&Do(Lo("strong/b em/i"),function(e){e=Lo(e,"/"),S[e[1]].outputName=e[0]}),Do(Lo("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){S[e]&&(S[e].removeEmpty=!0)}),Do(Lo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){S[e].paddEmpty=!0}),Do(Lo("span"),function(e){S[e].removeEmptyAttrs=!0})),P(e.custom_elements),I(e.valid_children),D(e.extended_valid_elements),I("+ol[ul|ol],+ul[ul|ol]"),Do({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){S[t]&&(S[t].parentsRequired=Lo(e))}),e.invalid_elements&&Do(Po(e.invalid_elements),function(e){S[e]&&delete S[e]}),L("span")||D("span[!data-mce-type|*]"),E.children=k,E.getValidStyles=function(){return t},E.getInvalidStyles=function(){return n},E.getValidClasses=function(){return u},E.getBoolAttrs=function(){return s},E.getBlockElements=function(){return c},E.getTextBlockElements=function(){return d},E.getTextInlineElements=function(){return m},E.getShortEndedElements=function(){return a},E.getSelfClosingElements=function(){return i},E.getNonEmptyElements=function(){return l},E.getMoveCaretBeforeOnEnterElements=function(){return f},E.getWhiteSpaceElements=function(){return o},E.getSpecialElements=function(){return _},E.isValidChild=function(e,t){var n=k[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},E.isValid=function(e,t){var n,r,o=L(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},E.getElementRule=L,E.getCustomElements=function(){return A},E.addValidElements=D,E.setValidElements=O,E.addCustomElements=P,E.addValidChildren=I,E.elements=S,E},zo=function(e,t){var n,r,o,i,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,s=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,u=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,l={},f="\ufeff";for(e=e||{},t&&(o=t.getValidStyles(),i=t.getInvalidStyles()),r=("\\\" \\' \\; \\: ; : "+f).split(" "),n=0;n<r.length;n++)l[r[n]]=f+n,l[f+n]=r[n];var d=function(e,t,n,r){var o=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+o(t)+o(n)+o(r)};return{toHex:function(e){return e.replace(a,d)},parse:function(t){var r,o,i,m,p,g,h,v,y={},b=e.url_converter,C=e.url_converter_scope||this,x=function(e,t,r){var o,i,a,s;if((o=y[e+"-top"+t])&&(i=y[e+"-right"+t])&&(a=y[e+"-bottom"+t])&&(s=y[e+"-left"+t])){var u=[o,i,a,s];for(n=u.length-1;n--&&u[n]===u[n+1];);n>-1&&r||(y[e+t]=-1===n?u[0]:u.join(" "),delete y[e+"-top"+t],delete y[e+"-right"+t],delete y[e+"-bottom"+t],delete y[e+"-left"+t])}},w=function(e){var t,n=y[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return y[e]=n[0],!0}},N=function(e){return m=!0,l[e]},E=function(e,t){return m&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return l[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},S=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},k=function(e){return e.replace(/\\[0-9a-f]+/gi,S)},T=function(t,n,r,o,i,a){if(i=i||a)return"'"+(i=E(i)).replace(/\'/g,"\\'")+"'";if(n=E(n||r||o),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return b&&(n=b.call(C,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,N).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,N)});r=u.exec(t);)if(u.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),i=r[2].replace(c,""),o&&i){if(o=k(o),i=k(i),-1!==o.indexOf(f)||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(i)))continue;"font-weight"===o&&"700"===i?i="bold":"color"!==o&&"background-color"!==o||(i=i.toLowerCase()),i=(i=i.replace(a,d)).replace(s,T),y[o]=m?E(i,!0):i}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),p="border",h="border-style",v="border-color",w(g="border-width")&&w(h)&&w(v)&&(y[p]=y[g]+" "+y[h]+" "+y[v],delete y[g],delete y[h],delete y[v]),"medium none"===y.border&&delete y.border,"none"===y["border-image"]&&delete y["border-image"]}return y},serialize:function(e,t){var n,r,a,s,u,c="",l=function(t){var n,r,i,a;if(n=o[t])for(r=0,i=n.length;r<i;r++)t=n[r],(a=e[t])&&(c+=(c.length>0?" ":"")+t+": "+a+";")};if(t&&o)l("*"),l(t);else for(n in e)!(r=e[n])||i&&(a=n,s=t,u=void 0,(u=i["*"])&&u[a]||(u=i[s])&&u[a])||(c+=(c.length>0?" ":"")+n+": "+r+";");return c}}},Uo=Ot.each,Vo=Ot.is,Ho=Ot.grep,qo=me.ie,jo=/^([a-z0-9],?)+$/i,$o=/^[ \t\r\n]*$/,Wo=function(e,t){var n=t.attr("style");(n=e.serializeStyle(e.parseStyle(n),t[0].nodeName))||(n=null),t.attr("data-mce-style",n)},Ko=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o},Xo=function(e,t){var n,r,o,i,a,s,u=this;u.doc=e,u.win=window,u.files={},u.counter=0,u.stdMode=!qo||e.documentMode>=8,u.boxModel=!qo||"CSS1Compat"===e.compatMode||u.stdMode,u.styleSheetLoader=function(e,t){var n,r=0,o={};n=(t=t||{}).maxLoadTime||5e3;var i=function(t){e.getElementsByTagName("head")[0].appendChild(t)},a=function(t,a,s){var u,c,l,f,d=function(){for(var e=f.passed,t=e.length;t--;)e[t]();f.status=2,f.passed=[],f.failed=[]},m=function(){for(var e=f.failed,t=e.length;t--;)e[t]();f.status=3,f.passed=[],f.failed=[]},p=function(e,t){e()||((new Date).getTime()-l<n?ye.setTimeout(t):m())},g=function(){p(function(){for(var t,n,r=e.styleSheets,o=r.length;o--;)if((n=(t=r[o]).ownerNode?t.ownerNode:t.owningElement)&&n.id===u.id)return d(),!0},g)},h=function(){p(function(){try{var e=c.sheet.cssRules;return d(),!!e}catch(t){}},h)};if(t=Ot._addCacheSuffix(t),o[t]?f=o[t]:(f={passed:[],failed:[]},o[t]=f),a&&f.passed.push(a),s&&f.failed.push(s),1!==f.status)if(2!==f.status)if(3!==f.status){if(f.status=1,(u=e.createElement("link")).rel="stylesheet",u.type="text/css",u.id="u"+r++,u.async=!1,u.defer=!1,l=(new Date).getTime(),"onload"in u&&!((v=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(v[1],10)<536))u.onload=g,u.onerror=m;else{if(navigator.userAgent.indexOf("Firefox")>0)return(c=e.createElement("style")).textContent='@import "'+t+'"',h(),void i(c);g()}var v;i(u),u.href=t}else m();else d()},s=function(e){return Xr.nu(function(t){a(e,y.compose(t,y.constant(eo.value(e))),y.compose(t,y.constant(eo.error(e))))})},u=function(e){return e.fold(y.identity,y.identity)};return{load:a,loadAll:function(e,t,n){Jr(M.map(e,s)).get(function(e){var r=M.partition(e,function(e){return e.isValue()});r.fail.length>0?n(r.fail.map(u)):t(r.pass.map(u))})}}}(e),u.boundEvents=[],u.settings=t=t||{},u.schema=t.schema?t.schema:Fo({}),u.styles=zo({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),u.fixDoc(e),u.events=t.ownEvents?new Te(t.proxy):Te.Event,u.attrHooks=(r=u,a={},s=(o=t).keep_values,i={set:function(e,t,n){o.url_converter&&(t=o.url_converter.call(o.url_converter_scope||r,t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},a={style:{set:function(e,t){null===t||"object"!=typeof t?(s&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=r.serializeStyle(r.parseStyle(t),e[0].nodeName)}}},s&&(a.href=a.src=i),a),n=u.schema.getBlockElements(),u.$=Qt.overrideDefaults(function(){return{context:e,element:u.getRoot()}}),u.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!n[e.nodeName]):!!n[e]}};Xo.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){},clone:function(e,t){var n,r,o=this;return!qo||1!==e.nodeType||t?e.cloneNode(t):(r=o.doc,t?n.firstChild:(n=r.createElement(e.nodeName),Uo(o.getAttribs(e),function(t){o.setAttrib(n,t.nodeName,o.getAttrib(e,t.nodeName))}),n))},getRoot:function(){return this.settings.root_element||this.doc.body},getViewPort:function(e){var t,n;return t=(e=e||this.win).document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t,n;return e=this.get(e),t=this.getPos(e),n=this.getSize(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:function(e){var t,n;return e=this.get(e),t=this.getStyle(e,"width"),n=this.getStyle(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,t,n,r){var o,i=this,a=[];for(e=i.get(e),r=r===undefined,n=n||("BODY"!==i.getRoot().nodeName?i.getRoot().parentNode:null),Vo(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return i.is(e,o)});e&&e!==n&&e.nodeType&&9!==e.nodeType;){if(!t||t(e)){if(!r)return e;a.push(e)}e=e.parentNode}return r?a:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,(e=this.doc.getElementById(e))&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(e,t){return lt(e,this.get(t)||this.settings.root_element||this.doc,[])},is:function(e,t){var n;if(!e)return!1;if(e.length===undefined){if("*"===t)return 1===e.nodeType;if(jo.test(t)){for(t=t.toLowerCase().split(/,/),e=e.nodeName.toLowerCase(),n=t.length-1;n>=0;n--)if(t[n]===e)return!0;return!1}}if(e.nodeType&&1!==e.nodeType)return!1;var r=e.nodeType?[e]:e;return lt(t,r[0].ownerDocument||r[0],null,r).length>0},add:function(e,t,n,r,o){var i=this;return this.run(e,function(e){var a;return a=Vo(t,"string")?i.doc.createElement(t):t,i.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):i.setHTML(a,r)),o?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+this.encode(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n,r,o=this.doc;for(r=o.createElement("div"),t=o.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&Wo(this,e)},getStyle:function(e,t,n){return e=this.$$(e),n?e.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=me.ie&&me.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[t]:undefined)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&Wo(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r,o,i=this.settings;""===n&&(n=null),r=(e=this.$$(e)).attr(t),e.length&&((o=this.attrHooks[t])&&o.set?o.set(e,n,t):e.attr(t,n),r!==n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){Uo(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r,o;return(e=this.$$(e)).length&&(o=(r=this.attrHooks[t])&&r.get?r.get(e,t):e.attr(t)),void 0===o&&(o=n||""),o},getPos:function(e,t){return qr(this.doc.body,this.get(e),t)},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t,n,r=this.doc;if(this!==Xo.DOM&&r===document){var o=Xo.DOM.addedStyles;if((o=o||[])[e])return;o[e]=!0,Xo.DOM.addedStyles=o}(n=r.getElementById("mceDefaultStyles"))||((n=r.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=r.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(r.createTextNode(e))},loadCSS:function(e){var t,n=this,r=n.doc;n===Xo.DOM||r!==document?(e||(e=""),t=r.getElementsByTagName("head")[0],Uo(e.split(","),function(e){var o;e=Ot._addCacheSuffix(e),n.files[e]||(n.files[e]=!0,o=n.create("link",{rel:"stylesheet",href:e}),qo&&r.documentMode&&r.recalc&&(o.onload=function(){r.recalc&&r.recalc(),o.onload=null}),t.appendChild(o))})):Xo.DOM.loadCSS(e)},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,n){this.$$(e).toggleClass(t,n).each(function(){""===this.className&&Qt(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"===this.$$(e).css("display")},uniqueId:function(e){return(e||"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),qo?e.each(function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild)}catch(r){Qt("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n)}return t}}):e.html(t)},getOuterHTML:function(e){return 1===(e=this.get(e)).nodeType&&"outerHTML"in e?e.outerHTML:Qt("<div></div>").append(Qt(e).clone()).html()},setOuterHTML:function(e,t){var n=this;n.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}n.remove(Qt(this).html(t),!0)})},decode:Ao.decode,encode:Ao.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,(r=t.nextSibling)?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){return this.run(t,function(t){return Vo(t,"array")&&(e=e.cloneNode(!0)),n&&Uo(Ho(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n,r=this;return e.nodeName!==t.toUpperCase()&&(n=r.create(t),Uo(r.getAttribs(e),function(t){r.setAttrib(n,t.nodeName,r.getAttrib(e,t.nodeName))}),r.replace(n,e,1)),n||e},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return this.styles.toHex(Ot.trim(e))},run:function(e,t,n){var r,o=this;return"string"==typeof e&&(e=o.get(e)),!!e&&(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(r=[],Uo(e,function(e,i){e&&("string"==typeof e&&(e=o.get(e)),r.push(t.call(n,e,i)))}),r))},getAttribs:function(e){var t;return(e=this.get(e))?qo?(t=[],"OBJECT"===e.nodeName?e.attributes:("OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"}),e.cloneNode(!1).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t)):e.attributes:[]},isEmpty:function(e,t){var n,r,o,i,a,s,u=0;if(e=e.firstChild){a=new to(e,e.parentNode),t=t||(this.schema?this.schema.getNonEmptyElements():null),i=this.schema?this.schema.getWhiteSpaceElements():{};do{if(1===(o=e.nodeType)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(s=e.nodeName.toLowerCase(),t&&t[s]){if("br"===s){u++,e=a.next();continue}return!1}for(n=(r=this.getAttribs(e)).length;n--;)if("name"===(s=r[n].nodeName)||"data-mce-bookmark"===s)return!1}if(8===o)return!1;if(3===o&&!$o.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&$o.test(e.nodeValue))return!1;e=a.next()}while(e)}return u<=1},createRng:function(){return this.doc.createRange()},nodeIndex:Ko,split:function(e,t,n){var r,o,i,a=this.createRng();if(e&&t)return a.setStart(e.parentNode,this.nodeIndex(e)),a.setEnd(t.parentNode,this.nodeIndex(t)),r=a.extractContents(),(a=this.createRng()).setStart(t.parentNode,this.nodeIndex(t)+1),a.setEnd(e.parentNode,this.nodeIndex(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Co.trimNode(this,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Co.trimNode(this,o),e),this.remove(e),n||t},bind:function(e,t,n,r){if(Ot.isArray(e)){for(var o=e.length;o--;)e[o]=this.bind(e[o],t,n,r);return e}return!this.settings.collect||e!==this.doc&&e!==this.win||this.boundEvents.push([e,t,n,r]),this.events.bind(e,t,n,r||this)},unbind:function(e,t,n){var r;if(Ot.isArray(e)){for(r=e.length;r--;)e[r]=this.unbind(e[r],t,n);return e}if(this.boundEvents&&(e===this.doc||e===this.win))for(r=this.boundEvents.length;r--;){var o=this.boundEvents[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1===e.nodeType?(t=e.getAttribute("data-mce-contenteditable"))&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null:null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&null===(n=this.getContentEditable(e));e=e.parentNode);return n},destroy:function(){if(this.boundEvents){for(var e=this.boundEvents.length;e--;){var t=this.boundEvents[e];this.events.unbind(t[0],t[1],t[2])}this.boundEvents=null}lt.setDocument&&lt.setDocument(),this.win=this.doc=this.root=this.events=this.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,o=t;if(e)for("string"==typeof o&&(o=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(o(e))return e;return null}},Xo.DOM=new Xo(document),Xo.nodeIndex=Ko;var Yo=Xo.DOM,Go=Ot.each,Jo=Ot.grep,Qo=function(e){return"function"==typeof e},Zo=function(){var e={},t=[],n={},r=[],o=0;this.isDone=function(t){return 2===e[t]},this.markDone=function(t){e[t]=2},this.add=this.load=function(r,o,i,a){e[r]===undefined&&(t.push(r),e[r]=0),o&&(n[r]||(n[r]=[]),n[r].push({success:o,failure:a,scope:i||this}))},this.remove=function(t){delete e[t],delete n[t]},this.loadQueue=function(e,n,r){this.loadScripts(t,e,n,r)},this.loadScripts=function(t,i,a,s){var u,c=[],l=function(e,t){Go(n[t],function(t){Qo(t[e])&&t[e].call(t.scope)}),n[t]=undefined};r.push({success:i,failure:s,scope:a||this}),(u=function(){var n=Jo(t);if(t.length=0,Go(n,function(t){var n,r,i,a,s,f,d;2!==e[t]?3!==e[t]?1!==e[t]&&(e[t]=1,o++,n=t,r=function(){e[t]=2,o--,l("success",t),u()},i=function(){e[t]=3,o--,c.push(t),l("failure",t),u()},d=function(){f.remove(s),a&&(a.onreadystatechange=a.onload=a=null),r()},s=(f=Yo).uniqueId(),(a=document.createElement("script")).id=s,a.type="text/javascript",a.src=Ot._addCacheSuffix(n),"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&d()}:a.onload=d,a.onerror=function(){Qo(i)?i():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+n)},(document.getElementsByTagName("head")[0]||document.body).appendChild(a)):l("failure",t):l("success",t)}),!o){var i=r.slice(0);r.length=0,Go(i,function(e){0===c.length?Qo(e.success)&&e.success.call(e.scope):Qo(e.failure)&&e.failure.call(e.scope,c)})}})()}};Zo.ScriptLoader=new Zo;var ei=Ot.each,ti=function(){this.items=[],this.urls={},this.lookup={},this._listeners=[]};ti.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:undefined},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(e,t){var n=ti.language;if(n&&!1!==ti.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Zo.ScriptLoader.add(this.urls[e]+"/langs/"+n+".js")}},add:function(e,t,n){this.items.push(t),this.lookup[e]={instance:t,dependencies:n};var r=M.partition(this._listeners,function(t){return t.name===e});return this._listeners=r.fail,ei(r.pass,function(e){e.callback()}),t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(e,t){var n=this.urls[e];ei(t,function(e){Zo.ScriptLoader.add(n+"/"+e)})},load:function(e,t,n,r,o){var i=this,a=t,s=function(){var o=i.dependencies(e);ei(o,function(e){var n=i.createUrl(t,e);i.load(n.resource,n,undefined,undefined)}),n&&(r?n.call(r):n.call(Zo))};i.urls[e]||("object"==typeof t&&(a=t.prefix+t.resource+t.suffix),0!==a.indexOf("/")&&-1===a.indexOf("://")&&(a=ti.baseURL+"/"+a),i.urls[e]=a.substring(0,a.lastIndexOf("/")),i.lookup[e]?s():Zo.ScriptLoader.add(a,s,r,o))},waitFor:function(e,t){this.lookup.hasOwnProperty(e)?t():this._listeners.push({name:e,callback:t})}},ti.PluginManager=new ti,ti.ThemeManager=new ti;var ni="\ufeff",ri=function(e){return e===ni},oi=ni,ii=function(e){return e.replace(new RegExp(ni,"g"),"")},ai=vo.isElement,si=vo.isText,ui=function(e){return si(e)&&(e=e.parentNode),ai(e)&&e.hasAttribute("data-mce-caret")},ci=function(e){return si(e)&&ri(e.data)},li=function(e){return ui(e)||ci(e)},fi=function(e){return si(e)&&e.data[0]===oi},di=function(e){return si(e)&&e.data[e.data.length-1]===oi},mi={isCaretContainer:li,isCaretContainerBlock:ui,isCaretContainerInline:ci,showCaretContainerBlock:function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],vo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},insertInline:function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(oi),o=e.parentNode,t){if(n=e.previousSibling,si(n)){if(li(n))return n;if(di(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,si(n)){if(li(n))return n;if(fi(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r},prependInline:function(e){if(vo.isText(e)){var t=e.data;return t.length>0&&t.charAt(0)!==oi&&e.insertData(0,oi),e}return null},appendInline:function(e){if(vo.isText(e)){var t=e.data;return t.length>0&&t.charAt(t.length-1)!==oi&&e.insertData(t.length,oi),e}return null},isBeforeInline:function(e){return e&&vo.isText(e.container())&&e.container().data.charAt(e.offset())===oi},isAfterInline:function(e){return e&&vo.isText(e.container())&&e.container().data.charAt(e.offset()-1)===oi},insertBlock:function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},hasContent:function(e){return e.firstChild!==e.lastChild||!vo.isBr(e.firstChild)},startsWithCaretContainer:fi,endsWithCaretContainer:di},pi=vo.isContentEditableTrue,gi=vo.isContentEditableFalse,hi=vo.isBr,vi=vo.isText,yi=vo.matchNodeNames("script style textarea"),bi=vo.matchNodeNames("img input textarea hr iframe video audio object"),Ci=vo.matchNodeNames("table"),xi=mi.isCaretContainer,wi=function(e){return!xi(e)&&(vi(e)?!yi(e.parentNode):bi(e)||hi(e)||Ci(e)||gi(e))},Ni=function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(gi(e))return!1;if(pi(e))return!0}return!0},Ei=wi,Si=function(e){return bi(e)||!!gi(t=e)&&!0!==At.reduce(t.getElementsByTagName("*"),function(e,t){return e||pi(t)},!1);var t},ki=function(e,t){return wi(e)&&Ni(e,t)},Ti=Math.round,Ai=function(e){return e?{left:Ti(e.left),top:Ti(e.top),bottom:Ti(e.bottom),right:Ti(e.right),width:Ti(e.width),height:Ti(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},_i=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},Bi=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&_i(t.top-e.bottom,e,t)},Ri=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&_i(t.bottom-e.top,e,t)},Di=Ai,Oi=function(e,t){return e=Ai(e),t?e.right=e.left:(e.left=e.left+e.width,e.right=e.left),e.width=0,e},Pi=function(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right},Ii=Bi,Li=Ri,Mi=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Fi=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},zi=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Ui=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),Vi=function(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&Ui.test(e)},Hi=[].slice,qi=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Hi.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return qi.apply(this,e)}},ji={constant:function(e){return function(){return e}},negate:function(e){return function(t){return!e(t)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Hi.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Hi.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},curry:qi,compose:function(e,t){return function(n){return e(t(n))}},noop:function(){}},$i=vo.isElement,Wi=Ei,Ki=vo.matchStyleValues("display","block table"),Xi=vo.matchStyleValues("float","left right"),Yi=ji.and($i,Wi,ji.negate(Xi)),Gi=ji.negate(vo.matchStyleValues("white-space","pre pre-line pre-wrap")),Ji=vo.isText,Qi=vo.isBr,Zi=Xo.nodeIndex,ea=zi,ta=function(e){return"createRange"in e?e.createRange():Xo.DOM.createRng()},na=function(e){return e&&/[\r\n\t ]/.test(e)},ra=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(na(e.toString())&&Gi(n.parentNode)&&(t=n.data,na(t[r-1])||na(t[r+1])))},oa=function(e){var t,n,r=[],o=function(e){var t,n,r,o,i,a,s,u;return t=(n=e.getClientRects()).length>0?Di(n[0]):Di(e.getBoundingClientRect()),Qi(e)&&0===t.left?(i=(r=e).ownerDocument,a=ta(i),s=i.createTextNode("\xa0"),(u=r.parentNode).insertBefore(s,r),a.setStart(s,0),a.setEnd(s,1),o=Di(a.getBoundingClientRect()),u.removeChild(s),o):t},i=function(e,t){return(e=Oi(e,t)).width=1,e.right=e.left+1,e},a=function(e){0!==e.height&&(r.length>0&&Pi(e,r[r.length-1])||r.push(e))},s=function(e,t){var n=ta(e.ownerDocument);if(t<e.data.length){if(Vi(e.data[t]))return r;if(Vi(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!ra(n)))return a(i(o(n),!1)),r}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),ra(n)||a(i(o(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),ra(n)||a(i(o(n),!0)))};if(Ji(e.container()))return s(e.container(),e.offset()),r;if($i(e.container()))if(e.isAtEnd())n=ea(e.container(),e.offset()),Ji(n)&&s(n,n.data.length),Yi(n)&&!Qi(n)&&a(i(o(n),!1));else{if(n=ea(e.container(),e.offset()),Ji(n)&&s(n,0),Yi(n)&&e.isAtEnd())return a(i(o(n),!1)),r;t=ea(e.container(),e.offset()-1),Yi(t)&&!Qi(t)&&(Ki(t)||Ki(n)||!Yi(n))&&a(i(o(t),!1)),Yi(n)&&a(i(o(n),!0))}return r},ia=function(e,t,n){var r=function(){return n||(n=oa(new ia(e,t))),n};return{container:ji.constant(e),offset:ji.constant(t),toRange:function(){var n;return(n=ta(e.ownerDocument)).setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Ji(e),0===t},isAtEnd:function(){return Ji(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return ea(e,n?t-1:t)}}};ia.fromRangeStart=function(e){return new ia(e.startContainer,e.startOffset)},ia.fromRangeEnd=function(e){return new ia(e.endContainer,e.endOffset)},ia.after=function(e){return new ia(e.parentNode,Zi(e)+1)},ia.before=function(e){return new ia(e.parentNode,Zi(e))},ia.isAtStart=function(e){return!!e&&e.isAtStart()},ia.isAtEnd=function(e){return!!e&&e.isAtEnd()},ia.isTextPosition=function(e){return!!e&&vo.isText(e.container())};var aa,sa,ua,ca,la,fa=vo.isContentEditableTrue,da=vo.isContentEditableFalse,ma=vo.matchStyleValues("display","block table table-cell table-caption list-item"),pa=mi.isCaretContainer,ga=mi.isCaretContainerBlock,ha=ji.curry,va=vo.isElement,ya=Ei,ba=function(e){return e>0},Ca=function(e){return e<0},xa=function(e,t){for(var n;n=e(t);)if(!ga(n))return n;return null},wa=function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode)if(fa(e))return e;return t},Na=function(e,t){for(;e&&e!==t;){if(ma(e))return e;e=e.parentNode}return null},Ea=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Sa=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],pa(r)&&(r=r[o]),da(r)){if(a=n,Na(r,i=t)===Na(a,i))return r;break}if(ya(r))break;n=n.parentNode}return null},ka=ha(Ea,!0),Ta=ha(Ea,!1),Aa=function(e,t){return da((n=e,(r=t)?(o=r.container(),i=r.offset(),va(o)?o.childNodes[i+n]:null):null));var n,r,o,i},_a={isForwards:ba,isBackwards:Ca,findNode:function(e,t,n,r,o){var i=new to(e,r);if(Ca(t)){if((da(e)||ga(e))&&n(e=xa(i.prev,!0)))return e;for(;e=xa(i.prev,o);)if(n(e))return e}if(ba(t)){if((da(e)||ga(e))&&n(e=xa(i.next,!0)))return e;for(;e=xa(i.next,o);)if(n(e))return e}return null},getEditingHost:wa,getParentBlock:Na,isInSameBlock:function(e,t,n){return Na(e.container(),n)===Na(t.container(),n)},isInSameEditingHost:function(e,t,n){return wa(e.container(),n)===wa(t.container(),n)},isBeforeContentEditableFalse:ha(Aa,0),isAfterContentEditableFalse:ha(Aa,-1),normalizeRange:function(e,t,n){var r,o,i,a,s=ha(Sa,!0,t),u=ha(Sa,!1,t);if(o=n.startContainer,i=n.startOffset,mi.isCaretContainerBlock(o)){if(va(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,da(r)))return ka(r);if("after"===a&&(r=o.previousSibling,da(r)))return Ta(r)}if(!n.collapsed)return n;if(vo.isText(o)){if(pa(o)){if(1===e){if(r=u(o))return ka(r);if(r=s(o))return Ta(r)}if(-1===e){if(r=s(o))return Ta(r);if(r=u(o))return ka(r)}return n}if(mi.endsWithCaretContainer(o)&&i>=o.data.length-1)return 1===e&&(r=u(o))?ka(r):n;if(mi.startsWithCaretContainer(o)&&i<=1)return-1===e&&(r=s(o))?Ta(r):n;if(i===o.data.length)return(r=u(o))?ka(r):n;if(0===i)return(r=s(o))?Ta(r):n}return n}},Ba=vo.isContentEditableFalse,Ra=vo.isText,Da=vo.isElement,Oa=vo.isBr,Pa=_a.isForwards,Ia=_a.isBackwards,La=Ei,Ma=Si,Fa=ki,za=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ua=function(e,t){if(Pa(e)){if(La(t.previousSibling)&&!Ra(t.previousSibling))return ia.before(t);if(Ra(t))return ia(t,0)}if(Ia(e)){if(La(t.nextSibling)&&!Ra(t.nextSibling))return ia.after(t);if(Ra(t))return ia(t,t.data.length)}return Ia(e)?Oa(t)?ia.before(t):ia.after(t):ia.before(t)},Va=function(e,t,n){var r,o,i,a,s,u,c,l,f,d;if(!Da(n)||!t)return null;if(t.isEqual(ia.after(n))&&n.lastChild){if(c=ia.after(n.lastChild),Ia(e)&&La(n.lastChild)&&Da(n.lastChild))return Oa(n.lastChild)?ia.before(n.lastChild):c}else c=t;if(r=c.container(),o=c.offset(),Ra(r)){if(Ia(e)&&o>0)return ia(r,--o);if(Pa(e)&&o<r.length)return ia(r,++o);i=r}else{if(Ia(e)&&o>0&&(a=za(r,o-1),La(a)))return!Ma(a)&&(s=_a.findNode(a,e,Fa,a))?Ra(s)?ia(s,s.data.length):ia.after(s):Ra(a)?ia(a,a.data.length):ia.before(a);if(Pa(e)&&o<r.childNodes.length&&(a=za(r,o),La(a)))return l=a,f=n,vo.isBr(l)&&(d=Va(1,ia.after(l),f))&&!_a.isInSameBlock(ia.before(l),ia.before(d),f)?Va(e,ia.after(a),n):!Ma(a)&&(s=_a.findNode(a,e,Fa,a))?Ra(s)?ia(s,0):ia.before(s):Ra(a)?ia(a,0):ia.after(a);i=c.getNode()}return(Pa(e)&&c.isAtEnd()||Ia(e)&&c.isAtStart())&&(i=_a.findNode(i,e,ji.constant(!0),n,!0),Fa(i,n))?Ua(e,i):(a=_a.findNode(i,e,Fa,n),!(u=At.last(At.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(r,n),Ba)))||a&&u.contains(a)?a?Ua(e,a):null:c=Pa(e)?ia.after(u):ia.before(u))},Ha=function(e){return{next:function(t){return Va(1,t,e)},prev:function(t){return Va(-1,t,e)}}},qa=function(e){return Ot.grep(e.childNodes,function(e){return"LI"===e.nodeName})},ja=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||vo.isBr(t));var t},$a=function(e){return e.length>0&&(!(t=e[e.length-1]).firstChild||ja(t))?e.slice(0,-1):e;var t},Wa=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Ka=function(e,t){var n=ia.after(e),r=Ha(t).prev(n);return r?r.toRange():null},Xa=function(e,t,n){var r,o,i,a,s=e.parentNode;return Ot.each(t,function(t){s.insertBefore(t,e)}),r=e,o=n,i=ia.before(r),(a=Ha(o).next(i))?a.toRange():null},Ya=function(e,t){var n,r,o,i,a,s,u=t.firstChild,c=t.lastChild;return u&&"meta"===u.name&&(u=u.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,s=(n=e).getNonEmptyElements(),r&&(r.isEmpty(s)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!u||u!==c||"ul"!==u.name&&"ol"!==u.name)},Ga=function(e,t,n,r){var o,i,a,s,u,c,l,f,d,m,p,g,h,v,y,b,C,x,w,N=(o=t,i=r,c=e.serialize(i),l=o.createFragment(c),s=(a=l).firstChild,u=a.lastChild,s&&"META"===s.nodeName&&s.parentNode.removeChild(s),u&&"mce_marker"===u.id&&u.parentNode.removeChild(u),a),E=Wa(t,n.startContainer),S=$a(qa(N.firstChild)),k=t.getRoot(),T=function(e){var r=ia.fromRangeStart(n),o=Ha(t.getRoot()),i=1===e?o.prev(r):o.next(r);return!i||Wa(t,i.getNode())!==E};return T(1)?Xa(E,S,k):T(2)?(f=E,d=S,m=k,t.insertAfter(d.reverse(),f),Ka(d[0],m)):(g=S,h=k,v=p=E,b=(y=n).cloneRange(),C=y.cloneRange(),b.setStartBefore(v),C.setEndAfter(v),x=[b.cloneContents(),C.cloneContents()],(w=p.parentNode).insertBefore(x[0],p),Ot.each(g,function(e){w.insertBefore(e,p)}),w.insertBefore(x[1],p),w.removeChild(p),Ka(g[g.length-1],h))},Ja=function(e,t){return!!Wa(e,t)},Qa=vo.isText,Za=vo.isBogus,es=Xo.nodeIndex,ts=function(e){var t=e.parentNode;return Za(t)?ts(t):t},ns=function(e){return e?At.reduce(e.childNodes,function(e,t){return Za(t)&&"BR"!==t.nodeName?e=e.concat(ns(t)):e.push(t),e},[]):[]},rs=function(e){return function(t){return e===t}},os=function(e){var t,n,r,o;return(Qa(e)?"text()":e.nodeName.toLowerCase())+"["+(n=ns(ts(t=e)),r=At.findIndex(n,rs(t),t),n=n.slice(0,r+1),o=At.reduce(n,function(e,t,r){return Qa(t)&&Qa(n[r-1])&&e++,e},0),n=At.filter(n,vo.matchNodeNames(t.nodeName)),(r=At.findIndex(n,rs(t),t))-o)+"]"},is=function(e,t){var n,r,o,i,a,s=[];return n=t.container(),r=t.offset(),Qa(n)?o=function(e,t){for(;(e=e.previousSibling)&&Qa(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),s.push(os(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=At.filter(a,ji.negate(vo.isBogus)),(s=s.concat(At.map(a,function(e){return os(e)}))).reverse().join("/")+","+o},as=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=n.length>1?n[1]:"before",(r=At.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=ns(n),i=At.filter(i,function(e,t){return!Qa(e)||!Qa(i[t-1])}),(i=At.filter(i,vo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Qa(r)?function(e,t){for(var n,r=e,o=0;Qa(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!Qa(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return t>e.data.length&&(t=e.data.length),new ia(e,t)}(r,parseInt(o,10)):(o="after"===o?es(r)+1:es(r),new ia(r.parentNode,o)):null):null},ss=vo.isContentEditableFalse,us=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],s=r[o?"startOffset":"endOffset"],u=[],c=0,l=e.getRoot();for(vo.isText(a)?u.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&vo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,s):s):(s>=(i=a.childNodes).length&&i.length&&(c=1,s=Math.max(0,i.length-1)),u.push(e.nodeIndex(i[s],n)+c));a&&a!==l;a=a.parentNode)u.push(e.nodeIndex(a,n));return u},cs=function(e){vo.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},ls=function(e,t,n){var r=0;return Ot.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},fs=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],vo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},ds=function(e){return fs(e,!0),fs(e,!1),e},ms=function(e,t){var n;if(vo.isElement(e)&&(e=zi(e,t),ss(e)))return e;if(mi.isCaretContainer(e)){if(vo.isText(e)&&mi.isCaretContainerBlock(e)&&(e=e.parentNode),n=e.previousSibling,ss(n))return n;if(n=e.nextSibling,ss(n))return n}},ps=function(e,t,n){var r,o,i,a,s,u,c,l=n.getNode(),f=l?l.nodeName:null,d=n.getRng();return ss(l)||"IMG"===f?{name:f,index:ls(n.dom,f,l)}:(l=ms((r=d).startContainer,r.startOffset)||ms(r.endContainer,r.endOffset))?{name:f=l.tagName,index:ls(n.dom,f,l)}:(o=e,a=t,s=d,u=(i=n).dom,(c={}).start=us(u,o,a,s,!0),i.isCollapsed()||(c.end=us(u,o,a,s,!1)),c)},gs={getBookmark:function(e,t,n){return 2===t?ps(ii,n,e):3===t?(o=(r=e).getRng(),{start:is(r.dom.getRoot(),ia.fromRangeStart(o)),end:is(r.dom.getRoot(),ia.fromRangeEnd(o))}):t?{rng:e.getRng()}:function(e){var t=e.dom,n=e.getRng(),r=t.uniqueId(),o=e.isCollapsed(),i="overflow:hidden;line-height:0px",a=e.getNode(),s=a.nodeName;if("IMG"===s)return{name:s,index:ls(t,s,a)};var u=ds(n.cloneRange());if(!o){u.collapse(!1);var c=t.create("span",{"data-mce-type":"bookmark",id:r+"_end",style:i},"&#xFEFF;");u.insertNode(c),cs(c.nextSibling)}(n=ds(n)).collapse(!0);var l=t.create("span",{"data-mce-type":"bookmark",id:r+"_start",style:i},"&#xFEFF;");return n.insertNode(l),cs(l.previousSibling),e.moveToBookmark({id:r,keep:1}),{id:r}}(e);var r,o},getUndoBookmark:y.curry(ps,y.identity,!0)},hs=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return E.none();n.push(o.getOrDie())}return E.some(t.apply(null,n))},vs=function(e,t){return!e.isBlock(t)||t.innerHTML||me.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},ys=function(e,t,n,r){var o,i,a,s,u=n[t?"start":"end"],c=e.getRoot();if(u){for(a=u[0],i=c,o=u.length-1;o>=1;o--){if(s=i.childNodes,u[o]>s.length-1)return;i=s[u[o]]}3===i.nodeType&&(a=Math.min(u[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(u[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},bs=function(e,t,n){var r,o,i,a,s,u,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,l?(r=c.firstChild,o=1):o=e.nodeIndex(c),s=r,u=o,!l){for(a=c.previousSibling,i=c.nextSibling,Ot.each(Ot.grep(c.childNodes),function(e){vo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,1);a&&i&&a.nodeType===i.nodeType&&vo.isText(a)&&!me.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),s=a,u=o)}return E.some(ia(s,u))}return E.none()},Cs=function(e,t){var n,r,o,i,a,s,u,c,l,f,d,m,p,g,h,v=e.dom;if(t){if(Ot.isArray(t.start))return g=t,h=(p=v).createRng(),ys(p,!0,g,h)&&ys(p,!1,g,h)?E.some(h):E.none();if("string"==typeof t.start)return E.some((f=t,d=(l=v).createRng(),m=as(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=as(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.id)return u=bs(o=v,"start",i=t),c=bs(o,"end",i),hs([u,(a=c,s=u,a.isSome()?a:s)],function(e,t){var n=o.createRng();return n.setStart(vs(o,e.container()),e.offset()),n.setEnd(vs(o,t.container()),t.offset()),n});if(t.name)return n=v,r=t,E.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.rng)return E.some(t.rng)}return E.none()},xs={getBookmark:function(e,t,n){return gs.getBookmark(e,t,n)},moveToBookmark:function(e,t){Cs(e,t).each(function(t){e.setRng(t)})},isBookmarkNode:function(e){return vo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")}},ws=Ot.each,Ns=function(e){this.compare=function(t,n){if(t.nodeName!==n.nodeName)return!1;var r=function(t){var n={};return ws(e.getAttribs(t),function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o))}),n},o=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!o(r(t),r(n))||!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))||xs.isBookmarkNode(t)||xs.isBookmarkNode(n))}},Es=function(e,t){Ur.parent(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})},Ss=function(e,t){e.dom().appendChild(t.dom())},ks={before:Es,after:function(e,t){Ur.nextSibling(e).fold(function(){Ur.parent(e).each(function(e){Ss(e,t)})},function(e){Es(e,t)})},prepend:function(e,t){Ur.firstChild(e).fold(function(){Ss(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},append:Ss,appendAt:function(e,t,n){Ur.child(e,n).fold(function(){Ss(e,t)},function(e){Es(e,t)})},wrap:function(e,t){Es(e,t),Ss(t,e)}},Ts=function(e,t){M.each(t,function(t){ks.before(e,t)})},As=function(e,t){M.each(t,function(t){ks.append(e,t)})},_s=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Bs={empty:function(e){e.dom().textContent="",M.each(Ur.children(e),function(e){_s(e)})},remove:_s,unwrap:function(e){var t=Ur.children(e);t.length>0&&Ts(e,t),_s(e)}},Rs=(aa=Zn.isText,sa="text",ua=function(e){return aa(e)?E.from(e.dom().nodeValue):E.none()},ca=Un.detect().browser,{get:function(e){if(!aa(e))throw new Error("Can only get "+sa+" value of a "+sa+" node");return la(e).getOr("")},getOption:la=ca.isIE()&&10===ca.version.major?function(e){try{return ua(e)}catch(yC){return E.none()}}:ua,set:function(e,t){if(!aa(e))throw new Error("Can only set raw "+sa+" value of a "+sa+" node");e.dom().nodeValue=t}}),Ds=function(e){return Rs.get(e)},Os=function(e,t){return _r.all(t,e)},Ps=function(e){var t=Os(e,"br"),n=M.filter(function(e){for(var t=[],n=e.dom();n;)t.push(Hn.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),io.isBr);t.length===n.length&&M.each(n,Bs.remove)},Is=function(e){Bs.empty(e),ks.append(e,Hn.fromHtml('<br data-mce-bogus="1">'))},Ls=function(e){Ur.lastChild(e).each(function(t){Ur.prevSibling(t).each(function(n){io.isBlock(e)&&io.isBr(t)&&io.isBlock(n)&&Bs.remove(t)})})},Ms=Ot.makeMap,Fs=function(e){var t,n,r,o,i,a=[];return t=(e=e||{}).indent,n=Ms(e.indent_before||""),r=Ms(e.indent_after||""),o=Ao.getEncodeFunc(e.entity_encoding||"raw",e.entities),i="html"===e.element_format,{start:function(e,s,u){var c,l,f,d;if(t&&n[e]&&a.length>0&&(d=a[a.length-1]).length>0&&"\n"!==d&&a.push("\n"),a.push("<",e),s)for(c=0,l=s.length;c<l;c++)f=s[c],a.push(" ",f.name,'="',o(f.value,!0),'"');a[a.length]=!u||i?">":" />",u&&t&&r[e]&&a.length>0&&(d=a[a.length-1]).length>0&&"\n"!==d&&a.push("\n")},end:function(e){var n;a.push("</",e,">"),t&&r[e]&&a.length>0&&(n=a[a.length-1]).length>0&&"\n"!==n&&a.push("\n")},text:function(e,t){e.length>0&&(a[a.length]=t?e:o(e))},cdata:function(e){a.push("<![CDATA[",e,"]]>")},comment:function(e){a.push("\x3c!--",e,"--\x3e")},pi:function(e,n){n?a.push("<?",e," ",o(n),"?>"):a.push("<?",e,"?>"),t&&a.push("\n")},doctype:function(e){a.push("<!DOCTYPE",e,">",t?"\n":"")},reset:function(){a.length=0},getContent:function(){return a.join("").replace(/\n$/,"")}}},zs=function(e,t){var n={},r=Fs(e);return(e=e||{}).validate=!("validate"in e)||e.validate,n.schema=t=t||Fo(),n.writer=r,n.serialize=function(n){var o,i;i=e.validate,o={3:function(e){r.text(e.value,e.raw)},8:function(e){r.comment(e.value)},7:function(e){r.pi(e.name,e.value)},10:function(e){r.doctype(e.value)},4:function(e){r.cdata(e.value)},11:function(e){if(e=e.firstChild)do{a(e)}while(e=e.next)}},r.reset();var a=function(e){var n,s,u,c,l,f,d,m,p,g=o[e.type];if(g)g(e);else{if(n=e.name,s=e.shortEnded,u=e.attributes,i&&u&&u.length>1&&((f=[]).map={},p=t.getElementRule(e.name))){for(d=0,m=p.attributesOrder.length;d<m;d++)(c=p.attributesOrder[d])in u.map&&(l=u.map[c],f.map[c]=l,f.push({name:c,value:l}));for(d=0,m=u.length;d<m;d++)(c=u[d].name)in f.map||(l=u.map[c],f.map[c]=l,f.push({name:c,value:l}));u=f}if(r.start(e.name,u,s),!s){if(e=e.firstChild)do{a(e)}while(e=e.next);r.end(n)}}};return 1!==n.type||e.inner?o[11](n):a(n),r.getContent()},n},Us=function(e){return ia.isTextPosition(e)?0===e.offset():Ei(e.getNode())},Vs=function(e){return ia.isTextPosition(e)?e.offset()===e.container().data.length:Ei(e.getNode(!0))},Hs=function(e,t){return!ia.isTextPosition(e)&&!ia.isTextPosition(t)&&e.getNode()===t.getNode(!0)},qs=function(e,t,n){return e?!Hs(t,n)&&(r=t,!(!ia.isTextPosition(r)&&vo.isBr(r.getNode())))&&Vs(t)&&Us(n):!Hs(n,t)&&Us(t)&&Vs(n);var r},js=function(e,t,n){var r=Ha(t);return E.from(e?r.next(n):r.prev(n))},$s=function(e,t){var n,r,o,i,a,s=e?t.firstChild:t.lastChild;return vo.isText(s)?E.some(new ia(s,e?0:s.data.length)):s?Ei(s)?E.some(e?ia.before(s):(a=s,vo.isBr(a)?ia.before(a):ia.after(a))):(r=t,o=s,i=(n=e)?ia.before(o):ia.after(o),js(n,r,i)):E.none()},Ws={fromPosition:js,nextPosition:y.curry(js,!0),prevPosition:y.curry(js,!1),navigate:function(e,t,n){return js(e,t,n).bind(function(r){return _a.isInSameBlock(n,r,t)&&qs(e,n,r)?js(e,t,r):E.some(r)})},positionIn:$s,firstPositionIn:y.curry($s,!0),lastPositionIn:y.curry($s,!1)},Ks=function(e){var t=ia.fromRangeStart(e),n=ia.fromRangeEnd(e),r=e.commonAncestorContainer;return Ws.fromPosition(!1,r,n).map(function(o){return!_a.isInSameBlock(t,n,r)&&_a.isInSameBlock(t,o,r)?(i=t.container(),a=t.offset(),s=o.container(),u=o.offset(),(c=document.createRange()).setStart(i,a),c.setEnd(s,u),c):e;var i,a,s,u,c}).getOr(e)},Xs=function(e){return(t=e).collapsed?t:Ks(t);var t},Ys=vo.matchNodeNames("td th"),Gs=function(e,t,n){var r,o,i,a,s,u,c,l,f,d,m,p,g=e.schema.getTextInlineElements(),h=e.selection,v=e.dom;if(/^ | $/.test(t)&&(t=function(e){var t,n,r;t=h.getRng(),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(r>0?e=e.replace(/^&nbsp;/," "):o("previousSibling")||(e=e.replace(/^ /,"&nbsp;")),r<n.length?e=e.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(e=e.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),e}(t)),r=e.parser,p=n.merge,o=zs({validate:e.settings.validate},e.schema),m='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',u={content:t,format:"html",selection:!0,paste:n.paste},(u=e.fire("BeforeSetContent",u)).isDefaultPrevented())e.fire("SetContent",{content:u.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=u.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,m);var y,b,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(y=N.firstChild)&&!e.schema.getShortEndedElements()[y.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(e.selection.setRng(Xs(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),C=(b=h.getRng()).startContainer,x=b.startOffset,3===C.nodeType&&b.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(t)||(t+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(t)||(t=" "+t))));var S,k,T,A={context:(i=h.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(s=r.parse(t,A),!0===n.paste&&Ya(e.schema,s)&&Ja(v,i))return l=Ga(o,v,e.selection.getRng(!0),s),e.selection.setRng(l),void e.fire("SetContent",u);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(s),"mce_marker"===(f=s.lastChild).attr("id"))for(c=f,f=f.prev;f;f=f.walk(!0))if(3===f.type||!v.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),A.invalid){for(h.setContent(m),i=h.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)i=f,f=f.parentNode;t=i===a?a.innerHTML:v.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(s)}))),i===a?v.setHTML(a,t):v.setOuterHTML(i,t)}else t=o.serialize(s),function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t)}}(e,t,i);!function(){if(p){var t=e.getBody(),n=new Ns(v);Ot.each(v.select("*[data-mce-fragment]"),function(e){for(var r=e.parentNode;r&&r!==t;r=r.parentNode)g[e.nodeName.toLowerCase()]&&n.compare(r,e)&&v.remove(e,!0)})}}(),function(t){var n,r,o;if(t){if(h.scrollIntoView(t),n=function(t){for(var n=e.getBody();t&&t!==n;t=t.parentNode)if("false"===e.dom.getContentEditable(t))return t;return null}(t))return v.remove(t),void h.select(n);l=v.createRng(),(f=t.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),me.ie||(d=t.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(t),l.setEndBefore(t)),r=v.getParent(t,v.isBlock),v.remove(t),r&&v.isEmpty(r)&&(e.$(r).empty(),l.setStart(r,0),l.setEnd(r,0),Ys(r)||r.getAttribute("data-mce-fragment")||!(o=function(t){var n=ia.fromRangeStart(t);if(n=Ha(e.getBody()).next(n))return n.toRange()}(l))?v.add(r,v.create("br",{"data-mce-bogus":"1"})):(l=o,v.remove(r))),h.setRng(l)}}(v.get("mce_marker")),S=e.getBody(),Ot.each(S.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),k=e.dom,T=e.selection.getStart(),E.from(k.getParent(T,"td,th")).map(Hn.fromDom).each(Ls),e.fire("SetContent",u),e.addVisual()}},Js=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Ot.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};Gs(e,o.content,o.details)},Qs=function(e,t,n,r,o){return e(n,r)?E.some(n):tr.isFunction(o)&&o(n)?E.none():t(n,r,o)},Zs=function(e,t,n){for(var r=e.dom(),o=tr.isFunction(n)?n:y.constant(!1);r.parentNode;){r=r.parentNode;var i=Hn.fromDom(r);if(t(i))return E.some(i);if(o(i))break}return E.none()},eu=function(e,t){return M.find(e.dom().childNodes,y.compose(t,Hn.fromDom)).map(Hn.fromDom)},tu=function(e,t){var n=function(e){for(var r=0;r<e.childNodes.length;r++){if(t(Hn.fromDom(e.childNodes[r])))return E.some(Hn.fromDom(e.childNodes[r]));var o=n(e.childNodes[r]);if(o.isSome())return o}return E.none()};return n(e.dom())},nu={first:function(e){return tu(gr.body(),e)},ancestor:Zs,closest:function(e,t,n){return Qs(function(e){return t(e)},Zs,e,t,n)},sibling:function(e,t){var n=e.dom();return n.parentNode?eu(Hn.fromDom(n.parentNode),function(n){return!Dr.eq(e,n)&&t(n)}):E.none()},child:eu,descendant:tu},ru=xr("sections","settings"),ou=Un.detect().deviceType.isTouch(),iu=["lists","autolink","autosave"],au={theme:"mobile"},su=function(e){var t=tr.isArray(e)?e.join(" "):e,n=M.map(tr.isString(t)?t.split(" "):[],On);return M.filter(n,function(e){return e.length>0})},uu=function(e,t){return e.sections().hasOwnProperty(t)},cu=function(e,t,n,r){var o,i,a=su(n.forced_plugins),s=su(r.plugins),u=e&&uu(t,"mobile")?(o=s,M.filter(o,y.curry(M.contains,iu))):s,c=(i=u,[].concat(su(a)).concat(su(i)));return Ot.extend(r,{plugins:c.join(" ")})},lu=function(e,t,n,r){var o,i,a,s,u,c,l,f,d,m,p,g,h,v=(o=["mobile"],i=r,a=sr.bifilter(i,function(e,t){return M.contains(o,t)}),ru(a.t,a.f)),y=Ot.extend(t,n,v.settings(),(p=e,h=(g=v).settings().inline,p&&uu(g,"mobile")&&!h?(l="mobile",f=au,d=v.sections(),m=d.hasOwnProperty(l)?d[l]:{},Ot.extend({},f,m)):{}),{validate:!0,content_editable:v.settings().inline,external_plugins:(s=n,u=v.settings(),c=u.external_plugins?u.external_plugins:{},s&&s.external_plugins?Ot.extend({},s.external_plugins,c):c)});return cu(e,v,n,y)},fu=function(e,t,n){return E.from(t.settings[n]).filter(e)},du=y.curry(fu,tr.isString),mu=function(e,t,n,r){var o,i,a=t in e.settings?e.settings[t]:n;return"hash"===r?(i={},"string"==typeof(o=a)?M.each(o.indexOf("=")>0?o.split(/[;,](?![^=;,]*(?:[;,]|$))/):o.split(","),function(e){(e=e.split("=")).length>1?i[Ot.trim(e[0])]=Ot.trim(e[1]):i[Ot.trim(e[0])]=Ot.trim(e)}):i=o,i):"string"===r?fu(tr.isString,e,t).getOr(n):"number"===r?fu(tr.isNumber,e,t).getOr(n):"boolean"===r?fu(tr.isBoolean,e,t).getOr(n):"object"===r?fu(tr.isObject,e,t).getOr(n):"array"===r?fu(tr.isArray,e,t).getOr(n):"function"===r?fu(tr.isFunction,e,t).getOr(n):a},pu=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,gu=function(e){return pu.test(e)},hu=function(e,t){var n=t.container(),r=t.offset();return e?mi.isCaretContainerInline(n)?vo.isText(n.nextSibling)?new ia(n.nextSibling,0):ia.after(n):mi.isBeforeInline(t)?new ia(n,r+1):t:mi.isCaretContainerInline(n)?vo.isText(n.previousSibling)?new ia(n.previousSibling,n.previousSibling.data.length):ia.before(n):mi.isAfterInline(t)?new ia(n,r-1):t},vu={isInlineTarget:function(e,t){var n=du(e,"inline_boundaries_selector").getOr("a[href],code");return _r.is(Hn.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,M.filter(Xo.DOM.getParents(i.container(),"*",o),r));return E.from(a[a.length-1])},isRtl:function(e){return"rtl"===Xo.DOM.getStyle(e,"direction",!0)||gu(e.textContent)},isAtZwsp:function(e){return mi.isBeforeInline(e)||mi.isAfterInline(e)},normalizePosition:hu,normalizeForwards:y.curry(hu,!0),normalizeBackwards:y.curry(hu,!1),hasSameParentBlock:function(e,t,n){var r=_a.getParentBlock(t,e),o=_a.getParentBlock(n,e);return r&&r===o}},yu=function(e,t){return Dr.contains(e,t)?nu.closest(t,function(e){return io.isTextBlock(e)||io.isListItem(e)},(n=e,function(e){return Dr.eq(n,Hn.fromDom(e.dom().parentNode))})):E.none();var n},bu=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},Cu=function(e,t,n){return hs([Ws.firstPositionIn(n),Ws.lastPositionIn(n)],function(r,o){var i=vu.normalizePosition(!0,r),a=vu.normalizePosition(!1,o),s=vu.normalizePosition(!1,t);return e?Ws.nextPosition(n,s).map(function(e){return e.isEqual(a)&&t.isEqual(i)}).getOr(!1):Ws.prevPosition(n,s).map(function(e){return e.isEqual(i)&&t.isEqual(a)}).getOr(!1)}).getOr(!0)},xu=function(e,t,n){return nu.ancestor(e,function(e){return _r.is(e,t)},n)},wu=xu,Nu=function(e,t){return _r.one(t,e)},Eu=function(e,t,n){return Qs(_r.is,xu,e,t,n)},Su=function(e,t,n){return wu(e,t,n).isSome()},ku=function(e,t){return vo.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===(n=e,r=t,o=Hn.fromDom(n),i=Hn.fromDom(r),Su(i,"pre,code",y.curry(Dr.eq,o)));var n,r,o,i},Tu=function(e,t){return Ei(t)&&!1===ku(e,t)||(n=t,vo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Au(t);var n},Au=vo.hasAttribute("data-mce-bookmark"),_u=vo.hasAttribute("data-mce-bogus"),Bu=vo.hasAttributeValue("data-mce-bogus","all"),Ru=function(e){return function(e){var t,n,r=0;if(Tu(e,e))return!1;if(!(n=e.firstChild))return!0;t=new to(n,e);do{if(Bu(n))n=t.next(!0);else if(_u(n))n=t.next();else if(vo.isBr(n))r++,n=t.next();else{if(Tu(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Du=xr("block","position"),Ou=xr("from","to"),Pu=function(e,t){var n=Hn.fromDom(e),r=Hn.fromDom(t.container());return yu(n,r).map(function(e){return Du(e,t)})},Iu=function(e,t,n){var r=Pu(e,ia.fromRangeStart(n)),o=r.bind(function(n){return Ws.fromPosition(t,e,n.position()).bind(function(n){return Pu(e,n).map(function(n){return r=e,o=t,i=n,vo.isBr(i.position().getNode())&&!1===Ru(i.block())?Ws.positionIn(!1,i.block().dom()).bind(function(e){return e.isEqual(i.position())?Ws.fromPosition(o,r,e).bind(function(e){return Pu(r,e)}):E.some(i)}).getOr(i):i;var r,o,i})})});return hs([r,o],Ou).filter(function(e){return r=e,!1===Dr.eq(r.from().block(),r.to().block())&&(n=e,Ur.parent(n.from().block()).bind(function(e){return Ur.parent(n.to().block()).filter(function(t){return Dr.eq(e,t)})}).isSome())&&(t=e,!1===vo.isContentEditableFalse(t.from().block())&&!1===vo.isContentEditableFalse(t.to().block()));var t,n,r})},Lu=function(e,t,n){return n.collapsed?Iu(e,t,n):E.none()},Mu=function(e,t,n){return Dr.contains(t,e)?Ur.parents(e,function(e){return n(e)||Dr.eq(e,t)}).slice(0,-1):[]},Fu=function(e,t){return Mu(e,t,y.constant(!1))},zu=Fu,Uu=function(e,t){return[e].concat(Fu(e,t))},Vu=function(e){var t,n,r=(t=e,n=Ur.children(t),M.findIndex(n,io.isBlock).fold(function(){return n},function(e){return n.slice(0,e)}));return M.each(r,function(e){Bs.remove(e)}),r},Hu=function(e,t){Ws.positionIn(e,t.dom()).each(function(e){var t=e.getNode();vo.isBr(t)&&Bs.remove(Hn.fromDom(t))})},qu=function(e,t){var n=Uu(t,e);return M.find(n.reverse(),Ru).each(Bs.remove)},ju=function(e,t){return Dr.contains(t,e)?Ur.parent(e).bind(function(n){return Dr.eq(n,t)?E.some(e):(r=t,o=e,i=Ur.parents(o,function(e){return Dr.eq(e,r)}),E.from(i[i.length-2]));var r,o,i}):E.none()},$u=function(e,t,n){if(Ru(n))return Bs.remove(n),Ru(t)&&Is(t),Ws.firstPositionIn(t.dom());Hu(!0,t),Hu(!1,n);var r=Vu(t);return ju(t,n).fold(function(){qu(e,t);var o=Ws.lastPositionIn(n.dom());return M.each(r,function(e){ks.append(n,e)}),o},function(o){var i=Ws.prevPosition(n.dom(),ia.before(o.dom()));return M.each(r,function(e){ks.before(o,e)}),qu(e,t),i})},Wu=function(e,t,n,r){return t?$u(e,r,n):$u(e,n,r)},Ku=function(e,t){var n,r=Hn.fromDom(e.getBody());return(n=Lu(r.dom(),t,e.selection.getRng()).bind(function(e){return Wu(r,t,e.from().block(),e.to().block())})).each(function(t){e.selection.setRng(t.toRange())}),n.isSome()},Xu=function(e,t){var n=Hn.fromDom(t),r=y.curry(Dr.eq,e);return nu.ancestor(n,io.isTableCell,r).isSome()},Yu=function(e,t){var n,r,o=Ws.prevPosition(e.dom(),ia.fromRangeStart(t)).isNone(),i=Ws.nextPosition(e.dom(),ia.fromRangeEnd(t)).isNone();return!(Xu(n=e,(r=t).startContainer)||Xu(n,r.endContainer))&&o&&i},Gu=function(e){var t,n,r,o,i=Hn.fromDom(e.getBody()),a=e.selection.getRng();return Yu(i,a)?((o=e).setContent(""),o.selection.setCursorLocation(),!0):(t=i,n=e.selection,r=n.getRng(),hs([yu(t,Hn.fromDom(r.startContainer)),yu(t,Hn.fromDom(r.endContainer))],function(e,o){return!1===Dr.eq(e,o)&&(r.deleteContents(),Wu(t,!0,e,o).each(function(e){n.setRng(e.toRange())}),!0)}).getOr(!1))},Ju=function(e,t){return!e.selection.isCollapsed()&&Gu(e)},Qu=function(e){if(!tr.isArray(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return M.each(e,function(r,o){var i=sr.keys(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],s=r[a];if(n[a]!==undefined)throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!tr.isArray(s))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){var n=arguments.length;if(n!==s.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+s.length+" ("+s+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];return{fold:function(){if(arguments.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+arguments.length);return arguments[o].apply(null,r)},match:function(e){var n=sr.keys(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!M.forall(t,function(e){return M.contains(n,e)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,r)},log:function(e){console.log(e,{constructors:t,constructor:a,params:r})}}}}),n},Zu=Qu([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),ec=function(e,t,n,r){var o=r.getNode(!1===t);return yu(Hn.fromDom(e),Hn.fromDom(n.getNode())).map(function(e){return Ru(e)?Zu.remove(e.dom()):Zu.moveToElement(o)}).orThunk(function(){return E.some(Zu.moveToElement(o))})},tc=function(e,t,n){return Ws.fromPosition(t,e,n).bind(function(r){return t&&vo.isContentEditableFalse(r.getNode())?ec(e,t,n,r):!1===t&&vo.isContentEditableFalse(r.getNode(!0))?ec(e,t,n,r):t&&_a.isAfterContentEditableFalse(n)?E.some(Zu.moveToPosition(r)):!1===t&&_a.isBeforeContentEditableFalse(n)?E.some(Zu.moveToPosition(r)):E.none()})},nc=function(e,t,n){return i=t,a=n.getNode(!1===i),s=i?"after":"before",vo.isElement(a)&&a.getAttribute("data-mce-caret")===s?(r=t,o=n.getNode(!1===t),r&&vo.isContentEditableFalse(o.nextSibling)?E.some(Zu.moveToElement(o.nextSibling)):!1===r&&vo.isContentEditableFalse(o.previousSibling)?E.some(Zu.moveToElement(o.previousSibling)):E.none()).fold(function(){return tc(e,t,n)},E.some):tc(e,t,n).bind(function(t){return r=e,o=n,t.fold(function(e){return E.some(Zu.remove(e))},function(e){return E.some(Zu.moveToElement(e))},function(e){return _a.isInSameBlock(o,e,r)?E.none():E.some(Zu.moveToPosition(e))});var r,o});var r,o,i,a,s},rc=function(e,t,n){var r=_a.normalizeRange(t?1:-1,e,n),o=ia.fromRangeStart(r);return!1===t&&_a.isAfterContentEditableFalse(o)?E.some(Zu.remove(o.getNode(!0))):t&&_a.isBeforeContentEditableFalse(o)?E.some(Zu.remove(o.getNode())):nc(e,t,o)},oc=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===ia.isTextPosition(n)&&o===r.parentNode&&i>ia.before(r).offset()?new ia(t.container(),t.offset()-1):t;var n,r,o,i},ic=function(e){return Ei(e.previousSibling)?E.some((t=e.previousSibling,vo.isText(t)?new ia(t,t.data.length):ia.after(t))):e.previousSibling?Ws.lastPositionIn(e.previousSibling):E.none();var t},ac=function(e){return Ei(e.nextSibling)?E.some((t=e.nextSibling,vo.isText(t)?new ia(t,0):ia.before(t))):e.nextSibling?Ws.firstPositionIn(e.nextSibling):E.none();var t},sc=function(e,t){return ic(t).orThunk(function(){return ac(t)}).orThunk(function(){return n=e,r=t,o=ia.before(r.previousSibling?r.previousSibling:r.parentNode),Ws.prevPosition(n,o).fold(function(){return Ws.nextPosition(n,ia.after(r))},E.some);var n,r,o})},uc=function(e,t){return ac(t).orThunk(function(){return ic(t)}).orThunk(function(){return n=e,r=t,Ws.nextPosition(n,ia.after(r)).fold(function(){return Ws.prevPosition(n,ia.before(r))},E.some);var n,r})},cc=function(e,t,n){return(r=e,o=t,i=n,r?uc(o,i):sc(o,i)).map(y.curry(oc,n));var r,o,i},lc=function(e,t,n){n.fold(function(){e.focus()},function(n){e.selection.setRng(n.toRange(),t)})},fc=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Zn.name(t))},dc=function(e){if(Ru(e)){var t=Hn.fromHtml('<br data-mce-bogus="1">');return Bs.empty(e),ks.append(e,t),E.some(ia.before(t.dom()))}return E.none()},mc=function(e,t,n){var r,o,i,a=cc(t,e.getBody(),n.dom()),s=nu.ancestor(n,y.curry(fc,e),(r=e.getBody(),function(e){return e.dom()===r})),u=(o=n,i=a,hs([Ur.prevSibling(o),Ur.nextSibling(o),i],function(e,t,n){var r,i=e.dom(),a=t.dom();return vo.isText(i)&&vo.isText(a)?(r=i.data.length,i.appendData(a.data),Bs.remove(t),Bs.remove(o),n.container()===a?new ia(i,r):n):(Bs.remove(o),n)}).orThunk(function(){return Bs.remove(o),i}));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):s.bind(dc).fold(function(){lc(e,t,u)},function(n){lc(e,t,E.some(n))})},pc=function(e,t){return rc(e.getBody(),t,e.selection.getRng()).map(function(n){return n.fold((a=e,s=t,function(e){return a._selectionOverrides.hideFakeCaret(),mc(a,s,Hn.fromDom(e)),!0}),(o=e,i=t,function(e){var t=i?ia.before(e):ia.after(e);return o.selection.setRng(t.toRange()),!0}),(r=e,function(e){return r.selection.setRng(e.toRange()),!0}));var r,o,i,a,s}).getOr(!1)},gc=function(e,t){var n,r=e.selection.getNode();return!!vo.isContentEditableFalse(r)&&(n=Hn.fromDom(e.getBody()),M.each(Os(n,".mce-offscreen-selection"),Bs.remove),mc(e,t,Hn.fromDom(e.selection.getNode())),bu(e),!0)},hc=function(e,t){return e.selection.isCollapsed()?pc(e,t):gc(e,t)},vc=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(vo.isContentEditableTrue(t)||vo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return vo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(ia.before(t).toRange())),!0},yc=vo.isText,bc=function(e){return yc(e)&&e.data[0]===oi},Cc=function(e){return yc(e)&&e.data[e.data.length-1]===oi},xc=function(e){return e.ownerDocument.createTextNode(oi)},wc=function(e,t){return e?function(e){if(yc(e.previousSibling))return Cc(e.previousSibling)?e.previousSibling:(e.previousSibling.appendData(oi),e.previousSibling);if(yc(e))return bc(e)?e:(e.insertData(0,oi),e);var t=xc(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(yc(e.nextSibling))return bc(e.nextSibling)?e.nextSibling:(e.nextSibling.insertData(0,oi),e.nextSibling);if(yc(e))return Cc(e)?e:(e.appendData(oi),e);var t=xc(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Nc={insertInline:wc,insertInlineBefore:y.curry(wc,!0),insertInlineAfter:y.curry(wc,!1)},Ec=vo.isElement,Sc=vo.isText,kc=function(e){var t=e.parentNode;t&&t.removeChild(e)},Tc=function(e,t){0===t.length?kc(e):e.nodeValue=t},Ac=function(e){var t=ii(e);return{count:e.length-t.length,text:t}},_c=function(e,t){return Dc(e),t},Bc=function(e,t){return t.container()===e?(r=t,o=Ac((n=e).data.substr(0,r.offset())),i=Ac(n.data.substr(r.offset())),(a=o.text+i.text).length>0?(Tc(n,a),new ia(n,r.offset()-o.count)):r):_c(e,t);var n,r,o,i,a},Rc=function(e,t){return t.container()===e.parentNode?(n=e,o=(r=t).container(),i=M.indexOf(o.childNodes,n).map(function(e){return e<r.offset()?new ia(o,r.offset()-1):r}).getOr(r),Dc(n),i):_c(e,t);var n,r,o,i},Dc=function(e){if(Ec(e)&&mi.isCaretContainer(e)&&(mi.hasContent(e)?e.removeAttribute("data-mce-caret"):kc(e)),Sc(e)){var t=ii(function(e){try{return e.nodeValue}catch(t){return""}}(e));Tc(e,t)}},Oc={removeAndReposition:function(e,t){return ia.isTextPosition(t)?Bc(e,t):Rc(e,t)},remove:Dc},Pc=function(e,t){return vo.isText(e.container())?Nc.insertInline(t,e.container()):Nc.insertInline(t,e.getNode())},Ic=function(e,t){var n=t.get();return n&&e.container()===n&&mi.isCaretContainerInline(n)},Lc=function(e,t){return t.fold(function(t){Oc.remove(e.get());var n=Nc.insertInlineBefore(t);return e.set(n),E.some(new ia(n,n.length-1))},function(t){return Ws.firstPositionIn(t).map(function(t){if(Ic(t,e))return new ia(e.get(),1);Oc.remove(e.get());var n=Pc(t,!0);return e.set(n),new ia(n,1)})},function(t){return Ws.lastPositionIn(t).map(function(t){if(Ic(t,e))return new ia(e.get(),e.get().length-1);Oc.remove(e.get());var n=Pc(t,!1);return e.set(n),new ia(n,n.length-1)})},function(t){Oc.remove(e.get());var n=Nc.insertInlineAfter(t);return e.set(n),E.some(new ia(n,1))})},Mc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},Fc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},zc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},Uc={isInlineBlock:Mc,moveStart:function(e,t,n){var r,o,i,a=n.startContainer,s=n.startOffset;if((n.startContainer!==n.endContainer||!Mc(n.startContainer.childNodes[n.startOffset]))&&(3===a.nodeType&&s>=a.nodeValue.length&&(s=e.nodeIndex(a),a=a.parentNode),1===a.nodeType))for(s<(i=a.childNodes).length?(a=i[s],r=new to(a,e.getParent(a,e.isBlock))):(a=i[i.length-1],(r=new to(a,e.getParent(a,e.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Fc(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!Fc(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:Fc,replaceVars:function(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e},isEq:function(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:zc,getStyle:function(e,t,n){return zc(e,e.getStyle(t,n),n)},getTextDecoration:function(e,t){var n;return e.getParent(t,function(t){return(n=e.getStyle(t,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Vc=xs.isBookmarkNode,Hc=Uc.getParents,qc=Uc.isWhiteSpaceNode,jc=Uc.isTextBlock,$c=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Wc=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Kc=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?-1===(o=(o=a.lastIndexOf(" ",r))>(i=a.lastIndexOf("\xa0",r))?o:i)||t||o++:(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Xc=function(e,t,n,r,o,i){var a,s,u,c;if(3===n.nodeType){if(-1!==(u=Kc(o,i,n,r)))return{container:n,offset:u};c=n}for(a=new to(n,e.getParent(n,e.isBlock)||t);s=a[o?"prev":"next"]();)if(3===s.nodeType){if(c=s,-1!==(u=Kc(o,i,s)))return{container:s,offset:u}}else if(e.isBlock(s))break;if(c)return{container:c,offset:r=o?0:c.length}},Yc=function(e,t,n,r,o){var i,a,s,u;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=Hc(e,r),a=0;a<i.length;a++)for(s=0;s<t.length;s++)if(!("collapsed"in(u=t[s])&&u.collapsed!==n.collapsed)&&e.is(i[a],u.selector))return i[a];return r},Gc=function(e,t,n,r){var o,i=e.dom,a=i.getRoot();if(t[0].wrapper||(o=i.getParent(n,t[0].block,a)),!o){var s=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(t){return t!==a&&jc(e,t)},s)}if(o&&t[0].wrapper&&(o=Hc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Uc.isEq(o,"br")););return o||n},Jc=function(e,t,n,r,o,i,a){var s,u,c,l,f,d;if(s=u=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===s.nodeType&&!qc(s)&&(a?r>0:i<s.nodeValue.length))return s;for(;;){if(!t[0].block_expand&&e.isBlock(u))return u;for(c=u[l];c;c=c[l])if(!Vc(c)&&!qc(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return u;if(u===f||u.parentNode===f){s=u;break}u=u.parentNode}return s},Qc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,s=t.endContainer,u=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=zi(i,a)).nodeType&&(a=0),1===s.nodeType&&s.hasChildNodes()&&3===(s=zi(s,t.collapsed?u:u-1)).nodeType&&(u=s.nodeValue.length),i=Wc(c,i),s=Wc(c,s),(Vc(i.parentNode)||Vc(i))&&3===(i=(i=Vc(i)?i:i.parentNode).nextSibling||i).nodeType&&(a=0),(Vc(s.parentNode)||Vc(s))&&3===(s=(s=Vc(s)?s:s.parentNode).previousSibling||s).nodeType&&(u=s.length),n[0].inline&&(t.collapsed&&((o=Xc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Xc(c,e.getBody(),s,u,!1,r))&&(s=o.container,u=o.offset)),s=r?s:function(e,t){var n=$c(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=$c(n.node.previousSibling);n.node&&n.offset>0&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&n.offset>1&&(e=n.node).splitText(n.offset-1)}return e}(s,u)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Jc(c,n,i,a,s,u,!0)),n[0].inline&&3===s.nodeType&&u!==s.nodeValue.length||(s=Jc(c,n,i,a,s,u,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=Yc(c,n,t,i,"previousSibling"),s=Yc(c,n,t,s,"nextSibling")),(n[0].block||n[0].selector)&&(i=Gc(e,n,i,"previousSibling"),s=Gc(e,n,s,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Jc(c,n,i,a,s,u,!0)),c.isBlock(s)||(s=Jc(c,n,i,a,s,u,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===s.nodeType&&(u=c.nodeIndex(s)+1,s=s.parentNode),{startContainer:i,startOffset:a,endContainer:s,endOffset:u}},Zc=Uc.isEq,el=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},tl=function(e,t,n,r){var o=e.dom.getRoot();return t!==o&&(t=e.dom.getParent(t,function(t){return!!el(e,t,n)||t.parentNode===o||!!ol(e,t,n,r,!0)}),ol(e,t,n,r))},nl=function(e,t,n){return!!Zc(t,n.inline)||!!Zc(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},rl=function(e,t,n,r,o,i){var a,s,u,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(s="attributes"===r?e.getAttrib(t,a):Uc.getStyle(e,t,a),o&&!s&&!n.exact)return;if((!o||n.exact)&&!Zc(s,Uc.normalizeStyleValue(e,Uc.replaceVars(c[a],i),a)))return}}else for(u=0;u<c.length;u++)if("attributes"===r?e.getAttrib(t,c[u]):Uc.getStyle(e,t,c[u]))return n;return n},ol=function(e,t,n,r,o){var i,a,s,u,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],nl(e.dom,t,i)&&rl(l,t,i,"attributes",o,r)&&rl(l,t,i,"styles",o,r)){if(u=i.classes)for(s=0;s<u.length;s++)if(!e.dom.hasClass(t,u[s]))return;return i}},il={matchNode:ol,matchName:nl,match:function(e,t,n,r){var o;return r?tl(e,r,t,n):(r=e.selection.getNode(),!!tl(e,r,t,n)||!((o=e.selection.getStart())===r||!tl(e,o,t,n)))},matchAll:function(e,t,n){var r,o=[],i={};return r=e.selection.getStart(),e.dom.getParent(r,function(r){var a,s;for(a=0;a<t.length;a++)s=t[a],!i[s]&&ol(e,r,s,n)&&(i[s]=!0,o.push(s))},e.dom.getRoot()),o},canApply:function(e,t){var n,r,o,i,a,s=e.formatter.get(t),u=e.dom;if(s)for(n=e.selection.getStart(),r=Uc.getParents(u,n),i=s.length-1;i>=0;i--){if(!(a=s[i].selector)||s[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(u.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:el},al=function(e,t){return e.splitText(t)},sl={split:function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&vo.isText(t)?n>0&&n<t.nodeValue.length&&(t=(r=al(t,n)).previousSibling,o>n?(t=r=al(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(vo.isText(t)&&n>0&&n<t.nodeValue.length&&(t=al(t,n),n=0),vo.isText(r)&&o>0&&o<r.nodeValue.length&&(o=(r=al(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}}},ul=oi,cl="_mce_caret",ll=function(e){return 1===e.nodeType&&e.id===cl},fl=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==ul||e.childNodes.length>1)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length>0},dl=function(e){var t;if(e)for(e=(t=new to(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},ml=function(e){var t=Hn.fromTag("span");return dr.setAll(t,{id:cl,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&ks.append(t,Hn.fromText(ul)),t},pl=function(e,t){for(;t&&t!==e;){if(t.id===cl)return t;t=t.parentNode}return null},gl=function(e,t,n,r){var o,i,a,s;o=t.getRng(!0),i=e.getParent(n,e.isBlock),fl(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):((s=dl(n))&&s.nodeValue.charAt(0)===ul&&s.deleteData(0,1),a=s,o.startContainer===a&&o.startOffset>0&&o.setStart(a,o.startOffset-1),o.endContainer===a&&o.endOffset>0&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&Is(Hn.fromDom(i)),t.setRng(o)},hl=function(e,t,n,r,o){if(r)gl(t,n,r,o);else if(!(r=pl(e,n.getStart())))for(;r=t.get(cl);)gl(t,n,r,!1)},vl=function(e,t,n){var r=e.dom,o=r.getParent(n,ji.curry(Uc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Ps(Hn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},yl=function(e,t){return e.appendChild(t),t},bl=function(e,t){var n=M.foldr(e,function(e,t){return yl(e,t.cloneNode(!1))},t);return yl(n,n.ownerDocument.createTextNode(ul))},Cl=function(e){var t=e.dom,n=e.selection,r=e.getBody();e.on("mouseup keydown",function(e){var o,i,a,s;o=r,i=t,a=n,s=e.keyCode,hl(o,i,a,null,!1),8===s&&a.isCollapsed()&&a.getStart().innerHTML===ul&&hl(o,i,a,pl(o,a.getStart())),37!==s&&39!==s||hl(o,i,a,pl(o,a.getStart()))})},xl=function(e,t,n){var r,o,i,a,s,u,c=e.selection;a=(r=c.getRng(!0)).startOffset,u=r.startContainer.nodeValue,(o=pl(e.getBody(),c.getStart()))&&(i=dl(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;u&&a>0&&a<u.length&&d.test(u.charAt(a))&&d.test(u.charAt(a-1))?(s=c.getBookmark(),r.collapse(!0),r=Qc(e,r,e.formatter.get(t)),r=sl.split(r),e.formatter.apply(t,n,r),c.moveToBookmark(s)):(o&&i.nodeValue===ul?e.formatter.apply(t,n,o):(l=e.getDoc(),f=ml(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1,e.formatter.apply(t,n,o)),c.setCursorLocation(i,a))},wl=function(e,t,n,r){var o,i,a,s,u,c,l,f=e.dom,d=e.selection,m=[],p=d.getRng();for(o=p.startContainer,i=p.startOffset,u=o,3===o.nodeType&&(i!==o.nodeValue.length&&(s=!0),u=u.parentNode);u;){if(il.matchNode(e,u,t,n,r)){c=u;break}u.nextSibling&&(s=!0),m.push(u),u=u.parentNode}if(c)if(s){a=d.getBookmark(),p.collapse(!0);var g=Qc(e,p,e.formatter.get(t),!0);g=sl.split(g),e.formatter.remove(t,n,g),d.moveToBookmark(a)}else{l=pl(e.getBody(),c);var h=ml(!1).dom(),v=bl(m,h);vl(e,h,l||c),gl(f,d,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}},Nl=ll,El=pl,Sl=function(e,t){var n=ml(!1),r=bl(t,n.dom());return ks.before(Hn.fromDom(e),n),Bs.remove(Hn.fromDom(e)),ia(r,0)},kl=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(Zn.name(t))&&!ll(t.dom())&&!vo.isBogus(t.dom())},Tl=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return E.none()},Al=Qu([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),_l=function(e,t){var n=_a.getParentBlock(t,e);return n||e},Bl=function(e,t,n){var r=vu.normalizeForwards(n),o=_l(t,r.container());return vu.findRootInline(e,o,r).fold(function(){return Ws.nextPosition(o,r).bind(y.curry(vu.findRootInline,e,o)).map(function(e){return Al.before(e)})},E.none)},Rl=function(e,t){return null===El(e,t)},Dl=function(e,t,n){return vu.findRootInline(e,t,n).filter(y.curry(Rl,t))},Ol=function(e,t,n){var r=vu.normalizeBackwards(n);return Dl(e,t,r).bind(function(e){return Ws.prevPosition(e,r).isNone()?E.some(Al.start(e)):E.none()})},Pl=function(e,t,n){var r=vu.normalizeForwards(n);return Dl(e,t,r).bind(function(e){return Ws.nextPosition(e,r).isNone()?E.some(Al.end(e)):E.none()})},Il=function(e,t,n){var r=vu.normalizeBackwards(n),o=_l(t,r.container());return vu.findRootInline(e,o,r).fold(function(){return Ws.prevPosition(o,r).bind(y.curry(vu.findRootInline,e,o)).map(function(e){return Al.after(e)})},E.none)},Ll=function(e){return!1===vu.isRtl(Fl(e))},Ml=function(e,t,n){return Tl([Bl,Ol,Pl,Il],[e,t,n]).filter(Ll)},Fl=function(e){return e.fold(y.identity,y.identity,y.identity,y.identity)},zl=function(e){return e.fold(y.constant("before"),y.constant("start"),y.constant("end"),y.constant("after"))},Ul=function(e){return e.fold(Al.before,Al.before,Al.after,Al.after)},Vl=function(e,t,n,r,o,i){return hs([vu.findRootInline(t,n,r),vu.findRootInline(t,n,o)],function(t,r){return t!==r&&vu.hasSameParentBlock(n,t,r)?Al.after(e?t:r):i}).getOr(i)},Hl=function(e,t){return e.fold(y.constant(!0),function(e){return r=t,!(zl(n=e)===zl(r)&&Fl(n)===Fl(r));var n,r})},ql=function(e,t){return e?t.fold(y.compose(E.some,Al.start),E.none,y.compose(E.some,Al.after),E.none):t.fold(E.none,y.compose(E.some,Al.before),E.none,y.compose(E.some,Al.end))},jl=function(e,t,n,r){var o=vu.normalizePosition(e,r),i=Ml(t,n,o);return Ml(t,n,o).bind(y.curry(ql,e)).orThunk(function(){return o=e,a=t,s=n,u=i,c=r,l=vu.normalizePosition(o,c),Ws.fromPosition(o,s,l).map(y.curry(vu.normalizePosition,o)).fold(function(){return u.map(Ul)},function(e){return Ml(a,s,e).map(y.curry(Vl,o,a,s,l,e)).filter(y.curry(Hl,u))}).filter(Ll);var o,a,s,u,c,l})},$l=Ml,Wl=jl,Kl=(y.curry(jl,!1),y.curry(jl,!0),Ul),Xl=function(e){return e.fold(Al.start,Al.start,Al.end,Al.end)},Yl=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Yl(n())}}},Gl=function(e){return tr.isFunction(e.selection.getSel().modify)},Jl=function(e,t,n){var r=e?1:-1;return t.setRng(ia(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Ql=function(e,t){var n=t.selection.getRng(),r=e?ia.fromRangeEnd(n):ia.fromRangeStart(n);return!!Gl(t)&&(e&&mi.isBeforeInline(r)?Jl(!0,t.selection,r):!(e||!mi.isAfterInline(r))&&Jl(!1,t.selection,r))},Zl=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},ef=function(e){return!1!==e.settings.inline_boundaries},tf=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},nf=function(e,t,n){return Lc(t,n).map(function(t){return Zl(e,t),n})},rf=function(e,t,n){return function(){return!!ef(t)&&Ql(e,t)}},of={move:function(e,t,n){return function(){return!!ef(e)&&(r=e,o=t,i=n,a=r.getBody(),s=ia.fromRangeStart(r.selection.getRng()),u=y.curry(vu.isInlineTarget,r),Wl(i,u,a,s).bind(function(e){return nf(r,o,e)})).isSome();var r,o,i,a,s,u}},moveNextWord:y.curry(rf,!0),movePrevWord:y.curry(rf,!1),setupSelectedState:function(e){var t=new Yl(null),n=y.curry(vu.isInlineTarget,e);return e.on("NodeChange",function(r){var o,i,a,s,u;ef(e)&&(o=n,i=e.dom,a=r.parents,s=M.filter(i.select('*[data-mce-selected="inline-boundary"]'),o),u=M.filter(a,o),M.each(M.difference(s,u),y.curry(tf,!1)),M.each(M.difference(u,s),y.curry(tf,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=ia.fromRangeStart(e.selection.getRng());ia.isTextPosition(n)&&!1===vu.isAtZwsp(n)&&(Zl(e,Oc.removeAndReposition(t.get(),n)),t.set(null))}}(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=M.filter(r,e);M.each(o,function(r){var o=ia.fromRangeStart(t.selection.getRng());$l(e,t.getBody(),o).bind(function(e){return nf(t,n,e)})})}}(n,e,t,r.parents))}),t},setCaretPosition:Zl},af=function(e,t){return function(n){return Lc(t,n).map(function(t){return of.setCaretPosition(e,t),!0}).getOr(!1)}},sf=function(e,t,n,r){var o=e.getBody(),i=y.curry(vu.isInlineTarget,e);e.undoManager.ignore(function(){var a,s,u;e.selection.setRng((a=n,s=r,(u=document.createRange()).setStart(a.container(),a.offset()),u.setEnd(s.container(),s.offset()),u)),e.execCommand("Delete"),$l(i,o,ia.fromRangeStart(e.selection.getRng())).map(Xl).map(af(e,t))}),e.nodeChanged()},uf=function(e,t,n,r){var o,i,a=(o=e.getBody(),i=r.container(),_a.getParentBlock(i,o)||o),s=y.curry(vu.isInlineTarget,e),u=$l(s,a,r);return u.bind(function(e){return n?e.fold(y.constant(E.some(Xl(e))),E.none,y.constant(E.some(Kl(e))),E.none):e.fold(E.none,y.constant(E.some(Kl(e))),E.none,y.constant(E.some(Xl(e))))}).map(af(e,t)).getOrThunk(function(){var o=Ws.navigate(n,a,r),i=o.bind(function(e){return $l(s,a,e)});return u.isSome()&&i.isSome()?vu.findRootInline(s,a,r).map(function(t){return r=t,!!hs([Ws.firstPositionIn(r),Ws.lastPositionIn(r)],function(e,t){var n=vu.normalizePosition(!0,e),o=vu.normalizePosition(!1,t);return Ws.nextPosition(r,n).map(function(e){return e.isEqual(o)}).getOr(!0)}).getOr(!0)&&(mc(e,n,Hn.fromDom(t)),!0);var r}).getOr(!1):i.bind(function(i){return o.map(function(o){return n?sf(e,t,r,o):sf(e,t,o,r),!0})}).getOr(!1)})},cf=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=ia.fromRangeStart(e.selection.getRng());return uf(e,t,n,r)}return!1},lf=xr("start","end"),ff=xr("rng","table","cells"),df=Qu([{removeTable:["element"]},{emptyCells:["cells"]}]),mf=function(e,t){return Eu(Hn.fromDom(e),"td,th",t)},pf=function(e,t){return wu(e,"table",t)},gf=function(e){return!1===Dr.eq(e.start(),e.end())},hf=function(e,t){return(n=e,r=t,pf(n.start(),r).bind(function(e){return pf(n.end(),r).bind(function(t){return Dr.eq(e,t)?E.some(e):E.none()})})).bind(function(t){var n=Os(t,"td,th");return ff(e,t,n)});var n,r},vf=function(e,t){var n,r,o=y.curry(Dr.eq,e);return(n=t,r=o,hs([mf(n.startContainer,r),mf(n.endContainer,r)],lf).filter(gf)).map(function(e){return hf(e,o)})},yf=function(e,t){return M.findIndex(e,function(e){return Dr.eq(e,t)})},bf=function(e){return(t=e,hs([yf(t.cells(),t.rng().start()),yf(t.cells(),t.rng().end())],function(e,n){return t.cells().slice(e,n+1)})).bind(function(t){var n=e.cells();return t.length===n.length?df.removeTable(e.table()):df.emptyCells(t)});var t},Cf=function(e,t){return vf(e,t).map(bf)},xf=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},wf=xf,Nf=function(e){return M.bind(e,function(e){var t=Fi(e);return t?[Hn.fromDom(t)]:[]})},Ef=function(e){return xf(e).length>1},Sf=function(e){return M.filter(Nf(e),io.isTableCell)},kf=function(e){return Os(e,"td[data-mce-selected],th[data-mce-selected]")},Tf=function(e,t){var n=kf(t),r=Sf(e);return n.length>0?n:r},Af=Tf,_f=function(e){return Tf(wf(e.selection.getSel()),Hn.fromDom(e.getBody()))},Bf=function(e,t){return M.each(t,Is),e.selection.setCursorLocation(t[0].dom(),0),!0},Rf=function(e,t){return mc(e,!1,t),!0},Df=function(e,t,n,r){return Pf(t,r).fold(function(){return r=e,Cf(t,n).map(function(e){return e.fold(y.curry(Rf,r),y.curry(Bf,r))});var r},function(t){return If(e,t)}).getOr(!1)},Of=function(e,t){return M.find(Uu(t,e),io.isTableCell)},Pf=function(e,t){return M.find(Uu(t,e),function(e){return"caption"===Zn.name(e)})},If=function(e,t){return Is(t),e.selection.setCursorLocation(t.dom(),0),E.some(!0)},Lf=function(e,t,n,r,o){return Ws.navigate(n,e.getBody(),o).bind(function(i){return u=r,c=n,l=o,f=i,Ws.firstPositionIn(u.dom()).bind(function(e){return Ws.lastPositionIn(u.dom()).map(function(t){return c?l.isEqual(e)&&f.isEqual(t):l.isEqual(t)&&f.isEqual(e)})}).getOr(!0)?If(e,r):(a=r,s=i,Pf(t,Hn.fromDom(s.getNode())).map(function(e){return!1===Dr.eq(e,a)}));var a,s,u,c,l,f}).or(E.some(!0))},Mf=function(e,t,n,r){var o=ia.fromRangeStart(e.selection.getRng());return Of(n,r).bind(function(r){return Ru(r)?If(e,r):(i=e,a=n,s=t,u=r,c=o,Ws.navigate(s,i.getBody(),c).bind(function(e){return Of(a,Hn.fromDom(e.getNode())).map(function(e){return!1===Dr.eq(e,u)})}));var i,a,s,u,c})},Ff=function(e,t,n){var r=Hn.fromDom(e.getBody());return Pf(r,n).fold(function(){return Mf(e,t,r,n)},function(n){return o=e,i=t,a=r,s=n,u=ia.fromRangeStart(o.selection.getRng()),Ru(s)?If(o,s):Lf(o,a,i,s,u);var o,i,a,s,u}).getOr(!1)},zf=function(e,t){var n,r,o,i,a,s=Hn.fromDom(e.selection.getStart(!0));return e.selection.isCollapsed()?Ff(e,t,s):(n=e,r=s,o=Hn.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=_f(n)).length?Bf(n,a):Df(n,o,i,r))},Uf=function(e,t){e.getDoc().execCommand(t,!1,null)},Vf=function(e){hc(e,!1)||cf(e,!1)||Ku(e,!1)||zf(e)||Ju(e,!1)||(Uf(e,"Delete"),bu(e))},Hf=function(e){hc(e,!0)||cf(e,!0)||Ku(e,!0)||zf(e)||Ju(e,!0)||Uf(e,"ForwardDelete")},qf=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},jf=xr("container","offset"),$f=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},Wf=function(e,t,n){return $f(e,t,function(e){return e.nodeName===n})},Kf=function(e){return e&&"TABLE"===e.nodeName},Xf=function(e,t,n){for(var r=new to(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(vo.isBr(t))return!0},Yf=function(e,t,n,r,o){var i,a,s,u,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(s=e.getParent(o.parentNode,e.isBlock)||f,r&&vo.isBr(o)&&t&&e.isEmpty(s))return E.some(jf(o.parentNode,e.nodeIndex(o)));for(i=new to(o,s);u=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(u)||(c=u,l=f,mi.isCaretContainer(c)&&!1===$f(c,l,Nl)))return E.none();if(vo.isText(u)&&u.nodeValue.length>0)return!1===Wf(u,f,"A")?E.some(jf(u,r?u.nodeValue.length:0)):E.none();if(e.isBlock(u)||d[u.nodeName.toLowerCase()])return E.none();a=u}return n&&a?E.some(jf(a,0)):E.none()},Gf=function(e,t,n,r){var o,i,a,s,u,c,l,f,d,m,p=e.getRoot(),g=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=vo.isElement(o)&&i===o.childNodes.length,u=e.schema.getNonEmptyElements(),c=n,mi.isCaretContainer(o))return E.none();if(vo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),vo.isDocument(o)&&(o=p,i=0),o===p){if(c&&(s=o.childNodes[i>0?i-1:0])){if(mi.isCaretContainer(s))return E.none();if(u[s.nodeName]||Kf(s))return E.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=vo.isText(o)&&l?o.data.length:0,!t&&o===p.lastChild&&Kf(o))return E.none();if(function(e,t){for(;t&&t!==e;){if(vo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(p,o)||mi.isCaretContainer(o))return E.none();if(o.hasChildNodes()&&!1===Kf(o)){s=o,a=new to(o,p);do{if(vo.isContentEditableFalse(s)||mi.isCaretContainer(s)){g=!1;break}if(vo.isText(s)&&s.nodeValue.length>0){i=c?0:s.nodeValue.length,o=s,g=!0;break}if(u[s.nodeName.toLowerCase()]&&(!(f=s)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(s),o=s.parentNode,"IMG"!==s.nodeName&&"PRE"!==s.nodeName||c||i++,g=!0;break}}while(s=c?a.next():a.prev())}}}return t&&(vo.isText(o)&&0===i&&Yf(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),vo.isElement(o)&&((s=o.childNodes[i])||(s=o.childNodes[i-1]),!s||!vo.isBr(s)||(m="A",(d=s).previousSibling&&d.previousSibling.nodeName===m)||Xf(e,s,!1)||Xf(e,s,!0)||Yf(e,l,t,!0,s).each(function(e){o=e.container(),i=e.offset(),g=!0}))),c&&!t&&vo.isText(o)&&i===o.nodeValue.length&&Yf(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),g?E.some(jf(o,i)):E.none()},Jf={normalize:function(e,t){var n=t.collapsed,r=t.cloneRange();return Gf(e,n,!0,r).each(function(e){r.setStart(e.container(),e.offset())}),n||Gf(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),qf(t,r)?E.none():E.some(r)}},Qf=function(e,t,n){var r=e.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Zf=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},ed=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Jf.normalize(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var s=a.startOffset,u=a.startContainer;if(1===u.nodeType&&u.hasChildNodes()){var c=s>u.childNodes.length-1;u=u.childNodes[Math.min(s,u.childNodes.length-1)]||u,s=c&&3===u.nodeType?u.nodeValue.length:0}var l=i.getParent(u,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),u&&3===u.nodeType&&s>=u.nodeValue.length&&(function(e,t,n){for(var r,o=new to(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(e.schema,u,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),Qf(i,o,n),Zf(i,o,n,r),e.undoManager.add()},td=function(e,t){var n=Hn.fromTag("br");ks.before(Hn.fromDom(t),n),e.undoManager.add()},nd=function(e,t){rd(e.getBody(),t)||ks.after(Hn.fromDom(t),Hn.fromTag("br"));var n=Hn.fromTag("br");ks.after(Hn.fromDom(t),n),Qf(e.dom,e.selection,n.dom()),Zf(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},rd=function(e,t){return n=ia.after(t),!!vo.isBr(n.getNode())||Ws.nextPosition(e,ia.after(t)).map(function(e){return vo.isBr(e.getNode())}).getOr(!1);var n},od=function(e){return e&&"A"===e.nodeName&&"href"in e},id=function(e){return e.fold(y.constant(!1),od,od,y.constant(!1))},ad=function(e,t){t.fold(y.noop,y.curry(td,e),y.curry(nd,e),y.noop)},sd=function(e,t){var n,r,o,i=(n=e,r=y.curry(vu.isInlineTarget,n),o=ia.fromRangeStart(n.selection.getRng()),$l(r,n.getBody(),o).filter(id));i.isSome()?i.each(y.curry(ad,e)):ed(e,t)},ud=Qu([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),cd=(ud.before,ud.on,ud.after,function(e){return e.fold(y.identity,y.identity,y.identity)}),ld=Qu([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),fd=xr("start","soffset","finish","foffset"),dd={domRange:ld.domRange,relative:ld.relative,exact:ld.exact,exactFromRange:function(e){return ld.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:fd,getWin:function(e){var t=e.match({domRange:function(e){return Hn.fromDom(e.startContainer)},relative:function(e,t){return cd(e)},exact:function(e,t,n,r){return e}});return Ur.defaultView(t)}},md=Un.detect().browser,pd=function(e,t){var n=Zn.isText(t)?Ds(t).length:Ur.children(t).length+1;return e>n?n:e<0?0:e},gd=function(e){return dd.range(e.start(),pd(e.soffset(),e.start()),e.finish(),pd(e.foffset(),e.finish()))},hd=function(e,t){return Dr.contains(e,t)||Dr.eq(e,t)},vd=function(e){return function(t){return hd(e,t.start())&&hd(e,t.finish())}},yd=function(e){return!0===e.inline||md.isIE()},bd=function(e){return dd.range(Hn.fromDom(e.startContainer),e.startOffset,Hn.fromDom(e.endContainer),e.endOffset)},Cd=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?E.from(t.getRangeAt(0)):E.none()).map(bd)},xd=function(e){var t=Ur.defaultView(e);return Cd(t.dom()).filter(vd(e))},wd=function(e,t){return E.from(t).filter(vd(e)).map(gd)},Nd=function(e){var t=document.createRange();return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),E.some(t)},Ed=function(e){return(e.bookmark?e.bookmark:E.none()).bind(y.curry(wd,Hn.fromDom(e.getBody()))).bind(Nd)},Sd=function(e){var t=yd(e)?xd(Hn.fromDom(e.getBody())):E.none();e.bookmark=t.isSome()?t:e.bookmark},kd=function(e){Ed(e).each(function(t){e.selection.setRng(t)})},Td=Ed,Ad=Ot.each,_d=Ot.extend,Bd=Ot.map,Rd=Ot.inArray,Dd=Ot.explode,Od=function(e){var t,n,r,o,i={state:{},exec:{},value:{}},a=e.settings;e.on("PreInit",function(){t=e.dom,n=e.selection,a=e.settings,r=e.formatter});var s=function(t){var n;if(!e.quirks.isHidden()&&!e.removed){if(t=t.toLowerCase(),n=i.state[t])return n(t);try{return e.getDoc().queryCommandState(t)}catch(r){}return!1}},u=function(e,t){t=t||"exec",Ad(e,function(e,n){Ad(n.toLowerCase().split(","),function(n){i[t][n]=e})})};_d(this,{execCommand:function(t,n,r,o){var a,s,u=!1;if(!e.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||o&&o.skip_focus?kd(e):e.focus(),(o=e.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(s=t.toLowerCase(),a=i.exec[s])return a(s,n,r),e.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(Ad(e.plugins,function(o){if(o.execCommand&&o.execCommand(t,n,r))return e.fire("ExecCommand",{command:t,ui:n,value:r}),u=!0,!1}),u)return u;if(e.theme&&e.theme.execCommand&&e.theme.execCommand(t,n,r))return e.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{u=e.getDoc().execCommand(t,n,r)}catch(c){}return!!u&&(e.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:s,queryCommandValue:function(t){var n;if(!e.quirks.isHidden()&&!e.removed){if(t=t.toLowerCase(),n=i.value[t])return n(t);try{return e.getDoc().queryCommandValue(t)}catch(r){}}},queryCommandSupported:function(t){if(t=t.toLowerCase(),i.exec[t])return!0;try{return e.getDoc().queryCommandSupported(t)}catch(n){}return!1},addCommands:u,addCommand:function(t,n,r){t=t.toLowerCase(),i.exec[t]=function(t,o,i,a){return n.call(r||e,o,i,a)}},addQueryStateHandler:function(t,n,r){t=t.toLowerCase(),i.state[t]=function(){return n.call(r||e)}},addQueryValueHandler:function(t,n,r){t=t.toLowerCase(),i.value[t]=function(){return n.call(r||e)}},hasCustomCommand:function(e){return e=e.toLowerCase(),!!i.exec[e]}});var c=function(t,n,r){return n===undefined&&(n=!1),r===undefined&&(r=null),e.getDoc().execCommand(t,n,r)},l=function(e){return r.match(e)},f=function(t,n){r.toggle(t,n?{value:n}:undefined),e.nodeChanged()},d=function(e){o=n.getBookmark(e)},m=function(){n.moveToBookmark(o)};u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add()},"Cut,Copy,Paste":function(t){var n,r=e.getDoc();try{c(t)}catch(i){n=!0}if("paste"!==t||r.queryCommandEnabled(t)||(n=!0),n||!r.queryCommandSupported(t)){var o=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");me.mac&&(o=o.replace(/Ctrl\+/g,"\u2318+")),e.notificationManager.open({text:o,type:"error"})}},unlink:function(){if(n.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0)}else r.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),Ad("left,center,right,justify".split(","),function(e){t!==e&&r.remove("align"+e)}),"none"!==t&&f("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var r,o;c(e),(r=t.getParent(n.getNode(),"ol,ul"))&&(o=r.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)&&(d(),t.split(o,r),m()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){f(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){f(e,n)},FontSize:function(e,t,n){var r,o;n>=1&&n<=7&&(o=Dd(a.font_size_style_values),n=(r=Dd(a.font_size_classes))?r[n-1]||n:o[n-1]||n),f(e,n)},RemoveFormat:function(e){r.remove(e)},mceBlockQuote:function(){f("blockquote")},FormatBlock:function(e,t,n){return f(n||"p")},mceCleanup:function(){var t=n.getBookmark();e.setContent(e.getContent({cleanup:!0}),{cleanup:!0}),n.moveToBookmark(t)},mceRemoveNode:function(t,r,o){var i=o||n.getNode();i!==e.getBody()&&(d(),e.dom.remove(i,!0),m())},mceSelectNodeDepth:function(r,o,i){var a=0;t.getParent(n.getNode(),function(e){if(1===e.nodeType&&a++===i)return n.select(e),!1},e.getBody())},mceSelectNode:function(e,t,r){n.select(r)},mceInsertContent:function(t,n,r){Js(e,r)},mceInsertRawHTML:function(t,r,o){n.setContent("tiny_mce_marker"),e.setContent(e.getContent().replace(/tiny_mce_marker/g,function(){return o}))},mceToggleFormat:function(e,t,n){f(n)},mceSetContent:function(t,n,r){e.setContent(r)},"Indent,Outdent":function(o){var i,u,l;i=a.indentation,u=/[a-z%]+$/i.exec(i),i=parseInt(i,10),s("InsertUnorderedList")||s("InsertOrderedList")?c(o):(a.forced_root_block||t.getParent(n.getNode(),t.isBlock)||r.apply("div"),Ad(n.getSelectedBlocks(),function(n){if("false"!==t.getContentEditable(n)&&"LI"!==n.nodeName){var r=e.getParam("indent_use_margin",!1)?"margin":"padding";r="TABLE"===n.nodeName?"margin":r,r+="rtl"===t.getStyle(n,"direction",!0)?"Right":"Left","outdent"===o?(l=Math.max(0,parseInt(n.style[r]||0,10)-i),t.setStyle(n,r,l?l+u:"")):(l=parseInt(n.style[r]||0,10)+i+u,t.setStyle(n,r,l))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual()},mceReplaceContent:function(t,r,o){e.execCommand("mceInsertContent",!1,o.replace(/\{\$selection\}/g,n.getContent({format:"text"})))},mceInsertLink:function(e,o,i){var a;"string"==typeof i&&(i={href:i}),a=t.getParent(n.getNode(),"a"),i.href=i.href.replace(" ","%20"),a&&i.href||r.remove("link"),i.href&&r.apply("link",i,a)},selectAll:function(){var e=t.getParent(n.getStart(),vo.isContentEditableTrue);if(e){var r=t.createRng();r.selectNodeContents(e),n.setRng(r)}},"delete":function(){Vf(e)},forwardDelete:function(){Hf(e)},mceNewDocument:function(){e.setContent("")},InsertLineBreak:function(t,n,r){return sd(e,r),!0}}),u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var o="align"+e.substring(7),i=n.isCollapsed()?[t.getParent(n.getNode(),t.isBlock)]:n.getSelectedBlocks(),a=Bd(i,function(e){return!!r.matchNode(e,o)});return-1!==Rd(a,!0)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return l(e)},mceBlockQuote:function(){return l("blockquote")},Outdent:function(){var e;if(a.inline_styles){if((e=t.getParent(n.getStart(),t.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return!0;if((e=t.getParent(n.getEnd(),t.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return!0}return s("InsertUnorderedList")||s("InsertOrderedList")||!a.inline_styles&&!!t.getParent(n.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var r=t.getParent(n.getNode(),"ul,ol");return r&&("insertunorderedlist"===e&&"UL"===r.tagName||"insertorderedlist"===e&&"OL"===r.tagName)}},"state"),u({"FontSize,FontName":function(e){var r,o=0;return(r=t.getParent(n.getNode(),"span"))&&(o="fontsize"===e?r.style.fontSize:r.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),o}},"value"),u({Undo:function(){e.undoManager.undo()},Redo:function(){e.undoManager.redo()}})},Pd=Ot.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),Id=function(e){var t,n,r=this,o={},i=function(){return!1},a=function(){return!0};t=(e=e||{}).scope||r,n=e.toggleEvent||i;var s=function(e,t,a,s){var u,c,l;if(!1===t&&(t=i),t)for(t={func:t},s&&Ot.extend(t,s),l=(c=e.toLowerCase().split(" ")).length;l--;)e=c[l],(u=o[e])||(u=o[e]=[],n(e,!0)),a?u.unshift(t):u.push(t);return r},u=function(e,t){var i,a,s,u,c;if(e)for(i=(u=e.toLowerCase().split(" ")).length;i--;){if(e=u[i],a=o[e],!e){for(s in o)n(s,!1),delete o[s];return r}if(a){if(t)for(c=a.length;c--;)a[c].func===t&&(a=a.slice(0,c).concat(a.slice(c+1)),o[e]=a);else a.length=0;a.length||(n(e,!1),delete o[e])}}else{for(e in o)n(e,!1);o={}}return r};r.fire=function(n,r){var s,c,l,f;if(n=n.toLowerCase(),(r=r||{}).type=n,r.target||(r.target=t),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=a},r.stopPropagation=function(){r.isPropagationStopped=a},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=a},r.isDefaultPrevented=i,r.isPropagationStopped=i,r.isImmediatePropagationStopped=i),e.beforeFire&&e.beforeFire(r),s=o[n])for(c=0,l=s.length;c<l;c++){if((f=s[c]).once&&u(n,f.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===f.func.call(t,r))return r.preventDefault(),r}return r},r.on=s,r.off=u,r.once=function(e,t,n){return s(e,t,n,{once:!0})},r.has=function(e){return e=e.toLowerCase(),!(!o[e]||0===o[e].length)}};Id.isNative=function(e){return!!Pd[e.toLowerCase()]};var Ld,Md=function(e){return e._eventDispatcher||(e._eventDispatcher=new Id({scope:e,toggleEvent:function(t,n){Id.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher},Fd={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Md(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Md(this).on(e,t,n)},off:function(e,t){return Md(this).off(e,t)},once:function(e,t){return Md(this).once(e,t)},hasEventListeners:function(e){return Md(this).has(e)}},zd=Xo.DOM,Ud=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=zd.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},Vd=function(e,t){var n,r,o=function(e){return!e.hidden&&!e.readonly};if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed)if(n=Ud(e,t),e.settings.event_root){if(Ld||(Ld={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&Ld){for(t in Ld)e.dom.unbind(Ud(e,t));Ld=null}})),Ld[t])return;r=function(n){for(var r=n.target,i=e.editorManager.get(),a=i.length;a--;){var s=i[a].getBody();(s===r||zd.isChildOf(r,s))&&o(i[a])&&i[a].fire(t,n)}},Ld[t]=r,zd.bind(n,t,r)}else r=function(n){o(e)&&e.fire(t,n)},zd.bind(n,t,r),e.delegates[t]=r},Hd={bindPendingEventDelegates:function(){var e=this;Ot.each(e._pendingNativeEvents,function(t){Vd(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?Vd(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(Ud(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this;if(t.delegates){for(e in t.delegates)t.dom.unbind(Ud(t,e),e,t.delegates[e]);delete t.delegates}t.inline||(t.getBody().onload=null,t.dom.unbind(t.getWin()),t.dom.unbind(t.getDoc())),t.dom.unbind(t.getBody()),t.dom.unbind(t.getContainer())}},qd=Hd=Ot.extend({},Fd,Hd),jd=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},$d=function(e,t){var n,r,o;e._clickBlocker&&(e._clickBlocker.unbind(),e._clickBlocker=null),t?(e._clickBlocker=(r=(n=e).getBody(),o=function(e){n.dom.getParents(e.target,"a").length>0&&e.preventDefault()},n.dom.bind(r,"click",o),{unbind:function(){n.dom.unbind(r,"click",o)}}),e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable=!1):(e.readonly=!1,e.getBody().contentEditable=!0,jd(e,"StyleWithCSS",!1),jd(e,"enableInlineTableEditing",!1),jd(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},Wd=function(e,t){var n=e.readonly?"readonly":"design";t!==n&&(e.initialized?$d(e,"readonly"===t):e.on("init",function(){$d(e,"readonly"===t)}),e.fire("SwitchMode",{mode:t}))},Kd=Ot.each,Xd=Ot.explode,Yd={f9:120,f10:121,f11:122},Gd=Ot.makeMap("alt,ctrl,shift,meta,access"),Jd=function(e){var t={},n=[],r=function(e){var t,n,r={};for(n in Kd(Xd(e,"+"),function(e){e in Gd?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Yd[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Gd)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,me.mac?r.ctrl=!0:r.shift=!0),r.meta&&(me.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},o=function(t,n,o,i){var a;return(a=Ot.map(Xd(t,">"),r))[a.length-1]=Ot.extend(a[a.length-1],{func:o,scope:i||e}),Ot.extend(a[0],{desc:e.translate(n),subpatterns:a.slice(1)})},i=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},a=function(e){return e.func?e.func.call(e.scope):null};e.on("keyup keypress keydown",function(e){var r,o;((o=e).altKey||o.ctrlKey||o.metaKey||"keydown"===(r=e).type&&r.keyCode>=112&&r.keyCode<=123)&&!e.isDefaultPrevented()&&(Kd(t,function(t){if(i(e,t))return n=t.subpatterns.slice(0),"keydown"===e.type&&a(t),!0}),i(e,n[0])&&(1===n.length&&"keydown"===e.type&&a(n[0]),n.shift()))}),this.add=function(n,r,i,a){var s;return s=i,"string"==typeof i?i=function(){e.execCommand(s,!1,null)}:Ot.isArray(s)&&(i=function(){e.execCommand(s[0],s[1],s[2])}),Kd(Xd(Ot.trim(n.toLowerCase())),function(e){var n=o(e,r,i,a);t[n.id]=n}),!0},this.remove=function(e){var n=o(e);return!!t[n.id]&&(delete t[n.id],!0)}},Qd=Ot.each,Zd=function(e,t,n){var r,o,i,a,s=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])s--;else if(!o[1]){if(o[2]in a)continue;s++}if(0===s)break}return r},em=function(e,t){var n=this,r=function(){};e=e||{},n.schema=t=t||Fo(),!1!==e.fix_self_closing&&(e.fix_self_closing=!0),Qd("comment cdata text start end pi doctype".split(" "),function(t){t&&(n[t]=e[t]||r)}),n.parse=function(n){var r,o,i,a,s,u,c,l,f,d,m,p,g,h,v,y,b,C,x,w,N,E,S,k,T,A,_,B,R,D=this,O=0,P=[],I=0,L=Ao.decode,M=Ot.makeMap("src,href,data,background,formaction,poster"),F=/((java|vb)script|mhtml):/i,z=/^data:/i,U=function(e){var t,n;for(t=P.length;t--&&P[t].name!==e;);if(t>=0){for(n=P.length-1;n>=t;n--)(e=P[n]).valid&&D.end(e.name);P.length=t}},V=function(t,n,r,o,i){var s,u,c;if(r=(n=n.toLowerCase())in m?n:L(r||o||i||""),g&&!l&&0==(0===(c=n).indexOf("data-")||0===c.indexOf("aria-"))){if(!(s=C[n])&&x){for(u=x.length;u--&&!(s=x[u]).pattern.test(n););-1===u&&(s=null)}if(!s)return;if(s.validValues&&!(r in s.validValues))return}if(M[n]&&!e.allow_script_urls){var f=r.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(F.test(f))return;if(!e.allow_html_data_urls&&z.test(f)&&!/^data:image\//i.test(f))return}l&&(n in M||0===n.indexOf("on"))||(a.map[n]=r,a.push({name:n,value:r}))};for(T=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),A=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,d=t.getShortEndedElements(),k=e.self_closing_elements||t.getSelfClosingElements(),m=t.getBoolAttrs(),g=e.validate,f=e.remove_internals,R=e.fix_self_closing,_=t.getSpecialElements(),S=n+">";r=T.exec(S);){if(O<r.index&&D.text(L(n.substr(O,r.index-O))),o=r[6])":"===(o=o.toLowerCase()).charAt(0)&&(o=o.substr(1)),U(o);else if(o=r[7]){if(r.index+r[0].length>n.length){D.text(L(n.substr(r.index))),O=r.index+r[0].length;continue}if(":"===(o=o.toLowerCase()).charAt(0)&&(o=o.substr(1)),p=o in d,R&&k[o]&&P.length>0&&P[P.length-1].name===o&&U(o),!g||(h=t.getElementRule(o))){if(v=!0,g&&(C=h.attributes,x=h.attributePatterns),(b=r[8])?((l=-1!==b.indexOf("data-mce-type"))&&f&&(v=!1),(a=[]).map={},b.replace(A,V)):(a=[]).map={},g&&!l){if(w=h.attributesRequired,N=h.attributesDefault,E=h.attributesForced,h.removeEmptyAttrs&&!a.length&&(v=!1),E)for(s=E.length;s--;)c=(y=E[s]).name,"{$uid}"===(B=y.value)&&(B="mce_"+I++),a.map[c]=B,a.push({name:c,value:B});if(N)for(s=N.length;s--;)(c=(y=N[s]).name)in a.map||("{$uid}"===(B=y.value)&&(B="mce_"+I++),a.map[c]=B,a.push({name:c,value:B}));if(w){for(s=w.length;s--&&!(w[s]in a.map););-1===s&&(v=!1)}if(y=a.map["data-mce-bogus"]){if("all"===y){O=Zd(t,n,T.lastIndex),T.lastIndex=O;continue}v=!1}}v&&D.start(o,a,p)}else v=!1;if(i=_[o]){i.lastIndex=O=r.index+r[0].length,(r=i.exec(n))?(v&&(u=n.substr(O,r.index-O)),O=r.index+r[0].length):(u=n.substr(O),O=n.length),v&&(u.length>0&&D.text(u,!0),D.end(o)),T.lastIndex=O;continue}p||(b&&b.indexOf("/")===b.length-1?v&&D.end(o):P.push({name:o,valid:v}))}else(o=r[1])?(">"===o.charAt(0)&&(o=" "+o),e.allow_conditional_comments||"[if"!==o.substr(0,3).toLowerCase()||(o=" "+o),D.comment(o)):(o=r[2])?D.cdata(o.replace(/<!--|-->/g,"")):(o=r[3])?D.doctype(o):(o=r[4])&&D.pi(o,r[5]);O=r.index+r[0].length}for(O<n.length&&D.text(L(n.substr(O))),s=P.length-1;s>=0;s--)(o=P[s]).valid&&D.end(o.name)}};em.findEndTag=Zd;var tm,nm,rm=function(e,t){var n,r,o,i,a,s,u,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(s=e.getTempAttrs(),u=l,c=new RegExp(["\\s?("+s.join("|")+')="[^"]+"'].join("|"),"gi"),l=u.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:em.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return l},om=function(e,t){return ii(rm(e,t))},im=rm,am=function(e){var t=e!==undefined?e.dom():document;return E.from(t.activeElement).map(Hn.fromDom)},sm=function(e){var t=Ur.owner(e).dom();return e.dom()===t.activeElement},um=function(e){return am(Ur.owner(e)).filter(function(t){return e.dom().contains(t.dom())})},cm=function(e,t){return(n=t,n.collapsed?E.from(zi(n.startContainer,n.startOffset)).map(Hn.fromDom):E.none()).bind(function(t){return io.isTableSection(t)?E.some(t):!1===Dr.contains(e,t)?E.some(e):E.none()});var n},lm=function(e,t){cm(Hn.fromDom(e.getBody()),t).bind(function(e){return Ws.firstPositionIn(e.dom())}).fold(function(){e.selection.normalize()},function(t){e.selection.setRng(t.toRange())})},fm=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},dm=function(e){var t,n=e.getBody();return n&&(t=Hn.fromDom(n),sm(t)||um(t).isSome())},mm=function(e){return e.inline?dm(e):(t=e).iframeElement&&sm(Hn.fromDom(t.iframeElement));var t},pm=function(e){e.editorManager.setActive(e)},gm=function(e,t){e.removed||(t?pm(e):function(e){var t,n,r,o=e.selection,i=e.settings.content_editable,a=e.getBody(),s=o.getRng();if(e.quirks.refreshContentEditable(),n=e,r=o.getNode(),t=n.dom.getParent(r,function(e){return"true"===n.dom.getContentEditable(e)}),e.$.contains(a,t))return fm(t),lm(e,s),void pm(e);e.bookmark!==undefined&&!1===mm(e)&&Td(e).each(function(t){e.selection.setRng(t),s=t}),i||(me.opera||fm(a),e.getWin().focus()),(me.gecko||i)&&(fm(a),lm(e,s)),pm(e)}(e))},hm=mm,vm=function(e,t){return t.dom()[e]},ym=function(e,t){return parseInt(Cr(t,e),10)},bm=y.curry(vm,"clientWidth"),Cm=y.curry(vm,"clientHeight"),xm=y.curry(ym,"margin-top"),wm=y.curry(ym,"margin-left"),Nm=function(e,t,n){var r,o,i,a,s,u,c,l,f,d,m=Hn.fromDom(e.getBody()),p=e.inline?m:Ur.documentElement(m),g=(r=e.inline,i=t,a=n,s=(o=p).dom().getBoundingClientRect(),{x:i-(r?s.left+o.dom().clientLeft+wm(o):0),y:a-(r?s.top+o.dom().clientTop+xm(o):0)});return c=g.x,l=g.y,f=bm(u=p),d=Cm(u),c>=0&&l>=0&&c<=f&&l<=d},Em=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,E.from(t).map(Hn.fromDom)).map(function(e){return Dr.contains(Ur.owner(e),e)}).getOr(!1)},Sm=function(e){var t,n=[],r=function(){var t,n=e.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:t,reposition:t,getArgs:t}},o=function(){n.length>0&&r().reposition(n)},i=function(e){M.findIndex(n,function(t){return t===e}).each(function(e){n.splice(e,1)})},a=function(t){if(!e.removed&&Em(e))return M.find(n,function(e){return n=r().getArgs(e),o=t,!(n.type!==o.type||n.text!==o.text||n.progressBar||n.timeout||o.progressBar||o.timeout);var n,o}).getOrThunk(function(){e.editorManager.setActive(e);var a,s=r().open(t,function(){i(s),o()});return a=s,n.push(a),o(),s})};return(t=e).on("SkinLoaded",function(){var e=t.settings.service_message;e&&a({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){ye.requestAnimationFrame(o)}),t.on("remove",function(){M.each(n,function(e){r().close(e)})}),{open:a,close:function(){E.from(n[0]).each(function(e){r().close(e),i(e),o()})},getNotifications:function(){return n}}},km=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:t=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:t,confirm:t,close:t,getParams:t,setParams:t}},r=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},o=function(n){var r;t.push(n),r=n,e.fire("OpenWindow",{win:r})},i=function(n){M.findIndex(t,function(e){return e===n}).each(function(r){var o;t.splice(r,1),o=n,e.fire("CloseWindow",{win:o}),0===t.length&&e.focus()})},a=function(){return E.from(t[t.length-1])};return e.on("remove",function(){M.each(t.slice(0),function(e){n().close(e)})}),{windows:t,open:function(t,r){e.editorManager.setActive(e),Sd(e);var a=n().open(t,r,i);return o(a),a},alert:function(e,t,a){var s=n().alert(e,r(a||this,t),i);o(s)},confirm:function(e,t,a){var s=n().confirm(e,r(a||this,t),i);o(s)},close:function(){a().each(function(e){n().close(e),i(e)})},getParams:function(){return a().map(n().getParams).getOr(null)},setParams:function(e){a().each(function(t){n().setParams(t,e)})},getWindows:function(){return t}}},Tm=ti.PluginManager,Am=function(e,t){var n=function(e,t){for(var n in Tm.urls)if(Tm.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},_m=function(e,t){e.notificationManager.open({type:"error",text:t})},Bm=function(e,t){e._skinLoaded?_m(e,t):e.on("SkinLoaded",function(){_m(e,t)})},Rm=function(e,t){Bm(e,Am(e,t))},Dm=function(e,t){Bm(e,"Failed to upload image: "+t)},Om=Bm,Pm=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},Im=ti.PluginManager,Lm=ti.ThemeManager,Mm=function(){return new(V("XMLHttpRequest"))},Fm=function(e,t){var n={},r=function(e,n,r,o){var i,a;(i=new Mm).open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=function(e){o(e.loaded/e.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,o,a;i.status<200||i.status>=300?r("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?n((o=t.basePath,a=e.location,o?o.replace(/\/$/,"")+"/"+a.replace(/^\//,""):a)):r("Invalid JSON: "+i.responseText)},(a=new FormData).append("file",e.blob(),e.filename()),i.send(a)},o=function(e,t){return{url:t,blobInfo:e,status:!0}},i=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},a=function(e,t){Ot.each(n[e],function(e){e(t)}),delete n[e]},s=function(r,s){return r=Ot.grep(r,function(t){return!e.isUploaded(t.blobUri())}),pe.all(Ot.map(r,function(r){return e.isPending(r.blobUri())?(f=r.blobUri(),new pe(function(e){n[f]=n[f]||[],n[f].push(e)})):(u=r,c=t.handler,l=s,e.markPending(u.blobUri()),new pe(function(t){var n;try{var r=function(){n&&n.close()};c(u,function(n){r(),e.markUploaded(u.blobUri(),n),a(u.blobUri(),o(u,n)),t(o(u,n))},function(n){r(),e.removeFailed(u.blobUri()),a(u.blobUri(),i(u,n)),t(i(u,n))},function(e){e<0||e>100||(n||(n=l()),n.progressBar.value(e))})}catch(s){t(i(u,s.message))}}));var u,c,l,f}))};return t=Ot.extend({credentials:!1,handler:r},t),{upload:function(e,n){return t.url||t.handler!==r?s(e,n):new pe(function(e){e([])})}}},zm=function(e,t){return new(V("Blob"))(e,t)},Um=function(e){return V("atob")(e)},Vm=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Hm=function(e){return new pe(function(t){var n,r,o;e=Vm(e);try{n=Um(e.data)}catch(yC){return void t(new zm([]))}for(r=new function(e){return new(V("Uint8Array"))(e)}(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);t(new zm([r],{type:e.type}))})},qm=function(e){return 0===e.indexOf("blob:")?(t=e,new pe(function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new Mm;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===this.status?e(this.response):r()},o.onerror=r,o.send()}catch(i){r()}})):0===e.indexOf("data:")?Hm(e):null;var t},jm=function(e){return new pe(function(t){var n=new function(){return new(V("FileReader"))};n.onloadend=function(){t(n.result)},n.readAsDataURL(e)})},$m=Vm,Wm=0,Km=function(e){return(e||"blobid")+Wm++},Xm=function(e,t){var n={};return{findAll:function(r,o){var i,a,s;return o||(o=ji.constant(!0)),i=At.filter((s=r)?s.getElementsByTagName("img"):[],function(t){var n=t.src;return!!me.fileApi&&!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!n||n===me.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n):0===n.indexOf("data:")&&o(t))}),a=At.map(i,function(e){var r;return n[e.src]?new pe(function(t){n[e.src].then(function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo})})}):(r=new pe(function(n,r){var o,i,a,s,u,c;o=t,a=n,s=r,0!==(i=e).src.indexOf("blob:")?(u=$m(i.src).data,(c=o.findFirst(function(e){return e.base64()===u}))?a({image:i,blobInfo:c}):qm(i.src).then(function(e){c=o.create(Km(),e,u),o.add(c),a({image:i,blobInfo:c})},function(e){s(e)})):(c=o.getByUri(i.src))?a({image:i,blobInfo:c}):qm(i.src).then(function(e){jm(e).then(function(t){u=$m(t).data,c=o.create(Km(),e,u),o.add(c),a({image:i,blobInfo:c})})},function(e){s(e)})}).then(function(e){return delete n[e.image.src],e})["catch"](function(t){return delete n[e.src],t}),n[e.src]=r,r)}),pe.all(a)}}},Ym=0,Gm=function(e){return e+Ym+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t},Jm=function(e){var t,n,r,o,i,a,s,u,c,l,f=(t=[],n=ji.constant,r=function(e){var t,r,o;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||Gm("blobid"),r=e.name||t,{id:n(t),name:n(r),filename:n(r+"."+(o=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[o.toLowerCase()]||"dat")),blob:n(e.blob),base64:n(e.base64),blobUri:n(e.blobUri||q(e.blob)),uri:n(e.uri)}},{create:function(e,t,n,o){return r("object"==typeof e?e:{id:e,name:o,blob:t,base64:n})},add:function(e){o(e.id())||t.push(e)},get:o=function(e){return i(function(t){return t.id()===e})},getByUri:function(e){return i(function(t){return t.blobUri()===e})},findFirst:i=function(e){return At.filter(t,e)[0]},removeByUri:function(e){t=At.filter(t,function(t){return t.blobUri()!==e||(j(t.blobUri()),!1)})},destroy:function(){At.each(t,function(e){j(e.blobUri())}),t=[]}}),d=e.settings,m=(u={},c=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:l=function(e){return e in u},getResultUri:function(e){var t=u[e];return t?t.resultUri:null},isPending:function(e){return!!l(e)&&1===u[e].status},isUploaded:function(e){return!!l(e)&&2===u[e].status},markPending:function(e){u[e]=c(1,null)},markUploaded:function(e,t){u[e]=c(2,t)},removeFailed:function(e){delete u[e]},destroy:function(){u={}}}),p=function(t){return function(n){return e.selection?t(n):[]}},g=function(e,t,n){var r=0;do{-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1)}while(-1!==r);return e},h=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},v=function(t,n){At.each(e.undoManager.data,function(e){"fragmented"===e.type?e.fragments=At.map(e.fragments,function(e){return h(e,t,n)}):e.content=h(e.content,t,n)})},y=function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},b=function(t,n){f.removeByUri(t.src),v(t.src,n),e.$(t).attr({src:d.images_reuse_filename?n+"?"+(new Date).getTime():n,"data-mce-src":e.convertURL(n,"src")})},C=function(t){return a||(a=Fm(m,{url:d.images_upload_url,basePath:d.images_upload_base_path,credentials:d.images_upload_credentials,handler:d.images_upload_handler})),N().then(p(function(n){var r;return r=At.map(n,function(e){return e.blobInfo}),a.upload(r,y).then(p(function(r){var o=At.map(r,function(t,r){var o=n[r].image;return t.status&&!1!==e.settings.images_replace_blob_uris?b(o,t.url):t.error&&Dm(e,t.error),{element:o,status:t.status}});return t&&t(o),o}))}))},x=function(e){if(!1!==d.automatic_uploads)return C(e)},w=function(e){return!d.images_dataimg_filter||d.images_dataimg_filter(e)},N=function(){return s||(s=Xm(m,f)),s.findAll(e.getBody(),w).then(p(function(t){return t=At.filter(t,function(t){return"string"!=typeof t||(Om(e,t),!1)}),At.each(t,function(e){v(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))},E=function(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=m.getResultUri(n);if(r)return'src="'+r+'"';var o=f.getByUri(n);return o||(o=At.reduce(e.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':t})};return e.on("setContent",function(){!1!==e.settings.automatic_uploads?x():N()}),e.on("RawSaveContent",function(e){e.content=E(e.content)}),e.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=E(e.content))}),e.on("PostRender",function(){e.parser.addNodeFilter("img",function(e){At.each(e,function(e){var t=e.attr("src");if(!f.getByUri(t)){var n=m.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:f,uploadImages:C,uploadImagesAuto:x,scanForImages:N,destroy:function(){f.destroy(),m.destroy(),s=a=null}}},Qm=function(e,t){return e.hasOwnProperty(t.nodeName)},Zm=function(e){var t,n,r,o,i,a,s,u,c,l,f,d=e.settings,m=e.dom,p=e.selection,g=e.schema,h=g.getBlockElements(),v=p.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&vo.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),g.isValidChild(l,f.toLowerCase())&&(b=h,C=y,x=v,!M.exists(zu(Hn.fromDom(x),Hn.fromDom(C)),function(e){return Qm(b,e.dom())})))){var b,C,x,w,N;for(n=(t=p.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=hm(e),v=y.firstChild;v;)if(w=h,N=v,vo.isText(N)||vo.isElement(N)&&!Qm(w,N)&&!xs.isBookmarkNode(N)){if(vo.isText(v)&&0===v.nodeValue.length){s=v,v=v.nextSibling,m.remove(s);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),u=!0),s=v,v=v.nextSibling,a.appendChild(s)}else a=null,v=v.nextSibling;u&&c&&(t.setStart(n,r),t.setEnd(o,i),p.setRng(t),e.nodeChanged())}},ep=function(e){e.settings.forced_root_block&&e.on("NodeChange",y.curry(Zm,e))},tp=function(e){var t,n=[];"onselectionchange"in e.getDoc()||e.on("NodeChange Click MouseUp KeyUp Focus",function(n){var r,o;o={startContainer:(r=e.selection.getRng()).startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset},"nodechange"!==n.type&&qf(o,t)||e.fire("SelectionChange"),t=o}),e.on("contextmenu",function(){e.fire("SelectionChange")}),e.on("SelectionChange",function(){var t=e.selection.getStart(!0);!t||!me.range&&e.selection.isCollapsed()||!function(t){var r,o;if((o=e.$(t).parentsUntil(e.getBody()).add(t)).length===n.length){for(r=o.length;r>=0&&o[r]===n[r];r--);if(-1===r)return n=o,!0}return n=o,!1}(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})}),e.on("MouseUp",function(t){t.isDefaultPrevented()||("IMG"===e.selection.getNode().nodeName?ye.setEditorTimeout(e,function(){e.nodeChanged()}):e.nodeChanged())}),this.nodeChanged=function(t){var n,r,o,i=e.selection;e.initialized&&i&&!e.settings.disable_nodechange&&!e.readonly&&(o=e.getBody(),(n=i.getStart(!0)||o).ownerDocument===e.getDoc()&&e.dom.isChildOf(n,o)||(n=o),r=[],e.dom.getParent(n,function(e){if(e===o)return!0;r.push(e)}),(t=t||{}).element=n,t.parents=r,e.fire("NodeChange",t))}},np=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},rp=function(e,t){return n=(s=e).inline?np(s.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=np(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,s={left:i.scrollLeft,top:i.scrollTop},u={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?s:u);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,s,u;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,s},op=vo.isContentEditableFalse,ip=vo.isContentEditableTrue,ap=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},sp=function(e,t){return function(n){if(0===n.button){var r=At.find(t.dom.getParents(n.target),ji.or(op,ip));if(s=t.getBody(),op(u=r)&&u!==s){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.element=r,e.screenX=n.screenX,e.screenY=n.screenY,e.maxX=(t.inline?i.scrollWidth:a.offsetWidth)-2,e.maxY=(t.inline?i.scrollHeight:a.offsetHeight)-2,e.relX=n.pageX-o.x,e.relY=n.pageY-o.y,e.width=r.offsetWidth,e.height=r.offsetHeight,e.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(t,r,e.width,e.height)}}var s,u}},up=function(e,t){return function(n){if(e.dragging&&(s=t,l=t.selection,f=l.getSel().getRangeAt(0).startContainer,u=3===f.nodeType?f.parentNode:f,c=e.element,u!==c&&!s.dom.isChildOf(u,c)&&!op(u))){var r=(i=e.element,(a=i.cloneNode(!0)).removeAttribute("data-mce-selected"),a),o=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,t.undoManager.transact(function(){ap(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}var i,a,s,u,c,l,f;cp(e)}},cp=function(e){e.dragging=!1,e.element=null,ap(e.ghost)},lp=function(e){var t,n,r,o,i,a,s,u,c,l,f,d={};t=Xo.DOM,a=document,n=sp(d,e),s=d,u=e,c=ye.throttle(function(e,t){u._selectionOverrides.hideFakeCaret(),u.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,l,f,d,m,p,g,h=Math.max(Math.abs(e.screenX-s.screenX),Math.abs(e.screenY-s.screenY));if(s.element&&!s.dragging&&h>10){if(u.fire("dragstart",{target:s.element}).isDefaultPrevented())return;s.dragging=!0,u.focus()}if(s.dragging){var v=(p=s,{pageX:(g=rp(u,e)).pageX-p.relX,pageY:g.pageY+5});d=s.ghost,m=u.getBody(),d.parentNode!==m&&m.appendChild(d),t=s.ghost,n=v,r=s.width,o=s.height,i=s.maxX,a=s.maxY,l=0,f=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(l=n.pageX+r-i),n.pageY+o>a&&(f=n.pageY+o-a),t.style.width=r-l+"px",t.style.height=o-f+"px",c(e.clientX,e.clientY)}},o=up(d,e),l=d,f=e,i=function(){cp(l),l.dragging&&f.fire("dragend")},e.on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},fp=function(e){var t;lp(e),(t=e).on("drop",function(e){var n="undefined"!=typeof e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(op(n)||op(t.dom.getContentEditableParent(n)))&&e.preventDefault()})},dp=vo.isContentEditableFalse,mp=function(e,t){var n,r,o=null,i=function(){!function(){var t,n,r,o,i;for(t=Qt("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,mi.endsWithCaretContainer(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,mi.startsWithCaretContainer(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(),r&&(Oc.remove(r),r=null),o&&(o.remove(),o=null),clearInterval(n)},a=function(){n=ye.setInterval(function(){e.ownerDocument.activeElement===e?Qt("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Qt("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")},500)};return{show:function(n,s){var u,c,l,f,d,m,p,g,h,v,y;return i(),(l=s)&&/^(TD|TH)$/i.test(l.nodeName)?null:t(s)?(r=mi.insertBlock("p",s,n),d=n,y=Oi((f=s).getBoundingClientRect(),d),"BODY"===e.tagName?(m=e.ownerDocument.documentElement,p=e.scrollLeft||m.scrollLeft,g=e.scrollTop||m.scrollTop):(v=e.getBoundingClientRect(),p=e.scrollLeft-v.left,g=e.scrollTop-v.top),y.left+=p,y.right+=p,y.top+=g,y.bottom+=g,y.width=1,(h=f.offsetWidth-f.clientWidth)>0&&(d&&(h*=-1),y.left+=h,y.right+=h),u=y,Qt(r).css("top",u.top),o=Qt('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(u).appendTo(e),n&&o.addClass("mce-visual-caret-before"),a(),(c=s.ownerDocument.createRange()).setStart(r,0),c.setEnd(r,0),c):(r=mi.insertInline(s,n),c=s.ownerDocument.createRange(),dp(r.nextSibling)?(c.setStart(r,0),c.setEnd(r,0)):(c.setStart(r,1),c.setEnd(r,1)),c)},hide:i,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},destroy:function(){ye.clearInterval(n)}}},pp=function(e){var t=function(t){return At.map(t,function(t){return(t=Di(t)).node=e,t})};if(At.isArray(e))return At.reduce(e,function(e,t){return e.concat(pp(t))},[]);if(vo.isElement(e))return t(e.getClientRects());if(vo.isText(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}},gp={getClientRects:pp},hp=vo.isContentEditableFalse,vp=_a.findNode,yp=ji.curry,bp=function(e,t){return Math.abs(e.left-t)},Cp=function(e,t){return Math.abs(e.right-t)},xp=function(e,t){var n=function(e,t){return e>=t.left&&e<=t.right};return At.reduce(e,function(e,r){var o,i;return o=Math.min(bp(e,t),Cp(e,t)),i=Math.min(bp(r,t),Cp(r,t)),n(t,r)?r:n(t,e)?e:i===o&&hp(r.node)?r:i<o?r:e})},wp=function(e,t,n,r){for(;r=vp(r,e,ki,t);)if(n(r))return},Np=function(e,t){var n=[],r=function(e,r){var o;return o=At.filter(gp.getClientRects(r),function(n){return!e(n,t)}),n=n.concat(o),0===o.length};return n.push(t),wp(-1,e,yp(r,Ii),t.node),wp(1,e,yp(r,Li),t.node),n},Ep=xp,Sp=function(e,t,n){var r,o,i,a,s;return r=gp.getClientRects((i=e,At.filter(At.toArray(i.getElementsByTagName("*")),hp))),r=At.filter(r,function(e){return n>=e.top&&n<=e.bottom}),(o=xp(r,t))&&(o=xp(Np(e,o),t))&&hp(o.node)?(s=t,{node:(a=o).node,before:bp(a,s)<Cp(a,s)}):null},kp=function(e,t,n){return!n.collapsed&&M.foldl(n.getClientRects(),function(n,r){return n||Mi(r,e,t)},!1)},Tp=function(e,t){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){var r=arguments;null===n&&(n=setTimeout(function(){e.apply(null,r),n=null,r=null},t))}}},Ap=vo.isContentEditableTrue,_p=vo.isContentEditableFalse,Bp=function(e,t,n,r){return t._selectionOverrides.showCaret(e,n,r)},Rp=function(e,t){var n,r;return t=_a.normalizeRange(1,e.getBody(),t),n=ia.fromRangeStart(t),_p(n.getNode())?Bp(1,e,n.getNode(),!n.isAtEnd()):_p(n.getNode(!0))?Bp(1,e,n.getNode(!0),!1):(r=e.dom.getParent(n.getNode(),ji.or(_p,Ap)),_p(r)?Bp(1,e,r,!1):null)},Dp=Bp,Op=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},Pp=Rp,Ip=function(e,t){return t&&t.collapsed&&Rp(e,t)||t},Lp=function(e){var t=Tp(function(){if(!e.removed){var t=Ip(e,e.selection.getRng());e.selection.setRng(t)}},0);e.on("focus",function(){t.throttle()}),e.on("blur",function(){t.cancel()})},Mp={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return me.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Fp=vo.isContentEditableTrue,zp=vo.isContentEditableFalse,Up=_a.isAfterContentEditableFalse,Vp=_a.isBeforeContentEditableFalse,Hp=function(e){var t,n,r,o=e.getBody(),i=mp(e.getBody(),function(t){return e.dom.isBlock(t)}),a="sel-"+e.dom.uniqueId(),s=function(t){t&&e.selection.setRng(t)},u=function(){return e.selection.getRng()},c=function(t,n){e.selection.scrollIntoView(t,n)},l=function(t,n,r){return e.fire("ShowCaret",{target:n,direction:t,before:r}).isDefaultPrevented()?null:(c(n,-1===t),i.show(r,n))},f=function(e,t){return t=_a.normalizeRange(e,o,t),-1===e?ia.fromRangeStart(t):ia.fromRangeEnd(t)},d=function(e){return mi.isCaretContainer(e)||mi.startsWithCaretContainer(e)||mi.endsWithCaretContainer(e)},m=function(e){return d(e.startContainer)||d(e.endContainer)},p=function(n,r){var o,i,s,u,c,d,p,g,v,y,b=e.$,C=e.dom;if(!n)return null;if(n.collapsed){if(!m(n))if(!1===r){if(g=f(-1,n),zp(g.getNode(!0)))return l(-1,g.getNode(!0),!1);if(zp(g.getNode()))return l(-1,g.getNode(),!g.isAtEnd())}else{if(g=f(1,n),zp(g.getNode()))return l(1,g.getNode(),!g.isAtEnd());if(zp(g.getNode(!0)))return l(1,g.getNode(!0),!1)}return null}return u=n.startContainer,c=n.startOffset,d=n.endOffset,3===u.nodeType&&0===c&&zp(u.parentNode)&&(u=u.parentNode,c=C.nodeIndex(u),u=u.parentNode),1!==u.nodeType?null:(d===c+1&&(o=u.childNodes[c]),zp(o)?(v=y=o.cloneNode(!0),(p=e.fire("ObjectSelected",{target:o,targetClone:v})).isDefaultPrevented()?null:(i=Nu(Hn.fromDom(e.getBody()),"#"+a).fold(function(){return b([])},function(e){return b([e.dom()])}),v=p.targetClone,0===i.length&&(i=b('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(e.getBody()),n=e.dom.createRng(),v===y&&me.ie?(i.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(v),n.setStartAfter(i[0].firstChild.firstChild),n.setEndAfter(v)):(i.empty().append("\xa0").append(v).append("\xa0"),n.setStart(i[0].firstChild,1),n.setEnd(i[0].lastChild,0)),i.css({top:C.getPos(o,e.getBody()).y}),i[0].focus(),(s=e.selection.getSel()).removeAllRanges(),s.addRange(n),M.each(Os(Hn.fromDom(e.getBody()),"*[data-mce-selected]"),function(e){dr.remove(e,"data-mce-selected")}),o.setAttribute("data-mce-selected","1"),t=o,h(),n)):null)},g=function(){t&&(t.removeAttribute("data-mce-selected"),Nu(Hn.fromDom(e.getBody()),"#"+a).each(Bs.remove),t=null)},h=function(){i.hide()};return me.ceFalse&&(function(){var n=function(t){for(var n=e.getBody();t&&t!==n;){if(Fp(t)||zp(t))return t;t=t.parentNode}return null};e.on("mouseup",function(t){var n=u();n.collapsed&&Nm(e,t.clientX,t.clientY)&&s(Pp(e,n))}),e.on("click",function(t){var r;(r=n(t.target))&&(zp(r)&&(t.preventDefault(),e.focus()),Fp(r)&&e.dom.isChildOf(r,e.selection.getNode())&&g())}),e.on("blur NewBlock",function(){g()});var r,i,c=function(t,n){var r,o,i=e.dom.getParent(t,e.dom.isBlock),a=e.dom.getParent(n,e.dom.isBlock);return i&&(r=i,o=a,!(e.dom.getParent(r,e.dom.isBlock)===e.dom.getParent(o,e.dom.isBlock)))&&function(e){var t=Ha(e);if(!e.firstChild)return!1;var n=ia.before(e.firstChild),r=t.next(n);return r&&!Vp(r)&&!Up(r)}(i)};i=!1,(r=e).on("touchstart",function(){i=!1}),r.on("touchmove",function(){i=!0}),r.on("touchend",function(e){var t=n(e.target);zp(t)&&(i||(e.preventDefault(),p(Op(r,t))))}),e.on("mousedown",function(t){var r;if(!1!==Nm(e,t.clientX,t.clientY))if(r=n(t.target))zp(r)?(t.preventDefault(),p(Op(e,r))):(g(),Fp(r)&&t.shiftKey||kp(t.clientX,t.clientY,e.selection.getRng())||e.selection.placeCaretAt(t.clientX,t.clientY));else{g(),h();var i=Sp(o,t.clientX,t.clientY);i&&(c(t.target,i.node)||(t.preventDefault(),e.getBody().focus(),s(l(1,i.node,i.before))))}}),e.on("keypress",function(t){Mp.modifierPressed(t)||(t.keyCode,zp(e.selection.getNode())&&t.preventDefault())}),e.on("getSelectionRange",function(e){var n=e.range;if(t){if(!t.parentNode)return void(t=null);(n=n.cloneRange()).selectNode(t),e.range=n}}),e.on("setSelectionRange",function(e){var t;(t=p(e.range,e.forward))&&(e.range=t)}),e.on("AfterSetSelectionRange",function(t){var n,r=t.range;m(r)||h(),n=r.startContainer.parentNode,e.dom.hasClass(n,"mce-offscreen-selection")||g()}),e.on("copy",function(t){var n,r=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!me.ie){var o=(n=e.dom.get(a))?n.getElementsByTagName("*")[0]:n;o&&(t.preventDefault(),r.clearData(),r.setData("text/html",o.outerHTML),r.setData("text/plain",o.outerText))}}),fp(e),Lp(e)}(),n=e.contentStyles,r=".mce-content-body",n.push(i.getCss()),n.push(r+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+r+" *[contentEditable=false] {cursor: default;}"+r+" *[contentEditable=true] {cursor: text;}")),{showCaret:l,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(mi.showCaretContainerBlock(e),s(u()),c(e[0]))},hideFakeCaret:h,destroy:function(){i.destroy(),t=null}}},qp=0,jp=2,$p=1,Wp=function(e,t){var n=e.length+t.length+2,r=new Array(n),o=new Array(n),i=function(n,r,o,a,u){var c=s(n,r,o,a);if(null===c||c.start===r&&c.diag===r-a||c.end===n&&c.diag===n-o)for(var l=n,f=o;l<r||f<a;)l<r&&f<a&&e[l]===t[f]?(u.push([0,e[l]]),++l,++f):r-n>a-o?(u.push([2,e[l]]),++l):(u.push([1,t[f]]),++f);else{i(n,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,e[d]]);i(c.end,r,c.end-c.diag,a,u)}},a=function(n,r,o,i){for(var a=n;a-r<i&&a<o&&e[a]===t[a-r];)++a;return{start:n,end:a,diag:r}},s=function(n,i,s,u){var c=i-n,l=u-s;if(0===c||0===l)return null;var f,d,m,p,g,h=c-l,v=l+c,y=(v%2==0?v:v+1)/2;for(r[1+y]=n,o[1+y]=i+1,f=0;f<=y;++f){for(d=-f;d<=f;d+=2){for(m=d+y,d===-f||d!==f&&r[m-1]<r[m+1]?r[m]=r[m+1]:r[m]=r[m-1]+1,g=(p=r[m])-n+s-d;p<i&&g<u&&e[p]===t[g];)r[m]=++p,++g;if(h%2!=0&&h-f<=d&&d<=h+f&&o[m-h]<=r[m])return a(o[m-h],d+n-s,i,u)}for(d=h-f;d<=h+f;d+=2){for(m=d+y-h,d===h-f||d!==h+f&&o[m+1]<=o[m-1]?o[m]=o[m+1]-1:o[m]=o[m-1],g=(p=o[m]-1)-n+s-d;p>=n&&g>=s&&e[p]===t[g];)o[m]=p--,g--;if(h%2==0&&-f<=d&&d<=f&&o[m]<=r[m+h])return a(o[m],d+n-s,i,u)}}},u=[];return i(0,e.length,0,t.length,u),u},Kp=function(e){return 1===e.nodeType?e.outerHTML:3===e.nodeType?Ao.encodeRaw(e.data,!1):8===e.nodeType?"\x3c!--"+e.data+"--\x3e":""},Xp=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Yp=function(e){return At.filter(At.map(e.childNodes,Kp),function(e){return e.length>0})},Gp=function(e,t){var n,r,o,i=At.map(t.childNodes,Kp);return n=Wp(i,e),r=t,o=0,At.each(n,function(e){e[0]===qp?o++:e[0]===$p?(Xp(r,e[1],o),o++):e[0]===jp&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Jp=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Qp=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Zp=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},eg=function(e){var t,n,r;return t=Yp(e.getBody()),-1!==(n=(r=M.bind(t,function(t){var n=im(e.serializer,t);return n.length>0?[n]:[]})).join("")).indexOf("</iframe>")?Jp(r):Qp(n)},tg=function(e,t,n){"fragmented"===t.type?Gp(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},ng=function(e,t){return!!e&&!!t&&Zp(e)===Zp(t)},rg=function(e){var t,n,r=this,o=0,i=[],a=0,s=function(){return 0===a},u=function(e){s()&&(r.typing=e)},c=function(t){e.setDirty(t)},l=function(e){u(!1),r.add({},e)},f=function(){r.typing&&(u(!1),r.add())};return e.on("init",function(){r.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(f(),r.beforeChange())}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&l(e)}),e.on("ObjectResizeStart Cut",function(){r.beforeChange()}),e.on("SaveContent ObjectResized blur",l),e.on("DragEnd",l),e.on("KeyUp",function(t){var o=t.keyCode;t.isDefaultPrevented()||((o>=33&&o<=36||o>=37&&o<=40||45===o||t.ctrlKey)&&(l(),e.nodeChanged()),46!==o&&8!==o||e.nodeChanged(),n&&r.typing&&!1===ng(eg(e),i[0])&&(!1===e.isDirty()&&(c(!0),e.fire("change",{level:i[0],lastLevel:null})),e.fire("TypingUndo"),n=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(t>=33&&t<=36||t>=37&&t<=40||45===t)r.typing&&l(e);else{var o=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||t>20)||224===t||91===t||r.typing||o||(r.beforeChange(),u(!0),r.add({},e),n=!0)}}),e.on("MouseDown",function(e){r.typing&&l(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),r={data:i,typing:!1,beforeChange:function(){s()&&(t=gs.getUndoBookmark(e.selection))},add:function(n,r){var a,u,l,f=e.settings;if(l=eg(e),n=n||{},n=Ot.extend(n,l),!1===s()||e.removed)return null;if(u=i[o],e.fire("BeforeAddUndo",{level:n,lastLevel:u,originalEvent:r}).isDefaultPrevented())return null;if(u&&ng(u,n))return null;if(i[o]&&(i[o].beforeBookmark=t),f.custom_undo_redo_levels&&i.length>f.custom_undo_redo_levels){for(a=0;a<i.length-1;a++)i[a]=i[a+1];i.length--,o=i.length}n.bookmark=gs.getUndoBookmark(e.selection),o<i.length-1&&(i.length=o+1),i.push(n),o=i.length-1;var d={level:n,lastLevel:u,originalEvent:r};return e.fire("AddUndo",d),o>0&&(c(!0),e.fire("change",d)),n},undo:function(){var t;return r.typing&&(r.add(),r.typing=!1,u(!1)),o>0&&(t=i[--o],tg(e,t,!0),c(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return o<i.length-1&&(t=i[++o],tg(e,t,!1),c(!0),e.fire("redo",{level:t})),t},clear:function(){i=[],o=0,r.typing=!1,r.data=i,e.fire("ClearUndos")},hasUndo:function(){return o>0||r.typing&&i[0]&&!ng(eg(e),i[0])},hasRedo:function(){return o<i.length-1&&!r.typing},transact:function(e){return f(),r.beforeChange(),r.ignore(e),r.add()},ignore:function(e){try{a++,e()}finally{a--}},extra:function(t,n){var a,s;r.transact(t)&&(s=i[o].bookmark,a=i[o-1],tg(e,a,!0),r.transact(n)&&(i[o-1].beforeBookmark=s))}}},og={},ig=At.filter,ag=At.each;nm=function(e){var t,n,r=e.selection.getRng();t=vo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),ag(ig(ig(n,t),function(e){return t(e.previousSibling)&&-1!==At.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,Qt(n=e).remove(),Qt(t).append("<br><br>").append(n.childNodes)}))},og[tm="pre"]||(og[tm]=[]),og[tm].push(nm);var sg=function(e,t){ag(og[e],function(e){e(t)})},ug=Ot.each,cg={walk:function(e,t,n){var r,o,i,a,s,u,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if((c=e.select("td[data-mce-selected],th[data-mce-selected]")).length>0)ug(c,function(e){n([e])});else{var p,g,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},y=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},b=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,r){var o=r?"nextSibling":"previousSibling";for(s=(a=e).parentNode;a&&a!==t;a=s)s=a.parentNode,(u=y(a===e?a:a[o],o)).length&&(r||u.reverse(),n(v(u)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(g=m,h=(p=d).childNodes,--g>h.length-1?g=h.length-1:g<0&&(g=0),d=h[g]||p),l===d)return n(v([l]));for(r=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,r,!0);if(a===r)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,r);if(a===r)break}o=b(l,r)||l,i=b(d,r)||d,C(l,o,!0),(u=y(o===l?o:o.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&n(v(u)),C(d,i)}}},lg=/^(src|href|style)$/,fg=Ot.each,dg=Uc.isEq,mg=function(e){return/^(TH|TD)$/.test(e.nodeName)},pg=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],vo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[o>i?i:o]),vo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new to(r,e.getBody()).next()||r),vo.isText(r)&&!n&&0===o&&(r=new to(r,e.getBody()).prev()||r),r},gg=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},hg=function(e,t,n,r){return!(t=Uc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},vg=function(e,t,n,r,o){var i,a,s,u,c,l,f,d,m,p,g,h,v,y,b,C=e.dom;if(l=C,!(dg(f=r,(d=t).inline)||dg(f,d.block)||(d.selector?vo.isElement(f)&&l.is(f,d.selector):void 0)||(u=r,c=t,c.links&&"A"===u.tagName)))return!1;if("all"!==t.remove)for(fg(t.styles,function(e,i){e=Uc.normalizeStyleValue(C,Uc.replaceVars(e,n),i),"number"==typeof i&&(i=e,o=0),(t.remove_similar||!o||dg(Uc.getStyle(C,o,i),e))&&C.setStyle(r,i,""),s=1}),s&&""===C.getAttrib(r,"style")&&(r.removeAttribute("style"),r.removeAttribute("data-mce-style")),fg(t.attributes,function(e,t){var i;if(e=Uc.replaceVars(e,n),"number"==typeof t&&(t=e,o=0),!o||dg(C.getAttrib(o,t),e)){if("class"===t&&(e=C.getAttrib(r,t))&&(i="",fg(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e)}),i))return void C.setAttrib(r,t,i);"class"===t&&r.removeAttribute("className"),lg.test(t)&&r.removeAttribute("data-mce-"+t),r.removeAttribute(t)}}),fg(t.classes,function(e){e=Uc.replaceVars(e,n),o&&!C.hasClass(o,e)||C.removeClass(r,e)}),a=C.getAttribs(r),i=0;i<a.length;i++){var x=a[i].nodeName;if(0!==x.indexOf("_")&&0!==x.indexOf("data-"))return!1}return"none"!==t.remove?(m=e,g=t,v=(p=r).parentNode,y=m.dom,b=m.settings.forced_root_block,g.block&&(b?v===y.getRoot()&&(g.list_block&&dg(p,g.list_block)||fg(Ot.grep(p.childNodes),function(e){Uc.isValid(m,b,e.nodeName.toLowerCase())?h?h.appendChild(e):(h=gg(y,e,b),y.setAttribs(h,m.settings.forced_root_block_attrs)):h=0})):y.isBlock(p)&&!y.isBlock(v)&&(hg(y,p,!1)||hg(y,p.firstChild,!0,1)||p.insertBefore(y.create("br"),p.firstChild),hg(y,p,!0)||hg(y,p.lastChild,!1,1)||p.appendChild(y.create("br")))),g.selector&&g.inline&&!dg(g.inline,p)||y.remove(p,1),!0):void 0},yg=vg,bg=function(e,t,n,r,o){var i,a,s=e.formatter.get(t),u=s[0],c=!0,l=e.dom,f=e.selection,d=function(r){var i,a,c,l,f,d,m=(i=e,a=r,c=t,l=n,f=o,fg(Uc.getParents(i.dom,a.parentNode).reverse(),function(e){var t;d||"_start"===e.id||"_end"===e.id||(t=il.matchNode(i,e,c,l,f))&&!1!==t.split&&(d=e)}),d);return function(e,t,n,r,o,i,a,s){var u,c,l,f,d,m,p=e.dom;if(n){for(m=n.parentNode,u=r.parentNode;u&&u!==m;u=u.parentNode){for(c=p.clone(u,!1),d=0;d<t.length;d++)if(vg(e,t[d],s,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&p.isBlock(n)||(r=p.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(e,s,m,r,r,!0,u,n)},m=function(t){var r,o,i,a,f;if(vo.isElement(t)&&l.getContentEditable(t)&&(a=c,c="true"===l.getContentEditable(t),f=!0),r=Ot.grep(t.childNodes),c&&!f)for(o=0,i=s.length;o<i&&!vg(e,s[o],n,t,t);o++);if(u.deep&&r.length){for(o=0,i=r.length;o<i;o++)m(r[o]);f&&(c=a)}},p=function(e){var t=l.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return xs.isBookmarkNode(n)&&(n=n[e?"firstChild":"lastChild"]),vo.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),l.remove(t,!0),n},g=function(t){var n,r,o=t.commonAncestorContainer;if(t=Qc(e,t,s,!0),u.split){if((n=pg(e,t,!0))!==(r=pg(e,t))){if(/^(TR|TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n="TR"===n.nodeName?n.firstChild.firstChild||n:n.firstChild||n),o&&/^T(HEAD|BODY|FOOT|R)$/.test(o.nodeName)&&mg(r)&&r.firstChild&&(r=r.firstChild||r),l.isChildOf(n,r)&&n!==r&&!l.isBlock(r)&&!mg(n)&&!mg(r))return n=gg(l,n,"span",{id:"_start","data-mce-type":"bookmark"}),d(n),void(n=p(!0));n=gg(l,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=gg(l,r,"span",{id:"_end","data-mce-type":"bookmark"}),d(n),d(r),n=p(!0),r=p()}else n=r=d(n);t.startContainer=n.parentNode?n.parentNode:n,t.startOffset=l.nodeIndex(n),t.endContainer=r.parentNode?r.parentNode:r,t.endOffset=l.nodeIndex(r)+1}cg.walk(l,t,function(t){fg(t,function(t){m(t),vo.isElement(t)&&"underline"===e.dom.getStyle(t,"text-decoration")&&t.parentNode&&"underline"===Uc.getTextDecoration(l,t.parentNode)&&vg(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,t)})})};if(r)r.nodeType?((a=l.createRng()).setStartBefore(r),a.setEndAfter(r),g(a)):g(r);else if("false"!==l.getContentEditable(f.getNode()))f.isCollapsed()&&u.inline&&!l.select("td[data-mce-selected],th[data-mce-selected]").length?wl(e,t,n,o):(i=f.getBookmark(),g(f.getRng()),f.moveToBookmark(i),u.inline&&il.match(e,t,n,f.getStart())&&Uc.moveStart(l,f,f.getRng()),e.nodeChanged());else{r=f.getNode();for(var h=0,v=s.length;h<v&&(!s[h].ceFalseOverride||!vg(e,s[h],n,r,r));h++);}},Cg=Ot.each,xg=function(e){return e&&1===e.nodeType&&!xs.isBookmarkNode(e)&&!Nl(e)&&!vo.isBogus(e)},wg=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!xs.isBookmarkNode(n))return n}return e},Ng=function(e,t,n){var r,o,i=new Ns(e);if(t&&n&&(t=wg(t,"previousSibling"),n=wg(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,t.appendChild(o);return e.remove(n),Ot.each(Ot.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Eg=function(e,t,n){Cg(e.childNodes,function(e){xg(e)&&(t(e)&&n(e),e.hasChildNodes()&&Eg(e,t,n))})},Sg=function(e,t){return y.curry(function(t,n){return!(!n||!Uc.getStyle(e,n,t))},t)},kg=function(e,t,n){return y.curry(function(t,n,r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),Tg(e,r)},t,n)},Tg=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Ag=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=Uc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},_g=function(e,t,n,r){Cg(t,function(t){Cg(e.dom.select(t.inline,r),function(r){xg(r)&&yg(e,t,n,r,t.exact?r:null)}),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";Cg(e.select(r,n),function(n){xg(n)&&Cg(t.styles,function(t,r){e.setStyle(n,r,"")})})}}(e.dom,t,r)})},Bg=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Ot.walk(r,y.curry(Ag,e),"childNodes"),Ag(e,r))},Rg=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Eg(r,Sg(e,"fontSize"),kg(e,"backgroundColor",Uc.replaceVars(t.styles.backgroundColor,n)))},Dg=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(Eg(r,Sg(e,"fontSize"),kg(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},Og=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=Ng(e,Uc.getNonWhiteSpaceSibling(r),r),r=Ng(e,r,Uc.getNonWhiteSpaceSibling(r,!0)))},Pg=function(e,t,n,r,o){il.matchNode(e,o.parentNode,n,r)&&yg(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,function(i){if(il.matchNode(e,i,n,r))return yg(e,t,r,o),!0})},Ig=Ot.each,Lg=function(e,t,n,r){var o,i,a=e.formatter.get(t),s=a[0],u=!r&&e.selection.isCollapsed(),c=e.dom,l=e.selection,f=function(e,t){if(t=t||s,e){if(t.onformat&&t.onformat(e,t,n,r),Ig(t.styles,function(t,r){c.setStyle(e,r,Uc.replaceVars(t,n))}),t.styles){var o=c.getAttrib(e,"style");o&&e.setAttribute("data-mce-style",o)}Ig(t.attributes,function(t,r){c.setAttrib(e,r,Uc.replaceVars(t,n))}),Ig(t.classes,function(t){t=Uc.replaceVars(t,n),c.hasClass(e,t)||c.addClass(e,t)})}},d=function(e,t){var n=!1;return!!s.selector&&(Ig(e,function(e){if(!("collapsed"in e&&e.collapsed!==u))return c.is(t,e.selector)&&!Nl(t)?(f(t,e),n=!0,!1):void 0}),n)},m=function(r,o,i,u){var c,l,m=[],p=!0;c=s.inline||s.block,l=r.create(c),f(l),cg.walk(r,o,function(o){var i,g=function(o){var h,v,y,b;if(b=p,h=o.nodeName.toLowerCase(),v=o.parentNode.nodeName.toLowerCase(),1===o.nodeType&&r.getContentEditable(o)&&(b=p,p="true"===r.getContentEditable(o),y=!0),Uc.isEq(h,"br"))return i=0,void(s.block&&r.remove(o));if(s.wrapper&&il.matchNode(e,o,t,n))i=0;else{if(p&&!y&&s.block&&!s.wrapper&&Uc.isTextBlock(e,h)&&Uc.isValid(e,v,c))return o=r.rename(o,c),f(o),m.push(o),void(i=0);if(s.selector){var C=d(a,o);if(!s.inline||C)return void(i=0)}!p||y||!Uc.isValid(e,c,h)||!Uc.isValid(e,v,c)||!u&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||Nl(o)||s.inline&&r.isBlock(o)?(i=0,Ig(Ot.grep(o.childNodes),g),y&&(p=b),i=0):(i||(i=r.clone(l,!1),o.parentNode.insertBefore(i,o),m.push(i)),i.appendChild(o))}};Ig(o,g)}),!0===s.links&&Ig(m,function(e){var t=function(e){"A"===e.nodeName&&f(e,s),Ig(Ot.grep(e.childNodes),t)};t(e)}),Ig(m,function(o){var i,u,c,l,d,p=function(e){var t=!1;return Ig(e.childNodes,function(e){if((n=e)&&1===n.nodeType&&!xs.isBookmarkNode(n)&&!Nl(n)&&!vo.isBogus(n))return t=e,!1;var n}),t};u=0,Ig(o.childNodes,function(e){Uc.isWhiteSpaceNode(e)||xs.isBookmarkNode(e)||u++}),i=u,!(m.length>1)&&r.isBlock(o)||0!==i?(s.inline||s.wrapper)&&(s.exact||1!==i||((l=p(c=o))&&!xs.isBookmarkNode(l)&&il.matchName(r,l,s)&&(d=r.clone(l,!1),f(d),r.replace(d,c,!0),r.remove(l,1)),o=d||c),_g(e,a,n,o),Pg(e,s,t,n,o),Rg(r,s,n,o),Dg(r,s,n,o),Og(r,s,n,o)):r.remove(o,1)})};if("false"!==c.getContentEditable(l.getNode())){if(s){if(r)r.nodeType?d(a,r)||((i=c.createRng()).setStartBefore(r),i.setEndAfter(r),m(c,Qc(e,i,a),0,!0)):m(c,r,0,!0);else if(u&&s.inline&&!c.select("td[data-mce-selected],th[data-mce-selected]").length)xl(e,t,n);else{var p=e.selection.getNode();e.settings.forced_root_block||!a[0].defaultBlock||c.getParent(p,c.isBlock)||Lg(e,a[0].defaultBlock),e.selection.setRng(Xs(e.selection.getRng())),o=l.getBookmark(),m(c,Qc(e,l.getRng(),a)),s.styles&&Bg(c,s,n,p),l.moveToBookmark(o),Uc.moveStart(c,l,l.getRng()),e.nodeChanged()}sg(t,e)}}else{r=l.getNode();for(var g=0,h=a.length;g<h;g++)if(a[g].ceFalseOverride&&c.is(r,a[g].selector))return void f(r,a[g])}},Mg={applyFormat:Lg},Fg=Ot.each,zg=function(e,t,n,r,o){var i,a,s,u,c,l,f,d;null===t.get()&&(a=e,s={},(i=t).set({}),a.on("NodeChange",function(e){var t=Uc.getParents(a.dom,e.element),n={};t=Ot.grep(t,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),Fg(i.get(),function(e,r){Fg(t,function(o){return a.formatter.matchNode(o,r,{},e.similar)?(s[r]||(Fg(e,function(e){e(!0,{node:o,format:r,parents:t})}),s[r]=e),n[r]=e,!1):!il.matchesUnInheritedFormatSelector(a,o,r)&&void 0})}),Fg(s,function(r,o){n[o]||(delete s[o],Fg(r,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),c=n,l=r,f=o,d=(u=t).get(),Fg(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),u.set(d)},Ug=function(e){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(t,n,r){Ot.each(r,function(n,r){e.setAttrib(t,r,n)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Ot.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t},Vg=Ot.each,Hg=Xo.DOM,qg=function(e,t){var n,r,o,i=t&&t.schema||Fo({}),a=function(e){var t,n,o;return r="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Hg.create(r.name),n=t,(o=r).classes.length&&Hg.addClass(n,o.classes.join(" ")),Hg.setAttribs(n,o.attrs),t},s=function(e,t,n){var r,o,u,c,l,f,d,m,p=t.length>0&&t[0],g=p&&p.name;if(l=g,f="string"!=typeof(c=e)?c.nodeName.toLowerCase():c,d=i.getElementRule(f),u=!(!(m=d&&d.parentsRequired)||!m.length)&&(l&&-1!==Ot.inArray(m,l)?l:m[0]))g===u?(o=t[0],t=t.slice(1)):o=u;else if(p)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=a(o)).appendChild(e),n&&(r||(r=Hg.create("div")).appendChild(e),Ot.each(n,function(t){var n=a(t);r.insertBefore(n,e)})),s(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=a(r),(o=Hg.create("div")).appendChild(s(n,e.slice(1),r.siblings)),o):""},jg=function(e){var t,n={classes:[],attrs:{}};return"*"!==(e=n.selector=Ot.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==Ot.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""})),n.name=t||"div",n},$g=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Ot.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Ot.map(e.split(/(?:~\+|~|\+)/),jg),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Wg=function(e,t){var n,r,o,i,a,s,u="";if(!1===(s=e.settings.preview_styles))return"";"string"!=typeof s&&(s="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0]}return"preview"in t&&!1===(s=t.preview)?"":(n=t.block||t.inline||"span",(i=$g(t.selector)).length?(i[0].name||(i[0].name=n),n=t.selector,r=qg(i,e)):r=qg([n],e),o=Hg.select(n,r)[0]||r.firstChild,Vg(t.styles,function(e,t){(e=c(e))&&Hg.setStyle(o,t,e)}),Vg(t.attributes,function(e,t){(e=c(e))&&Hg.setAttrib(o,t,e)}),Vg(t.classes,function(e){e=c(e),Hg.hasClass(o,e)||Hg.addClass(o,e)}),e.fire("PreviewFormats"),Hg.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),a=Hg.getStyle(e.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Vg(s.split(" "),function(t){var n=Hg.getStyle(o,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Hg.getStyle(e.getBody(),t,!0),"#ffffff"===Hg.toHex(n).toLowerCase())||"color"===t&&"#000000"===Hg.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===a)return;n=(n=parseFloat(n)/(/%$/.test(n)?100:1))*a+"px"}"border"===t&&n&&(u+="padding:0 2px;"),u+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),Hg.remove(r),u)},Kg=function(e,t,n,r,o){var i=t.get(n);!il.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Mg.applyFormat(e,n,r,o):bg(e,n,r,o)},Xg=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])},Yg=function(e){var t,n,r,o=(n={},(r=function(e,t){e&&("string"!=typeof e?Ot.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Ot.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Ug((t=e).dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Yl(null);return Xg(e),Cl(e),{get:o.get,register:o.register,unregister:o.unregister,apply:y.curry(Mg.applyFormat,e),remove:y.curry(bg,e),toggle:y.curry(Kg,e,o),match:y.curry(il.match,e),matchAll:y.curry(il.matchAll,e),matchNode:y.curry(il.matchNode,e),canApply:y.curry(il.canApply,e),formatChanged:y.curry(zg,e,i),getCssText:y.curry(Wg,e)}},Gg=function(e){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<t.length;o++){var i=t[o];for(var a in i)i.hasOwnProperty(a)&&(r[a]=e(r[a],i[a]))}return r}},Jg=Gg(function(e,t){return tr.isObject(e)&&tr.isObject(t)?Jg(e,t):t}),Qg=Gg(function(e,t){return t}),Zg={deepMerge:Jg,merge:Qg},eh=function(e,t){return e.fire("PreProcess",t)},th=function(e,t){return e.fire("PostProcess",t)},nh=function(e,t,n){e.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),e.addAttributeFilter("src,href,style",function(e,r){for(var o,i,a=e.length,s="data-mce-"+r,u=t.url_converter,c=t.url_converter_scope;a--;)(i=(o=e[a]).attributes.map[s])!==undefined?(o.attr(r,i.length>0?i:null),o.attr(s,null)):(i=o.attributes.map[r],"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):u&&(i=u.call(c,i,r,o.name)),o.attr(r,i.length>0?i:null))}),e.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",n.length>0?n:null))}),e.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),e.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Ao.decode(t.value))}),e.addNodeFilter("script,style",function(e,n){for(var r,o,i,a=e.length,s=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};a--;)o=(r=e[a]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+s(o)+"\n// ]]>")):"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+s(o)+"\n--\x3e")}),e.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),e.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),e.addAttributeFilter("data-mce-type",function(t){M.each(t,function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())})}),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},rh=function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())},oh=function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(s=a.createHTMLDocument(""),Ot.each("BODY"===o.nodeName?o.childNodes:[o],function(e){s.body.appendChild(s.importNode(e,!0))}),o="BODY"!==o.nodeName?s.body.firstChild:s.body,u=c.doc,c.doc=s),eh(r,Zg.merge(i,{node:o})),u&&(c.doc=u),o):t;var r,o,i,a,s,u,c,l,f},ih=function(e,t,n){e.addNodeFilter("font",function(e){M.each(e,function(e){var r,o,i=t.parse(e.attr("style")),a=e.attr("color"),s=e.attr("face"),u=e.attr("size");a&&(i.color=a),s&&(i["font-family"]=s),u&&(i["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(i)),r=e,o=["color","face","size"],M.each(o,function(e){r.attr(e,null)})})})},ah=function(e,t){var n,r=zo();t.convert_fonts_to_spans&&ih(e,r,Ot.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){M.each(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},sh=function(e,t){t.inline_styles&&ah(e,t)},uh=/^[ \t\r\n]*$/,ch={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},lh=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},fh=function(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})};fh.prototype={replace:function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},attr:function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},clone:function(){var e,t,n,r,o,i=new fh(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},wrap:function(e){return this.parent.insert(e,this),e.append(this),this},unwrap:function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},remove:function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t,t&&(t.prev=null)):n.next=t,e.lastChild===this?(e.lastChild=n,n&&(n.next=null)):t.prev=n,this.parent=this.next=this.prev=null),this},append:function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?(t.next=e,e.prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(e){var t,n=[];for(t=this.firstChild;t;t=lh(t,this))t.name===e&&n.push(t);return n},empty:function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=lh(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},isEmpty:function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!uh.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&uh.test(i.value))return!1;if(n&&n(i))return!1}while(i=lh(i,this));return!0},walk:function(e){return lh(this,null,e)}},fh.create=function(e,t){var n,r;if(n=new fh(e,ch[e]||1),t)for(r in t)n.attr(r,t[r]);return n};var dh=Ot.makeMap,mh=Ot.each,ph=Ot.explode,gh=Ot.extend,hh=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new fh("br","1")).shortEnded=!0:r.empty().append(new fh("#text","3")).value="\xa0"},vh=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},yh=function(e,t,n,r){return r.isEmpty(t,n,function(t){return n=t,(r=e.getElementRule(n.name))&&r.paddEmpty;var n,r})},bh=function(e,t){var n={},r={},o=[],i={},a={};return(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body",n.schema=t=t||Fo(),n.filterNode=function(e){var t,n,s;n in r&&((s=i[n])?s.push(e):i[n]=[e]),t=o.length;for(;t--;)(n=o[t].name)in e.attributes.map&&((s=a[n])?s.push(e):a[n]=[e]);return e},n.addNodeFilter=function(e,t){mh(ph(e),function(e){var n=r[e];n||(r[e]=n=[]),n.push(t)})},n.addAttributeFilter=function(e,t){mh(ph(e),function(e){var n;for(n=0;n<o.length;n++)if(o[n].name===e)return void o[n].callbacks.push(t);o.push({name:e,callbacks:[t]})})},n.parse=function(s,u){var c,l,f,d,m,p,g,h,v,y,b,C,x,w,N,E,S,k,T,A,_,B=[];u=u||{},i={},a={},C=gh(dh("script,style,head,html,body,title,meta,param"),t.getBlockElements()),A=t.getNonEmptyElements(),T=t.children,b=e.validate,_="forced_root_block"in u?u.forced_root_block:e.forced_root_block,k=t.getWhiteSpaceElements(),x=/^[ \t\r\n]+/,N=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,S=/^[ \t\r\n]+$/;var R=function(e,t){var n,o=new fh(e,t);return e in r&&((n=i[e])?n.push(o):i[e]=[o]),o},D=function(e){var n,r,o,i,a=t.getBlockElements();for(n=e.prev;n&&3===n.type;){if((o=n.value.replace(N,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!a[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}};if(c=new em({validate:b,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(t.getSelfClosingElements()),cdata:function(e){f.append(R("#cdata",4)).value=e},text:function(e,t){var n;w||(e=e.replace(E," "),f.lastChild&&C[f.lastChild.name]&&(e=e.replace(x,""))),0!==e.length&&((n=R("#text",3)).raw=!!t,f.append(n).value=e)},comment:function(e){f.append(R("#comment",8)).value=e},pi:function(e,t){f.append(R(e,7)).value=t,D(f)},doctype:function(e){f.append(R("#doctype",10)).value=e,D(f)},start:function(e,n,r){var i,s,u,c,l;if(u=b?t.getElementRule(e):{}){for((i=R(u.outputName||e,1)).attributes=n,i.shortEnded=r,f.append(i),(l=T[f.name])&&T[i.name]&&!l[i.name]&&B.push(i),s=o.length;s--;)(c=o[s].name)in n.map&&((v=a[c])?v.push(i):a[c]=[i]);C[e]&&D(i),r||(f=i),!w&&k[e]&&(w=!0)}},end:function(n){var r,o,i,a,s,c;if(o=b?t.getElementRule(n):{}){if(C[n]&&!w){if((r=f.firstChild)&&3===r.type)if((i=r.value.replace(x,"")).length>0)r.value=i,r=r.next;else for(a=r.next,r.remove(),r=a;r&&3===r.type;)i=r.value,a=r.next,(0===i.length||S.test(i))&&(r.remove(),r=a),r=a;if((r=f.lastChild)&&3===r.type)if((i=r.value.replace(N,"")).length>0)r.value=i,r=r.prev;else for(a=r.prev,r.remove(),r=a;r&&3===r.type;)i=r.value,a=r.prev,(0===i.length||S.test(i))&&(r.remove(),r=a),r=a}if(w&&k[n]&&(w=!1),o.removeEmpty&&yh(t,A,k,f)&&!f.attributes.map.name&&!f.attributes.map.id)return s=f.parent,C[f.name]?f.empty().remove():f.unwrap(),void(f=s);o.paddEmpty&&(vh(c=f,"#text")&&"\xa0"===c.firstChild.value||yh(t,A,k,f))&&hh(e,u,C,f),f=f.parent}}},t),l=f=new fh(u.context||e.root_name,11),c.parse(s),b&&B.length&&(u.context?u.invalid=!0:function(e){var r,o,i,a,s,u,c,l,f,d,m,p,g,h,v,y;for(p=dh("tr,td,th,tbody,thead,tfoot,table"),d=t.getNonEmptyElements(),m=t.getWhiteSpaceElements(),g=t.getTextBlockElements(),h=t.getSpecialElements(),r=0;r<e.length;r++)if((o=e[r]).parent&&!o.fixed)if(g[o.name]&&"li"===o.parent.name){for(v=o.next;v&&g[v.name];)v.name="li",v.fixed=!0,o.parent.insert(v,o.parent),v=v.next;o.unwrap(o)}else{for(a=[o],i=o.parent;i&&!t.isValidChild(i.name,o.name)&&!p[i.name];i=i.parent)a.push(i);if(i&&a.length>1){for(a.reverse(),s=u=n.filterNode(a[0].clone()),f=0;f<a.length-1;f++){for(t.isValidChild(u.name,a[f].name)?(c=n.filterNode(a[f].clone()),u.append(c)):c=u,l=a[f].firstChild;l&&l!==a[f+1];)y=l.next,c.append(l),l=y;u=c}yh(t,d,m,s)?i.insert(o,a[0],!0):(i.insert(s,a[0],!0),i.insert(o,s)),i=a[0],(yh(t,d,m,i)||vh(i,"br"))&&i.empty().remove()}else if(o.parent){if("li"===o.name){if((v=o.prev)&&("ul"===v.name||"ul"===v.name)){v.append(o);continue}if((v=o.next)&&("ul"===v.name||"ul"===v.name)){v.insert(o,v.firstChild,!0);continue}o.wrap(n.filterNode(new fh("ul",1)));continue}t.isValidChild(o.parent.name,"div")&&t.isValidChild("div",o.name)?o.wrap(n.filterNode(new fh("div",1))):h[o.name]?o.empty().remove():o.unwrap()}}}(B)),_&&("body"===l.name||u.isRootContent)&&function(){var n,r,o=l.firstChild,i=function(e){e&&((o=e.firstChild)&&3===o.type&&(o.value=o.value.replace(x,"")),(o=e.lastChild)&&3===o.type&&(o.value=o.value.replace(N,"")))};if(t.isValidChild(l.name,_.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!C[o.name]&&!o.attr("data-mce-type")?r?r.append(o):((r=R(_,1)).attr(e.forced_root_block_attrs),l.insert(r,o),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!u.invalid){for(y in i){for(v=r[y],g=(d=i[y]).length;g--;)d[g].parent||d.splice(g,1);for(m=0,p=v.length;m<p;m++)v[m](d,y,u)}for(m=0,p=o.length;m<p;m++)if((v=o[m]).name in a){for(g=(d=a[v.name]).length;g--;)d[g].parent||d.splice(g,1);for(g=0,h=v.callbacks.length;g<h;g++)v.callbacks[g](d,v.name,u)}}return l},e.remove_trailing_brs&&n.addNodeFilter("br",function(n,r,o){var i,a,s,u,c,l,f,d,m=n.length,p=gh({},t.getBlockElements()),g=t.getNonEmptyElements(),h=t.getNonEmptyElements();for(p.body=1,i=0;i<m;i++)if(s=(a=n[i]).parent,p[a.parent.name]&&a===s.lastChild){for(c=a.prev;c;){if("span"!==(l=c.name)||"bookmark"!==c.attr("data-mce-type")){if("br"!==l)break;if("br"===l){a=null;break}}c=c.prev}a&&(a.remove(),yh(t,g,h,s)&&(f=t.getElementRule(s.name))&&(f.removeEmpty?s.remove():f.paddEmpty&&hh(e,o,p,s)))}else{for(u=a;s&&s.firstChild===u&&s.lastChild===u&&(u=s,!p[s.name]);)s=s.parent;u===s&&!0!==e.padd_empty_with_br&&((d=new fh("#text",3)).value="\xa0",a.replace(d))}}),n.addAttributeFilter("href",function(t){var n,r,o,i=t.length;if(!e.allow_unsafe_link_target)for(;i--;)"a"===(n=t[i]).name&&"_blank"===n.attr("target")&&n.attr("rel",(r=n.attr("rel"),o=r?Ot.trim(r):"",/\b(noopener)\b/g.test(o)?o:o.split(" ").filter(function(e){return e.length>0}).concat(["noopener"]).sort().join(" ")))}),e.allow_html_in_named_anchor||n.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,t=o.lastChild;do{n=t.prev,r.insert(t,o),t=n}while(t)}}),e.fix_list_elements&&n.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new fh("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),e.validate&&t.getValidClasses()&&n.addAttributeFilter("class",function(e){for(var n,r,o,i,a,s,u,c=e.length,l=t.getValidClasses();c--;){for(r=(n=e[c]).attr("class").split(" "),a="",o=0;o<r.length;o++)i=r[o],u=!1,(s=l["*"])&&s[i]&&(u=!0),s=l[n.name],!u&&s&&s[i]&&(u=!0),u&&(a&&(a+=" "),a+=i);a.length||(a=null),n.attr("class",a)}}),sh(n,e),n},Ch=function(e,t,n){-1===Ot.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},xh=function(e,t,n,r,o){var i,a,s,u,c=(i=r,zs(t,n).serialize(i));return a=e,u=c,!(s=o).no_events&&a?th(a,Zg.merge(s,{content:u})).content:u},wh=function(e,t){var n,r,o,i=["data-mce-selected"];return n=t&&t.dom?t.dom:Xo.DOM,r=t&&t.schema?t.schema:Fo(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs,o=bh(e,r),nh(o,e,n),{schema:r,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:function(i,a){var s,u,c,l,f,d,m,p,g,h=Zg.merge({format:"html"},a||{}),v=oh(t,i,h),y=(s=n,u=v,l=ii((c=h).getInner?u.innerHTML:s.getOuterHTML(u)),c.selection?l:Ot.trim(l)),b=(f=o,d=y,p=(m=h).selection?Zg.merge({forced_root_block:!1},m):m,g=f.parse(d,p),rh(g),g);return"tree"===h.format?b:xh(t,e,r,b,h)},addRules:function(e){r.addValidElements(e)},setRules:function(e){r.setValidElements(e)},addTempAttr:y.curry(Ch,o,i),getTempAttrs:function(){return i}}},Nh=function(e,t){var n=wh(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs}},Eh=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(mi.showCaretContainerBlock(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},Sh=function(e,t){var n,r=(n=e,Nu(Hn.fromDom(n.getBody()),"*[data-mce-caret]").fold(y.constant(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void Eh(e,r)):void(mi.hasContent(r)&&Eh(e,r))},kh=function(e){e.on("keyup compositionstart",y.curry(Sh,e))};function Th(e){return{getBookmark:y.curry(xs.getBookmark,e),moveToBookmark:y.curry(xs.moveToBookmark,e)}}(Th||(Th={})).isBookmarkNode=xs.isBookmarkNode;var Ah=Th,_h=vo.isContentEditableFalse,Bh=vo.isContentEditableTrue,Rh=function(e,t){var n,r,o,i,a,s,u,c,l,f,d,m,p,g,h,v,y,b=t.dom,C=Ot.each,x=t.getDoc(),w=document,N=Math.abs,E=Math.round,S=t.getBody();i={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var k=".mce-content-body";t.contentStyles.push(k+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+k+" .mce-resizehandle:hover {background: #000}"+k+" img[data-mce-selected],"+k+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+k+" .mce-clonedresizable {position: absolute;"+(me.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+k+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var T=function(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))},A=function(e){var n,r,o=e.target;n=e,r=t.selection.getRng(),!T(n.target)||kp(n.clientX,n.clientY,r)||e.isDefaultPrevented()||(e.preventDefault(),t.selection.select(o))},_=function(e){return t.dom.is(e,"figure.image")?e.querySelector("img"):e},B=function(e){var n=t.settings.object_resizing;return!1!==n&&!me.iOS&&("string"!=typeof n&&(n="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&_r.is(Hn.fromDom(e),n))},R=function(e){var i,C,x,w;i=e.screenX-s,C=e.screenY-u,g=i*a[2]+f,h=C*a[3]+d,g=g<5?5:g,h=h<5?5:h,(T(n)&&!1!==t.settings.resize_img_proportional?!Mp.modifierPressed(e):Mp.modifierPressed(e)||T(n)&&a[2]*a[3]!=0)&&(N(i)>N(C)?(h=E(g*m),g=E(h/m)):(g=E(h/m),h=E(g*m))),b.setStyles(_(r),{width:g,height:h}),x=a.startPos.x+i,w=a.startPos.y+C,x=x>0?x:0,w=w>0?w:0,b.setStyles(o,{left:x,top:w,display:"block"}),o.innerHTML=g+" &times; "+h,a[2]<0&&r.clientWidth<=g&&b.setStyle(r,"left",c+(f-g)),a[3]<0&&r.clientHeight<=h&&b.setStyle(r,"top",l+(d-h)),(i=S.scrollWidth-v)+(C=S.scrollHeight-y)!=0&&b.setStyles(o,{left:x-i,top:w-C}),p||(t.fire("ObjectResizeStart",{target:n,width:f,height:d}),p=!0)},D=function(){p=!1;var e=function(e,r){r&&(n.style[e]||!t.schema.isValid(n.nodeName.toLowerCase(),e)?b.setStyle(_(n),e,r):b.setAttrib(_(n),e,r))};e("width",g),e("height",h),b.unbind(x,"mousemove",R),b.unbind(x,"mouseup",D),w!==x&&(b.unbind(w,"mousemove",R),b.unbind(w,"mouseup",D)),b.remove(r),b.remove(o),O(n),t.fire("ObjectResized",{target:n,width:g,height:h}),b.setAttrib(n,"style",b.getAttrib(n,"style")),t.nodeChanged()},O=function(e){var p,N,E,k,T;P(),M(),p=b.getPos(e,S),c=p.x,l=p.y,T=e.getBoundingClientRect(),N=T.width||T.right-T.left,E=T.height||T.bottom-T.top,n!==e&&(n=e,g=h=0),k=t.fire("ObjectSelected",{target:e}),B(e)&&!k.isDefaultPrevented()?C(i,function(e,t){var i;(i=b.get("mceResizeHandle"+t))&&b.remove(i),i=b.add(S,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),me.ie&&(i.contentEditable=!1),b.bind(i,"mousedown",function(t){var i;t.stopImmediatePropagation(),t.preventDefault(),s=(i=t).screenX,u=i.screenY,f=_(n).clientWidth,d=_(n).clientHeight,m=d/f,a=e,e.startPos={x:N*e[0]+c,y:E*e[1]+l},v=S.scrollWidth,y=S.scrollHeight,r=n.cloneNode(!0),b.addClass(r,"mce-clonedresizable"),b.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,b.setStyles(r,{left:c,top:l,margin:0}),r.removeAttribute("data-mce-selected"),S.appendChild(r),b.bind(x,"mousemove",R),b.bind(x,"mouseup",D),w!==x&&(b.bind(w,"mousemove",R),b.bind(w,"mouseup",D)),o=b.add(S,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},f+" &times; "+d)}),e.elm=i,b.setStyles(i,{left:N*e[0]+c-i.offsetWidth/2,top:E*e[1]+l-i.offsetHeight/2})}):P(),n.setAttribute("data-mce-selected","1")},P=function(){var e,t;for(e in M(),n&&n.removeAttribute("data-mce-selected"),i)(t=b.get("mceResizeHandle"+e))&&(b.unbind(t),b.remove(t))},I=function(n){var r,o=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};p||t.removed||(C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"===n.type?n.target:e.getNode(),o(r=b.$(r).closest("table,img,figure.image,hr")[0],S)&&(F(),o(e.getStart(!0),r)&&o(e.getEnd(!0),r))?O(r):P())},L=function(e){return _h(function(e,t){for(;t&&t!==e;){if(Bh(t)||_h(t))return t;t=t.parentNode}return null}(t.getBody(),e))},M=function(){for(var e in i){var t=i[e];t.elm&&(b.unbind(t.elm),delete t.elm)}},F=function(){try{t.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return t.on("init",function(){F(),me.ie&&me.ie>=11&&(t.on("mousedown click",function(e){var n=e.target,r=n.nodeName;p||!/^(TABLE|IMG|HR)$/.test(r)||L(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged())}),t.dom.bind(S,"mscontrolselect",function(e){var n=function(e){ye.setEditorTimeout(t,function(){t.selection.select(e)})};if(L(e.target))return e.preventDefault(),void n(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&n(e.target))}));var e=ye.throttle(function(e){t.composing||I(e)});t.on("nodechange ResizeEditor ResizeWindow drop",e),t.on("keyup compositionend",function(t){n&&"TABLE"===n.nodeName&&e(t)}),t.on("hide blur",P),t.on("contextmenu",A)}),t.on("remove",M),{isResizable:B,showResizeRect:O,hideResizeRect:P,updateResizeRect:I,destroy:function(){n=r=null}}},Dh=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},Oh=function(e,t,n){var r,o,i,a,s,u=e.dom,c=u.getRoot(),l=0;if(s={elm:t,alignToTop:n},e.fire("scrollIntoView",s),!s.isDefaultPrevented()&&vo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Dh(t).y-Dh(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||r+25>i+a)&&(f.scrollTop=r<i?r:r-a+25))}o=u.getViewPort(e.getWin()),r=u.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||r+25>i+a)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},Ph=function(e){return vo.isContentEditableTrue(e)||vo.isContentEditableFalse(e)},Ih=function(e,t,n){var r,o,i,a,s,u=n;if(u.caretPositionFromPoint)(o=u.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(u.body.createTextRange){r=u.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,t,n){var r,o,i;if(r=n.elementFromPoint(e,t),o=n.body.createTextRange(),r&&"HTML"!==r.tagName||(r=n.body),o.moveToElementText(r),(i=(i=Ot.toArray(o.getClientRects())).sort(function(e,n){return(e=Math.abs(Math.max(e.top-t,e.bottom-t)))-(n=Math.abs(Math.max(n.top-t,n.bottom-t)))})).length>0){t=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,t),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,s=i&&i.parentElement?i.parentElement():null,vo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(s,a,Ph))?null:i}return r},Lh=function(e,t){return M.map(t,function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t})},Mh=function(e,t){return Hn.fromDom(e.dom().cloneNode(t))},Fh=function(e){return Mh(e,!0)},zh=function(e){return Mh(e,!1)},Uh=Fh,Vh=function(e,t){var n=(t||document).createDocumentFragment();return M.each(e,function(e){n.appendChild(e.dom())}),Hn.fromDom(n)},Hh=function(e){return Ur.firstChild(e).fold(y.constant([e]),function(t){return[e].concat(Hh(t))})},qh=function(e){return Ur.lastChild(e).fold(y.constant([e]),function(t){return"br"===Zn.name(t)?Ur.prevSibling(t).map(function(t){return[e].concat(qh(t))}).getOr([]):[e].concat(qh(t))})},jh=function(e,t){return hs([(i=t,a=i.startContainer,s=i.startOffset,vo.isText(a)?0===s?E.some(Hn.fromDom(a)):E.none():E.from(a.childNodes[s]).map(Hn.fromDom)),(n=t,r=n.endContainer,o=n.endOffset,vo.isText(r)?o===r.data.length?E.some(Hn.fromDom(r)):E.none():E.from(r.childNodes[o-1]).map(Hn.fromDom))],function(t,n){var r=M.find(Hh(e),y.curry(Dr.eq,t)),o=M.find(qh(e),y.curry(Dr.eq,n));return r.isSome()&&o.isSome()}).getOr(!1);var n,r,o,i,a,s},$h=function(e,t,n,r){var o=n,i=new to(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Ot.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(me.ie&&me.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Wh=xr("element","width","rows"),Kh=xr("element","cells"),Xh=xr("x","y"),Yh=function(e,t){var n=parseInt(dr.get(e,t),10);return isNaN(n)?1:n},Gh=function(e){return M.foldl(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Jh=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Dr.eq(o[i],t))return E.some(Xh(i,r));return E.none()},Qh=function(e,t,n,r,o){for(var i=[],a=e.rows(),s=n;s<=o;s++){var u=a[s].cells(),c=t<r?u.slice(t,r+1):u.slice(r,t+1);i.push(Kh(a[s].element(),c))}return i},Zh=function(e){var t=Wh(zh(e),0,[]);return M.each(Os(e,"tr"),function(e,n){M.each(Os(e,"td,th"),function(r,o){!function(e,t,n,r,o){for(var i=Yh(o,"rowspan"),a=Yh(o,"colspan"),s=e.rows(),u=n;u<n+i;u++){s[u]||(s[u]=Kh(Uh(r),[]));for(var c=t;c<t+a;c++)s[u].cells()[c]=u===n&&c===t?o:zh(o)}}(t,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(t,o,n),n,e,r)})}),Wh(t.element(),Gh(t.rows()),t.rows())},ev=function(e){return t=e,i=e,n=M.map(i.rows(),function(e){var t=M.map(e.cells(),function(e){var t=Uh(e);return dr.remove(t,"colspan"),dr.remove(t,"rowspan"),t}),n=zh(e.element());return As(n,t),n}),r=zh(t.element()),o=Hn.fromTag("tbody"),As(o,n),ks.append(r,o),r;var t,n,r,o,i},tv=function(e,t,n){return Jh(e,t).bind(function(t){return Jh(e,n).map(function(n){return r=e,i=n,a=(o=t).x(),s=o.y(),u=i.x(),c=i.y(),l=s<c?Qh(r,a,s,u,c):Qh(r,a,c,u,s),Wh(r.element(),Gh(l),l);var r,o,i,a,s,u,c,l})})},nv=function(e,t){return M.find(e,function(e){return"li"===Zn.name(e)&&jh(e,t)}).fold(y.constant([]),function(t){return(n=e,M.find(n,function(e){return"ul"===Zn.name(e)||"ol"===Zn.name(e)})).map(function(e){return[Hn.fromTag("li"),Hn.fromTag(Zn.name(e))]}).getOr([]);var n})},rv=function(e,t){var n,r=Hn.fromDom(t.commonAncestorContainer),o=Uu(r,e),i=M.filter(o,function(e){return io.isInline(e)||io.isHeading(e)}),a=nv(o,t),s=i.concat(a.length?a:(n=r,io.isListItem(n)?Ur.parent(n).filter(io.isList).fold(y.constant([]),function(e){return[n,e]}):io.isList(n)?[n]:[]));return M.map(s,zh)},ov=function(){return Vh([])},iv=function(e,t){return n=Hn.fromDom(t.cloneContents()),r=rv(e,t),o=M.foldl(r,function(e,t){return ks.append(t,e),t},n),r.length>0?Vh([o]):o;var n,r,o},av=function(e,t){return(n=e,r=t[0],wu(r,"table",y.curry(Dr.eq,n))).bind(function(e){var n=t[0],r=t[t.length-1],o=Zh(e);return tv(o,n,r).map(function(e){return Vh([ev(e)])})}).getOrThunk(ov);var n,r},sv=function(e,t){var n,r,o=Af(t,e);return o.length>0?av(e,o):(n=e,(r=t).length>0&&r[0].collapsed?ov():iv(n,r[0]))},uv=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=Lh(e,wf(i));if((t=t||{}).get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return e.selection.isCollapsed()?"":ii(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?sv(Hn.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var s=e.selection.serializer.serialize(o,t);return"tree"===t.format?s:(t.content=e.selection.isCollapsed()?"":s,e.fire("GetContent",t),t.content)},cv=function(e,t,n){var r,o,i,a=e.selection.getRng(),s=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===s&&a.endContainer===s?s.body.innerHTML=t:(a.deleteContents(),0===s.body.childNodes.length?s.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=s.createDocumentFragment(),i=s.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=s.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(u){}}else a.item&&(s.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},lv=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return E.from(i).map(Hn.fromDom).map(function(e){return r&&t.collapsed?e:Ur.child(e,o(e,a)).getOr(e)}).bind(function(e){return Zn.isElement(e)?E.some(e):Ur.parent(e)}).map(function(e){return e.dom()}).getOr(e)},fv=function(e,t,n){return lv(e,t,!0,n,function(e,t){return Math.min(Ur.childNodesCount(e),t)})},dv=function(e,t,n){return lv(e,t,!1,n,function(e,t){return t>0?t-1:t})},mv=function(e,t){for(var n=e;e&&vo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},pv=Ot.each,gv=function(e){return!!e.select},hv=function(e){return!(!e||!e.ownerDocument)&&Dr.contains(Hn.fromDom(e.ownerDocument),Hn.fromDom(e))},vv=function(e,t,n,r){var o,i,a,s,u,c=function(e,t){return cv(r,e,t)},l=function(e){var t=d();t.collapse(!!e),m(t)},f=function(){return t.getSelection?t.getSelection():t.document.selection},d=function(){var n,o,i,u,c=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!t)return null;if(void 0===(u=t.document)||null===u)return null;if(r.bookmark!==undefined&&!1===hm(r)){var l=Td(r);if(l.isSome())return l.map(function(e){return Lh(r,[e])[0]}).getOr(u.createRange())}try{(n=f())&&(o=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():u.createRange())}catch(d){}return(o=Lh(r,[o])[0])||(o=u.createRange?u.createRange():u.body.createTextRange()),o.setStart&&9===o.startContainer.nodeType&&o.collapsed&&(i=e.getRoot(),o.setStart(i,0),o.setEnd(i,0)),a&&s&&(0===c(o.START_TO_START,o,a)&&0===c(o.END_TO_END,o,a)?o=s:(a=null,s=null)),o},m=function(e,t){var n,o;if((i=e)&&(gv(i)||hv(i.startContainer)&&hv(i.endContainer))){var i,u=gv(e)?e:null;if(u){s=null;try{u.select()}catch(c){}}else{if(n=f(),e=r.fire("SetSelectionRange",{range:e,forward:t}).range,n){s=e;try{n.removeAllRanges(),n.addRange(e)}catch(c){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),a=n.rangeCount>0?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||me.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(o=e.startContainer.childNodes[e.startOffset])&&"IMG"===o.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(o,0,o,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t})}}},p=function(){var t,n,r=f();return!(r&&r.anchorNode&&r.focusNode)||((t=e.createRng()).setStart(r.anchorNode,r.anchorOffset),t.collapse(!0),(n=e.createRng()).setStart(r.focusNode,r.focusOffset),n.collapse(!0),t.compareBoundaryPoints(t.START_TO_START,n)<=0)},g={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:l,setCursorLocation:function(t,n){var o=e.createRng();t?(o.setStart(t,n),o.setEnd(t,n),m(o),l(!1)):($h(e,o,r.getBody(),!0),m(o))},getContent:function(e){return uv(r,e)},setContent:c,getBookmark:function(e,t){return o.getBookmark(e,t)},moveToBookmark:function(e){return o.moveToBookmark(e)},select:function(t,n){var r,o,i;return(r=e,o=t,i=n,E.from(o).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),i&&($h(r,n,e,!0),$h(r,n,e,!1)),n})).each(m),t},isCollapsed:function(){var e=d(),t=f();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:p,setNode:function(t){return c(e.getOuterHTML(t)),t},getNode:function(){return e=r.getBody(),(t=d())?(o=t.startContainer,i=t.endContainer,a=t.startOffset,s=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(o===i&&s-a<2&&o.hasChildNodes()&&(n=o.childNodes[a]),3===o.nodeType&&3===i.nodeType&&(o=o.length===a?mv(o.nextSibling,!0):o.parentNode,i=0===s?mv(i.previousSibling,!1):i.parentNode,o&&o===i))?o:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,o,i,a,s},getSel:f,setRng:m,getRng:d,getStart:function(e){return fv(r.getBody(),d(),e)},getEnd:function(e){return dv(r.getBody(),d(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||fv(i,t,!1),e.isBlock),r=e.getParent(r||dv(i,t,!1),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r){o=n;for(var s=new to(n,i);(o=s.next())&&o!==r;)e.isBlock(o)&&a.push(o)}return r&&n!==r&&r!==i&&a.push(r),a}(e,d(),t,n)},normalize:function(){var t=d();if(!Ef(f())){var n=Jf.normalize(e,t);return n.each(function(e){m(e,p())}),n.getOr(t)}return t},selectorChanged:function(t,n){var o;return u||(u={},o={},r.on("NodeChange",function(t){var n=t.element,r=e.getParents(n,null,e.getRoot()),i={};pv(u,function(t,n){pv(r,function(a){if(e.is(a,n))return o[n]||(pv(t,function(e){e(!0,{node:a,selector:n,parents:r})}),o[n]=t),i[n]=t,!1})}),pv(o,function(e,t){i[t]||(delete o[t],pv(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),u[t]||(u[t]=[]),u[t].push(n),g},getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode}return t},scrollIntoView:function(e,t){return Oh(r,e,t)},placeCaretAt:function(e,t){return m(Ih(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=d();return e.collapsed?ia.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=null,i.destroy()}};return o=Ah(g),i=Rh(g,r),g.bookmarkManager=o,g.controlSelection=i,g},yv=ji.curry,bv=function(e,t,n,r,o,i){var a,s,u=0,c=[],l=function(r){var i,a,l;for(l=gp.getClientRects(r),-1===e&&(l=l.reverse()),i=0;i<l.length;i++)if(a=l[i],!n(a,s)){if(c.length>0&&t(a,At.last(c))&&u++,a.line=u,o(a))return!0;c.push(a)}};return(s=At.last(i.getClientRects()))?(l(a=i.getNode()),function(e,t,n,r){for(;r=_a.findNode(r,e,ki,t);)if(n(r))return}(e,r,l,a),c):c},Cv={upUntil:yv(bv,-1,Ii,Li),downUntil:yv(bv,1,Li,Ii),positionsUntil:function(e,t,n,r){var o,i,a,s,u,c,l=Ha(t),f=[],d=0,m=function(e){return At.last(e.getClientRects())};1===e?(o=l.next,i=Li,a=Ii,s=ia.after(r)):(o=l.prev,i=Ii,a=Li,s=ia.before(r)),c=m(s);do{if(s.isVisible()&&!a(u=m(s),c)){if(f.length>0&&i(u,At.last(f))&&d++,(u=Di(u)).position=s,u.line=d,n(u))return f;f.push(u)}}while(s=o(s));return f},isAboveLine:yv(function(e,t){return t.line>e}),isLine:yv(function(e,t){return t.line===e})},xv=vo.isContentEditableFalse,wv=Fi,Nv=_a.isAfterContentEditableFalse,Ev=_a.isBeforeContentEditableFalse,Sv=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},kv=function(e,t,n){return n=_a.normalizeRange(e,t,n),-1===e?ia.fromRangeStart(n):ia.fromRangeEnd(n)},Tv=function(e,t,n,r,o){var i,a,s,u,c,l,f,d;return!o.collapsed&&(i=wv(o),xv(i))?Dp(e,t,i,-1===e):(c=o,u=mi.isCaretContainerBlock(c.startContainer),r(a=kv(e,t.getBody(),o))?Op(t,a.getNode(-1===e)):(a=n(a))?r(a)?Dp(e,t,a.getNode(-1===e),1===e):r(s=n(a))&&(l=a,f=s,!(d=_a.isInSameBlock(l,f))&&vo.isBr(l.getNode())||d)?Dp(e,t,s.getNode(-1===e),1===e):u?Ip(t,a.toRange()):null:u?o:null)},Av=function(e,t,n){var r,o,i,a,s=Ha(e.getBody()),u=ji.curry(Sv,s.next),c=ji.curry(Sv,s.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?u(ia.fromRangeStart(n)):c(ia.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!me.ie||me.ie>=11)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},_v=function(e,t){var n,r=t?1:-1,o=t?Cv.downUntil:Cv.upUntil,i=e.selection.getRng();return(n=function(e,t,n,r){var o,i,a,s,u,c,l,f,d;if(d=wv(r),o=kv(e,t.getBody(),r),i=n(t.getBody(),Cv.isAboveLine(1),o),a=At.filter(i,Cv.isLine(1)),u=At.last(o.getClientRects()),Ev(o)&&(d=o.getNode()),Nv(o)&&(d=o.getNode(!0)),!u)return null;if(c=u.left,(s=Ep(a,c))&&xv(s.node))return l=Math.abs(c-s.left),f=Math.abs(c-s.right),Dp(e,t,s.node,l<f);if(d){var m=Cv.positionsUntil(e,t.getBody(),Cv.isAboveLine(1),d);if(s=Ep(At.filter(m,Cv.isLine(1)),c))return Ip(t,s.position.toRange());if(s=At.last(At.filter(m,Cv.isLine(0))))return Ip(t,s.position.toRange())}}(r,e,o,i))?n:(n=Av(e,r,i))||null},Bv=function(e,t){return function(){var n,r,o,i,a,s,u,c,l,f,d=(r=t,i=Ha((n=e).getBody()),a=ji.curry(Sv,i.next),s=ji.curry(Sv,i.prev),u=r?1:-1,c=r?a:s,l=r?Ev:Nv,f=n.selection.getRng(),(o=Tv(u,n,c,l,f))?o:(o=Av(n,u,f))||null);return!!d&&(e.selection.setRng(d),!0)}},Rv=function(e,t){return function(){var n=_v(e,t);return!!n&&(e.selection.setRng(n),!0)}},Dv=function(e,t){return M.bind((n=e,M.map(n,function(e){return Zg.merge({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:y.noop},e)})),function(e){return n=e,(r=t).keyCode===n.keyCode&&r.shiftKey===n.shiftKey&&r.altKey===n.altKey&&r.ctrlKey===n.ctrlKey&&r.metaKey===n.metaKey?[e]:[];var n,r});var n},Ov=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},Pv=function(e,t){return M.find(Dv(e,t),function(e){return e.action()})},Iv=function(e,t){e.on("keydown",function(n){var r,o,i,a;!1===n.isDefaultPrevented()&&(r=e,o=t,i=n,a=Un.detect().os,Pv([{keyCode:Mp.RIGHT,action:Bv(r,!0)},{keyCode:Mp.LEFT,action:Bv(r,!1)},{keyCode:Mp.UP,action:Rv(r,!1)},{keyCode:Mp.DOWN,action:Rv(r,!0)},{keyCode:Mp.RIGHT,action:of.move(r,o,!0)},{keyCode:Mp.LEFT,action:of.move(r,o,!1)},{keyCode:Mp.RIGHT,ctrlKey:!a.isOSX(),altKey:a.isOSX(),action:of.moveNextWord(r,o)},{keyCode:Mp.LEFT,ctrlKey:!a.isOSX(),altKey:a.isOSX(),action:of.movePrevWord(r,o)}],i).each(function(e){i.preventDefault()}))})},Lv=function(e){return 1===Ur.children(e).length},Mv=function(e,t){var n,r=Hn.fromDom(e.getBody()),o=Hn.fromDom(e.selection.getStart()),i=M.filter((n=Uu(o,r),M.findIndex(n,io.isBlock).fold(y.constant(n),function(e){return n.slice(0,e)})),Lv);return M.last(i).map(function(n){var r=ia.fromRangeStart(e.selection.getRng());return!!Cu(t,r,n.dom())&&(function(e,t,n,r){var o=y.curry(kl,t),i=M.map(M.filter(r,o),function(e){return e.dom()});if(0===i.length)mc(t,e,n);else{var a=Sl(n.dom(),i);t.selection.setRng(a.toRange())}}(t,e,n,i),!0)}).getOr(!1)},Fv=function(e,t){return!!e.selection.isCollapsed()&&Mv(e,t)},zv=function(e,t){e.on("keydown",function(n){var r,o,i;!1===n.isDefaultPrevented()&&(r=e,o=t,i=n,Pv([{keyCode:Mp.BACKSPACE,action:Ov(hc,r,!1)},{keyCode:Mp.DELETE,action:Ov(hc,r,!0)},{keyCode:Mp.BACKSPACE,action:Ov(cf,r,o,!1)},{keyCode:Mp.DELETE,action:Ov(cf,r,o,!0)},{keyCode:Mp.BACKSPACE,action:Ov(Ju,r,!1)},{keyCode:Mp.DELETE,action:Ov(Ju,r,!0)},{keyCode:Mp.BACKSPACE,action:Ov(Ku,r,!1)},{keyCode:Mp.DELETE,action:Ov(Ku,r,!0)},{keyCode:Mp.BACKSPACE,action:Ov(zf,r,!1)},{keyCode:Mp.DELETE,action:Ov(zf,r,!0)},{keyCode:Mp.BACKSPACE,action:Ov(Fv,r,!1)},{keyCode:Mp.DELETE,action:Ov(Fv,r,!0)}],i).each(function(e){i.preventDefault()}))}),e.on("keyup",function(t){var n,r;!1===t.isDefaultPrevented()&&(n=e,r=t,Pv([{keyCode:Mp.BACKSPACE,action:Ov(vc,n)},{keyCode:Mp.DELETE,action:Ov(vc,n)}],r))})},Uv=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},Vv=function(e){return e.getParam("iframe_attrs",{})},Hv=function(e){return e.getParam("doctype","<!DOCTYPE html>")},qv=function(e){return e.getParam("document_base_url","")},jv=function(e){return Uv(e,"body_id","tinymce")},$v=function(e){return Uv(e,"body_class","")},Wv=function(e){return e.getParam("content_security_policy","")},Kv=function(e){return e.getParam("br_in_pre",!0)},Xv=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},Yv=function(e){return e.getParam("forced_root_block_attrs",{})},Gv=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Jv=function(e){return e.getParam("no_newline_selector","")},Qv=function(e){return e.getParam("keep_styles",!0)},Zv=function(e){return e.getParam("end_container_on_empty_block",!1)},ey=function(e){return E.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},ty=function(e,t){var n,r,o,i=t,a=e.dom,s=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var u=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new to(t,t);r=n.current();){if(vo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(s[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else vo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},ny=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},ry=ey,oy=function(e){return ey(e).fold(y.constant(""),function(e){return e.nodeName.toUpperCase()})},iy=function(e){return ey(e).filter(function(e){return io.isListItem(Hn.fromDom(e))}).isSome()},ay=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},sy=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},uy=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},cy=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!vo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},ly=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var s;sy(s=n)&&sy(s.parentNode)&&(o="LI");var u,c,l=o?t(o):i.create("BR");if(cy(n,r,!0)&&cy(n,r,!1))ay(n,"LI")?i.insertAfter(l,uy(n)):i.replace(l,n);else if(cy(n,r,!0))ay(n,"LI")?(i.insertAfter(l,uy(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(cy(n,r,!1))i.insertAfter(l,uy(n));else{n=uy(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(u=d).firstChild&&u.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),ty(e,l)}},fy=function(e){e.innerHTML='<br data-mce-bogus="1">'},dy=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},my=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},py=function(e,t,n){return!1===vo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===oi?0:n:n===t.data.length-1&&t.data.charAt(n)===oi?t.data.length:n},gy=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},hy=function(e,t){var n=Xv(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,Yv(e))},vy=function(e,t){var n,r,o,i,a,s,u,c,l,f,d,m,p,g,h,v,y,b,C=e.dom,x=e.schema,w=x.getNonEmptyElements(),N=e.selection.getRng(),E=function(t){var n,i,s,u=o,c=x.getTextInlineElements();if(t||"TABLE"===f||"HR"===f?(n=C.create(t||m),hy(e,n)):n=a.cloneNode(!1),s=n,!1===Qv(e))C.setAttrib(n,"style",null),C.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Nl(u))continue;i=u.cloneNode(!1),C.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(s=i,n.appendChild(i))}}while((u=u.parentNode)&&u!==r);return fy(s),n},S=function(e){var t,n,r,s;if(s=py(e,o,i),vo.isText(o)&&(e?s>0:s<o.nodeValue.length))return!1;if(o.parentNode===a&&p&&!e)return!0;if(e&&vo.isElement(o)&&o===a.firstChild)return!0;if(dy(o,"TABLE")||dy(o,"HR"))return p&&!e||!p&&e;for(t=new to(o,a),vo.isText(o)&&(e&&0===s?t.prev():e||s!==o.nodeValue.length||t.next());n=t.current();){if(vo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),w[r]&&"br"!==r))return!1}else if(vo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},k=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?E(m):E(),Zv(e)&&my(C,l)&&C.isEmpty(a)?u=C.split(l,a):C.insertAfter(u,a),ty(e,u)};Jf.normalize(C,N).each(function(e){N.setStart(e.startContainer,e.startOffset),N.setEnd(e.endContainer,e.endOffset)}),o=N.startContainer,i=N.startOffset,m=Xv(e),s=t.shiftKey,vo.isElement(o)&&o.hasChildNodes()&&(p=i>o.childNodes.length-1,o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o,i=p&&vo.isText(o)?o.nodeValue.length:0),(r=gy(C,o))&&((m&&!s||!m&&s)&&(o=function(e,t,n,r,o){var i,a,s,u,c,l,f,d=t||"P",m=e.dom,p=gy(m,r);if(!(a=m.getParent(r,m.isBlock))||!my(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),hy(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(u=r;u.parentNode!==a;)u=u.parentNode;for(;u&&!m.isBlock(u);)s=u,u=u.previousSibling;if(s&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),hy(e,i),s.parentNode.insertBefore(i,s),u=s;u&&!m.isBlock(u);)c=u.nextSibling,i.appendChild(u),u=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(e,m,N,o,i)),a=C.getParent(o,C.isBlock),l=a?C.getParent(a.parentNode,C.isBlock):null,f=a?a.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||t.ctrlKey||(a=l,l=l.parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(a)?ly(e,E,l,a,m):m&&a===e.getBody()||(m=m||"P",mi.isCaretContainerBlock(a)?(u=mi.showCaretContainerBlock(a),C.isEmpty(a)&&fy(a),ty(e,u)):S()?k():S(!0)?(u=a.parentNode.insertBefore(E(),a),ty(e,dy(a,"HR")?u:a)):((n=(y=N,b=y.cloneRange(),b.setStart(y.startContainer,py(!0,y.startContainer,y.startOffset)),b.setEnd(y.endContainer,py(!1,y.endContainer,y.endOffset)),b).cloneRange()).setEndAfter(a),function(e){do{vo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild}while(e)}(c=n.extractContents()),u=c.firstChild,C.insertAfter(c,a),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;vo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===Ot.trim(ii(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,u),g=C,(h=a).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(g.getStyle(v,"float",!0))||g.add(h,"br"),C.isEmpty(a)&&fy(a),u.normalize(),C.isEmpty(u)?(C.remove(u),k()):ty(e,u)),C.setAttrib(u,"id",""),e.fire("NewBlock",{newBlock:u})))},yy=function(e,t){return ry(e).filter(function(e){return t.length>0&&_r.is(Hn.fromDom(e),t)}).isSome()},by=function(e){return yy(e,Gv(e))},Cy=function(e){return yy(e,Jv(e))},xy=Qu([{br:[]},{block:[]},{none:[]}]),wy=function(e,t){return Cy(e)},Ny=function(e){return function(t,n){return""===Xv(t)===e}},Ey=function(e){return function(t,n){return iy(t)===e}},Sy=function(e){return function(t,n){return"PRE"===oy(t)===e}},ky=function(e){return function(t,n){return Kv(t)===e}},Ty=function(e,t){return by(e)},Ay=function(e,t){return t},_y=function(e){var t=Xv(e),n=ny(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},By=function(e,t){return function(n,r){return M.foldl(e,function(e,t){return e&&t(n,r)},!0)?E.some(t):E.none()}},Ry=function(e,t){return Tl([By([wy],xy.none()),By([Sy(!0),ky(!1),Ay],xy.br()),By([Sy(!0),ky(!1)],xy.block()),By([Sy(!0),ky(!0),Ay],xy.block()),By([Sy(!0),ky(!0)],xy.br()),By([Ey(!0),Ay],xy.br()),By([Ey(!0)],xy.block()),By([Ny(!0),Ay,_y],xy.block()),By([Ny(!0)],xy.br()),By([Ty],xy.br()),By([Ny(!1),Ay],xy.br()),By([_y],xy.block())],[e,t.shiftKey]).getOr(xy.none())},Dy=function(e,t){Ry(e,t).fold(function(){sd(e,t)},function(){vy(e,t)},y.noop)},Oy=function(e){e.on("keydown",function(t){var n,r,o;t.keyCode===Mp.ENTER&&(n=e,(r=t).isDefaultPrevented()||(r.preventDefault(),(o=n.undoManager).typing&&(o.typing=!1,o.add()),n.undoManager.transact(function(){!1===n.selection.isCollapsed()&&n.execCommand("Delete"),Dy(n,r)})))})},Py=function(e,t,n){return s=t,!(!Iy(n)||!vo.isText(s.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,s},Iy=function(e){return e.fold(y.constant(!1),y.constant(!0),y.constant(!0),y.constant(!1))},Ly=function(e){return!!e.selection.isCollapsed()&&(t=e,n=y.curry(vu.isInlineTarget,t),r=ia.fromRangeStart(t.selection.getRng()),$l(n,t.getBody(),r).map(y.curry(Py,t,r)).getOr(!1));var t,n,r},My=function(e){e.on("keydown",function(t){var n,r;!1===t.isDefaultPrevented()&&(n=e,r=t,Pv([{keyCode:Mp.SPACEBAR,action:Ov(Ly,n)}],r).each(function(e){r.preventDefault()}))})},Fy=function(e){var t=of.setupSelectedState(e);Iv(e,t),zv(e,t),Oy(e),My(e)},zy=function(e){var t,n,r,o=Ot.each,i=Mp.BACKSPACE,a=Mp.DELETE,s=e.dom,u=e.selection,c=e.settings,l=e.parser,f=me.gecko,d=me.ie,m=me.webkit,p="data:text/mce-internal,",g=d?"Text":"URL",h=function(t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},v=function(e){return e.isDefaultPrevented()},y=function(){e.shortcuts.add("meta+a",null,"SelectAll")},b=function(){e.on("keydown",function(e){if(!v(e)&&e.keyCode===i&&u.isCollapsed()&&0===u.getRng().startOffset){var t=u.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",function(t){var n;if("HTML"===t.target.nodeName){if(me.ie>11)return void e.getBody().focus();n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged()}}))};return e.on("keydown",function(t){var n,r,o,i,a;if(!v(t)&&t.keyCode===Mp.BACKSPACE&&(r=(n=u.getRng()).startContainer,o=n.startOffset,i=s.getRoot(),a=r,n.collapsed&&0===o)){for(;a&&a.parentNode&&a.parentNode.firstChild===a&&a.parentNode!==i;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(e.formatter.toggle("blockquote",null,a),(n=s.createRng()).setStart(r,0),n.setEnd(r,0),u.setRng(n))}}),t=function(e){var t=s.create("body"),n=e.cloneContents();return t.appendChild(n),u.serializer.serialize(t,{format:"html"})},e.on("keydown",function(n){var r,o,u,c,l,f=n.keyCode;if(!v(n)&&(f===a||f===i)){if(r=e.selection.isCollapsed(),o=e.getBody(),r&&!s.isEmpty(o))return;if(!r&&(u=e.selection.getRng(),c=t(u),(l=s.createRng()).selectNode(e.getBody()),c!==t(l)))return;n.preventDefault(),e.setContent(""),o.firstChild&&s.isBlock(o.firstChild)?e.selection.setCursorLocation(o.firstChild,0):e.selection.setCursorLocation(o,0),e.nodeChanged()}}),me.windowsPhone||e.on("keyup focusin mouseup",function(e){Mp.modifierPressed(e)||u.normalize()},!0),m&&(e.settings.content_editable||s.bind(e.getDoc(),"mousedown mouseup",function(t){var n;if(t.target===e.getDoc().documentElement)if(n=u.getRng(),e.getBody().focus(),"mousedown"===t.type){if(mi.isCaretContainer(n.startContainer))return;u.placeCaretAt(t.clientX,t.clientY)}else u.setRng(n)}),e.on("click",function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==s.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&s.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),u.select(n))}),c.forced_root_block&&e.on("init",function(){h("DefaultParagraphSeparator",c.forced_root_block)}),e.on("init",function(){e.dom.bind(e.getBody(),"submit",function(e){e.preventDefault()})}),b(),l.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),me.iOS?(e.inline||e.on("keydown",function(){document.activeElement===document.body&&e.getWin().focus()}),C(),e.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):y()),me.ie>=11&&(C(),b()),me.ie&&(y(),h("AutoUrlDetect",!1),e.on("dragstart",function(t){var n,r,o;(n=t).dataTransfer&&(e.selection.isCollapsed()&&"IMG"===n.target.tagName&&u.select(n.target),(r=e.selection.getContent()).length>0&&(o=p+escape(e.id)+","+escape(r),n.dataTransfer.setData(g,o)))}),e.on("drop",function(t){if(!v(t)){var n=(a=t).dataTransfer&&(s=a.dataTransfer.getData(g))&&s.indexOf(p)>=0?(s=s.substr(p.length).split(","),{id:unescape(s[0]),html:unescape(s[1])}):null;if(n&&n.id!==e.id){t.preventDefault();var r=Ih(t.x,t.y,e.getDoc());u.setRng(r),o=n.html,i=!0,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):e.execCommand("mceInsertContent",!1,o)}}var o,i,a,s})),f&&(e.on("keydown",function(t){if(!v(t)&&t.keyCode===i){if(!e.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return s.remove(n),void t.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(s.remove(r),t.preventDefault())}}}),Range.prototype.getClientRects||e.on("mousedown",function(t){if(!v(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ye.setEditorTimeout(e,function(){n.focus()})}}),n=function(){var t=s.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==e.getBody()&&(s.setAttrib(n,"style",null),o(t,function(e){n.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!u.isCollapsed()&&s.getParent(u.getStart(),s.isBlock)!==s.getParent(u.getEnd(),s.isBlock)},e.on("keypress",function(t){var o;if(!v(t)&&(8===t.keyCode||46===t.keyCode)&&r())return o=n(),e.getDoc().execCommand("delete",!1,null),o(),t.preventDefault(),!1}),s.bind(e.getDoc(),"cut",function(t){var o;!v(t)&&r()&&(o=n(),ye.setEditorTimeout(e,function(){o()}))}),c.readonly||e.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),c.object_resizing||h("enableObjectResizing",!1)}),e.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(s.select("a"),function(e){var t=e.parentNode,n=s.getRoot();if(t.lastChild===e){for(;t&&!s.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}s.add(t,"br",{"data-mce-bogus":1})}})}),e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),me.mac&&e.on("keydown",function(t){!Mp.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){var t;return!f||e.removed?0:!(t=e.selection.getSel())||!t.rangeCount||0===t.rangeCount}}},Uy=Xo.DOM,Vy=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&ye.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},Hy=function(e,t){var n,r,o,i,a,s,u,c,l,f=e.settings,d=e.getElement(),m=e.getDoc();f.inline||(e.getElement().style.visibility=e.orgVisibility),t||f.content_editable||(m.open(),m.write(e.iframeHTML),m.close()),f.content_editable&&(e.on("remove",function(){var e=this.getBody();Uy.removeClass(e,"mce-content-body"),Uy.removeClass(e,"mce-edit-focus"),Uy.setAttrib(e,"contentEditable",null)}),Uy.addClass(d,"mce-content-body"),e.contentDocument=m=f.content_document||document,e.contentWindow=f.content_window||window,e.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=e.getBody()).disabled=!0,e.readonly=f.readonly,e.readonly||(e.inline&&"static"===Uy.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=e.getParam("content_editable_state",!0)),n.disabled=!1,e.editorUpload=Jm(e),e.schema=Fo(f),e.dom=new Xo(m,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:e.inline?e.getBody():null,collect:f.content_editable,schema:e.schema,onSetAttrib:function(t){e.fire("SetAttrib",t)}}),e.parser=((i=bh((o=e).settings,o.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,i,a=e.length,s=o.dom;a--;)if(r=(n=e[a]).attr(t),i="data-mce-"+t,!n.attributes.map[i]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=s.serializeStyle(s.parseStyle(r),n.name)).length||(r=null),n.attr(i,r),n.attr(t,r)):"tabindex"===t?(n.attr(i,r),n.attr(t,null)):n.attr(i,o.convertURL(r,t,n.name))}}),i.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),i.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=o.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new fh("br",1)).shortEnded=!0)}),i),e.serializer=Nh(f,e),e.selection=vv(e.dom,e.getWin(),e.serializer,e),e.formatter=Yg(e),e.undoManager=rg(e),e._nodeChangeDispatcher=new tp(e),e._selectionOverrides=Hp(e),kh(e),Fy(e),ep(e),e.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,Uy.setAttrib(n,"spellcheck","false")),e.quirks=zy(e),e.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&e.on("BeforeSetContent",function(e){Ot.each(f.protect,function(t){e.content=e.content.replace(t,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),e.on("SetContent",function(){e.addVisual(e.getBody())}),f.padd_empty_editor&&e.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|<br \/>|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"}),e.on("compositionstart compositionend",function(t){e.composing="compositionstart"===t.type}),e.contentStyles.length>0&&(r="",Ot.each(e.contentStyles,function(e){r+=e+"\r\n"}),e.dom.addStyle(r)),(a=e,a.inline?Uy.styleSheetLoader:a.dom.styleSheetLoader).loadAll(e.contentCSS,function(t){Vy(e)},function(t){Vy(e)}),f.content_style&&(s=e,u=f.content_style,c=Hn.fromDom(s.getDoc().head),l=Hn.fromTag("style"),dr.set(l,"type","text/css"),ks.append(l,Hn.fromText(u)),ks.append(c,l))},qy=Xo.DOM,jy=function(e,t){var n,r,o,i,a,s,u,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=Vv(e),u=Hn.fromTag("iframe"),dr.setAll(u,i),dr.setAll(u,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),br(u,{width:"100%",height:(a=o,s="number"==typeof a?a+"px":a,s||""),display:"block"}),u).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,p,g=function(e,t){if(document.domain!==window.location.hostname&&me.ie&&me.ie<12){var n=Gm("mce");e[n]=function(){Hy(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return qy.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(p=Hv(f=e)+"<html><head>",qv(f)!==f.documentBaseUrl&&(p+='<base href="'+f.documentBaseURI.getURI()+'" />'),p+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=jv(f),m=$v(f),Wv(f)&&(p+='<meta http-equiv="Content-Security-Policy" content="'+Wv(f)+'" />'),p+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),qy.add(t.iframeContainer,l),g},$y=function(e,t){var n=jy(e,t);t.editorContainer&&(qy.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=qy.isHidden(t.editorContainer)),e.getElement().style.display="none",qy.setAttrib(e.id,"aria-hidden",!0),n||Hy(e)},Wy=Xo.DOM,Ky=function(e,t,n){var r,o,i=Im.get(n);if(r=Im.urls[n]||e.documentBaseUrl.replace(/\/$/,""),n=Ot.trim(n),i&&-1===Ot.inArray(t,n)){if(Ot.each(Im.dependencies(n),function(n){Ky(e,t,n)}),e.plugins[n])return;o=new i(e,r,e.$),e.plugins[n]=o,o.init&&(o.init(e,r),t.push(n))}},Xy=function(e){return e.replace(/^\-/,"")},Yy=function(e){return{editorContainer:e,iframeContainer:e}},Gy=function(e){var t,n,r=e.getElement();return e.inline?Yy(null):(t=r,n=Wy.create("div"),Wy.insertAfter(n,t),Yy(n))},Jy=function(e){var t,n,r,o,i,a,s,u,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,tr.isString(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Wy.getStyle(f,"width")||"100%",a=l.height||Wy.getStyle(f,"height")||f.offsetHeight,s=l.min_height||100,(u=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),u.test(""+a)&&(a=Math.max(parseInt(a,10),s)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<s&&(a=s),c.height=a,c):tr.isFunction(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):Gy(e)},Qy=function(e){var t,n,r,o,i,a,s=e.settings,u=e.getElement();return e.rtl=s.rtl_ui||e.editorManager.i18n.rtl,e.editorManager.i18n.setCode(s.language),s.aria_label=s.aria_label||Wy.getAttrib(u,"aria-label",e.getLang("aria.rich_text_area")),e.fire("ScriptsLoaded"),o=(n=e).settings.theme,tr.isString(o)?(n.settings.theme=Xy(o),r=Lm.get(o),n.theme=new r(n,Lm.urls[o]),n.theme.init&&n.theme.init(n,Lm.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=e,a=[],Ot.each(i.settings.plugins.split(/[ ,]/),function(e){Ky(i,a,Xy(e))}),t=Jy(e),e.editorContainer=t.editorContainer?t.editorContainer:null,s.content_css&&Ot.each(Ot.explode(s.content_css),function(t){e.contentCSS.push(e.documentBaseURI.toAbsolute(t))}),s.content_editable?Hy(e):$y(e,t)},Zy=Xo.DOM,eb=function(e){return"-"===e.charAt(0)},tb=function(e,t){var n=Zo.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(tr.isString(i)){if(!eb(i)&&!Lm.urls.hasOwnProperty(i)){var a=o.theme_url;a?Lm.load(i,t.documentBaseURI.toAbsolute(a)):Lm.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Lm.waitFor(i,r)})}else r()}(n,e,t,function(){var r,o,i,a,s;r=n,(i=(o=e).settings).language&&"en"!==i.language&&!i.language_url&&(i.language_url=o.editorManager.baseURL+"/langs/"+i.language+".js"),i.language_url&&!o.editorManager.i18n.data[i.language]&&r.add(i.language_url),a=e.settings,s=t,Ot.isArray(a.plugins)&&(a.plugins=a.plugins.join(" ")),Ot.each(a.external_plugins,function(e,t){Im.load(t,e),a.plugins+=" "+t}),Ot.each(a.plugins.split(/[ ,]/),function(e){if((e=Ot.trim(e))&&!Im.urls[e])if(eb(e)){e=e.substr(1,e.length);var t=Im.dependencies(e);Ot.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+s+".js"};e=Im.createUrl(t,e),Im.load(e.resource,e)})}else Im.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+s+".js"})}),n.loadQueue(function(){e.removed||Qy(e)},e,function(t){Rm(e,t[0]),e.removed||Qy(e)})})},nb=function(e){var t=e.settings,n=e.id,r=function(){Zy.unbind(window,"ready",r),e.render()};if(Te.Event.domLoaded){if(e.getElement()&&me.contentEditable){t.inline?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");var o=e.getElement().form||Zy.getParent(n,"form");o&&(e.formElement=o,t.hidden_input&&!/TEXTAREA|INPUT/i.test(e.getElement().nodeName)&&(Zy.insertAfter(Zy.create("input",{type:"hidden",name:n}),n),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t)},Zy.bind(o,"submit reset",e.formEventDelegate),e.on("reset",function(){e.setContent(e.startContent,{format:"raw"})}),!t.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),o._mceOldSubmit(o)})),e.windowManager=km(e),e.notificationManager=Sm(e),"xml"===t.encoding&&e.on("GetContent",function(e){e.save&&(e.content=Zy.encode(e.content))}),t.add_form_submit_trigger&&e.on("submit",function(){e.initialized&&e.save()}),t.add_unload_trigger&&(e._beforeUnload=function(){!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),tb(e,e.suffix)}}else Zy.bind(window,"ready",r)},rb=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},ob=Ot.each,ib=Ot.trim,ab="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),sb={ftp:21,http:80,https:443,mailto:25},ub=function(e,t){var n,r,o=this;if(e=ib(e),n=(t=o.settings=t||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");0!==e.indexOf("/")||i||(e=(n&&n.protocol||"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(r=t.base_uri?t.base_uri.path:new ub(document.location.href).directory,""==t.base_uri.protocol?e="//mce_host"+o.toAbsPath(r,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(n&&n.protocol||"http")+"://mce_host"+o.toAbsPath(r,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),ob(ab,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),n&&(o.protocol||(o.protocol=n.protocol),o.userInfo||(o.userInfo=n.userInfo),o.port||"mce_host"!==o.host||(o.port=n.port),o.host&&"mce_host"!==o.host||(o.host=n.host),o.source=""),i&&(o.protocol="")}};ub.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new ub(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new ub(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=sb[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),ob(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];n>=0;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?i>0?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},ub.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},ub.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var cb=Xo.DOM,lb=Ot.extend,fb=Ot.each,db=Ot.trim,mb=Ot.resolve,pb=me.ie,gb=function(e,t,n){var r,o,i,a,s,u,c,l,f,d=this;r=d.documentBaseUrl=n.documentBaseURL,o=n.baseURI,i=d,a=e,s=r,u=n.defaultSettings,c=t,f={id:a,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:s,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(l=i).convertURL,url_converter_scope:l,ie7_compat:!0},t=lu(ou,f,u,c),d.settings=t,ti.language=t.language||"en",ti.languageLoad=t.language_load,ti.baseURL=n.baseURL,d.id=e,d.setDirty(!1),d.plugins={},d.documentBaseURI=new ub(t.document_base_url,{base_uri:o}),d.baseURI=o,d.contentCSS=[],d.contentStyles=[],d.shortcuts=new Jd(d),d.loadedCSS={},d.editorCommands=new Od(d),d.suffix=n.suffix,d.editorManager=n,d.inline=t.inline,d.buttons={},d.menuItems={},t.cache_suffix&&(me.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(me.overrideViewPort=!1),n.fire("SetupEditor",d),d.execCallback("setup",d),d.$=Qt.overrideDefaults(function(){return{context:d.inline?d.getBody():d.getDoc(),element:d.getBody()}})};lb(gb.prototype={render:function(){nb(this)},focus:function(e){gm(this,e)},execCallback:function(e){var t,n=this.settings[e];if(n)return this.callbackLookup&&(t=this.callbackLookup[e])&&(n=t.func,t=t.scope),"string"==typeof n&&(t=(t=n.replace(/\.\w+$/,""))?mb(t):0,n=mb(n),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:n,scope:t}),n.apply(t||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Ot.is(e,"string")){var t=this.settings.language||"en",n=this.editorManager.i18n;e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return mu(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return rb(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Gm("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(cb.show(this.getContainer()),cb.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(pb&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(cb.hide(e.getContainer()),cb.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(r.inline||(o.innerHTML=t),(n=cb.getParent(r.id,"form"))&&fb(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){var n,r,o=this,i=o.getBody();return(t=t||{}).format=t.format||"html",t.set=!0,t.content=e,t.no_events||o.fire("BeforeSetContent",t),0===(e=t.content).length||/^\s+$/.test(e)?(r=pb&&pb<11?"":'<br data-mce-bogus="1">',"TABLE"===i.nodeName?e="<tr><td>"+r+"</td></tr>":/^(UL|OL)$/.test(i.nodeName)&&(e="<li>"+r+"</li>"),(n=o.settings.forced_root_block)&&o.schema.isValidChild(i.nodeName.toLowerCase(),n.toLowerCase())?(e=r,e=o.dom.createHTML(n,o.settings.forced_root_block_attrs,e)):pb||e||(e='<br data-mce-bogus="1">'),o.dom.setHTML(i,e),o.fire("SetContent",t)):("raw"!==t.format&&(e=zs({validate:o.validate},o.schema).serialize(o.parser.parse(e,{isRootContent:!0,insert:!0}))),t.content=db(e),o.dom.setHTML(i,t.content),t.no_events||o.fire("SetContent",t)),t.content},getContent:function(e){var t,n=this.getBody();if(this.removed)return"";if((e=e||{}).format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||this.fire("BeforeGetContent",e),"raw"===e.format)t=Ot.trim(om(this.serializer,n.innerHTML));else if("text"===e.format)t=n.innerText||n.textContent;else{if("tree"===e.format)return this.serializer.serialize(n,e);t=this.serializer.serialize(n,e)}return"text"!==e.format?e.content=db(t):e.content=t,e.no_events||this.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=lb({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){Wd(this,e)},getContainer:function(){return this.container||(this.container=cb.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=cb.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var t,n=this,r=n.settings,o=n.dom;e=e||n.getBody(),n.hasVisual===undefined&&(n.hasVisual=r.visual),fb(o.select("table,a",e),function(e){var i;switch(e.nodeName){case"TABLE":return t=r.visual_table_class||"mce-item-table",void((i=o.getAttrib(e,"border"))&&"0"!==i||!n.hasVisual?o.removeClass(e,t):o.addClass(e,t));case"A":return void(o.getAttrib(e,"href",!1)||(i=o.getAttrib(e,"name")||e.id,t=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(e,t):o.removeClass(e,t)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&cb.remove(e.getElement().nextSibling),e.inline||(pb&&pb<10&&e.getDoc().execCommand("SelectAll",!1,null),cb.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),cb.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t,n=this;n.destroyed||(e||n.removed?(e||(n.editorManager.off("beforeunload",n._beforeUnload),n.theme&&n.theme.destroy&&n.theme.destroy(),n.selection.destroy(),n.dom.destroy()),(t=n.formElement)&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),cb.unbind(t,"submit reset",n.formEventDelegate)),n.contentAreaContainer=n.formElement=n.container=n.editorContainer=null,n.bodyElement=n.contentDocument=n.contentWindow=null,n.iframeElement=n.targetElm=null,n.selection&&(n.selection=n.selection.win=n.selection.dom=n.selection.dom.doc=null),n.destroyed=1):n.remove())},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},qd);var hb,vb,yb,bb={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},Cb=function(e,t){var n,r,o=Un.detect().browser;o.isIE()||o.isEdge()?(r=e).on("focusout",function(){Sd(r)}):(n=t,e.on("mouseup touchend",function(e){n.throttle()})),e.on("keyup nodechange",function(t){var n;"nodechange"===(n=t).type&&n.selectionChange||Sd(e)})},xb=function(e){var t,n,r,o=Tp(function(){Sd(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},Xo.DOM.bind(document,"mouseup",r),t.on("remove",function(){Xo.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Cb(e,o)}),e.on("remove",function(){o.cancel()})},wb=Xo.DOM,Nb=function(e){return bb.isEditorUIElement(e)},Eb=function(e,t){var n=e?e.settings.custom_ui_selector:"";return null!==wb.getParent(t,function(t){return Nb(t)||!!n&&e.dom.is(t,n)})},Sb=function(e,t){var n=t.editor;xb(n),n.on("focusin",function(){var t=e.focusedEditor;t!==this&&(t&&t.fire("blur",{focusedEditor:this}),e.setActive(this),e.focusedEditor=this,this.fire("focus",{blurredEditor:t}),this.focus(!0))}),n.on("focusout",function(){var t=this;ye.setEditorTimeout(t,function(){var n=e.focusedEditor;Eb(t,function(){try{return document.activeElement}catch(e){return document.body}}())||n!==t||(t.fire("blur",{focusedEditor:null}),e.focusedEditor=null)})}),hb||(hb=function(t){var n,r=e.activeEditor;n=t.target,r&&n.ownerDocument===document&&(n===document.body||Eb(r,n)||e.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},wb.bind(document,"focusin",hb))},kb=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(wb.unbind(document,"focusin",hb),hb=null)},Tb=function(e){e.on("AddEditor",y.curry(Sb,e)),e.on("RemoveEditor",y.curry(kb,e))},Ab={},_b="en",Bb={setCode:function(e){e&&(_b=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return _b},rtl:!1,add:function(e,t){var n=Ab[e];for(var r in n||(Ab[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=Ab[_b]||{},n=function(e){return Ot.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Ot.is(e,"undefined")},o=function(e){return e=n(e),Ot.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Ot.is(e,"object")&&Ot.hasOwn(e,"raw"))return n(e.raw);if(Ot.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Ot.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:Ab},Rb=Xo.DOM,Db=Ot.explode,Ob=Ot.each,Pb=Ot.extend,Ib=0,Lb=!1,Mb=[],Fb=[],zb=function(e){Ob(yb.get(),function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})},Ub=function(e){e!==Lb&&(e?Qt(window).on("resize scroll",zb):Qt(window).off("resize scroll",zb),Lb=e)},Vb=function(e){var t=Fb;delete Mb[e.id];for(var n=0;n<Mb.length;n++)if(Mb[n]===e){Mb.splice(n,1);break}return Fb=M.filter(Fb,function(t){return e!==t}),yb.activeEditor===e&&(yb.activeEditor=Fb.length>0?Fb[0]:null),yb.focusedEditor===e&&(yb.focusedEditor=null),t.length!==Fb.length};Pb(yb={defaultSettings:{},$:Qt,majorVersion:"4",minorVersion:"7.5",releaseDate:"2018-01-22",editors:Mb,i18n:Bb,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=ub.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var s=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==s.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new ub(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new ub(this.baseURL),this.suffix=o,Tb(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new ub(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new ub(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;for(var o in r)ti.PluginManager.urls[o]=r[o]},init:function(e){var t,n,r=this;n=Ot.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var o=function(e){var t=e.id;return t||(t=(t=e.name)&&!Rb.get(t)?e.name:Rb.uniqueId(),e.setAttribute("id",t)),t},i=function(e,t){return t.constructor===RegExp?t.test(e.className):Rb.hasClass(e,t)},a=function(e){t=e},s=function(){var t,u=0,c=[],l=function(e,n,o){var i=new gb(e,n,r);c.push(i),i.on("init",function(){++u===t.length&&a(c)}),i.targetElm=i.targetElm||o,i.render()};Rb.unbind(window,"ready",s),function(t){var n=e[t];n&&n.apply(r,Array.prototype.slice.call(arguments,2))}("onpageload"),t=Qt.unique(function(e){var t,n=[];if(me.ie&&me.ie<11)return Pm("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(e.types)return Ob(e.types,function(e){n=n.concat(Rb.select(e.selector))}),n;if(e.selector)return Rb.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":(t=e.elements||"").length>0&&Ob(Db(t),function(e){var t;(t=Rb.get(e))?n.push(t):Ob(document.forms,function(t){Ob(t.elements,function(t){t.name===e&&(e="mce_editor_"+Ib++,Rb.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":Ob(Rb.select("textarea"),function(t){e.editor_deselector&&i(t,e.editor_deselector)||e.editor_selector&&!i(t,e.editor_selector)||n.push(t)})}return n}(e)),e.types?Ob(e.types,function(n){Ot.each(t,function(t){return!Rb.is(t,n.selector)||(l(o(t),Pb({},e,n),t),!1)})}):(Ot.each(t,function(e){var t;(t=r.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(Vb(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(t=Ot.grep(t,function(e){return!r.get(e.id)})).length?a([]):Ob(t,function(t){var r;r=t,e.inline&&r.tagName.toLowerCase()in n?Pm("Could not initialize inline editor on invalid inline target element",t):l(o(t),e,t)}))};return r.settings=e,Rb.bind(window,"ready",s),new pe(function(e){t?e(t):a=function(t){e(t)}})},get:function(e){return 0===arguments.length?Fb.slice(0):tr.isString(e)?M.find(Fb,function(t){return t.id===e}).getOr(null):tr.isNumber(e)&&Fb[e]?Fb[e]:null},add:function(e){var t=this;return Mb[e.id]===e?e:(null===t.get(e.id)&&("length"!==e.id&&(Mb[e.id]=e),Mb.push(e),Fb.push(e)),Ub(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),vb||(vb=function(){t.fire("BeforeUnload")},Rb.bind(window,"beforeunload",vb)),e)},createEditor:function(e,t){return this.add(new gb(e,t,this))},remove:function(e){var t,n,r=this;if(e)return tr.isString(e)?(e=e.selector||e,void Ob(Rb.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})):(n=e,tr.isNull(r.get(n.id))?null:(Vb(n)&&r.fire("RemoveEditor",{editor:n}),0===Fb.length&&Rb.unbind(window,"beforeunload",vb),n.remove(),Ub(Fb.length>0),n));for(t=Fb.length-1;t>=0;t--)r.remove(Fb[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new gb(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",0,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Ob(Fb,function(e){e.save()})},addI18n:function(e,t){Bb.add(e,t)},translate:function(e){return Bb.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},Fd),yb.setup();var Hb,qb=yb;function jb(e){return{walk:function(t,n){return cg.walk(e,t,n)},split:sl.split,normalize:function(t){return Jf.normalize(e,t).fold(y.constant(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(Hb=jb||(jb={})).compareRanges=qf,Hb.getCaretRangeFromPoint=Ih,Hb.getSelectedNode=Fi,Hb.getNode=zi;var $b,Wb,Kb=jb,Xb=Math.min,Yb=Math.max,Gb=Math.round,Jb=function(e,t,n){var r,o,i,a,s,u;return r=t.x,o=t.y,i=e.w,a=e.h,s=t.w,u=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=u),"r"===n[1]&&(r+=s),"c"===n[0]&&(o+=Gb(u/2)),"c"===n[1]&&(r+=Gb(s/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=Gb(a/2)),"c"===n[4]&&(r-=Gb(i/2)),Qb(r,o,i,a)},Qb=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},Zb={inflate:function(e,t,n){return Qb(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Jb,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=Jb(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=Yb(e.x,t.x),r=Yb(e.y,t.y),o=Xb(e.x+e.w,t.x+t.w),i=Xb(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Qb(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,s,u,c,l,f,d;return s=e.x,u=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=Yb(0,t.x-s),o=Yb(0,t.y-u),i=Yb(0,c-f),a=Yb(0,l-d),s+=r,u+=o,n&&(c+=r,l+=o,s-=i,u-=a),Qb(s,u,(c-=i)-s,(l-=a)-u)},create:Qb,fromClientRect:function(e){return Qb(e.left,e.top,e.width,e.height)}},eC={},tC={add:function(e,t){eC[e.toLowerCase()]=t},has:function(e){return!!eC[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=eC.hasOwnProperty(t)?eC[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=eC[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},nC=Ot.each,rC=Ot.extend,oC=function(){};oC.extend=$b=function(e){var t,n,r,o=this.prototype,i=function(){var e,t,n;if(!Wb&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},s=function(e,t){return function(){var n,r=this._super;return this._super=o[e],n=t.apply(this,arguments),this._super=r,n}};for(n in Wb=!0,t=new this,Wb=!1,e.Mixins&&(nC(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),o.Mixins&&(e.Mixins=o.Mixins.concat(e.Mixins))),e.Methods&&nC(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&nC(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){return e!==undefined?(this[n]=e,this):this[n]}}),e.Statics&&nC(e.Statics,function(e,t){i[t]=e}),e.Defaults&&o.Defaults&&(e.Defaults=rC({},o.Defaults,e.Defaults)),e)"function"==typeof(r=e[n])&&o[n]?t[n]=s(n,r):t[n]=r;return i.prototype=t,i.constructor=i,i.extend=$b,i};var iC=Math.min,aC=Math.max,sC=Math.round,uC=function(e,t){var n,r,o,i;if(t=t||'"',null===e)return"null";if("string"==(o=typeof e))return r="\bb\tt\nn\ff\rr\"\"''\\\\",t+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,o){return'"'===t&&"'"===e?e:(n=r.indexOf(o))+1?"\\"+r.charAt(n+1):(e=o.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+t;if("object"===o){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(n=0,r="[";n<e.length;n++)r+=(n>0?",":"")+uC(e[n],t);return r+"]"}for(i in r="{",e)e.hasOwnProperty(i)&&(r+="function"!=typeof e[i]?(r.length>1?","+t:t)+i+t+":"+uC(e[i],t):"");return r+"}"}return""+e},cC={serialize:uC,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}},lC={callbacks:{},count:0,send:function(e){var t=this,n=Xo.DOM,r=e.count!==undefined?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i)},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++}},fC={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||n++>1e4?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,n>1e4?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",fC.fire("beforeInitialize",{settings:e}),t=new Mm){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Ot.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=fC.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Ot.extend(fC,Fd);var dC=Ot.extend,mC=function(e){this.settings=dC({},e),this.count=0};mC.sendRPC=function(e){return(new mC).send(e)},mC.prototype={send:function(e){var t=e.error,n=e.success;(e=dC(this.settings,e)).success=function(r,o){void 0===(r=cC.parse(r))&&(r={error:"JSON Parse error."}),r.error?t.call(e.error_scope||e.scope,r.error,o):n.call(e.success_scope||e.scope,r.result)},e.error=function(n,r){t&&t.call(e.error_scope||e.scope,n,r)},e.data=cC.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),e.content_type="application/json",fC.send(e)}};var pC,gC=window.localStorage,hC=qb,vC={geom:{Rect:Zb},util:{Promise:pe,Delay:ye,Tools:Ot,VK:Mp,URI:ub,Class:oC,EventDispatcher:Id,Observable:Fd,I18n:Bb,XHR:fC,JSON:cC,JSONRequest:mC,JSONP:lC,LocalStorage:gC,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return"object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){var a,s,u,c;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=aC(0,iC(t,1)),i=aC(0,iC(i,1)),0!==t){switch(a=e/60,u=(s=i*t)*(1-Math.abs(a%2-1)),c=i-s,Math.floor(a)){case 0:n=s,r=u,o=0;break;case 1:n=u,r=s,o=0;break;case 2:n=0,r=s,o=u;break;case 3:n=0,r=u,o=s;break;case 4:n=u,r=0,o=s;break;case 5:n=s,r=0,o=u;break;default:n=r=o=0}n=sC(255*(n+c)),r=sC(255*(r+c)),o=sC(255*(o+c))}else n=r=o=sC(255*i)}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,t};return e&&i(e),t.toRgb=function(){return{r:n,g:r,b:o}},t.toHsv=function(){return e=n,t=r,i=o,s=0,(u=iC(e/=255,iC(t/=255,i/=255)))===(c=aC(e,aC(t,i)))?{h:0,s:0,v:100*(s=u)}:(a=(c-u)/c,s=c,{h:sC(60*((e===u?3:i===u?1:5)-(e===u?t-i:i===u?e-t:i-e)/(c-u))),s:sC(100*a),v:sC(100*s)});var e,t,i,a,s,u,c},t.toHex=function(){var e=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+e(n)+e(r)+e(o)},t.parse=i,t}},dom:{EventUtils:Te,Sizzle:lt,DomQuery:Qt,TreeWalker:to,DOMUtils:Xo,ScriptLoader:Zo,RangeUtils:Kb,Serializer:Nh,ControlSelection:Rh,BookmarkManager:Ah,Selection:vv,Event:Te.Event},html:{Styles:zo,Entities:Ao,Node:fh,Schema:Fo,SaxParser:em,DomParser:bh,Writer:Fs,Serializer:zs},ui:{Factory:tC},Env:me,AddOnManager:ti,Formatter:Yg,UndoManager:rg,EditorCommands:Od,WindowManager:km,NotificationManager:Sm,EditorObservable:qd,Shortcuts:Jd,Editor:gb,FocusManager:bb,EditorManager:qb,DOM:Xo.DOM,ScriptLoader:Zo.ScriptLoader,PluginManager:ti.PluginManager,ThemeManager:ti.ThemeManager,trim:Ot.trim,isArray:Ot.isArray,is:Ot.is,toArray:Ot.toArray,makeMap:Ot.makeMap,each:Ot.each,map:Ot.map,grep:Ot.grep,inArray:Ot.inArray,extend:Ot.extend,create:Ot.create,walk:Ot.walk,createNS:Ot.createNS,resolve:Ot.resolve,explode:Ot.explode,_addCacheSuffix:Ot._addCacheSuffix,isOpera:me.opera,isWebKit:me.webkit,isIE:me.ie,isGecko:me.gecko,isMac:me.mac};hC=Ot.extend(hC,vC),pC=hC,window.tinymce=pC,window.tinyMCE=pC}();!function(){"use strict";var n,t,e,r,o,i,u,a,c,l,s,f=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(n){return function(){return n}},m={noop:function(){},noarg:function(n){return function(){return n()}},compose:function(n,t){return function(){return n(t.apply(null,arguments))}},constant:d,identity:function(n){return n},tripleEquals:function(n,t){return n===t},curry:function(n){for(var t=new Array(arguments.length-1),e=1;e<arguments.length;e++)t[e-1]=arguments[e];return function(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var o=t.concat(e);return n.apply(null,o)}},not:function(n){return function(){return!n.apply(null,arguments)}},die:function(n){return function(){throw new Error(n)}},apply:function(n){return n()},call:function(n){n()},never:d(!1),always:d(!0)},g=m.never,p=m.always,h=function(){return v},v=(r={fold:function(n,t){return n()},is:g,isSome:g,isNone:p,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},or:e,orThunk:t,map:h,ap:h,each:function(){},bind:h,flatten:h,exists:g,forall:p,filter:h,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:m.constant("none()")},Object.freeze&&Object.freeze(r),r),b=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:p,isNone:g,getOr:t,getOrThunk:t,getOrDie:t,or:e,orThunk:e,map:function(t){return b(t(n))},ap:function(t){return t.fold(h,function(t){return b(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:v},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},w={some:b,none:h,from:function(n){return null===n||n===undefined?v:b(n)}},y=(o=Array.prototype.indexOf)===undefined?function(n,t){return A(n,t)}:function(n,t){return o.call(n,t)},x=function(n,t){return y(n,t)>-1},C=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o,n)}return r},S=function(n,t){for(var e=0,r=n.length;e<r;e++)t(n[e],e,n)},R=function(n,t){for(var e=n.length-1;e>=0;e--)t(n[e],e,n)},T=function(n,t){for(var e=[],r=0,o=n.length;r<o;r++){var i=n[r];t(i,r,n)&&e.push(i)}return e},D=function(n,t){for(var e=0,r=n.length;e<r;e++)if(t(n[e],e,n))return w.some(e);return w.none()},A=function(n,t){for(var e=0,r=n.length;e<r;++e)if(n[e]===t)return e;return-1},k=Array.prototype.push,N=function(n){for(var t=[],e=0,r=n.length;e<r;++e){if(!Array.prototype.isPrototypeOf(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);k.apply(t,n[e])}return t},O=function(n,t){for(var e=0,r=n.length;e<r;++e)if(!0!==t(n[e],e,n))return!1;return!0},E=Array.prototype.slice,B={map:C,each:S,eachr:R,partition:function(n,t){for(var e=[],r=[],o=0,i=n.length;o<i;o++){var u=n[o];(t(u,o,n)?e:r).push(u)}return{pass:e,fail:r}},filter:T,groupBy:function(n,t){if(0===n.length)return[];for(var e=t(n[0]),r=[],o=[],i=0,u=n.length;i<u;i++){var a=n[i],c=t(a);c!==e&&(r.push(o),o=[]),e=c,o.push(a)}return 0!==o.length&&r.push(o),r},indexOf:function(n,t){var e=y(n,t);return-1===e?w.none():w.some(e)},foldr:function(n,t,e){return R(n,function(n){e=t(e,n)}),e},foldl:function(n,t,e){return S(n,function(n){e=t(e,n)}),e},find:function(n,t){for(var e=0,r=n.length;e<r;e++){var o=n[e];if(t(o,e,n))return w.some(o)}return w.none()},findIndex:D,flatten:N,bind:function(n,t){var e=C(n,t);return N(e)},forall:O,exists:function(n,t){return D(n,t).isSome()},contains:x,equal:function(n,t){return n.length===t.length&&O(n,function(n,e){return n===t[e]})},reverse:function(n){var t=E.call(n,0);return t.reverse(),t},chunk:function(n,t){for(var e=[],r=0;r<n.length;r+=t){var o=n.slice(r,r+t);e.push(o)}return e},difference:function(n,t){return T(n,function(n){return!x(t,n)})},mapToObject:function(n,t){for(var e={},r=0,o=n.length;r<o;r++){var i=n[r];e[String(i)]=t(i,r)}return e},pure:function(n){return[n]},sort:function(n,t){var e=E.call(n,0);return e.sort(t),e},range:function(n,t){for(var e=[],r=0;r<n;r++)e.push(t(r));return e},head:function(n){return 0===n.length?w.none():w.some(n[0])},last:function(n){return 0===n.length?w.none():w.some(n[n.length-1])}},I=(i=Object.keys)===undefined?function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t}:i,P=function(n,t){for(var e=I(n),r=0,o=e.length;r<o;r++){var i=e[r];t(n[i],i,n)}},W=function(n,t){var e={};return P(n,function(r,o){var i=t(r,o,n);e[i.k]=i.v}),e},_=function(n,t){var e=[];return P(n,function(n,r){e.push(t(n,r))}),e},M=function(n){return _(n,function(n){return n})},L={bifilter:function(n,t){var e={},r={};return P(n,function(n,o){(t(n,o)?e:r)[o]=n}),{t:e,f:r}},each:P,map:function(n,t){return W(n,function(n,e,r){return{k:e,v:t(n,e,r)}})},mapToArray:_,tupleMap:W,find:function(n,t){for(var e=I(n),r=0,o=e.length;r<o;r++){var i=e[r],u=n[i];if(t(u,i,n))return w.some(u)}return w.none()},keys:I,values:M,size:function(n){return M(n).length}},q=function(n){return function(t){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&Array.prototype.isPrototypeOf(n)?"array":"object"===t&&String.prototype.isPrototypeOf(n)?"string":t}(t)===n}},z={isString:q("string"),isObject:q("object"),isArray:q("array"),isNull:q("null"),isBoolean:q("boolean"),isUndefined:q("undefined"),isFunction:q("function"),isNumber:q("number")},F=function(n){return n.slice(0).sort()},j=function(n,t){throw new Error("All required keys ("+F(n).join(", ")+") were not specified. Specified keys were: "+F(t).join(", ")+".")},H=function(n){throw new Error("Unsupported keys for object: "+F(n).join(", "))},V=function(n,t){if(!z.isArray(t))throw new Error("The "+n+" fields must be an array. Was: "+t+".");B.each(t,function(t){if(!z.isString(t))throw new Error("The value "+t+" in the "+n+" fields was not a string.")})},U=function(n,t){throw new Error("All values need to be of type: "+t+". Keys ("+F(n).join(", ")+") were not.")},G=function(n){var t=F(n);B.find(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})},X={immutable:function(){var n=arguments;return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(n.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+n.length+']", got '+t.length+" arguments");var r={};return B.each(n,function(n,e){r[n]=m.constant(t[e])}),r}},immutableBag:function(n,t){var e=n.concat(t);if(0===e.length)throw new Error("You must specify at least one required or optional field.");return V("required",n),V("optional",t),G(e),function(r){var o=L.keys(r);B.forall(n,function(n){return B.contains(o,n)})||j(n,o);var i=B.filter(o,function(n){return!B.contains(e,n)});i.length>0&&H(i);var u={};return B.each(n,function(n){u[n]=m.constant(r[n])}),B.each(t,function(n){u[n]=m.constant(Object.prototype.hasOwnProperty.call(r,n)?w.some(r[n]):w.none())}),u}}},Y=X.immutable("width","height"),$=X.immutable("rows","columns"),K=X.immutable("row","column"),J=X.immutable("x","y"),Q=X.immutable("element","rowspan","colspan"),Z=X.immutable("element","rowspan","colspan","isNew"),nn={dimensions:Y,grid:$,address:K,coords:J,extended:X.immutable("element","rowspan","colspan","row","column"),detail:Q,detailnew:Z,rowdata:X.immutable("element","cells","section"),elementnew:X.immutable("element","isNew"),rowdatanew:X.immutable("element","cells","section","isNew"),rowcells:X.immutable("cells","section"),rowdetails:X.immutable("details","section"),bounds:X.immutable("startRow","startCol","finishRow","finishCol")},tn=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:m.constant(n)}},en={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||e.childNodes.length>1)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return tn(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return tn(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return tn(e)},fromDom:tn,fromPoint:function(n,t,e){return w.from(n.dom().elementFromPoint(t,e)).map(tn)}},rn=8,on=9,un=1,an=3,cn=un,ln=on,sn=function(n){return n.nodeType!==cn&&n.nodeType!==ln||0===n.childElementCount},fn={all:function(n,t){var e=t===undefined?document:t.dom();return sn(e)?[]:B.map(e.querySelectorAll(n),en.fromDom)},is:function(n,t){var e=n.dom();if(e.nodeType!==cn)return!1;if(e.matches!==undefined)return e.matches(t);if(e.msMatchesSelector!==undefined)return e.msMatchesSelector(t);if(e.webkitMatchesSelector!==undefined)return e.webkitMatchesSelector(t);if(e.mozMatchesSelector!==undefined)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(n,t){var e=t===undefined?document:t.dom();return sn(e)?w.none():w.from(e.querySelector(n)).map(en.fromDom)}},dn=function(n,t){var e=[],r=function(n){return e.push(n),t(n)},o=t(n);do{o=o.bind(r)}while(o.isSome());return e},mn="undefined"!=typeof window?window:Function("return this;")(),gn=function(n,t){for(var e=t!==undefined&&null!==t?t:mn,r=0;r<n.length&&e!==undefined&&null!==e;++r)e=e[n[r]];return e},pn=function(n,t){var e=n.split(".");return gn(e,t)},hn=function(n,t){var e=pn(n,t);if(e===undefined||null===e)throw n+" not available on this browser";return e},vn=function(){return hn("Node")},bn=function(n,t,e){return 0!=(n.compareDocumentPosition(t)&e)},wn=function(n,t){return bn(n,t,vn().DOCUMENT_POSITION_CONTAINED_BY)},yn=function(n){var t,e=!1;return function(){return e||(e=!0,t=n.apply(null,arguments)),t}},xn=function(n,t){var e=function(n,t){for(var e=0;e<n.length;e++){var r=n[e];if(r.test(t))return r}return undefined}(n,t);if(!e)return{major:0,minor:0};var r=function(n){return Number(t.replace(e,"$"+n))};return Sn(r(1),r(2))},Cn=function(){return Sn(0,0)},Sn=function(n,t){return{major:n,minor:t}},Rn={nu:Sn,detect:function(n,t){var e=String(t).toLowerCase();return 0===n.length?Cn():xn(n,e)},unknown:Cn},Tn="Firefox",Dn=function(n,t){return function(){return t===n}},An=function(n){var t=n.current;return{current:t,version:n.version,isEdge:Dn("Edge",t),isChrome:Dn("Chrome",t),isIE:Dn("IE",t),isOpera:Dn("Opera",t),isFirefox:Dn(Tn,t),isSafari:Dn("Safari",t)}},kn={unknown:function(){return An({current:undefined,version:Rn.unknown()})},nu:An,edge:m.constant("Edge"),chrome:m.constant("Chrome"),ie:m.constant("IE"),opera:m.constant("Opera"),firefox:m.constant(Tn),safari:m.constant("Safari")},Nn="Windows",On="Android",En="Solaris",Bn="FreeBSD",In=function(n,t){return function(){return t===n}},Pn=function(n){var t=n.current;return{current:t,version:n.version,isWindows:In(Nn,t),isiOS:In("iOS",t),isAndroid:In(On,t),isOSX:In("OSX",t),isLinux:In("Linux",t),isSolaris:In(En,t),isFreeBSD:In(Bn,t)}},Wn={unknown:function(){return Pn({current:undefined,version:Rn.unknown()})},nu:Pn,windows:m.constant(Nn),ios:m.constant("iOS"),android:m.constant(On),linux:m.constant("Linux"),osx:m.constant("OSX"),solaris:m.constant(En),freebsd:m.constant(Bn)},_n=function(n,t){var e=String(t).toLowerCase();return B.find(n,function(n){return n.search(e)})},Mn=function(n,t){return _n(n,t).map(function(n){var e=Rn.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Ln=function(n,t){return _n(n,t).map(function(n){var e=Rn.detect(n.versionRegexes,t);return{current:n.name,version:e}})},qn=function(n,t){return t+n},zn=function(n,t){return n+t},Fn=function(n,t){return n.substring(t)},jn=function(n,t){return n.substring(0,n.length-t)},Hn=function(n){return""===n?w.none():w.some(n.substr(0,1))},Vn=function(n){return""===n?w.none():w.some(n.substring(1))},Un=function(n,t,e){return""===t||!(n.length<t.length)&&n.substr(e,e+t.length)===t},Gn=function(n,t){return Un(n,t,0)},Xn=function(n,t){return Un(n,t,n.length-t.length)},Yn={supplant:function(n,t){return n.replace(/\${([^{}]*)}/g,function(n,e){var r,o=t[e];return"string"==(r=typeof o)||"number"===r?o:n})},startsWith:Gn,removeLeading:function(n,t){return Gn(n,t)?Fn(n,t.length):n},removeTrailing:function(n,t){return Xn(n,t)?jn(n,t.length):n},ensureLeading:function(n,t){return Gn(n,t)?n:qn(n,t)},ensureTrailing:function(n,t){return Xn(n,t)?n:zn(n,t)},endsWith:Xn,contains:function(n,t){return-1!==n.indexOf(t)},trim:function(n){return n.replace(/^\s+|\s+$/g,"")},lTrim:function(n){return n.replace(/^\s+/g,"")},rTrim:function(n){return n.replace(/\s+$/g,"")},capitalize:function(n){return Hn(n).bind(function(t){return Vn(n).map(function(n){return t.toUpperCase()+n})}).getOr(n)}},$n=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Kn=function(n){return function(t){return Yn.contains(t,n)}},Jn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Yn.contains(n,"edge/")&&Yn.contains(n,"chrome")&&Yn.contains(n,"safari")&&Yn.contains(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$n],search:function(n){return Yn.contains(n,"chrome")&&!Yn.contains(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Yn.contains(n,"msie")||Yn.contains(n,"trident")}},{name:"Opera",versionRegexes:[$n,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Kn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Kn("firefox")},{name:"Safari",versionRegexes:[$n,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Yn.contains(n,"safari")||Yn.contains(n,"mobile/"))&&Yn.contains(n,"applewebkit")}}],Qn=[{name:"Windows",search:Kn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Yn.contains(n,"iphone")||Yn.contains(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Kn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Kn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Kn("linux"),versionRegexes:[]},{name:"Solaris",search:Kn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Kn("freebsd"),versionRegexes:[]}],Zn={browsers:m.constant(Jn),oses:m.constant(Qn)},nt=function(n){var t,e,r,o,i,u,a,c,l,s,f,d=Zn.browsers(),g=Zn.oses(),p=Mn(d,n).fold(kn.unknown,kn.nu),h=Ln(g,n).fold(Wn.unknown,Wn.nu);return{browser:p,os:h,deviceType:(e=p,r=n,o=(t=h).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),s=l&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:m.constant(o),isiPhone:m.constant(i),isTablet:m.constant(c),isPhone:m.constant(s),isTouch:m.constant(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m.constant(f)})}},tt={detect:yn(function(){var n=navigator.userAgent;return nt(n)})},et=function(n,t){return n.dom()===t.dom()},rt=tt.detect().browser.isIE()?function(n,t){return wn(n.dom(),t.dom())}:function(n,t){var e=n.dom(),r=t.dom();return e!==r&&e.contains(r)},ot={eq:et,isEqualNode:function(n,t){return n.dom().isEqualNode(t.dom())},member:function(n,t){return B.exists(t,m.curry(et,n))},contains:rt,is:fn.is},it=function(n){return en.fromDom(n.dom().ownerDocument)},ut=function(n){var t=n.dom();return w.from(t.parentNode).map(en.fromDom)},at=function(n){var t=n.dom();return w.from(t.previousSibling).map(en.fromDom)},ct=function(n){var t=n.dom();return w.from(t.nextSibling).map(en.fromDom)},lt=function(n){var t=n.dom();return B.map(t.childNodes,en.fromDom)},st=function(n,t){var e=n.dom().childNodes;return w.from(e[t]).map(en.fromDom)},ft=X.immutable("element","offset"),dt={owner:it,defaultView:function(n){var t=n.dom().ownerDocument.defaultView;return en.fromDom(t)},documentElement:function(n){var t=it(n);return en.fromDom(t.dom().documentElement)},parent:ut,findIndex:function(n){return ut(n).bind(function(t){var e=lt(t);return B.findIndex(e,function(t){return ot.eq(n,t)})})},parents:function(n,t){for(var e=z.isFunction(t)?t:m.constant(!1),r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=en.fromDom(i);if(o.push(u),!0===e(u))break;r=i}return o},siblings:function(n){return ut(n).map(lt).map(function(t){return B.filter(t,function(t){return!ot.eq(n,t)})}).getOr([])},prevSibling:at,offsetParent:function(n){var t=n.dom();return w.from(t.offsetParent).map(en.fromDom)},prevSiblings:function(n){return B.reverse(dn(n,at))},nextSibling:ct,nextSiblings:function(n){return dn(n,ct)},children:lt,child:st,firstChild:function(n){return st(n,0)},lastChild:function(n){return st(n,n.dom().childNodes.length-1)},childNodesCount:function(n){return n.dom().childNodes.length},hasChildNodes:function(n){return n.dom().hasChildNodes()},leaf:function(n,t){var e=lt(n);return e.length>0&&t<e.length?ft(e[t],0):ft(n,t)}},mt=function(n,t,e){return B.bind(dt.children(n),function(n){return fn.is(n,t)?e(n)?[n]:[]:mt(n,t,e)})},gt={firstLayer:function(n,t){return mt(n,t,m.constant(!0))},filterFirstLayer:mt},pt=function(n){return n.dom().nodeName.toLowerCase()},ht=function(n){return n.dom().nodeType},vt=function(n){return function(t){return ht(t)===n}},bt=vt(un),wt=vt(an),yt=vt(on),xt={name:pt,type:ht,value:function(n){return n.dom().nodeValue},isElement:bt,isText:wt,isDocument:yt,isComment:function(n){return ht(n)===rn||"#comment"===pt(n)}},Ct=function(n,t,e){if(!(z.isString(e)||z.isBoolean(e)||z.isNumber(e)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")},St=function(n,t,e){Ct(n.dom(),t,e)},Rt=function(n,t){var e=n.dom().getAttribute(t);return null===e?undefined:e},Tt=function(n,t){var e=n.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(t)},Dt={clone:function(n){return B.foldl(n.dom().attributes,function(n,t){return n[t.name]=t.value,n},{})},set:St,setAll:function(n,t){var e=n.dom();L.each(t,function(n,t){Ct(e,t,n)})},get:Rt,has:Tt,remove:function(n,t){n.dom().removeAttribute(t)},hasNone:function(n){var t=n.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(n,t,e){xt.isElement(n)&&xt.isElement(t)&&B.each(e,function(e){var r,o,i;o=t,Tt(r=n,i=e)&&!Tt(o,i)&&St(o,i,Rt(r,i))})}},At=yn(function(){return kt(en.fromDom(document))}),kt=function(n){var t=n.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return en.fromDom(t)},Nt={body:At,getBody:kt,inBody:function(n){var t=xt.isText(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},Ot=function(n,t){var e=[];return B.each(dt.children(n),function(n){t(n)&&(e=e.concat([n])),e=e.concat(Ot(n,t))}),e},Et={all:function(n){return Ot(Nt.body(),n)},ancestors:function(n,t,e){return B.filter(dt.parents(n,e),t)},siblings:function(n,t){return B.filter(dt.siblings(n),t)},children:function(n,t){return B.filter(dt.children(n),t)},descendants:Ot},Bt={all:function(n){return fn.all(n)},ancestors:function(n,t,e){return Et.ancestors(n,function(n){return fn.is(n,t)},e)},siblings:function(n,t){return Et.siblings(n,function(n){return fn.is(n,t)})},children:function(n,t){return Et.children(n,function(n){return fn.is(n,t)})},descendants:function(n,t){return fn.all(t,n)}},It=function(n,t,e,r,o){return n(e,r)?w.some(e):z.isFunction(o)&&o(e)?w.none():t(e,r,o)},Pt=function(n,t,e){for(var r=n.dom(),o=z.isFunction(e)?e:m.constant(!1);r.parentNode;){r=r.parentNode;var i=en.fromDom(r);if(t(i))return w.some(i);if(o(i))break}return w.none()},Wt=function(n,t){return B.find(n.dom().childNodes,m.compose(t,en.fromDom)).map(en.fromDom)},_t=function(n,t){var e=function(n){for(var r=0;r<n.childNodes.length;r++){if(t(en.fromDom(n.childNodes[r])))return w.some(en.fromDom(n.childNodes[r]));var o=e(n.childNodes[r]);if(o.isSome())return o}return w.none()};return e(n.dom())},Mt={first:function(n){return _t(Nt.body(),n)},ancestor:Pt,closest:function(n,t,e){return It(function(n){return t(n)},Pt,n,t,e)},sibling:function(n,t){var e=n.dom();return e.parentNode?Wt(en.fromDom(e.parentNode),function(e){return!ot.eq(n,e)&&t(e)}):w.none()},child:Wt,descendant:_t},Lt=function(n,t,e){return Mt.ancestor(n,function(n){return fn.is(n,t)},e)},qt={first:function(n){return fn.one(n)},ancestor:Lt,sibling:function(n,t){return Mt.sibling(n,function(n){return fn.is(n,t)})},child:function(n,t){return Mt.child(n,function(n){return fn.is(n,t)})},descendant:function(n,t){return fn.one(t,n)},closest:function(n,t,e){return It(fn.is,Lt,n,t,e)}},zt=function(n,t,e){var r=e!==undefined?e:m.constant(!1);return r(t)?w.none():B.contains(n,xt.name(t))?w.some(t):qt.ancestor(t,n.join(","),function(n){return fn.is(n,"table")||r(n)})},Ft=function(n,t){return dt.parent(t).map(function(t){return Bt.children(t,n)})},jt=function(n,t){return zt(["td","th"],n,t)},Ht=function(n){return gt.firstLayer(n,"th,td")},Vt=(m.curry(Ft,"th,td"),function(n,t){return qt.closest(n,"table",t)}),Ut=function(n){return gt.firstLayer(n,"tr")},Gt=(m.curry(Ft,"tr"),function(n){var t=Ut(n);return B.map(t,function(n){var t=n,e=dt.parent(t).bind(function(n){var t=xt.name(n);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}),r=B.map(Ht(n),function(n){var t=Dt.has(n,"rowspan")?parseInt(Dt.get(n,"rowspan"),10):1,e=Dt.has(n,"colspan")?parseInt(Dt.get(n,"colspan"),10):1;return nn.detail(n,t,e)});return nn.rowdata(t,r,e)})}),Xt=function(n,t){return B.map(n,function(n){var e=B.map(Ht(n),function(n){var t=Dt.has(n,"rowspan")?parseInt(Dt.get(n,"rowspan"),10):1,e=Dt.has(n,"colspan")?parseInt(Dt.get(n,"colspan"),10):1;return nn.detail(n,t,e)});return nn.rowdata(n,e,t.section())})},Yt=function(n,t){return n+","+t},$t=function(n,t){var e=B.bind(n.all(),function(n){return n.cells()});return B.filter(e,t)},Kt={generate:function(n){var t={},e=[],r=n.length,o=0;B.each(n,function(n,r){var i=[];B.each(n.cells(),function(n,e){for(var u=0;t[Yt(r,u)]!==undefined;)u++;for(var a=nn.extended(n.element(),n.rowspan(),n.colspan(),r,u),c=0;c<n.colspan();c++)for(var l=0;l<n.rowspan();l++){var s=u+c,f=Yt(r+l,s);t[f]=a,o=Math.max(o,s+1)}i.push(a)}),e.push(nn.rowdata(n.element(),i,n.section()))});var i=nn.grid(r,o);return{grid:m.constant(i),access:m.constant(t),all:m.constant(e)}},getAt:function(n,t,e){var r=n.access()[Yt(t,e)];return r!==undefined?w.some(r):w.none()},findItem:function(n,t,e){var r=$t(n,function(n){return e(t,n.element())});return r.length>0?w.some(r[0]):w.none()},filterItems:$t,justCells:function(n){var t=B.map(n.all(),function(n){return n.cells()});return B.flatten(t)}},Jt=function(n){return n.style!==undefined},Qt=function(n,t,e){if(!z.isString(e))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",e,":: Element ",n),new Error("CSS value must be a string: "+e);Jt(n)&&n.style.setProperty(t,e)},Zt=function(n,t){Jt(n)&&n.style.removeProperty(t)},ne=function(n,t,e){var r=n.dom();Qt(r,t,e)},te=function(n,t){return Jt(n)?n.style.getPropertyValue(t):""},ee=function(n,t){var e=n.dom(),r=te(e,t);return w.from(r).filter(function(n){return n.length>0})},re={copy:function(n,t){var e=n.dom(),r=t.dom();Jt(e)&&Jt(r)&&(r.style.cssText=e.style.cssText)},set:ne,preserve:function(n,t){var e=Dt.get(n,"style"),r=t(n);return(e===undefined?Dt.remove:Dt.set)(n,"style",e),r},setAll:function(n,t){var e=n.dom();L.each(t,function(n,t){Qt(e,t,n)})},setOptions:function(n,t){var e=n.dom();L.each(t,function(n,t){n.fold(function(){Zt(e,t)},function(n){Qt(e,t,n)})})},remove:function(n,t){var e=n.dom();Zt(e,t),Dt.has(n,"style")&&""===Yn.trim(Dt.get(n,"style"))&&Dt.remove(n,"style")},get:function(n,t){var e=n.dom(),r=window.getComputedStyle(e).getPropertyValue(t),o=""!==r||Nt.inBody(n)?r:te(e,t);return null===o?undefined:o},getRaw:ee,getAllRaw:function(n){var t={},e=n.dom();if(Jt(e))for(var r=0;r<e.style.length;r++){var o=e.style.item(r);t[o]=e.style[o]}return t},isValidValue:function(n,t,e){var r=en.fromTag(n);return ne(r,t,e),ee(r,t).isSome()},reflow:function(n){return n.dom().offsetWidth},transfer:function(n,t,e){xt.isElement(n)&&xt.isElement(t)&&B.each(e,function(e){var r,o;r=t,ee(n,o=e).each(function(n){ee(r,o).isNone()&&ne(r,o,n)})})}},oe=function(n,t){dt.parent(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})},ie=function(n,t){n.dom().appendChild(t.dom())},ue={before:oe,after:function(n,t){dt.nextSibling(n).fold(function(){dt.parent(n).each(function(n){ie(n,t)})},function(n){oe(n,t)})},prepend:function(n,t){dt.firstChild(n).fold(function(){ie(n,t)},function(e){n.dom().insertBefore(t.dom(),e.dom())})},append:ie,appendAt:function(n,t,e){dt.child(n,e).fold(function(){ie(n,t)},function(n){oe(n,t)})},wrap:function(n,t){oe(n,t),ie(t,n)}},ae={before:function(n,t){B.each(t,function(t){ue.before(n,t)})},after:function(n,t){B.each(t,function(e,r){var o=0===r?n:t[r-1];ue.after(o,e)})},prepend:function(n,t){B.each(t.slice().reverse(),function(t){ue.prepend(n,t)})},append:function(n,t){B.each(t,function(t){ue.append(n,t)})}},ce=function(n){var t=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},le={empty:function(n){n.dom().textContent="",B.each(dt.children(n),function(n){ce(n)})},remove:ce,unwrap:function(n){var t=dt.children(n);t.length>0&&ae.before(n,t),ce(n)}},se=X.immutable("minRow","minCol","maxRow","maxCol"),fe=function(n,t){var e,r,o,i,u,a,c,l,s,f,d=function(n){return fn.is(n.element(),t)},m=Gt(n),g=Kt.generate(m),p=(r=d,o=(e=g).grid().columns(),i=e.grid().rows(),u=o,a=0,c=0,L.each(e.access(),function(n){if(r(n)){var t=n.row(),e=t+n.rowspan()-1,o=n.column(),l=o+n.colspan()-1;t<i?i=t:e>a&&(a=e),o<u?u=o:l>c&&(c=l)}}),se(i,u,a,c)),h="th:not("+t+"),td:not("+t+")",v=gt.filterFirstLayer(n,"th,td",function(n){return fn.is(n,h)});return B.each(v,le.remove),function(n,t,e,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;l<c;l++)for(var s=!1,f=0;f<a;f++)l<e.minRow()||l>e.maxRow()||f<e.minCol()||f>e.maxCol()||(Kt.getAt(t,l,f).filter(r).isNone()?(o=s,i=n[l].element(),u=en.fromTag("td"),ue.append(u,en.fromTag("br")),(o?ue.append:ue.prepend)(i,u)):s=!0)}(m,g,p,d),l=n,s=p,f=B.filter(gt.firstLayer(l,"tr"),function(n){return 0===n.dom().childElementCount}),B.each(f,le.remove),s.minCol()!==s.maxCol()&&s.minRow()!==s.maxRow()||B.each(gt.firstLayer(l,"th,td"),function(n){Dt.remove(n,"rowspan"),Dt.remove(n,"colspan")}),Dt.remove(l,"width"),Dt.remove(l,"height"),re.remove(l,"width"),re.remove(l,"height"),n},de=function(n,t){return en.fromDom(n.dom().cloneNode(t))},me=function(n){return de(n,!0)},ge=function(n,t){var e=en.fromTag(t),r=Dt.clone(n);return Dt.setAll(e,r),e},pe=function(n){return de(n,!1)},he=me,ve=function(n,t){var e=ge(n,t),r=dt.children(me(n));return ae.append(e,r),e},be=(u=xt.isText,a="text",c=function(n){return u(n)?w.from(n.dom().nodeValue):w.none()},l=tt.detect().browser,{get:function(n){if(!u(n))throw new Error("Can only get "+a+" value of a "+a+" node");return s(n).getOr("")},getOption:s=l.isIE()&&10===l.version.major?function(n){try{return c(n)}catch(t){return w.none()}}:c,set:function(n,t){if(!u(n))throw new Error("Can only set raw "+a+" value of a "+a+" node");n.dom().nodeValue=t}}),we={get:function(n){return be.get(n)},getOption:function(n){return be.getOption(n)},set:function(n,t){be.set(n,t)}},ye=function(n){return"img"===xt.name(n)?1:we.getOption(n).fold(function(){return dt.children(n).length},function(n){return n.length})},xe=["img","br"],Ce=ye,Se=function(n){return we.getOption(n).filter(function(n){return 0!==n.trim().length||n.indexOf("\xa0")>-1}).isSome()||B.contains(xe,xt.name(n))},Re=function(n,t){var e=function(n){for(var r=dt.children(n),o=r.length-1;o>=0;o--){var i=r[o];if(t(i))return w.some(i);var u=e(i);if(u.isSome())return u}return w.none()};return e(n)},Te={first:function(n){return Mt.descendant(n,Se)},last:function(n){return Re(n,Se)}},De=function(){var n=en.fromTag("td");return ue.append(n,en.fromTag("br")),n},Ae=function(n,t,e){var r=ve(n,t);return L.each(e,function(n,t){null===n?Dt.remove(r,t):Dt.set(r,t,n)}),r},ke=function(n){return n},Ne=function(n){return function(){return en.fromTag("tr",n.dom())}},Oe=function(n,t,e){return{row:Ne(t),cell:function(t){var r,o,i,u=dt.owner(t.element()),a=en.fromTag(xt.name(t.element()),u.dom()),c=e.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),l=c.length>0?(r=t.element(),o=a,i=c,Te.first(r).map(function(n){var t=i.join(","),e=Bt.ancestors(n,t,function(n){return ot.eq(n,r)});return B.foldr(e,function(n,t){var e=pe(t);return ue.append(n,e),e},o)}).getOr(o)):a;return ue.append(l,en.fromTag("br")),re.copy(t.element(),a),re.remove(a,"height"),1!==t.colspan()&&re.remove(t.element(),"width"),n(t.element(),a),a},replace:Ae,gap:De}},Ee=function(n){return{row:Ne(n),cell:De,replace:ke,gap:De}},Be=function(n,t){var e=(t||document).createElement("div");return e.innerHTML=n,dt.children(en.fromDom(e))},Ie=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Pe=function(){return{up:m.constant({selector:qt.ancestor,closest:qt.closest,predicate:Mt.ancestor,all:dt.parents}),down:m.constant({selector:Bt.descendants,predicate:Et.descendants}),styles:m.constant({get:re.get,getRaw:re.getRaw,set:re.set,remove:re.remove}),attrs:m.constant({get:Dt.get,set:Dt.set,remove:Dt.remove,copyTo:function(n,t){var e=Dt.clone(n);Dt.setAll(t,e)}}),insert:m.constant({before:ue.before,after:ue.after,afterAll:ae.after,append:ue.append,appendAll:ae.append,prepend:ue.prepend,wrap:ue.wrap}),remove:m.constant({unwrap:le.unwrap,remove:le.remove}),create:m.constant({nu:en.fromTag,clone:function(n){return en.fromDom(n.dom().cloneNode(!1))},text:en.fromText}),query:m.constant({comparePosition:function(n,t){return n.dom().compareDocumentPosition(t.dom())},prevSibling:dt.prevSibling,nextSibling:dt.nextSibling}),property:m.constant({children:dt.children,name:xt.name,parent:dt.parent,isText:xt.isText,isComment:xt.isComment,isElement:xt.isElement,getText:we.get,setText:we.set,isBoundary:function(n){return!!xt.isElement(n)&&("body"===xt.name(n)||B.contains(Ie,xt.name(n)))},isEmptyTag:function(n){return!!xt.isElement(n)&&B.contains(["br","img","hr","input"],xt.name(n))}}),eq:ot.eq,is:ot.is}},We=(X.immutable("left","right"),function(n,t,e,r){var o=t(n,e);return B.foldr(r,function(e,r){var o=t(n,r);return _e(n,e,o)},o)}),_e=function(n,t,e){return t.bind(function(t){return e.filter(m.curry(n.eq,t))})},Me=function(n,t,e){return e.length>0?We(n,t,(r=e)[0],r.slice(1)):w.none();var r},Le=function(n,t){return m.curry(n.eq,t)},qe=function(n,t,e,r){var o=r!==undefined?r:m.constant(!1),i=[t].concat(n.up().all(t)),u=[e].concat(n.up().all(e)),a=function(n){return B.findIndex(n,o).fold(function(){return n},function(t){return n.slice(0,t+1)})},c=a(i),l=a(u),s=B.find(c,function(t){return B.exists(l,Le(n,t))});return{firstpath:m.constant(c),secondpath:m.constant(l),shared:m.constant(s)}},ze=qe,Fe=function(n,t,e){return Me(n,t,e)},je=function(n,t,e,r){return ze(n,t,e,r)},He=Pe(),Ve=function(n,t){return Fe(He,function(t,e){return n(e)},t)},Ue=function(n,t,e){return je(He,n,t,e)},Ge=function(n,t){return t.column()>=n.startCol()&&t.column()+t.colspan()-1<=n.finishCol()&&t.row()>=n.startRow()&&t.row()+t.rowspan()-1<=n.finishRow()},Xe=function(n,t){var e=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return e<=n.finishCol()&&r>=n.startCol()&&o<=n.finishRow()&&i>=n.startRow()},Ye=function(n,t){for(var e=!0,r=m.curry(Ge,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)e=e&&Kt.getAt(n,o,i).exists(r);return e?w.some(t):w.none()},$e=function(n,t,e){var r=Kt.findItem(n,t,ot.eq),o=Kt.findItem(n,e,ot.eq);return r.bind(function(n){return o.map(function(t){return e=n,r=t,nn.bounds(Math.min(e.row(),r.row()),Math.min(e.column(),r.column()),Math.max(e.row()+e.rowspan()-1,r.row()+r.rowspan()-1),Math.max(e.column()+e.colspan()-1,r.column()+r.colspan()-1));var e,r})})},Ke=$e,Je=function(n,t,e){return $e(n,t,e).bind(function(t){return Ye(n,t)})},Qe=function(n,t,e,r){return Kt.findItem(n,t,ot.eq).bind(function(t){var o=e>0?t.row()+t.rowspan()-1:t.row(),i=r>0?t.column()+t.colspan()-1:t.column();return Kt.getAt(n,o+e,i+r).map(function(n){return n.element()})})},Ze=function(n,t,e){return Ke(n,t,e).map(function(t){var e=Kt.filterItems(n,m.curry(Xe,t));return B.map(e,function(n){return n.element()})})},nr=function(n,t){return Kt.findItem(n,t,function(n,t){return ot.contains(t,n)}).bind(function(n){return n.element()})},tr=function(n){var t=Gt(n);return Kt.generate(t)},er=function(n,t,e){return Vt(n).bind(function(r){var o=tr(r);return Qe(o,n,t,e)})},rr=function(n,t,e){var r=tr(n);return Ze(r,t,e)},or=function(n,t,e,r,o){var i=tr(n),u=ot.eq(n,e)?t:nr(i,t),a=ot.eq(n,o)?r:nr(i,r);return Ze(i,u,a)},ir=function(n,t,e){var r=tr(n);return Je(r,t,e)},ur=function(n,t){return qt.ancestor(n,"table")},ar=X.immutableBag(["boxes","start","finish"],[]),cr=function(n,t,e){var r=function(n){return function(t){return e(t)||ot.eq(t,n)}};return ot.eq(n,t)?w.some(ar({boxes:w.some([n]),start:n,finish:t})):ur(n).bind(function(o){return ur(t).bind(function(i){if(ot.eq(o,i))return w.some(ar({boxes:rr(o,n,t),start:n,finish:t}));if(ot.contains(o,i)){var u=(a=Bt.ancestors(t,"td,th",r(o))).length>0?a[a.length-1]:t;return w.some(ar({boxes:or(o,n,o,t,i),start:n,finish:u}))}if(ot.contains(i,o)){var a,c=(a=Bt.ancestors(n,"td,th",r(i))).length>0?a[a.length-1]:n;return w.some(ar({boxes:or(i,n,o,t,i),start:n,finish:c}))}return Ue(n,t).shared().bind(function(u){return qt.closest(u,"table",e).bind(function(e){var u=Bt.ancestors(t,"td,th",r(e)),a=u.length>0?u[u.length-1]:t,c=Bt.ancestors(n,"td,th",r(e)),l=c.length>0?c[c.length-1]:n;return w.some(ar({boxes:or(e,n,o,t,i),start:l,finish:a}))})})})})},lr=cr,sr=function(n,t){var e=Bt.descendants(n,t);return e.length>0?w.some(e):w.none()},fr=function(n,t,e,r,o){return(i=n,u=o,B.find(i,function(n){return fn.is(n,u)})).bind(function(n){return er(n,t,e).bind(function(n){return e=r,qt.ancestor(t=n,"table").bind(function(n){return qt.descendant(n,e).bind(function(n){return cr(n,t).bind(function(n){return n.boxes().map(function(t){return{boxes:m.constant(t),start:m.constant(n.start()),finish:m.constant(n.finish())}})})})});var t,e})});var i,u},dr=function(n,t,e){return qt.descendant(n,t).bind(function(t){return qt.descendant(n,e).bind(function(n){return Ve(ur,[t,n]).map(function(e){return{first:m.constant(t),last:m.constant(n),table:m.constant(e)}})})})},mr=function(n,t){return sr(n,t)},gr=function(n,t,e){return dr(n,t,e).bind(function(t){var e=function(t){return ot.eq(n,t)},r=qt.ancestor(t.first(),"thead,tfoot,tbody,table",e),o=qt.ancestor(t.last(),"thead,tfoot,tbody,table",e);return r.bind(function(n){return o.bind(function(e){return ot.eq(n,e)?ir(t.table(),t.first(),t.last()):w.none()})})})},pr="data-mce-selected",hr="data-mce-first-selected",vr="data-mce-last-selected",br={selected:m.constant(pr),selectedSelector:m.constant("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:m.constant("[data-mce-selected]"),firstSelected:m.constant(hr),firstSelectedSelector:m.constant("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:m.constant(vr),lastSelectedSelector:m.constant("td[data-mce-last-selected],th[data-mce-last-selected]")},wr=function(n){if(!z.isArray(n))throw new Error("cases must be an array");if(0===n.length)throw new Error("there must be at least one case");var t=[],e={};return B.each(n,function(r,o){var i=L.keys(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(e[u]!==undefined)throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!z.isArray(a))throw new Error("case arguments must be an array");t.push(u),e[u]=function(){var e=arguments.length;if(e!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+e);for(var r=new Array(e),i=0;i<r.length;i++)r[i]=arguments[i];return{fold:function(){if(arguments.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+arguments.length);return arguments[o].apply(null,r)},match:function(n){var e=L.keys(n);if(t.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+e.join(","));if(!B.forall(t,function(n){return B.contains(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+t.join(", "));return n[u].apply(null,r)},log:function(n){console.log(n,{constructors:t,constructor:u,params:r})}}}}),e},yr=wr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),xr={cata:function(n,t,e,r){return n.fold(t,e,r)},none:yr.none,multiple:yr.multiple,single:yr.single},Cr=function(n,t){return xr.cata(t.get(),m.constant([]),m.identity,m.constant([n]))},Sr=function(n,t){return xr.cata(t.get(),w.none,function(t,e){return 0===t.length?w.none():gr(n,br.firstSelectedSelector(),br.lastSelectedSelector()).bind(function(n){return t.length>1?w.some({bounds:m.constant(n),cells:m.constant(t)}):w.none()})},w.none)},Rr=function(n,t){var e=Cr(n,t);return e.length>0&&B.forall(e,function(n){return Dt.has(n,"rowspan")&&parseInt(Dt.get(n,"rowspan"),10)>1||Dt.has(n,"colspan")&&parseInt(Dt.get(n,"colspan"),10)>1})?w.some(e):w.none()},Tr=Cr,Dr=function(n){return{element:m.constant(n),mergable:w.none,unmergable:w.none,selection:m.constant([n])}},Ar=X.immutable("element","clipboard","generators"),kr={noMenu:Dr,forMenu:function(n,t,e){return{element:m.constant(e),mergable:m.constant(Sr(t,n)),unmergable:m.constant(Rr(e,n)),selection:m.constant(Tr(e,n))}},notCell:function(n){return Dr(n)},paste:Ar,pasteRows:function(n,t,e,r,o){return{element:m.constant(e),mergable:w.none,unmergable:w.none,selection:m.constant(Tr(e,n)),clipboard:m.constant(r),generators:m.constant(o)}}},Nr={registerEvents:function(n,t,e,r){n.on("BeforeGetContent",function(e){!0===e.selection&&xr.cata(t.get(),m.noop,function(t){var r;e.preventDefault(),(r=t,Vt(r[0]).map(he).map(function(n){return[fe(n,br.attributeSelector())]})).each(function(t){e.content=B.map(t,function(t){return e=t,n.selection.serializer.serialize(e.dom(),{});var e}).join("")})},m.noop)}),n.on("BeforeSetContent",function(t){!0===t.selection&&!0===t.paste&&w.from(n.dom.getParent(n.selection.getStart(),"th,td")).each(function(o){var i=en.fromDom(o);Vt(i).bind(function(o){var u=B.filter(Be(t.content),function(n){return"meta"!==xt.name(n)});if(1===u.length&&"table"===xt.name(u[0])){t.preventDefault();var a=en.fromDom(n.getDoc()),c=Ee(a),l=kr.paste(i,u[0],c);e.pasteCells(o,l).each(function(t){n.selection.setRng(t),n.focus(),r.clear(o)})}})})})}},Or={render:function(n,t,e,r){var o=en.fromTag("table");re.setAll(o,{"border-collapse":"collapse",width:"100%"}),Dt.set(o,"border","1");var i=en.fromTag("tbody");ue.append(o,i);for(var u=[],a=0;a<n;a++){for(var c=en.fromTag("tr"),l=0;l<t;l++){var s=a<e||l<r?en.fromTag("th"):en.fromTag("td");l<r&&Dt.set(s,"scope","row"),a<e&&Dt.set(s,"scope","col"),ue.append(s,en.fromTag("br")),re.set(s,"width",100/t+"%"),ue.append(c,s)}u.push(c)}return ae.append(i,u),o}},Er=function(n){return n.dom().innerHTML},Br=function(n){var t=en.fromTag("div"),e=en.fromDom(n.dom().cloneNode(!0));return ue.append(t,e),Er(t)},Ir=function(n,t){n.selection.select(t.dom(),!0),n.selection.collapse(!0)},Pr={insert:function(n,t,e){var r,o=Or.render(e,t,0,0);Dt.set(o,"id","__mce");var i,u,a=Br(o);return n.insertContent(a),r=n.dom.get("__mce"),n.dom.setAttrib(r,"id",null),n.$("tr",r).each(function(t,e){n.fire("newrow",{node:e}),n.$("th,td",e).each(function(t,e){n.fire("newcell",{node:e})})}),n.dom.setAttribs(r,n.settings.table_default_attributes||{}),n.dom.setStyles(r,n.settings.table_default_styles||{}),i=n,u=en.fromDom(r),qt.descendant(u,"td,th").each(m.curry(Ir,i)),r}},Wr=function(n,t){var e=function(e){var r=t(e);if(r<=0||null===r){var o=re.get(e,n);return parseFloat(o)||0}return r},r=function(n,t){return B.foldl(t,function(t,e){var r=re.get(n,e),o=r===undefined?0:parseInt(r,10);return isNaN(o)?t:t+o},0)};return{set:function(t,e){if(!z.isNumber(e)&&!e.match(/^[0-9]+$/))throw n+".set accepts only positive integer values. Value was "+e;var r=t.dom();Jt(r)&&(r.style[n]=e+"px")},get:e,getOuter:e,aggregate:r,max:function(n,t,e){var o=r(n,e);return t>o?t-o:0}}},_r=Wr("height",function(n){return Nt.inBody(n)?n.dom().getBoundingClientRect().height:n.dom().offsetHeight}),Mr=function(n){return _r.get(n)},Lr=function(n){return _r.getOuter(n)},qr=Wr("width",function(n){return n.dom().offsetWidth}),zr=function(n){return qr.get(n)},Fr=function(n){return qr.getOuter(n)},jr=tt.detect(),Hr=function(n,t,e){return r=re.get(n,t),o=e,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Vr=function(n){return jr.browser.isIE()||jr.browser.isEdge()?(e=Hr(t=n,"padding-top",0),r=Hr(t,"padding-bottom",0),o=Hr(t,"border-top-width",0),i=Hr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===re.get(t,"box-sizing")?u:u-e-r-(o+i)):Hr(n,"height",Mr(n));var t,e,r,o,i,u},Ur=/(\d+(\.\d+)?)(\w|%)*/,Gr=/(\d+(\.\d+)?)%/,Xr=/(\d+(\.\d+)?)px|em/,Yr=function(n,t){re.set(n,"height",t+"px")},$r=function(n,t,e,r){var o,i,u,a,c,l=parseInt(n,10);return Yn.endsWith(n,"%")&&"table"!==xt.name(t)?(i=l,u=e,a=r,c=Vt(o=t).map(function(n){var t=u(n);return Math.floor(i/100*t)}).getOr(i),a(o,c),c):l},Kr=function(n){var t,e=re.getRaw(t=n,"height").getOrThunk(function(){return Vr(t)+"px"});return e?$r(e,n,Mr,Yr):Mr(n)},Jr=function(n,t){return Dt.has(n,t)?parseInt(Dt.get(n,t),10):1},Qr=function(n){return re.getRaw(n,"width").fold(function(){return w.from(Dt.get(n,"width"))},function(n){return w.some(n)})},Zr=function(n,t){return n/t.pixelWidth()*100},no={percentageBasedSizeRegex:m.constant(Gr),pixelBasedSizeRegex:m.constant(Xr),setPixelWidth:function(n,t){re.set(n,"width",t+"px")},setPercentageWidth:function(n,t){re.set(n,"width",t+"%")},setHeight:Yr,getPixelWidth:function(n,t){return Qr(n).fold(function(){var t=zr(n);return parseInt(t,10)},function(e){return function(n,t,e){if(Xr.test(t)){var r=Xr.exec(t);return parseInt(r[1],10)}if(Gr.test(t)){var o=Gr.exec(t),i=parseFloat(o[1]);return i/100*e.pixelWidth()}var u=zr(n);return parseInt(u,10)}(n,e,t)})},getPercentageWidth:function(n,t){return Qr(n).fold(function(){var e=zr(n),r=parseInt(e,10);return Zr(r,t)},function(e){return function(n,t,e){if(Gr.test(t)){var r=Gr.exec(t);return parseFloat(r[1])}var o=zr(n),i=parseInt(o,10);return Zr(i,e)}(n,e,t)})},getGenericWidth:function(n){return Qr(n).bind(function(n){if(Ur.test(n)){var t=Ur.exec(n);return w.some({width:m.constant(t[1]),unit:m.constant(t[3])})}return w.none()})},setGenericWidth:function(n,t,e){re.set(n,"width",t+e)},getHeight:function(n){return e="rowspan",Kr(t=n)/Jr(t,e);var t,e},getRawWidth:Qr},to=function(n,t){no.getGenericWidth(n).each(function(e){var r=e.width()/2;no.setGenericWidth(n,r,e.unit()),no.setGenericWidth(t,r,e.unit())})},eo=function(n,t){var e=t||en.fromDom(document.documentElement);return Mt.ancestor(n,m.curry(ot.eq,e)).isSome()},ro=function(n){var t=n.dom();return t===t.window?n:xt.isDocument(n)?t.defaultView||t.parentWindow:null},oo=function(n,t){return{left:m.constant(n),top:m.constant(t),translate:function(e,r){return oo(n+e,t+r)}}},io=function(n,t){return n!==undefined?n:t!==undefined?t:0},uo=function(n){var t,e=n.dom(),r=e.ownerDocument,o=r.body,i=en.fromDom(r.documentElement);return o===e?oo(o.offsetLeft,o.offsetTop):eo(n,i)?(t=e.getBoundingClientRect(),oo(t.left,t.top)):oo(0,0)},ao=function(n){var t=n.dom().ownerDocument,e=t.body,r=ro(en.fromDom(t)),o=t.documentElement,i=io(r.pageYOffset,o.scrollTop),u=io(r.pageXOffset,o.scrollLeft),a=io(o.clientTop,e.clientTop),c=io(o.clientLeft,e.clientLeft);return uo(n).translate(u-c,i-a)},co=X.immutable("row","y"),lo=X.immutable("col","x"),so=function(n){return ao(n).left()+Fr(n)},fo=function(n){return ao(n).left()},mo=function(n,t){return lo(n,fo(t))},go=function(n,t){return lo(n,so(t))},po=function(n){return ao(n).top()},ho=function(n,t,e){if(0===e.length)return[];var r=B.map(e.slice(1),function(t,e){return t.map(function(t){return n(e,t)})}),o=e[e.length-1].map(function(n){return t(e.length-1,n)});return r.concat([o])},vo={delta:m.identity,positions:m.curry(ho,function(n,t){return co(n,po(t))},function(n,t){return co(n,po(t)+Lr(t))}),edge:po},bo={delta:m.identity,edge:fo,positions:m.curry(ho,mo,go)},wo={height:vo,rtl:{delta:function(n,t){return-n},edge:so,positions:m.curry(ho,go,mo)},ltr:bo},yo={ltr:wo.ltr,rtl:wo.rtl},xo=function(n){var t=function(t){return n(t).isRtl()?yo.rtl:yo.ltr};return{delta:function(n,e){return t(e).delta(n,e)},edge:function(n){return t(n).edge(n)},positions:function(n,e){return t(e).positions(n,e)}}},Co=function(n){var t=Gt(n);return Kt.generate(t).grid()},So=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return So(e())}}},Ro=function(n,t){return To(n,t,{validate:z.isFunction,label:"function"})},To=function(n,t,e){if(0===t.length)throw new Error("You must specify at least one required field.");return V("required",t),G(t),function(r){var o=L.keys(r);B.forall(t,function(n){return B.contains(o,n)})||j(t,o),n(t,o);var i=B.filter(t,function(n){return!e.validate(r[n],n)});return i.length>0&&U(i,e.label),r}},Do=m.noop,Ao={exactly:m.curry(Ro,function(n,t){var e=B.filter(t,function(t){return!B.contains(n,t)});e.length>0&&H(e)}),ensure:m.curry(Ro,Do),ensureWith:m.curry(To,Do)},ko=function(n){var t=Dt.has(n,"colspan")?parseInt(Dt.get(n,"colspan"),10):1,e=Dt.has(n,"rowspan")?parseInt(Dt.get(n,"rowspan"),10):1;return{element:m.constant(n),colspan:m.constant(t),rowspan:m.constant(e)}},No=Ao.exactly(["cell","row","replace","gap"]),Oo=function(n,t){No(n);var e=So(w.none()),r=t!==undefined?t:ko,o=function(t){var e,o=r(t);return e=o,n.cell(e)},i=function(n){var t=o(n);return e.get().isNone()&&e.set(w.some(t)),u=w.some({item:n,replacement:t}),t},u=w.none();return{getOrInit:function(n,t){return u.fold(function(){return i(n)},function(e){return t(n,e.item)?e.replacement:i(n)})},cursor:e.get}},Eo=function(n,t){return function(e){var r=So(w.none());No(e);var o=[],i=function(i){var u=e.replace(i,t,{scope:n});return o.push({item:i,sub:u}),r.get().isNone()&&r.set(w.some(u)),u};return{replaceOrInit:function(n,t){return(e=n,r=t,B.find(o,function(n){return r(n.item,e)})).fold(function(){return i(n)},function(e){return t(n,e.item)?e.sub:i(n)});var e,r},cursor:r.get}}},Bo=function(n){No(n);var t=So(w.none());return{combine:function(e){return t.get().isNone()&&t.set(w.some(e)),function(){var t=n.cell({element:m.constant(e),colspan:m.constant(1),rowspan:m.constant(1)});return re.remove(t,"width"),re.remove(e,"width"),t}},cursor:t.get}},Io=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Po=function(n,t){var e=n.property().name(t);return B.contains(Io,e)},Wo=function(n,t){return B.contains(["br","img","hr","input"],n.property().name(t))},_o=Po,Mo=function(n,t){var e=n.property().name(t);return B.contains(["ol","ul"],e)},Lo=Wo,qo=Pe(),zo=function(n){return _o(qo,n)},Fo=function(n){return Mo(qo,n)},jo=function(n){return Lo(qo,n)},Ho=function(n){var t,e=function(n){return"br"===xt.name(n)},r=function(n){return Te.last(n).bind(function(t){var r,o=(r=t,dt.nextSibling(r).map(function(n){return!!zo(n)||(jo(n)?"img"!==xt.name(n):void 0)}).getOr(!1));return dt.parent(t).map(function(r){return!0===o||(i=r,"li"===xt.name(i)||Mt.ancestor(i,Fo).isSome())||e(t)||zo(r)&&!ot.eq(n,r)?[]:[en.fromTag("br")];var i})}).getOr([])},o=0===(t=B.bind(n,function(n){var t,o=dt.children(n);return t=o,B.forall(t,function(n){return e(n)||xt.isText(n)&&0===we.get(n).trim().length})?[]:o.concat(r(n))})).length?[en.fromTag("br")]:t;le.empty(n[0]),ae.append(n[0],o)},Vo=function(n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<t.length;o++){var i=t[o];for(var u in i)i.hasOwnProperty(u)&&(r[u]=n(r[u],i[u]))}return r}},Uo=Vo(function(n,t){return z.isObject(n)&&z.isObject(t)?Uo(n,t):t}),Go=Vo(function(n,t){return t}),Xo={deepMerge:Uo,merge:Go},Yo=function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t},$o=function(n,t){for(var e=0;e<n.length;e++){var r=t(n[e],e);if(r.isSome())return r}return w.none()},Ko=function(n,t){return nn.rowcells(t,n.section())},Jo=function(n,t){return n.cells()[t]},Qo={addCell:function(n,t,e){var r=n.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([e]).concat(i);return Ko(n,u)},setCells:Ko,mutateCell:function(n,t,e){n.cells()[t]=e},getCell:Jo,getCellElement:function(n,t){return Jo(n,t).element()},mapCells:function(n,t){var e=n.cells(),r=B.map(e,t);return nn.rowcells(r,n.section())},cellLength:function(n){return n.cells().length}},Zo=function(n,t){if(0===n.length)return 0;var e=n[0];return B.findIndex(n,function(n){return!t(e.element(),n.element())}).fold(function(){return n.length},function(n){return n})},ni=function(n,t,e,r){var o,i,u,a,c=(o=n,i=t,o[i]).cells().slice(e),l=Zo(c,r),s=(u=n,a=e,B.map(u,function(n){return Qo.getCell(n,a)})).slice(t),f=Zo(s,r);return{colspan:m.constant(l),rowspan:m.constant(f)}},ti=function(n,t){var e=B.map(n,function(n,t){return B.map(n.cells(),function(n,t){return!1})});return B.map(n,function(r,o){var i=B.bind(r.cells(),function(r,i){if(!1===e[o][i]){var u=ni(n,o,i,t);return function(n,t,r,o){for(var i=n;i<n+r;i++)for(var u=t;u<t+o;u++)e[i][u]=!0}(o,i,u.rowspan(),u.colspan()),[nn.detailnew(r.element(),u.rowspan(),u.colspan(),r.isNew())]}return[]});return nn.rowdetails(i,r.section())})},ei=function(n,t,e){for(var r=[],o=0;o<n.grid().rows();o++){for(var i=[],u=0;u<n.grid().columns();u++){var a=Kt.getAt(n,o,u).map(function(n){return nn.elementnew(n.element(),e)}).getOrThunk(function(){return nn.elementnew(t.gap(),!0)});i.push(a)}var c=nn.rowcells(i,n.all()[o].section());r.push(c)}return r},ri=function(n,t,e,r){e===r?Dt.remove(n,t):Dt.set(n,t,e)},oi=function(n,t){var e=[],r=[],o=function(t,o){t.length>0?function(t,o){var i=qt.child(n,o).getOrThunk(function(){var t=en.fromTag(o,dt.owner(n).dom());return ue.append(n,t),t});le.empty(i);var u=B.map(t,function(n){n.isNew()&&e.push(n.element());var t=n.element();return le.empty(t),B.each(n.cells(),function(n){n.isNew()&&r.push(n.element()),ri(n.element(),"colspan",n.colspan(),1),ri(n.element(),"rowspan",n.rowspan(),1),ue.append(t,n.element())}),t});ae.append(i,u)}(t,o):qt.child(n,o).bind(le.remove)},i=[],u=[],a=[];return B.each(t,function(n){switch(n.section()){case"thead":i.push(n);break;case"tbody":u.push(n);break;case"tfoot":a.push(n)}}),o(i,"thead"),o(u,"tbody"),o(a,"tfoot"),{newRows:m.constant(e),newCells:m.constant(r)}},ii=function(n){return B.map(n,function(n){var t=pe(n.element());return B.each(n.cells(),function(n){var e=he(n.element());ri(e,"colspan",n.colspan(),1),ri(e,"rowspan",n.rowspan(),1),ue.append(t,e)}),t})},ui=function(n,t){for(var e=[],r=0;r<n;r++)e.push(t(r));return e},ai=function(n,t){for(var e=[],r=n;r<t;r++)e.push(r);return e},ci=function(n,t){if(t<0||t>=n.length-1)return w.none();var e=n[t].fold(function(){var e=B.reverse(n.slice(0,t));return $o(e,function(n,t){return n.map(function(n){return{value:n,delta:t+1}})})},function(n){return w.some({value:n,delta:0})}),r=n[t+1].fold(function(){var e=n.slice(t+1);return $o(e,function(n,t){return n.map(function(n){return{value:n,delta:t+1}})})},function(n){return w.some({value:n,delta:1})});return e.bind(function(n){return r.map(function(t){var e=t.delta+n.delta;return Math.abs(t.value-n.value)/e})})},li=function(n,t,e){var r=n();return B.find(r,t).orThunk(function(){return w.from(r[0]).orThunk(e)}).map(function(n){return n.element()})},si=function(n){var t=n.grid(),e=ai(0,t.columns()),r=ai(0,t.rows());return B.map(e,function(t){return li(function(){return B.bind(r,function(e){return Kt.getAt(n,e,t).filter(function(n){return n.column()===t}).fold(m.constant([]),function(n){return[n]})})},function(n){return 1===n.colspan()},function(){return Kt.getAt(n,0,t)})})},fi=function(n){var t=n.grid(),e=ai(0,t.rows()),r=ai(0,t.columns());return B.map(e,function(t){return li(function(){return B.bind(r,function(e){return Kt.getAt(n,t,e).filter(function(n){return n.row()===t}).fold(m.constant([]),function(n){return[n]})})},function(n){return 1===n.rowspan()},function(){return Kt.getAt(n,t,0)})})},di=function(n,t,e,r,o){var i=en.fromTag("div");return re.setAll(i,{position:"absolute",left:t-r/2+"px",top:e+"px",height:o+"px",width:r+"px"}),Dt.setAll(i,{"data-column":n,role:"presentation"}),i},mi=function(n,t,e,r,o){var i=en.fromTag("div");return re.setAll(i,{position:"absolute",left:t+"px",top:e-o/2+"px",height:o+"px",width:r+"px"}),Dt.setAll(i,{"data-row":n,role:"presentation"}),i},gi=function(n){var t=n.replace(/\./g,"-");return{resolve:function(n){return t+"-"+n}}},pi={resolve:gi("ephox-snooker").resolve},hi=function(n,t){var e=Dt.get(n,t);return e===undefined||""===e?[]:e.split(" ")},vi=hi,bi=function(n,t,e){var r=hi(n,t).concat([e]);Dt.set(n,t,r.join(" "))},wi=function(n,t,e){var r=B.filter(hi(n,t),function(n){return n!==e});r.length>0?Dt.set(n,t,r.join(" ")):Dt.remove(n,t)},yi=function(n){return vi(n,"class")},xi=function(n,t){return bi(n,"class",t)},Ci=function(n,t){return wi(n,"class",t)},Si=yi,Ri=xi,Ti=Ci,Di=function(n,t){B.contains(yi(n),t)?Ci(n,t):xi(n,t)},Ai=function(n){return n.dom().classList!==undefined},ki=function(n,t){return Ai(n)&&n.dom().classList.contains(t)},Ni={add:function(n,t){Ai(n)?n.dom().classList.add(t):Ri(n,t)},remove:function(n,t){var e;Ai(n)?n.dom().classList.remove(t):Ti(n,t),0===(Ai(e=n)?e.dom().classList:Si(e)).length&&Dt.remove(e,"class")},toggle:function(n,t){return Ai(n)?n.dom().classList.toggle(t):Di(n,t)},toggler:function(n,t){var e,r,o,i,u,a,c=Ai(n),l=n.dom().classList;return e=function(){c?l.remove(t):Ti(n,t)},r=function(){c?l.add(t):Ri(n,t)},o=ki(n,t),i=o||!1,{on:u=function(){r(),i=!0},off:a=function(){e(),i=!1},toggle:function(){(i?a:u)()},isOn:function(){return i}}},has:ki},Oi=pi.resolve("resizer-bar"),Ei=pi.resolve("resizer-rows"),Bi=pi.resolve("resizer-cols"),Ii=function(n){var t=Bt.descendants(n.parent(),"."+Oi);B.each(t,le.remove)},Pi=function(n,t,e){var r=n.origin();B.each(t,function(t,o){t.each(function(t){var o=e(r,t);Ni.add(o,Oi),ue.append(n.parent(),o)})})},Wi=function(n,t,e,r,o,i){var u,a,c,l,s=ao(t),f=e.length>0?o.positions(e,t):[];u=n,a=f,c=s,l=Fr(t),Pi(u,a,function(n,t){var e=mi(t.row(),c.left()-n.left(),t.y()-n.top(),l,7);return Ni.add(e,Ei),e});var d,m,g,p,h=r.length>0?i.positions(r,t):[];d=n,m=h,g=s,p=Lr(t),Pi(d,m,function(n,t){var e=di(t.col(),t.x()-n.left(),g.top()-n.top(),7,p);return Ni.add(e,Bi),e})},_i=function(n,t){var e=Bt.descendants(n.parent(),"."+Oi);B.each(e,t)},Mi=function(n,t,e,r){Ii(n);var o=Gt(t),i=Kt.generate(o),u=fi(i),a=si(i);Wi(n,t,u,a,e,r)},Li=function(n){_i(n,function(n){re.set(n,"display","none")})},qi=function(n){_i(n,function(n){re.set(n,"display","block")})},zi=Ii,Fi=function(n){return Ni.has(n,Ei)},ji=function(n){return Ni.has(n,Bi)},Hi=function(n,t){return B.map(n,function(n){var e,r=(e=n.details(),$o(e,function(n){return dt.parent(n.element()).map(function(n){var t=dt.parent(n).isNone();return nn.elementnew(n,t)})}).getOrThunk(function(){return nn.elementnew(t.row(),!0)}));return nn.rowdatanew(r.element(),n.details(),n.section(),r.isNew())})},Vi=function(n,t){var e=ti(n,ot.eq);return Hi(e,t)},Ui=function(n,t){var e=B.flatten(B.map(n.all(),function(n){return n.cells()}));return B.find(e,function(n){return ot.eq(t,n.element())})},Gi=function(n,t,e,r,o){return function(i,u,a,c,l){var s=Gt(u),f=Kt.generate(s);return t(f,a).map(function(t){var e=ei(f,c,!1),r=n(e,t,ot.eq,o(c)),i=Vi(r.grid(),c);return{grid:m.constant(i),cursor:r.cursor}}).fold(function(){return w.none()},function(n){var t=oi(u,n.grid());return e(u,n.grid(),l),r(u),Mi(i,u,wo.height,l),w.some({cursor:n.cursor,newRows:t.newRows,newCells:t.newCells})})}},Xi=Vi,Yi=function(n,t){return jt(t.element()).bind(function(t){return Ui(n,t)})},$i=function(n,t){var e=B.map(t.selection(),function(t){return jt(t).bind(function(t){return Ui(n,t)})}),r=Yo(e);return r.length>0?w.some(r):w.none()},Ki=function(n,t){return jt(t.element()).bind(function(e){return Ui(n,e).map(function(n){return Xo.merge(n,{generators:t.generators,clipboard:t.clipboard})})})},Ji=function(n,t){var e=B.map(t.selection(),function(t){return jt(t).bind(function(t){return Ui(n,t)})}),r=Yo(e);return r.length>0?w.some(Xo.merge({cells:r},{generators:t.generators,clipboard:t.clipboard})):w.none()},Qi=function(n,t){return t.mergable()},Zi=function(n,t){return t.unmergable()},nu=function(n){return{is:function(t){return n===t},isValue:m.constant(!0),isError:m.constant(!1),getOr:m.constant(n),getOrThunk:m.constant(n),getOrDie:m.constant(n),or:function(t){return nu(n)},orThunk:function(t){return nu(n)},fold:function(t,e){return e(n)},map:function(t){return nu(t(n))},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return w.some(n)}}},tu=function(n){return{is:m.constant(!1),isValue:m.constant(!1),isError:m.constant(!0),getOr:m.identity,getOrThunk:function(n){return n()},getOrDie:function(){return m.die(n)()},or:function(n){return n},orThunk:function(n){return n()},fold:function(t,e){return t(n)},map:function(t){return tu(n)},each:m.noop,bind:function(t){return tu(n)},exists:m.constant(!1),forall:m.constant(!0),toOption:w.none}},eu={value:nu,error:tu},ru=function(n,t){return B.map(n,function(){return nn.elementnew(t.cell(),!0)})},ou=function(n,t,e){return n.concat(ui(t,function(t){return Qo.setCells(n[n.length-1],ru(n[n.length-1].cells(),e))}))},iu=function(n,t,e){return B.map(n,function(n){return Qo.setCells(n,n.cells().concat(ru(ai(0,t),e)))})},uu=function(n,t,e){if(n.row()>=t.length||n.column()>Qo.cellLength(t[0]))return eu.error("invalid start address out of table bounds, row: "+n.row()+", column: "+n.column());var r=t.slice(n.row()),o=r[0].cells().slice(n.column()),i=Qo.cellLength(e[0]),u=e.length;return eu.value({rowDelta:m.constant(r.length-u),colDelta:m.constant(o.length-i)})},au=function(n,t){var e=Qo.cellLength(n[0]),r=Qo.cellLength(t[0]);return{rowDelta:m.constant(0),colDelta:m.constant(e-r)}},cu=function(n,t,e){var r=t.colDelta()<0?iu:m.identity;return(t.rowDelta()<0?ou:m.identity)(r(n,Math.abs(t.colDelta()),e),Math.abs(t.rowDelta()),e)},lu=function(n,t,e,r){if(0===n.length)return n;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)Qo.mutateCell(n[o],i,nn.elementnew(r(),!1));return n},su=function(n,t,e,r){for(var o=!0,i=0;i<n.length;i++)for(var u=0;u<Qo.cellLength(n[0]);u++){var a=e(Qo.getCellElement(n[i],u),t);!0===a&&!1===o?Qo.mutateCell(n[i],u,nn.elementnew(r(),!0)):!0===a&&(o=!1)}return n},fu=function(n,t,e,r){if(t>0&&t<n.length){var o=n[t-1].cells(),i=(u=o,a=e,B.foldl(u,function(n,t){return B.exists(n,function(n){return a(n.element(),t.element())})?n:n.concat([t])},[]));B.each(i,function(o){for(var i=w.none(),u=t;u<n.length;u++)for(var a=0;a<Qo.cellLength(n[0]);a++){var c=n[u].cells()[a];e(c.element(),o.element())&&(i.isNone()&&(i=w.some(r())),i.each(function(t){Qo.mutateCell(n[u],a,nn.elementnew(t,!0))}))}})}var u,a;return n},du=function(n,t,e,r,o){return uu(n,t,e).map(function(i){var u=cu(t,i,r);return function(n,t,e,r,o){for(var i,u,a,c,l,s,f,d=n.row(),g=n.column(),p=d+e.length,h=g+Qo.cellLength(e[0]),v=d;v<p;v++)for(var b=g;b<h;b++){i=t,u=v,a=b,c=o,l=void 0,s=void 0,l=Qo.getCell(i[u],a),s=m.curry(c,l.element()),f=i[u],i.length>1&&Qo.cellLength(f)>1&&(a>0&&s(Qo.getCellElement(f,a-1))||a<f.length-1&&s(Qo.getCellElement(f,a+1))||u>0&&s(Qo.getCellElement(i[u-1],a))||u<i.length-1&&s(Qo.getCellElement(i[u+1],a)))&&su(t,Qo.getCellElement(t[v],b),o,r.cell);var w=Qo.getCellElement(e[v-d],b-g),y=r.replace(w);Qo.mutateCell(t[v],b,nn.elementnew(y,!0))}return t}(n,u,e,r,o)})},mu=function(n,t,e,r,o){fu(t,n,o,r.cell);var i=au(e,t),u=cu(e,i,r),a=au(t,u),c=cu(t,a,r);return c.slice(0,n).concat(u).concat(c.slice(n,c.length))},gu=function(n,t,e,r,o){var i=n.slice(0,t),u=n.slice(t),a=Qo.mapCells(n[e],function(e,i){return t>0&&t<n.length&&r(Qo.getCellElement(n[t-1],i),Qo.getCellElement(n[t],i))?Qo.getCell(n[t],i):nn.elementnew(o(e.element(),r),!0)});return i.concat([a]).concat(u)},pu=function(n,t,e,r,o){return B.map(n,function(n){var i=t>0&&t<Qo.cellLength(n)&&r(Qo.getCellElement(n,t-1),Qo.getCellElement(n,t))?Qo.getCell(n,t):nn.elementnew(o(Qo.getCellElement(n,e),r),!0);return Qo.addCell(n,t,i)})},hu=function(n,t,e,r,o){var i=e+1;return B.map(n,function(n,u){var a=u===t?nn.elementnew(o(Qo.getCellElement(n,e),r),!0):Qo.getCell(n,e);return Qo.addCell(n,i,a)})},vu=function(n,t,e,r,o){var i=t+1,u=n.slice(0,i),a=n.slice(i),c=Qo.mapCells(n[t],function(n,t){return t===e?nn.elementnew(o(n.element(),r),!0):n});return u.concat([c]).concat(a)},bu=function(n,t,e){return n.slice(0,t).concat(n.slice(e+1))},wu=function(n,t,e){var r=B.map(n,function(n){var r=n.cells().slice(0,t).concat(n.cells().slice(e+1));return nn.rowcells(r,n.section())});return B.filter(r,function(n){return n.cells().length>0})},yu=function(n,t,e,r){return B.map(n,function(n){return Qo.mapCells(n,function(n){return o=n,B.exists(t,function(n){return e(o.element(),n.element())})?nn.elementnew(r(n.element(),e),!0):n;var o})})},xu=function(n,t,e,r){return Qo.getCellElement(n[t],e)!==undefined&&t>0&&r(Qo.getCellElement(n[t-1],e),Qo.getCellElement(n[t],e))},Cu=function(n,t,e){return t>0&&e(Qo.getCellElement(n,t-1),Qo.getCellElement(n,t))},Su=function(n,t,e,r){var o=B.bind(n,function(r,o){return xu(n,o,t,e)||Cu(r,t,e)?[]:[Qo.getCell(r,t)]});return yu(n,o,e,r)},Ru=function(n,t,e,r){var o=n[t],i=B.bind(o.cells(),function(r,i){return xu(n,t,i,e)||Cu(o,i,e)?[]:[r]});return yu(n,i,e,r)},Tu=function(n){return{fold:n}},Du=function(){return Tu(function(n,t,e,r,o){return n()})},Au=function(n){return Tu(function(t,e,r,o,i){return e(n)})},ku=function(n,t){return Tu(function(e,r,o,i,u){return o(n,t)})},Nu=function(n,t,e){return Tu(function(r,o,i,u,a){return u(n,t,e)})},Ou=function(n,t){return Tu(function(e,r,o,i,u){return u(n,t)})},Eu=function(n,t,e,r){var o,i,u=n.slice(0),a=(i=t,0===(o=n).length?Du():1===o.length?Au(0):0===i?ku(0,1):i===o.length-1?Ou(i-1,i):i>0&&i<o.length-1?Nu(i-1,i,i+1):Du()),c=function(n){return B.map(n,m.constant(0))},l=m.constant(c(u)),s=function(n,t){if(e>=0){var o=Math.max(r.minCellWidth(),u[t]-e);return c(u.slice(0,n)).concat([e,o-u[t]]).concat(c(u.slice(t+1)))}var i=Math.max(r.minCellWidth(),u[n]+e),a=u[n]-i;return c(u.slice(0,n)).concat([i-u[n],a]).concat(c(u.slice(t+1)))},f=s;return a.fold(l,function(n){return r.singleColumnWidth(u[n],e)},f,function(n,t,e){return s(t,e)},function(n,t){if(e>=0)return c(u.slice(0,t)).concat([e]);var o=Math.max(r.minCellWidth(),u[t]+e);return c(u.slice(0,t)).concat([o-u[t]])})},Bu=function(n,t){return Dt.has(n,t)&&parseInt(Dt.get(n,t),10)>1},Iu={hasColspan:function(n){return Bu(n,"colspan")},hasRowspan:function(n){return Bu(n,"rowspan")},minWidth:m.constant(10),minHeight:m.constant(10),getInt:function(n,t){return parseInt(re.get(n,t),10)}},Pu=function(n,t,e){return re.getRaw(n,t).fold(function(){return e(n)+"px"},function(n){return n})},Wu=function(n){return Pu(n,"width",no.getPixelWidth)},_u=function(n){return Pu(n,"height",no.getHeight)},Mu=function(n,t,e,r,o){var i=si(n),u=B.map(i,function(n){return n.map(t.edge)});return B.map(i,function(n,t){return n.filter(m.not(Iu.hasColspan)).fold(function(){var n=ci(u,t);return r(n)},function(n){return e(n,o)})})},Lu=function(n){return n.map(function(n){return n+"px"}).getOr("")},qu=function(n,t,e,r){var o=fi(n),i=B.map(o,function(n){return n.map(t.edge)});return B.map(o,function(n,t){return n.filter(m.not(Iu.hasRowspan)).fold(function(){var n=ci(i,t);return r(n)},function(n){return e(n)})})},zu={getRawWidths:function(n,t){return Mu(n,t,Wu,Lu)},getPixelWidths:function(n,t,e){return Mu(n,t,no.getPixelWidth,function(n){return n.getOrThunk(e.minCellWidth)},e)},getPercentageWidths:function(n,t,e){return Mu(n,t,no.getPercentageWidth,function(n){return n.fold(function(){return e.minCellWidth()},function(n){return n/e.pixelWidth()*100})},e)},getPixelHeights:function(n,t){return qu(n,t,no.getHeight,function(n){return n.getOrThunk(Iu.minHeight)})},getRawHeights:function(n,t){return qu(n,t,_u,Lu)}},Fu=function(n,t,e){for(var r=0,o=n;o<t;o++)r+=e[o]!==undefined?e[o]:0;return r},ju=function(n,t){var e=Kt.justCells(n);return B.map(e,function(n){var e=Fu(n.column(),n.column()+n.colspan(),t);return{element:n.element,width:m.constant(e),colspan:n.colspan}})},Hu=function(n,t){var e=Kt.justCells(n);return B.map(e,function(n){var e=Fu(n.row(),n.row()+n.rowspan(),t);return{element:n.element,height:m.constant(e),rowspan:n.rowspan}})},Vu=function(n,t){return B.map(n.all(),function(n,e){return{element:n.element,height:m.constant(t[e])}})},Uu=function(n){var t=parseInt(n,10),e=m.identity;return{width:m.constant(t),pixelWidth:m.constant(t),getWidths:zu.getPixelWidths,getCellDelta:e,singleColumnWidth:function(n,t){return[Math.max(Iu.minWidth(),n+t)-n]},minCellWidth:Iu.minWidth,setElementWidth:no.setPixelWidth,setTableWidth:function(n,t,e){var r=B.foldr(t,function(n,t){return n+t},0);no.setPixelWidth(n,r)}}},Gu=function(n,t){if(no.percentageBasedSizeRegex().test(t)){var e=no.percentageBasedSizeRegex().exec(t);return o=e[1],i=n,u=parseFloat(o),a=zr(i),{width:m.constant(u),pixelWidth:m.constant(a),getWidths:zu.getPercentageWidths,getCellDelta:function(n){return n/a*100},singleColumnWidth:function(n,t){return[100-n]},minCellWidth:function(){return Iu.minWidth()/a*100},setElementWidth:no.setPercentageWidth,setTableWidth:function(n,t,e){var r=u+e;no.setPercentageWidth(n,r)}}}if(no.pixelBasedSizeRegex().test(t)){var r=no.pixelBasedSizeRegex().exec(t);return Uu(r[1])}var o,i,u,a,c=zr(n);return Uu(c)},Xu=function(n){return no.getRawWidth(n).fold(function(){var t=zr(n);return Uu(t)},function(t){return Gu(n,t)})},Yu=function(n){return Kt.generate(n)},$u=function(n){var t=Gt(n);return Yu(t)},Ku=function(n,t,e,r){var o=Xu(n),i=o.getCellDelta(t),u=$u(n),a=o.getWidths(u,r,o),c=Eu(a,e,i,o),l=B.map(c,function(n,t){return n+a[t]}),s=ju(u,l);B.each(s,function(n){o.setElementWidth(n.element(),n.width())}),e===u.grid().columns()-1&&o.setTableWidth(n,l,i)},Ju=function(n,t,e,r){var o=$u(n),i=zu.getPixelHeights(o,r),u=B.map(i,function(n,r){return e===r?Math.max(t+n,Iu.minHeight()):n}),a=Hu(o,u),c=Vu(o,u);B.each(c,function(n){no.setHeight(n.element(),n.height())}),B.each(a,function(n){no.setHeight(n.element(),n.height())});var l,s=(l=u,B.foldr(l,function(n,t){return n+t},0));no.setHeight(n,s)},Qu=function(n,t,e){var r=Xu(n),o=Yu(t),i=r.getWidths(o,e,r),u=ju(o,i);B.each(u,function(n){r.setElementWidth(n.element(),n.width())});var a=B.foldr(i,function(n,t){return t+n},0);u.length>0&&r.setElementWidth(n,a)},Zu=function(n){0===Ht(n).length&&le.remove(n)},na=X.immutable("grid","cursor"),ta=function(n,t,e){return ea(n,t,e).orThunk(function(){return ea(n,0,0)})},ea=function(n,t,e){return w.from(n[t]).bind(function(n){return w.from(n.cells()[e]).bind(function(n){return w.from(n.element())})})},ra=function(n,t,e){return na(n,ea(n,t,e))},oa=function(n){return B.foldl(n,function(n,t){return B.exists(n,function(n){return n.row()===t.row()})?n:n.concat([t])},[]).sort(function(n,t){return n.row()-t.row()})},ia=function(n){return B.foldl(n,function(n,t){return B.exists(n,function(n){return n.column()===t.column()})?n:n.concat([t])},[]).sort(function(n,t){return n.column()-t.column()})},ua=function(n,t,e){var r=Xt(n,e),o=Kt.generate(r);return ei(o,t,!0)},aa=Qu,ca={insertRowBefore:Gi(function(n,t,e,r){var o=t.row(),i=t.row(),u=gu(n,i,o,e,r.getOrInit);return ra(u,i,t.column())},Yi,m.noop,m.noop,Oo),insertRowsBefore:Gi(function(n,t,e,r){var o=t[0].row(),i=t[0].row(),u=oa(t),a=B.foldl(u,function(n,t){return gu(n,i,o,e,r.getOrInit)},n);return ra(a,i,t[0].column())},$i,m.noop,m.noop,Oo),insertRowAfter:Gi(function(n,t,e,r){var o=t.row(),i=t.row()+t.rowspan(),u=gu(n,i,o,e,r.getOrInit);return ra(u,i,t.column())},Yi,m.noop,m.noop,Oo),insertRowsAfter:Gi(function(n,t,e,r){var o=oa(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=B.foldl(o,function(n,t){return gu(n,u,i,e,r.getOrInit)},n);return ra(a,u,t[0].column())},$i,m.noop,m.noop,Oo),insertColumnBefore:Gi(function(n,t,e,r){var o=t.column(),i=t.column(),u=pu(n,i,o,e,r.getOrInit);return ra(u,t.row(),i)},Yi,aa,m.noop,Oo),insertColumnsBefore:Gi(function(n,t,e,r){var o=ia(t),i=o[0].column(),u=o[0].column(),a=B.foldl(o,function(n,t){return pu(n,u,i,e,r.getOrInit)},n);return ra(a,t[0].row(),u)},$i,aa,m.noop,Oo),insertColumnAfter:Gi(function(n,t,e,r){var o=t.column(),i=t.column()+t.colspan(),u=pu(n,i,o,e,r.getOrInit);return ra(u,t.row(),i)},Yi,aa,m.noop,Oo),insertColumnsAfter:Gi(function(n,t,e,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ia(t),a=B.foldl(u,function(n,t){return pu(n,i,o,e,r.getOrInit)},n);return ra(a,t[0].row(),i)},$i,aa,m.noop,Oo),splitCellIntoColumns:Gi(function(n,t,e,r){var o=hu(n,t.row(),t.column(),e,r.getOrInit);return ra(o,t.row(),t.column())},Yi,aa,m.noop,Oo),splitCellIntoRows:Gi(function(n,t,e,r){var o=vu(n,t.row(),t.column(),e,r.getOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Oo),eraseColumns:Gi(function(n,t,e,r){var o=ia(t),i=wu(n,o[0].column(),o[o.length-1].column()),u=ta(i,t[0].row(),t[0].column());return na(i,u)},$i,aa,Zu,Oo),eraseRows:Gi(function(n,t,e,r){var o=oa(t),i=bu(n,o[0].row(),o[o.length-1].row()),u=ta(i,t[0].row(),t[0].column());return na(i,u)},$i,m.noop,Zu,Oo),makeColumnHeader:Gi(function(n,t,e,r){var o=Su(n,t.column(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo("row","th")),unmakeColumnHeader:Gi(function(n,t,e,r){var o=Su(n,t.column(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo(null,"td")),makeRowHeader:Gi(function(n,t,e,r){var o=Ru(n,t.row(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo("col","th")),unmakeRowHeader:Gi(function(n,t,e,r){var o=Ru(n,t.row(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo(null,"td")),mergeCells:Gi(function(n,t,e,r){var o=t.cells();Ho(o);var i=lu(n,t.bounds(),e,m.constant(o[0]));return na(i,w.from(o[0]))},Qi,m.noop,m.noop,Bo),unmergeCells:Gi(function(n,t,e,r){var o=B.foldr(t,function(n,t){return su(n,t,e,r.combine(t))},n);return na(o,w.from(t[0]))},Zi,aa,m.noop,Bo),pasteCells:Gi(function(n,t,e,r){var o,i,u,a,c=(o=t.clipboard(),i=t.generators(),u=Gt(o),a=Kt.generate(u),ei(a,i,!0)),l=nn.address(t.row(),t.column());return du(l,n,c,t.generators(),e).fold(function(){return na(n,w.some(t.element()))},function(n){var e=ta(n,t.row(),t.column());return na(n,e)})},Ki,aa,m.noop,Oo),pasteRowsBefore:Gi(function(n,t,e,r){var o=n[t.cells[0].row()],i=t.cells[0].row(),u=ua(t.clipboard(),t.generators(),o),a=mu(i,n,u,t.generators(),e),c=ta(a,t.cells[0].row(),t.cells[0].column());return na(a,c)},Ji,m.noop,m.noop,Oo),pasteRowsAfter:Gi(function(n,t,e,r){var o=n[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=ua(t.clipboard(),t.generators(),o),a=mu(i,n,u,t.generators(),e),c=ta(a,t.cells[0].row(),t.cells[0].column());return na(a,c)},Ji,m.noop,m.noop,Oo)},la=function(n){return en.fromDom(n.getBody())},sa={getBody:la,getIsRoot:function(n){return function(t){return ot.eq(t,la(n))}},addSizeSuffix:function(n){return/^[0-9]+$/.test(n)&&(n+="px"),n},removePxSuffix:function(n){return n?n.replace(/px$/,""):""}},fa=function(n){return"rtl"===re.get(n,"direction")?"rtl":"ltr"},da={onDirection:function(n,t){return function(e){return"rtl"===fa(e)?t:n}},getDirection:fa},ma={isRtl:m.constant(!1)},ga={isRtl:m.constant(!0)},pa=function(n){return"rtl"===da.getDirection(n)?ga:ma},ha=function(n,t){var e,r=function(n){return"table"===xt.name(sa.getBody(n))};!1!==n.settings.table_clone_elements&&("string"==typeof n.settings.table_clone_elements?e=n.settings.table_clone_elements.split(/[ ,]/):Array.isArray(n.settings.table_clone_elements)&&(e=n.settings.table_clone_elements));var o=w.from(e),i=function(t,e,r,i){return function(u,a){var c=Bt.descendants(u,"td[data-mce-style],th[data-mce-style]");B.each(c,function(n){Dt.remove(n,"data-mce-style")});var l=i(),s=en.fromDom(n.getDoc()),f=xo(pa),d=Oe(r,s,o);return e(u)?t(l,u,a,d,f).bind(function(t){return B.each(t.newRows(),function(t){var e;e=t,n.fire("newrow",{node:e.dom()}),e.dom()}),B.each(t.newCells(),function(t){var e;e=t,n.fire("newcell",{node:e.dom()}),e.dom()}),t.cursor().map(function(t){var e=n.dom.createRng();return e.setStart(t.dom(),0),e.setEnd(t.dom(),0),e})}):w.none()}};return{deleteRow:i(ca.eraseRows,function(t){var e=Co(t);return!1===r(n)||e.rows()>1},m.noop,t),deleteColumn:i(ca.eraseColumns,function(t){var e=Co(t);return!1===r(n)||e.columns()>1},m.noop,t),insertRowsBefore:i(ca.insertRowsBefore,m.always,m.noop,t),insertRowsAfter:i(ca.insertRowsAfter,m.always,m.noop,t),insertColumnsBefore:i(ca.insertColumnsBefore,m.always,to,t),insertColumnsAfter:i(ca.insertColumnsAfter,m.always,to,t),mergeCells:i(ca.mergeCells,m.always,m.noop,t),unmergeCells:i(ca.unmergeCells,m.always,m.noop,t),pasteRowsBefore:i(ca.pasteRowsBefore,m.always,m.noop,t),pasteRowsAfter:i(ca.pasteRowsAfter,m.always,m.noop,t),pasteCells:i(ca.pasteCells,m.always,m.noop,t)}},va=function(n,t,e){var r=Gt(n),o=Kt.generate(r);return $i(o,t).map(function(n){var t=ei(o,e,!1).slice(n[0].row(),n[n.length-1].row()+n[n.length-1].rowspan()),r=Xi(t,e);return ii(r)})},ba=tinymce.util.Tools.resolve("tinymce.util.Tools"),wa=tinymce.util.Tools.resolve("tinymce.Env"),ya={applyAlign:function(n,t,e){e&&n.formatter.apply("align"+e,{},t)},applyVAlign:function(n,t,e){e&&n.formatter.apply("valign"+e,{},t)},unApplyAlign:function(n,t){ba.each("left center right".split(" "),function(e){n.formatter.remove("align"+e,{},t)})},unApplyVAlign:function(n,t){ba.each("top middle bottom".split(" "),function(e){n.formatter.remove("valign"+e,{},t)})},getTDTHOverallStyle:function(n,t,e){var r;return r=function(t,r){for(var o=0;o<r.length;o++){var i=n.getStyle(r[o],e);if(void 0===t&&(t=i),t!==i)return""}return t}(r,n.select("td,th",t))}},xa=function(n,t){var e=n.dom,r=t.control.rootControl,o=r.toJSON(),i=e.parseStyle(o.style);"style"===t.control.name()?(r.find("#borderStyle").value(i["border-style"]||"")[0].fire("select"),r.find("#borderColor").value(i["border-color"]||"")[0].fire("change"),r.find("#backgroundColor").value(i["background-color"]||"")[0].fire("change"),r.find("#width").value(i.width||"").fire("change"),r.find("#height").value(i.height||"").fire("change")):(i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?sa.addSizeSuffix(o.width):"",i.height=o.height?sa.addSizeSuffix(o.height):""),r.find("#style").value(e.serializeStyle(e.parseStyle(e.serializeStyle(i))))},Ca={createStyleForm:function(n){var t=function(){var t=n.settings.color_picker_callback;if(t)return function(e){return t.call(n,function(n){e.control.value(n).fire("change")},e.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:m.curry(xa,n)},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:m.curry(xa,n),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:t()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:t()}]}]}},buildListItems:function(n,t,e){var r=function(n,e){return e=e||[],ba.each(n,function(n){var o={text:n.text||n.title};n.menu?o.menu=r(n.menu):(o.value=n.value,t&&t(o)),e.push(o)}),e};return r(n,e||[])},updateStyleField:xa,extractAdvancedStyles:function(n,t){var e=n.parseStyle(n.getAttrib(t,"style")),r={};return e["border-style"]&&(r.borderStyle=e["border-style"]),e["border-color"]&&(r.borderColor=e["border-color"]),e["background-color"]&&(r.backgroundColor=e["background-color"]),r.style=n.serializeStyle(e),r}};function Sa(n,t,e,r){if("TD"===t.tagName||"TH"===t.tagName)n.setStyle(t,e,r);else if(t.children)for(var o=0;o<t.children.length;o++)Sa(n,t.children[o],e,r)}var Ra=function(n,t,e){var r,o,i=n.dom;Ca.updateStyleField(n,e),!1===(o=e.control.rootControl.toJSON())["class"]&&delete o["class"],n.undoManager.transact(function(){t||(t=Pr.insert(n,o.cols||1,o.rows||1)),function(n,t,e){var r=n.dom,o={},i={};if(o["class"]=e["class"],i.height=sa.addSizeSuffix(e.height),r.getAttrib(t,"width")&&!n.settings.table_style_by_css?o.width=sa.removePxSuffix(e.width):i.width=sa.addSizeSuffix(e.width),n.settings.table_style_by_css?(i["border-width"]=sa.addSizeSuffix(e.border),i["border-spacing"]=sa.addSizeSuffix(e.cellspacing),ba.extend(o,{"data-mce-border-color":e.borderColor,"data-mce-cell-padding":e.cellpadding,"data-mce-border":e.border})):ba.extend(o,{border:e.border,cellpadding:e.cellpadding,cellspacing:e.cellspacing}),n.settings.table_style_by_css&&t.children)for(var u=0;u<t.children.length;u++)Sa(r,t.children[u],{"border-width":sa.addSizeSuffix(e.border),"border-color":e.borderColor,padding:sa.addSizeSuffix(e.cellpadding)});e.style?ba.extend(i,r.parseStyle(e.style)):i=ba.extend({},r.parseStyle(r.getAttrib(t,"style")),i),o.style=r.serializeStyle(i),r.setAttribs(t,o)}(n,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=wa.ie?"\xa0":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),ya.unApplyAlign(n,t),o.align&&ya.applyAlign(n,t,o.align),n.focus(),n.addVisual()})},Ta=function(n,t){var e,r,o,i,u,a,c,l,s,f=n.dom,d={};!0===t?(e=f.getParent(n.selection.getStart(),"table"))&&(c=e,l=(a=n).dom,s={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||ya.getTDTHOverallStyle(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||ya.getTDTHOverallStyle(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},ba.each("left center right".split(" "),function(n){a.formatter.matchNode(c,"align"+n)&&(s.align=n)}),!1!==a.settings.table_advtab&&ba.extend(s,Ca.extractAdvancedStyles(l,c)),d=s):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),n.settings.table_class_list&&(d["class"]&&(d["class"]=d["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:Ca.buildListItems(n.settings.table_class_list,function(t){t.value&&(t.textStyle=function(){return n.formatter.getCssText({block:"table",classes:[t.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:!1!==n.settings.table_appearance_options?[r,o,{label:"Width",name:"width",onchange:m.curry(Ca.updateStyleField,n)},{label:"Height",name:"height",onchange:m.curry(Ca.updateStyleField,n)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:m.curry(Ca.updateStyleField,n)},{label:"Height",name:"height",onchange:m.curry(Ca.updateStyleField,n)}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},!1!==n.settings.table_advtab?n.windowManager.open({title:"Table properties",data:d,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Ca.createStyleForm(n)],onsubmit:m.curry(Ra,n,e)}):n.windowManager.open({title:"Table properties",data:d,body:u,onsubmit:m.curry(Ra,n,e)})},Da=function(n,t,e){var r=n.getParent(t,"table"),o=t.parentNode,i=n.select(e,r)[0];i||(i=n.create(e),r.firstChild?"CAPTION"===r.firstChild.nodeName?n.insertAfter(i,r.firstChild):r.insertBefore(i,r.firstChild):r.appendChild(i)),i.appendChild(t),o.hasChildNodes()||n.remove(o)};function Aa(n,t,e){var r,o=n.dom;function i(n,t,e){e&&o.setAttrib(n,t,e)}Ca.updateStyleField(n,e),r=e.control.rootControl.toJSON(),n.undoManager.transact(function(){ba.each(t,function(e){var u,a,c;i(e,"scope",r.scope),i(e,"style",r.style),i(e,"class",r["class"]),u=e,a="height",(c=sa.addSizeSuffix(r.height))&&o.setStyle(u,a,c),r.type!==e.parentNode.nodeName.toLowerCase()&&Da(n.dom,e,r.type),1===t.length&&ya.unApplyAlign(n,e),r.align&&ya.applyAlign(n,e,r.align)}),n.focus()})}var ka=function(n){var t,e,r,o,i,u,a,c,l,s,f=n.dom,d=[];t=f.getParent(n.selection.getStart(),"table"),e=f.getParent(n.selection.getStart(),"td,th"),ba.each(t.rows,function(n){ba.each(n.cells,function(t){if(f.getAttrib(t,"data-mce-selected")||t===e)return d.push(n),!1})}),(r=d[0])&&(d.length>1?i={height:"",scope:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=n).dom,(s={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class")}).type=c.parentNode.nodeName.toLowerCase(),ba.each("left center right".split(" "),function(n){a.formatter.matchNode(c,"align"+n)&&(s.align=n)}),!1!==a.settings.table_row_advtab&&ba.extend(s,Ca.extractAdvancedStyles(l,c)),i=s),n.settings.table_row_class_list&&(o={name:"class",type:"listbox",label:"Class",values:Ca.buildListItems(n.settings.table_row_class_list,function(t){t.value&&(t.textStyle=function(){return n.formatter.getCssText({block:"tr",classes:[t.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},!1!==n.settings.table_row_advtab?n.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Ca.createStyleForm(n)],onsubmit:m.curry(Aa,n,d)}):n.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:m.curry(Aa,n,d)}))},Na=function(n,t,e){var r,o=n.dom;function i(n,t,e){e&&o.setAttrib(n,t,e)}function u(n,t,e){e&&o.setStyle(n,t,e)}Ca.updateStyleField(n,e),r=e.control.rootControl.toJSON(),n.undoManager.transact(function(){ba.each(t,function(e){var a,c;i(e,"scope",r.scope),1===t.length?i(e,"style",r.style):(a=e,c=r.style,a.style.cssText+=";"+c),i(e,"class",r["class"]),u(e,"width",sa.addSizeSuffix(r.width)),u(e,"height",sa.addSizeSuffix(r.height)),r.type&&e.nodeName.toLowerCase()!==r.type&&(e=o.rename(e,r.type)),1===t.length&&(ya.unApplyAlign(n,e),ya.unApplyVAlign(n,e)),r.align&&ya.applyAlign(n,e,r.align),r.valign&&ya.applyVAlign(n,e,r.valign)}),n.focus()})},Oa=function(n){var t,e,r,o=[];if(o=n.dom.select("td[data-mce-selected],th[data-mce-selected]"),t=n.dom.getParent(n.selection.getStart(),"td,th"),!o.length&&t&&o.push(t),t=t||o[0]){var i,u,a,c;o.length>1?e={width:"",height:"",scope:"","class":"",align:"",style:"",type:t.nodeName.toLowerCase()}:(u=t,a=(i=n).dom,(c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class")}).type=u.nodeName.toLowerCase(),ba.each("left center right".split(" "),function(n){i.formatter.matchNode(u,"align"+n)&&(c.align=n)}),ba.each("top middle bottom".split(" "),function(n){i.formatter.matchNode(u,"valign"+n)&&(c.valign=n)}),!1!==i.settings.table_cell_advtab&&ba.extend(c,Ca.extractAdvancedStyles(a,u)),e=c),n.settings.table_cell_class_list&&(r={name:"class",type:"listbox",label:"Class",values:Ca.buildListItems(n.settings.table_cell_class_list,function(t){t.value&&(t.textStyle=function(){return n.formatter.getCssText({block:"td",classes:[t.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:m.curry(Ca.updateStyleField,n)},{label:"Height",name:"height",onchange:m.curry(Ca.updateStyleField,n)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};!1!==n.settings.table_cell_advtab?n.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:e,body:[{title:"General",type:"form",items:l},Ca.createStyleForm(n)],onsubmit:m.curry(Na,n,o)}):n.windowManager.open({title:"Cell properties",data:e,body:l,onsubmit:m.curry(Na,n,o)})}},Ea=ba.each,Ba=w.none(),Ia={registerCommands:function(n,t,e,r){var o=sa.getIsRoot(n),i=function(){return en.fromDom(n.dom.getParent(n.selection.getStart(),"th,td"))},u=function(n){return Vt(n,o)},a=function(t){var o=i();u(o).each(function(i){var u=kr.forMenu(r,i,o);t(i,u).each(function(t){n.selection.setRng(t),n.focus(),e.clear(i)})})},c=function(t){var e=i();return u(e).bind(function(t){var o=en.fromDom(n.getDoc()),i=kr.forMenu(r,t,e),u=Oe(m.noop,o,w.none());return va(t,i,u)})},l=function(t){Ba.each(function(o){var a=B.map(o,function(n){return he(n)}),c=i();u(c).bind(function(o){var i=en.fromDom(n.getDoc()),u=Ee(i),l=kr.pasteRows(r,o,c,a,u);t(o,l).each(function(t){n.selection.setRng(t),n.focus(),e.clear(o)})})})};Ea({mceTableSplitCells:function(){a(t.unmergeCells)},mceTableMergeCells:function(){a(t.mergeCells)},mceTableInsertRowBefore:function(){a(t.insertRowsBefore)},mceTableInsertRowAfter:function(){a(t.insertRowsAfter)},mceTableInsertColBefore:function(){a(t.insertColumnsBefore)},mceTableInsertColAfter:function(){a(t.insertColumnsAfter)},mceTableDeleteCol:function(){a(t.deleteColumn)},mceTableDeleteRow:function(){a(t.deleteRow)},mceTableCutRow:function(n){Ba=c(),a(t.deleteRow)},mceTableCopyRow:function(n){Ba=c()},mceTablePasteRowBefore:function(n){l(t.pasteRowsBefore)},mceTablePasteRowAfter:function(n){l(t.pasteRowsAfter)},mceTableDelete:function(){var t=en.fromDom(n.dom.getParent(n.selection.getStart(),"th,td"));Vt(t,o).filter(m.not(o)).each(function(t){var e=en.fromText("");ue.after(t,e),le.remove(t);var r=n.dom.createRng();r.setStart(e.dom(),0),r.setEnd(e.dom(),0),n.selection.setRng(r)})}},function(t,e){n.addCommand(e,t)}),Ea({mceInsertTable:m.curry(Ta,n),mceTableProps:m.curry(Ta,n,!0),mceTableRowProps:m.curry(ka,n),mceTableCellProps:m.curry(Oa,n)},function(t,e){n.addCommand(e,function(n,e){t(e)})})},getClipboardRows:function(){return Ba.fold(function(){},function(n){return B.map(n,function(n){return n.dom()})})},setClipboardRows:function(n){var t=B.map(n,en.fromDom);Ba=w.from(t)}},Pa=function(n){var t=w.from(n.dom().documentElement).map(en.fromDom).getOr(n);return{parent:m.constant(t),view:m.constant(n),origin:m.constant(oo(0,0))}},Wa=function(n,t){return{parent:m.constant(t),view:m.constant(n),origin:m.constant(oo(0,0))}},_a=function(n){var t=X.immutable.apply(null,n),e=[];return{bind:function(n){if(n===undefined)throw"Event bind error: undefined handler";e.push(n)},unbind:function(n){e=B.filter(e,function(t){return t!==n})},trigger:function(){var n=t.apply(null,arguments);B.each(e,function(t){t(n)})}}},Ma=function(n){return{registry:L.map(n,function(n){return{bind:n.bind,unbind:n.unbind}}),trigger:L.map(n,function(n){return n.trigger})}},La={mode:Ao.exactly(["compare","extract","mutate","sink"]),sink:Ao.exactly(["element","start","stop","destroy"]),api:Ao.exactly(["forceDrop","drop","move","delayDrop"])},qa={resolve:gi("ephox-dragster").resolve},za=function(n,t){return function(e){if(n(e)){var r,o,i,u,a,c,l,s=en.fromDom(e.target),f=function(){e.stopPropagation()},d=function(){e.preventDefault()},g=m.compose(d,f),p=(r=s,o=e.clientX,i=e.clientY,u=f,a=d,c=g,l=e,{target:m.constant(r),x:m.constant(o),y:m.constant(i),stop:u,prevent:a,kill:c,raw:m.constant(l)});t(p)}}},Fa=function(n,t,e,r,o){var i=za(e,r);return n.dom().addEventListener(t,i,o),{unbind:m.curry(ja,n,t,i,o)}},ja=function(n,t,e,r){n.dom().removeEventListener(t,e,r)},Ha=function(n,t,e,r){return Fa(n,t,e,r,!1)},Va=m.constant(!0),Ua=function(n,t,e){return Ha(n,t,Va,e)},Ga=La.mode({compare:function(n,t){return oo(t.left()-n.left(),t.top()-n.top())},extract:function(n){return w.some(oo(n.x(),n.y()))},sink:function(n,t){var e,r,o,i=(e=t,r=Xo.merge({layerClass:qa.resolve("blocker")},e),o=en.fromTag("div"),Dt.set(o,"role","presentation"),re.setAll(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ni.add(o,qa.resolve("blocker")),Ni.add(o,r.layerClass),{element:function(){return o},destroy:function(){le.remove(o)}}),u=Ua(i.element(),"mousedown",n.forceDrop),a=Ua(i.element(),"mouseup",n.drop),c=Ua(i.element(),"mousemove",n.move),l=Ua(i.element(),"mouseout",n.delayDrop);return La.sink({element:i.element,start:function(n){ue.append(n,i.element())},stop:function(){le.remove(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(n,t){n.mutate(t.left(),t.top())}}),Xa=function(){var n=w.none(),t=Ma({move:_a(["info"])});return{onEvent:function(e,r){r.extract(e).each(function(e){var o,i,u;(o=r,i=e,u=n.map(function(n){return o.compare(n,i)}),n=w.some(i),u).each(function(n){t.trigger.move(n)})})},reset:function(){n=w.none()},events:t.registry}},Ya=function(){var n={onEvent:function(n,t){},reset:m.noop},t=Xa(),e=n;return{on:function(){e.reset(),e=t},off:function(){e.reset(),e=n},isOn:function(){return e===t},onEvent:function(n,t){e.onEvent(n,t)},events:t.events}},$a=function(n,t){var e=null;return{cancel:function(){null!==e&&(clearTimeout(e),e=null)},throttle:function(){var r=arguments;null!==e&&clearTimeout(e),e=setTimeout(function(){n.apply(null,r),e=null,r=null},t)}}},Ka=function(n,t,e){var r=!1,o=Ma({start:_a([]),stop:_a([])}),i=Ya(),u=function(){l.stop(),i.isOn()&&(i.off(),o.trigger.stop())},a=$a(u,200);i.events.move.bind(function(e){t.mutate(n,e.info())});var c=function(n){return function(){var t=Array.prototype.slice.call(arguments,0);if(r)return n.apply(null,t)}},l=t.sink(La.api({forceDrop:u,drop:c(u),move:c(function(n,e){a.cancel(),i.onEvent(n,t)}),delayDrop:c(a.throttle)}),e);return{element:l.element,go:function(n){l.start(n),i.on(),o.trigger.start()},on:function(){r=!0},off:function(){r=!1},destroy:function(){l.destroy()},events:o.registry}},Ja=function(n,t){var e=t!==undefined?t:{},r=e.mode!==undefined?e.mode:Ga;return Ka(n,r,t)},Qa=function(){var n,t=Ma({drag:_a(["xDelta","yDelta","target"])}),e=w.none(),r={mutate:function(t,e){n.trigger.drag(t,e)},events:(n=Ma({drag:_a(["xDelta","yDelta"])})).registry};return r.events.drag.bind(function(n){e.each(function(e){t.trigger.drag(n.xDelta(),n.yDelta(),e)})}),{assign:function(n){e=w.some(n)},get:function(){return e},mutate:r.mutate,events:t.registry}},Za=function(n,t,e){return qt.ancestor(n,t,e).isSome()},nc=pi.resolve("resizer-bar-dragging"),tc=function(n,t){var e=wo.height,r=function(n,t,e){var r=Qa(),o=Ja(r,{}),i=w.none(),u=function(n,t){return w.from(Dt.get(n,t))};r.events.drag.bind(function(n){u(n.target(),"data-row").each(function(t){var e=Iu.getInt(n.target(),"top");re.set(n.target(),"top",e+n.yDelta()+"px")}),u(n.target(),"data-column").each(function(t){var e=Iu.getInt(n.target(),"left");re.set(n.target(),"left",e+n.xDelta()+"px")})});var a=function(n,t){return Iu.getInt(n,t)-parseInt(Dt.get(n,"data-initial-"+t),10)};o.events.stop.bind(function(){r.get().each(function(r){i.each(function(o){u(r,"data-row").each(function(n){var t=a(r,"top");Dt.remove(r,"data-initial-top"),d.trigger.adjustHeight(o,t,parseInt(n,10))}),u(r,"data-column").each(function(n){var t=a(r,"left");Dt.remove(r,"data-initial-left"),d.trigger.adjustWidth(o,t,parseInt(n,10))}),Mi(n,o,e,t)})})});var c=function(t,e){d.trigger.startAdjust(),r.assign(t),Dt.set(t,"data-initial-"+e,parseInt(re.get(t,e),10)),Ni.add(t,nc),re.set(t,"opacity","0.2"),o.go(n.parent())},l=Ua(n.parent(),"mousedown",function(n){Fi(n.target())&&c(n.target(),"top"),ji(n.target())&&c(n.target(),"left")}),s=function(t){return ot.eq(t,n.view())},f=Ua(n.view(),"mouseover",function(r){"table"===xt.name(r.target())||Za(r.target(),"table",s)?(i="table"===xt.name(r.target())?w.some(r.target()):qt.ancestor(r.target(),"table",s)).each(function(r){Mi(n,r,e,t)}):Nt.inBody(r.target())&&zi(n)}),d=Ma({adjustHeight:_a(["table","delta","row"]),adjustWidth:_a(["table","delta","column"]),startAdjust:_a([])});return{destroy:function(){l.unbind(),f.unbind(),o.destroy(),zi(n)},refresh:function(r){Mi(n,r,e,t)},on:o.on,off:o.off,hideBars:m.curry(Li,n),showBars:m.curry(qi,n),events:d.registry}}(n,t,e),o=Ma({beforeResize:_a(["table"]),afterResize:_a(["table"]),startDrag:_a([])});return r.events.adjustHeight.bind(function(n){o.trigger.beforeResize(n.table());var t=e.delta(n.delta(),n.table());Ju(n.table(),t,n.row(),e),o.trigger.afterResize(n.table())}),r.events.startAdjust.bind(function(n){o.trigger.startDrag()}),r.events.adjustWidth.bind(function(n){o.trigger.beforeResize(n.table());var e=t.delta(n.delta(),n.table());Ku(n.table(),e,n.column(),t),o.trigger.afterResize(n.table())}),{on:r.on,off:r.off,hideBars:r.hideBars,showBars:r.showBars,destroy:r.destroy,events:o.registry}},ec=function(n,t){return n.inline?Wa(sa.getBody(n),(e=en.fromTag("div"),re.setAll(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),ue.append(Nt.body(),e),e)):Pa(en.fromDom(n.getDoc()));var e},rc=function(n,t){n.inline&&le.remove(t.parent())},oc=function(n){var t,e,r=w.none(),o=w.none(),i=w.none(),u=/(\d+(\.\d+)?)%/,a=function(n){return"TABLE"===n.nodeName};return n.on("init",function(){var t=xo(pa),e=ec(n);if(i=w.some(e),n.settings.object_resizing&&!1!==n.settings.table_resize_bars&&(!0===n.settings.object_resizing||"table"===n.settings.object_resizing)){var u=tc(e,t);u.on(),u.events.startDrag.bind(function(t){r=w.some(n.selection.getRng())}),u.events.afterResize.bind(function(t){var e=t.table(),o=Bt.descendants(e,"td[data-mce-style],th[data-mce-style]");B.each(o,function(n){Dt.remove(n,"data-mce-style")}),r.each(function(t){n.selection.setRng(t),n.focus()}),n.undoManager.add()}),o=w.some(u)}}),n.on("ObjectResizeStart",function(r){var o;a(r.target)&&(t=r.width,o=r.target,e=n.dom.getStyle(o,"width")||n.dom.getAttrib(o,"width"))}),n.on("ObjectResized",function(r){if(a(r.target)){var o=r.target;if(u.test(e)){var i=parseFloat(u.exec(e)[1]),c=r.width*i/t;n.dom.setStyle(o,"width",c+"%")}else{var l=[];ba.each(o.rows,function(t){ba.each(t.cells,function(t){var e=n.dom.getStyle(t,"width",!0);l.push({cell:t,width:e})})}),ba.each(l,function(t){n.dom.setStyle(t.cell,"width",t.width),n.dom.setAttrib(t.cell,"width",null)})}}}),{lazyResize:function(){return o},lazyWire:function(){return i.getOr(Pa(en.fromDom(n.getBody())))},destroy:function(){o.each(function(n){n.destroy()}),i.each(function(t){rc(n,t)})}}},ic=function(n){return{fold:n}},uc=function(n){return ic(function(t,e,r,o){return t(n)})},ac=function(n){return ic(function(t,e,r,o){return e(n)})},cc=function(n,t){return ic(function(e,r,o,i){return o(n,t)})},lc=function(n){return ic(function(t,e,r,o){return o(n)})},sc=function(n,t){return Vt(n,t).bind(function(t){var e=Ht(t);return B.findIndex(e,function(t){return ot.eq(n,t)}).map(function(n){return{index:m.constant(n),all:m.constant(e)}})})},fc=function(n,t){return sc(n,t).fold(function(){return uc(n)},function(t){return t.index()+1<t.all().length?cc(n,t.all()[t.index()+1]):lc(n)})},dc=function(n,t){return sc(n,t).fold(function(){return uc()},function(t){return t.index()-1>=0?cc(n,t.all()[t.index()-1]):ac(n)})},mc=wr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),gc={before:mc.before,on:mc.on,after:mc.after,cata:function(n,t,e,r){return n.fold(t,e,r)},getStart:function(n){return n.fold(m.identity,m.identity,m.identity)}},pc=wr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),hc=X.immutable("start","soffset","finish","foffset"),vc={domRange:pc.domRange,relative:pc.relative,exact:pc.exact,exactFromRange:function(n){return pc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},range:hc,getWin:function(n){var t=n.match({domRange:function(n){return en.fromDom(n.startContainer)},relative:function(n,t){return gc.getStart(n)},exact:function(n,t,e,r){return n}});return dt.defaultView(t)}},bc=function(n,t,e,r){var o=dt.owner(n).dom().createRange();return o.setStart(n.dom(),t),o.setEnd(e.dom(),r),o},wc=function(n,t,e,r){var o=bc(n,t,e,r),i=ot.eq(n,e)&&t===r;return o.collapsed&&!i},yc=function(n,t){n.selectNodeContents(t.dom())},xc=function(n){n.deleteContents()},Cc=function(n){return{left:m.constant(n.left),top:m.constant(n.top),right:m.constant(n.right),bottom:m.constant(n.bottom),width:m.constant(n.width),height:m.constant(n.height)}},Sc={create:function(n){return n.document.createRange()},replaceWith:function(n,t){xc(n),n.insertNode(t.dom())},selectNodeContents:function(n,t){var e=n.document.createRange();return yc(e,t),e},selectNodeContentsUsing:yc,relativeToNative:function(n,t,e){var r,o,i=n.document.createRange();return r=i,t.fold(function(n){r.setStartBefore(n.dom())},function(n,t){r.setStart(n.dom(),t)},function(n){r.setStartAfter(n.dom())}),o=i,e.fold(function(n){o.setEndBefore(n.dom())},function(n,t){o.setEnd(n.dom(),t)},function(n){o.setEndAfter(n.dom())}),i},exactToNative:function(n,t,e,r,o){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(r.dom(),o),i},deleteContents:xc,cloneFragment:function(n){var t=n.cloneContents();return en.fromDom(t)},getFirstRect:function(n){var t=n.getClientRects(),e=t.length>0?t[0]:n.getBoundingClientRect();return e.width>0||e.height>0?w.some(e).map(Cc):w.none()},getBounds:function(n){var t=n.getBoundingClientRect();return t.width>0||t.height>0?w.some(t).map(Cc):w.none()},isWithin:function(n,t){return t.compareBoundaryPoints(n.END_TO_START,n)<1&&t.compareBoundaryPoints(n.START_TO_END,n)>-1},toString:function(n){return n.toString()}},Rc=wr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Tc=function(n,t,e){return t(en.fromDom(e.startContainer),e.startOffset,en.fromDom(e.endContainer),e.endOffset)},Dc=function(n,t){var e,r,o,i=(e=n,t.match({domRange:function(n){return{ltr:m.constant(n),rtl:w.none}},relative:function(n,t){return{ltr:yn(function(){return Sc.relativeToNative(e,n,t)}),rtl:yn(function(){return w.some(Sc.relativeToNative(e,t,n))})}},exact:function(n,t,r,o){return{ltr:yn(function(){return Sc.exactToNative(e,n,t,r,o)}),rtl:yn(function(){return w.some(Sc.exactToNative(e,r,o,n,t))})}}}));return(o=(r=i).ltr()).collapsed?r.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Rc.rtl(en.fromDom(n.endContainer),n.endOffset,en.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Tc(0,Rc.ltr,o)}):Tc(0,Rc.ltr,o)},Ac=(Rc.ltr,Rc.rtl,Dc),kc=function(n,t){return Dc(n,t).match({ltr:function(t,e,r,o){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(r.dom(),o),i},rtl:function(t,e,r,o){var i=n.document.createRange();return i.setStart(r.dom(),o),i.setEnd(t.dom(),e),i}})},Nc=function(n,t,e){return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom},Oc=function(n,t,e,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var a=n(u),c=Math.abs(t-a.left);if(e>a.bottom);else{if(e<a.top||c>i)return u-1;i=c}}return 0},Ec={locate:function(n,t,e,r){var o=n.dom().createRange();o.selectNode(t.dom());var i=o.getClientRects();return $o(i,function(n){return Nc(n,e,r)?w.some(n):w.none()}).map(function(o){return i=n,a=e,c=r,l=o,s=function(n){var t=i.dom().createRange();return t.setStart(u.dom(),n),t.collapse(!0),t},f=we.get(u=t).length,d=Oc(function(n){return s(n).getBoundingClientRect()},a,c,l.right,f),s(d);var i,u,a,c,l,s,f,d})}},Bc=function(n,t,e,r){var o=n.dom().createRange(),i=dt.children(t);return $o(i,function(t){return o.selectNode(t.dom()),Nc(o.getBoundingClientRect(),e,r)?Ic(n,t,e,r):w.none()})},Ic=function(n,t,e,r){return(xt.isText(t)?Ec.locate:Bc)(n,t,e,r)},Pc=function(n,t,e,r){var o=n.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,r));return Ic(n,t,u,a)},Wc=function(n,t){return t-n.left<n.right-t},_c=function(n,t,e){var r=n.dom().createRange();return r.selectNode(t.dom()),r.collapse(e),r},Mc=function(n,t,e){var r=n.dom().createRange();r.selectNode(t.dom());var o=r.getBoundingClientRect(),i=Wc(o,e);return(!0===i?Te.first:Te.last)(t).map(function(t){return _c(n,t,i)})},Lc=function(n,t,e){var r=t.dom().getBoundingClientRect(),o=Wc(r,e);return w.some(_c(n,t,o))},qc=function(n,t,e){return(0===dt.children(t).length?Lc:Mc)(n,t,e)},zc=document.caretPositionFromPoint?function(n,t,e){return w.from(n.dom().caretPositionFromPoint(t,e)).bind(function(t){if(null===t.offsetNode)return w.none();var e=n.dom().createRange();return e.setStart(t.offsetNode,t.offset),e.collapse(),w.some(e)})}:document.caretRangeFromPoint?function(n,t,e){return w.from(n.dom().caretRangeFromPoint(t,e))}:function(n,t,e){return en.fromPoint(n,t,e).bind(function(r){var o=function(){return qc(n,r,t)};return 0===dt.children(r).length?o():function(n,t,e,r){var o=n.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,r));return Pc(n,t,u,a)}(n,r,t,e).orThunk(o)})},Fc=function(n,t,e){var r=en.fromDom(n.document);return zc(r,t,e).map(function(n){return vc.range(en.fromDom(n.startContainer),n.startOffset,en.fromDom(n.endContainer),n.endOffset)})},jc=function(n,t){var e=xt.name(n);return"input"===e?gc.after(n):B.contains(["br","img"],e)?0===t?gc.before(n):gc.after(n):gc.on(n,t)},Hc=function(n,t){var e=n.fold(gc.before,jc,gc.after),r=t.fold(gc.before,jc,gc.after);return vc.relative(e,r)},Vc=function(n,t,e,r){var o=jc(n,t),i=jc(e,r);return vc.relative(o,i)},Uc=function(n){return n.match({domRange:function(n){var t=en.fromDom(n.startContainer),e=en.fromDom(n.endContainer);return Vc(t,n.startOffset,e,n.endOffset)},relative:Hc,exact:Vc})},Gc=Hc,Xc=Vc,Yc=function(n,t){w.from(n.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(t)})},$c=function(n,t,e,r,o){var i=Sc.exactToNative(n,t,e,r,o);Yc(n,i)},Kc=function(n,t){return Ac(n,t).match({ltr:function(t,e,r,o){$c(n,t,e,r,o)},rtl:function(t,e,r,o){var i=n.getSelection();i.extend?(i.collapse(t.dom(),e),i.extend(r.dom(),o)):$c(n,r,o,t,e)}})},Jc=function(n){var t=en.fromDom(n.anchorNode),e=en.fromDom(n.focusNode);return wc(t,n.anchorOffset,e,n.focusOffset)?w.some(vc.range(en.fromDom(n.anchorNode),n.anchorOffset,en.fromDom(n.focusNode),n.focusOffset)):function(n){if(n.rangeCount>0){var t=n.getRangeAt(0),e=n.getRangeAt(n.rangeCount-1);return w.some(vc.range(en.fromDom(t.startContainer),t.startOffset,en.fromDom(e.endContainer),e.endOffset))}return w.none()}(n)},Qc=function(n){var t=n.getSelection();return t.rangeCount>0?Jc(t):w.none()},Zc=function(n,t,e,r,o){var i=Xc(t,e,r,o);Kc(n,i)},nl=function(n){return Qc(n).map(function(n){return vc.exact(n.start(),n.soffset(),n.finish(),n.foffset())})},tl=function(n,t,e){var r=Gc(t,e);Kc(n,r)},el=function(n){var t=vc.getWin(n).dom(),e=function(n,e,r,o){return Sc.exactToNative(t,n,e,r,o)},r=Uc(n);return Ac(t,r).match({ltr:e,rtl:e})},rl=function(n,t){var e=Sc.selectNodeContents(n,t);Yc(n,e)},ol=function(n){n.getSelection().removeAllRanges()},il=function(n,t){var e=kc(n,t);return Sc.getFirstRect(e)},ul=function(n,t,e){return Fc(n,t,e)},al=tinymce.util.Tools.resolve("tinymce.util.VK"),cl=function(n,t,e,r){return fl(n,t,fc(e),r)},ll=function(n,t,e,r){return fl(n,t,dc(e),r)},sl=function(n,t){var e=vc.exact(t,0,t,0);return el(e)},fl=function(n,t,e,r,o){return e.fold(w.none,w.none,function(n,t){return Te.first(t).map(function(n){return sl(0,n)})},function(e){return Vt(e,t).bind(function(t){var o,i=kr.noMenu(e);return n.undoManager.transact(function(){r.insertRowsAfter(t,i)}),o=Bt.descendants(t,"tr"),B.last(o).bind(function(n){return qt.descendant(n,"td,th").map(function(n){return sl(0,n)})})})})},dl=["table","li","dl"],ml={handle:function(n,t,e,r){if(n.keyCode===al.TAB){var o=sa.getBody(t),i=function(n){var t=xt.name(n);return ot.eq(n,o)||B.contains(dl,t)},u=t.selection.getRng();if(u.collapsed){var a=en.fromDom(u.startContainer);jt(a,i).each(function(o){n.preventDefault(),(n.shiftKey?ll:cl)(t,i,o,e,r).each(function(n){t.selection.setRng(n)})})}}}},gl={response:X.immutable("selection","kill")},pl=function(n){return function(t){return t===n}},hl=pl(38),vl=pl(40),bl={ltr:{isBackward:pl(37),isForward:pl(39)},rtl:{isBackward:pl(39),isForward:pl(37)},isUp:hl,isDown:vl,isNavigation:function(n){return n>=37&&n<=40}},wl=function(n,t){var e=kc(n,t);return{start:m.constant(en.fromDom(e.startContainer)),soffset:m.constant(e.startOffset),finish:m.constant(en.fromDom(e.endContainer)),foffset:m.constant(e.endOffset)}},yl=function(n,t,e,r){return{start:m.constant(gc.on(n,t)),finish:m.constant(gc.on(e,r))}},xl=(tt.detect().browser.isSafari(),function(n){var t=n!==undefined?n.dom():document,e=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return oo(e,r)}),Cl=xl,Sl=function(n,t,e){(e!==undefined?e.dom():document).defaultView.scrollBy(n,t)},Rl=function(n){return{elementFromPoint:function(t,e){return w.from(n.document.elementFromPoint(t,e)).map(en.fromDom)},getRect:function(n){return n.dom().getBoundingClientRect()},getRangedRect:function(t,e,r,o){var i=vc.exact(t,e,r,o);return il(n,i).map(function(n){return L.map(n,m.apply)})},getSelection:function(){return nl(n).map(function(t){return wl(n,t)})},fromSitus:function(t){var e=vc.relative(t.start(),t.finish());return wl(n,e)},situsFromPoint:function(t,e){return ul(n,t,e).map(function(n){return{start:m.constant(gc.on(n.start(),n.soffset())),finish:m.constant(gc.on(n.finish(),n.foffset()))}})},clearSelection:function(){ol(n)},setSelection:function(t){Zc(n,t.start(),t.soffset(),t.finish(),t.foffset())},setRelativeSelection:function(t,e){tl(n,t,e)},selectContents:function(t){rl(n,t)},getInnerHeight:function(){return n.innerHeight},getScrollY:function(){return Cl(en.fromDom(n.document)).top()},scrollBy:function(t,e){Sl(t,e,en.fromDom(n.document))}}},Tl=function(n,t,e,r,o){if(!ot.eq(e,r))return lr(e,r,t).bind(function(t){var r=t.boxes().getOr([]);return r.length>0?(o(n,r,t.start(),t.finish()),w.some(gl.response(w.some(yl(e,0,e,Ce(e))),!0))):w.none()})},Dl={sync:function(n,t,e,r,o,i,u){return ot.eq(e,o)&&r===i?w.none():qt.closest(e,"td,th",t).bind(function(e){return qt.closest(o,"td,th",t).bind(function(r){return Tl(n,t,e,r,u)})})},detect:Tl,update:function(n,t,e,r,o){return fr(r,n,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(n){return o.clear(e),o.selectRange(e,n.boxes(),n.start(),n.finish()),n.boxes()})}},Al=X.immutableBag(["left","top","right","bottom"],[]),kl={nu:Al,moveUp:function(n,t){return Al({left:n.left(),top:n.top()-t,right:n.right(),bottom:n.bottom()-t})},moveDown:function(n,t){return Al({left:n.left(),top:n.top()+t,right:n.right(),bottom:n.bottom()+t})},moveBottomTo:function(n,t){var e=n.bottom()-n.top();return Al({left:n.left(),top:t-e,right:n.right(),bottom:t})},moveTopTo:function(n,t){var e=n.bottom()-n.top();return Al({left:n.left(),top:t,right:n.right(),bottom:t+e})},getTop:function(n){return n.top()},getBottom:function(n){return n.bottom()},translate:function(n,t,e){return Al({left:n.left()+t,top:n.top()+e,right:n.right()+t,bottom:n.bottom()+e})},toString:function(n){return"("+n.left()+", "+n.top()+") -> ("+n.right()+", "+n.bottom()+")"}},Nl=function(n){return kl.nu({left:n.left,top:n.top,right:n.right,bottom:n.bottom})},Ol=function(n,t){return w.some(n.getRect(t))},El=function(n,t,e){return xt.isElement(t)?Ol(n,t).map(Nl):xt.isText(t)?(r=n,o=t,i=e,i>=0&&i<Ce(o)?r.getRangedRect(o,i,o,i+1):i>0?r.getRangedRect(o,i-1,o,i):w.none()).map(Nl):w.none();var r,o,i},Bl=function(n,t){return xt.isElement(t)?Ol(n,t).map(Nl):xt.isText(t)?n.getRangedRect(t,0,t,Ce(t)).map(Nl):w.none()},Il=X.immutable("item","mode"),Pl=function(n,t,e,r){var o=r!==undefined?r:Wl;return n.property().parent(t).map(function(n){return Il(n,o)})},Wl=function(n,t,e,r){var o=r!==undefined?r:_l;return e.sibling(n,t).map(function(n){return Il(n,o)})},_l=function(n,t,e,r){var o=r!==undefined?r:_l,i=n.property().children(t);return e.first(i).map(function(n){return Il(n,o)})},Ml=[{current:Pl,next:Wl,fallback:w.none()},{current:Wl,next:_l,fallback:w.some(Pl)},{current:_l,next:_l,fallback:w.some(Wl)}],Ll=function(n,t,e,r,o){return o=o!==undefined?o:Ml,B.find(o,function(n){return n.current===e}).bind(function(e){return e.current(n,t,r,e.next).orThunk(function(){return e.fallback.bind(function(e){return Ll(n,t,e,r)})})})},ql={backtrack:Pl,sidestep:Wl,advance:_l,go:Ll},zl={left:function(){return{sibling:function(n,t){return n.query().prevSibling(t)},first:function(n){return n.length>0?w.some(n[n.length-1]):w.none()}}},right:function(){return{sibling:function(n,t){return n.query().nextSibling(t)},first:function(n){return n.length>0?w.some(n[0]):w.none()}}}},Fl=function(n,t,e,r,o,i){return ql.go(n,t,r,o).bind(function(t){return i(t.item())?w.none():e(t.item())?w.some(t.item()):Fl(n,t.item(),e,t.mode(),o,i)})},jl=function(n,t,e,r){return Fl(n,t,e,ql.sidestep,zl.left(),r)},Hl=function(n,t,e,r){return Fl(n,t,e,ql.sidestep,zl.right(),r)},Vl=function(n,t){return 0===n.property().children(t).length},Ul=function(n,t,e,r){return jl(n,t,e,r)},Gl=function(n,t,e,r){return Hl(n,t,e,r)},Xl={before:function(n,t,e){return Ul(n,t,m.curry(Vl,n),e)},after:function(n,t,e){return Gl(n,t,m.curry(Vl,n),e)},seekLeft:Ul,seekRight:Gl,walkers:function(){return{left:zl.left,right:zl.right}},walk:function(n,t,e,r,o){return ql.go(n,t,e,r,o)},backtrack:ql.backtrack,sidestep:ql.sidestep,advance:ql.advance},Yl=Pe(),$l={gather:function(n,t,e){return Xl.gather(Yl,n,t,e)},before:function(n,t){return Xl.before(Yl,n,t)},after:function(n,t){return Xl.after(Yl,n,t)},seekLeft:function(n,t,e){return Xl.seekLeft(Yl,n,t,e)},seekRight:function(n,t,e){return Xl.seekRight(Yl,n,t,e)},walkers:function(){return Xl.walkers()},walk:function(n,t,e,r){return Xl.walk(Yl,n,t,e,r)}},Kl=wr([{none:[]},{retry:["caret"]}]),Jl=function(n,t,e){return Mt.closest(t,zo).fold(m.constant(!1),function(t){return Bl(n,t).exists(function(n){return r=n,(t=e).left()<r.left()||Math.abs(r.right()-t.left())<1||t.left()>r.right();var t,r})})},Ql={point:kl.getTop,adjuster:function(n,t,e,r,o){var i=kl.moveUp(o,5);return Math.abs(e.top()-r.top())<1?Kl.retry(i):e.bottom()<o.top()?Kl.retry(i):e.bottom()===o.top()?Kl.retry(kl.moveUp(o,1)):Jl(n,t,o)?Kl.retry(kl.translate(i,5,0)):Kl.none()},move:kl.moveUp,gather:$l.before},Zl={point:kl.getBottom,adjuster:function(n,t,e,r,o){var i=kl.moveDown(o,5);return Math.abs(e.bottom()-r.bottom())<1?Kl.retry(i):e.top()>o.bottom()?Kl.retry(i):e.top()===o.bottom()?Kl.retry(kl.moveDown(o,1)):Jl(n,t,o)?Kl.retry(kl.translate(i,5,0)):Kl.none()},move:kl.moveDown,gather:$l.after},ns=function(n,t,e,r,o){return 0===o?w.some(r):(c=n,l=r.left(),s=t.point(r),c.elementFromPoint(l,s).filter(function(n){return"table"===xt.name(n)}).isSome()?(u=r,a=o-1,ns(n,i=t,e,i.move(u,5),a)):n.situsFromPoint(r.left(),t.point(r)).bind(function(i){return i.start().fold(w.none,function(i,u){return Bl(n,i,u).bind(function(u){return t.adjuster(n,i,u,e,r).fold(w.none,function(r){return ns(n,t,e,r,o-1)})}).orThunk(function(){return w.some(r)})},w.none)}));var i,u,a,c,l,s},ts=function(n,t,e){var r,o,i,u=n.move(e,5),a=ns(t,n,e,u,100).getOr(u);return(r=n,o=a,i=t,r.point(o)>i.getInnerHeight()?w.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?w.some(-r.point(o)):w.none()).fold(function(){return t.situsFromPoint(a.left(),n.point(a))},function(e){return t.scrollBy(0,e),t.situsFromPoint(a.left(),n.point(a)-e)})},es={tryUp:m.curry(ts,Ql),tryDown:m.curry(ts,Zl),ieTryUp:function(n,t){return n.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(n,t){return n.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:m.constant(5)},rs=wr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),os=function(n){return qt.closest(n,"tr")},is={verify:function(n,t,e,r,o,i,u){return qt.closest(r,"td,th",u).bind(function(e){return qt.closest(t,"td,th",u).map(function(t){return ot.eq(e,t)?ot.eq(r,e)&&Ce(e)===o?i(t):rs.none("in same cell"):Ve(os,[e,t]).fold(function(){return o=t,u=e,a=(r=n).getRect(o),(c=r.getRect(u)).right>a.left&&c.left<a.right?rs.success():i(t);var r,o,u,a,c},function(n){return i(t)})})}).getOr(rs.none("default"))},cata:function(n,t,e,r,o){return n.fold(t,e,r,o)},adt:rs},us={point:X.immutable("element","offset"),delta:X.immutable("element","deltaOffset"),range:X.immutable("element","start","finish"),points:X.immutable("begin","end"),text:X.immutable("element","text")},as=(X.immutable("ancestor","descendants","element","index"),X.immutable("parent","children","element","index")),cs=function(n,t){return B.findIndex(n,m.curry(ot.eq,t))},ls=function(n){return dt.parent(n).bind(function(t){var e=dt.children(t);return cs(e,n).map(function(r){return as(t,e,n,r)})})},ss=function(n){return"br"===xt.name(n)},fs=function(n,t,e){return t(n,e).bind(function(n){return xt.isText(n)&&0===we.get(n).trim().length?fs(n,t,e):w.some(n)})},ds=function(n,t,e,r){return(o=t,i=e,dt.child(o,i).filter(ss).orThunk(function(){return dt.child(o,i-1).filter(ss)})).bind(function(t){return r.traverse(t).fold(function(){return fs(t,r.gather,n).map(r.relative)},function(n){return ls(n).map(function(n){return gc.on(n.parent(),n.index())})})});var o,i},ms=function(n,t,e,r){var o,i,u;return(ss(t)?(o=n,i=t,(u=r).traverse(i).orThunk(function(){return fs(i,u.gather,o)}).map(u.relative)):ds(n,t,e,r)).map(function(n){return{start:m.constant(n),finish:m.constant(n)}})},gs=function(n){return is.cata(n,function(n){return w.none("BR ADT: none")},function(){return w.none()},function(n){return w.some(us.point(n,0))},function(n){return w.some(us.point(n,Ce(n)))})},ps=tt.detect(),hs=function(n,t,e,r,o,i){return 0===i?w.none():ws(n,t,e,r,o).bind(function(u){var a=n.fromSitus(u),c=is.verify(n,e,r,a.finish(),a.foffset(),o.failure,t);return is.cata(c,function(){return w.none()},function(){return w.some(u)},function(u){return ot.eq(e,u)&&0===r?vs(n,e,r,kl.moveUp,o):hs(n,t,u,0,o,i-1)},function(u){return ot.eq(e,u)&&r===Ce(u)?vs(n,e,r,kl.moveDown,o):hs(n,t,u,Ce(u),o,i-1)})})},vs=function(n,t,e,r,o){return El(n,t,e).bind(function(t){return bs(n,o,r(t,es.getJumpSize()))})},bs=function(n,t,e){return ps.browser.isChrome()||ps.browser.isSafari()||ps.browser.isFirefox()||ps.browser.isEdge()?t.otherRetry(n,e):ps.browser.isIE()?t.ieRetry(n,e):w.none()},ws=function(n,t,e,r,o){return El(n,e,r).bind(function(t){return bs(n,o,t)})},ys=function(n,t,e){return(r=n,o=t,i=e,r.getSelection().bind(function(n){return ms(o,n.finish(),n.foffset(),i).fold(function(){return w.some(us.point(n.finish(),n.foffset()))},function(t){var e=r.fromSitus(t),u=is.verify(r,n.finish(),n.foffset(),e.finish(),e.foffset(),i.failure,o);return gs(u)})})).bind(function(r){return hs(n,t,r.element(),r.offset(),e,20).map(n.fromSitus)});var r,o,i},xs=function(n,t,e){return Mt.ancestor(n,t,e).isSome()},Cs=tt.detect(),Ss=function(n,t,e,r,o){return qt.closest(r,"td,th",t).bind(function(r){return qt.closest(r,"table",t).bind(function(i){return u=i,xs(o,function(n){return dt.parent(n).exists(function(n){return ot.eq(n,u)})})?ys(n,t,e).bind(function(n){return qt.closest(n.finish(),"td,th",t).map(function(t){return{start:m.constant(r),finish:m.constant(t),range:m.constant(n)}})}):w.none();var u})})},Rs=function(n,t,e,r,o,i){return Cs.browser.isIE()?w.none():i(r,t).orThunk(function(){return Ss(n,t,e,r,o).map(function(n){var t=n.range();return gl.response(w.some(yl(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Ts=function(n,t,e,r,o,i,u){return Ss(n,e,r,o,i).bind(function(n){return Dl.detect(t,e,n.start(),n.finish(),u)})},Ds=function(n,t){return qt.closest(n,"tr",t).bind(function(n){return qt.closest(n,"table",t).bind(function(e){var r=Bt.descendants(e,"tr");return ot.eq(n,r[0])?$l.seekLeft(e,function(n){return Te.last(n).isSome()},t).map(function(n){var t=Ce(n);return gl.response(w.some(yl(n,t,n,t)),!0)}):w.none()})})},As=function(n,t){return qt.closest(n,"tr",t).bind(function(n){return qt.closest(n,"table",t).bind(function(e){var r=Bt.descendants(e,"tr");return ot.eq(n,r[r.length-1])?$l.seekRight(e,function(n){return Te.first(n).isSome()},t).map(function(n){return gl.response(w.some(yl(n,0,n,0)),!0)}):w.none()})})},ks=function(n,t){return qt.closest(n,"td,th",t)},Ns={down:{traverse:dt.nextSibling,gather:$l.after,relative:gc.before,otherRetry:es.tryDown,ieRetry:es.ieTryDown,failure:is.adt.failedDown},up:{traverse:dt.prevSibling,gather:$l.before,relative:gc.before,otherRetry:es.tryUp,ieRetry:es.ieTryUp,failure:is.adt.failedUp}},Os=X.immutable("rows","cols"),Es=function(n,t,e,r){var o,i,u,a,c,l,s=Rl(n),f=(o=s,i=t,u=e,a=r,c=w.none(),l=function(){c=w.none()},{mousedown:function(n){a.clear(i),c=ks(n.target(),u)},mouseover:function(n){c.each(function(t){a.clear(i),ks(n.target(),u).each(function(n){lr(t,n,u).each(function(e){var r=e.boxes().getOr([]);(r.length>1||1===r.length&&!ot.eq(t,n))&&(a.selectRange(i,r,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){c.each(l)}});return{mousedown:f.mousedown,mouseover:f.mouseover,mouseup:f.mouseup}},Bs=function(n,t,e,r){var o=Rl(n),i=function(){return r.clear(t),w.none()};return{keydown:function(n,u,a,c,l,s){var f=n.raw().which,d=!0===n.raw().shiftKey;return sr(t,r.selectedSelector()).fold(function(){return bl.isDown(f)&&d?m.curry(Ts,o,t,e,Ns.down,c,u,r.selectRange):bl.isUp(f)&&d?m.curry(Ts,o,t,e,Ns.up,c,u,r.selectRange):bl.isDown(f)?m.curry(Rs,o,e,Ns.down,c,u,As):bl.isUp(f)?m.curry(Rs,o,e,Ns.up,c,u,Ds):w.none},function(n){var e=function(e){return function(){return $o(e,function(e){return Dl.update(e.rows(),e.cols(),t,n,r)}).fold(function(){return dr(t,r.firstSelectedSelector(),r.lastSelectedSelector()).map(function(n){var e=bl.isDown(f)||s.isForward(f)?gc.after:gc.before;return o.setRelativeSelection(gc.on(n.first(),0),e(n.table())),r.clear(t),gl.response(w.none(),!0)})},function(n){return w.some(gl.response(w.none(),!0))})}};return bl.isDown(f)&&d?e([Os(1,0)]):bl.isUp(f)&&d?e([Os(-1,0)]):s.isBackward(f)&&d?e([Os(0,-1),Os(-1,0)]):s.isForward(f)&&d?e([Os(0,1),Os(1,0)]):bl.isNavigation(f)&&!1===d?i:w.none})()},keyup:function(n,o,i,u,a){return sr(t,r.selectedSelector()).fold(function(){var c=n.raw().which;return 0==(!0===n.raw().shiftKey)?w.none():bl.isNavigation(c)?Dl.sync(t,e,o,i,u,a,r.selectRange):w.none()},w.none)}}},Is=function(n){var t=function(t){Dt.remove(t,n.selected()),Dt.remove(t,n.firstSelected()),Dt.remove(t,n.lastSelected())},e=function(t){Dt.set(t,n.selected(),"1")},r=function(e){var r=Bt.descendants(e,n.selectedSelector());B.each(r,t)};return{clear:r,selectRange:function(t,o,i,u){r(t),B.each(o,e),Dt.set(i,n.firstSelected(),"1"),Dt.set(u,n.lastSelected(),"1")},selectedSelector:n.selectedSelector,firstSelectedSelector:n.firstSelectedSelector,lastSelectedSelector:n.lastSelectedSelector}},Ps=function(n,t){var e=X.immutableBag(["mousedown","mouseover","mouseup","keyup","keydown"],[]),r=w.none(),o=Is(br);return n.on("init",function(i){var u=n.getWin(),a=sa.getBody(n),c=sa.getIsRoot(n),l=Es(u,a,c,o),s=Bs(u,a,c,o),f=function(t,e){e.kill()&&t.kill(),e.selection().each(function(t){var e=vc.relative(t.start(),t.finish()),r=kc(u,e);n.selection.setRng(r)})},d=function(t){var e=h(t);if(e.raw().shiftKey&&bl.isNavigation(e.raw().which)){var r=n.selection.getRng(),o=en.fromDom(r.startContainer),i=en.fromDom(r.endContainer);s.keyup(e,o,r.startOffset,i,r.endOffset).each(function(n){f(e,n)})}},g=function(n){return!(Dt.has(n,"data-mce-bogus")||"br"===xt.name(n)||xt.isText(n)&&0===we.get(n).length)},p=function(e){var r,o,i=h(e);t().each(function(n){n.hideBars()}),40===e.which&&(r=en.fromDom(n.getBody()),o=function(n){return dt.prevSibling(n).bind(function(n){return g(n)?w.some(n):o(n)})},dt.lastChild(r).bind(function(n){return g(n)?w.some(n):o(n)})).each(function(t){"table"===xt.name(t)&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs,"<br/>"):n.dom.add(n.getBody(),"br"))});var u=n.selection.getRng(),a=en.fromDom(n.selection.getStart()),c=en.fromDom(u.startContainer),l=en.fromDom(u.endContainer),d=pa(a).isRtl()?bl.rtl:bl.ltr;s.keydown(i,c,u.startOffset,l,u.endOffset,d).each(function(n){f(i,n)}),t().each(function(n){n.showBars()})},h=function(n){var t=en.fromDom(n.target),e=function(){n.stopPropagation()},r=function(){n.preventDefault()},o=m.compose(r,e);return{target:m.constant(t),x:m.constant(n.x),y:m.constant(n.y),stop:e,prevent:r,kill:o,raw:m.constant(n)}},v=function(n){return 0===n.button},b=function(n){v(n)&&l.mousedown(h(n))},y=function(n){var t;((t=n).buttons===undefined||0!=(1&t.buttons))&&l.mouseover(h(n))},x=function(n){v&&l.mouseup(h(n))};n.on("mousedown",b),n.on("mouseover",y),n.on("mouseup",x),n.on("keyup",d),n.on("keydown",p),n.on("nodechange",function(){var t=n.selection,e=en.fromDom(t.getStart()),r=en.fromDom(t.getEnd()),i=Vt(e),u=Vt(r);i.bind(function(n){return u.bind(function(t){return ot.eq(n,t)?w.some(!0):w.none()})}).fold(function(){o.clear(a)},m.noop)}),r=w.some(e({mousedown:b,mouseover:y,mouseup:x,keyup:d,keydown:p}))}),{clear:o.clear,destroy:function(){r.each(function(n){})}}},Ws=function(n){return{get:function(){var t=sa.getBody(n);return mr(t,br.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?xr.none():xr.single(n.selection)},function(n){return xr.multiple(n)})}}},_s=ba.each,Ms={addButtons:function(n){var t=[];function e(t){return function(){n.execCommand(t)}}_s("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?t.push({text:"-"}):t.push(n.menuItems[e])}),n.addButton("table",{type:"menubutton",title:"Table",menu:t}),n.addButton("tableprops",{title:"Table properties",onclick:m.curry(Ta,n,!0),icon:"table"}),n.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),n.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),n.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),n.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),n.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),n.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),n.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),n.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),n.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),n.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),n.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),n.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),n.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),n.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),n.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},addToolbars:function(n){var t=n.settings.table_toolbar;""!==t&&!1!==t&&(t||(t="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"),n.addContextToolbar(function(t){return n.dom.is(t,"table")&&n.getBody().contains(t)},t))}},Ls={addMenuItems:function(n,t){var e=w.none(),r=[],o=[],i=[],u=[],a=function(n){n.disabled(!0)},c=function(n){n.disabled(!1)},l=function(){var n=this;r.push(n),e.fold(function(){a(n)},function(t){c(n)})},s=function(){var n=this;o.push(n),e.fold(function(){a(n)},function(t){c(n)})};n.on("init",function(){n.on("nodechange",function(l){var s=w.from(n.dom.getParent(n.selection.getStart(),"th,td"));(e=s.bind(function(n){var e=en.fromDom(n);return Vt(e).map(function(n){return kr.forMenu(t,n,e)})})).fold(function(){B.each(r,a),B.each(o,a),B.each(i,a),B.each(u,a)},function(n){B.each(r,c),B.each(o,c),B.each(i,function(t){t.disabled(n.mergable().isNone())}),B.each(u,function(t){t.disabled(n.unmergable().isNone())})})})});var f=function(n,t,e,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],s=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(e+1),s&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(s?o>=t:o<=t)&&i<=e,n.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===n.settings.table_grid?{text:"Table",icon:"table",context:"table",onclick:m.curry(Ta,n)}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(t){t.aria&&(this.parent().hideAll(),t.stopImmediatePropagation(),Ta(n))},onshow:function(){f(n,0,0,this.menu.items()[0])},onhide:function(){var t=this.menu.items()[0].getEl().getElementsByTagName("a");n.dom.removeClass(t,"mce-active"),n.dom.addClass(t[0],"mce-active")},menu:[{type:"container",html:function(){var n="";n='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){n+="<tr>";for(var e=0;e<10;e++)n+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+e)+'" href="#" data-mce-x="'+e+'" data-mce-y="'+t+'"></a></td>';n+="</tr>"}return n+="</table>",n+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(t){var e,r,o=t.target;"A"===o.tagName.toUpperCase()&&(e=parseInt(o.getAttribute("data-mce-x"),10),r=parseInt(o.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(e=9-e),e===this.lastX&&r===this.lastY||(f(n,e,r,t.control),this.lastX=e,this.lastY=r))},onclick:function(t){var e=this;"A"===t.target.tagName.toUpperCase()&&(t.preventDefault(),t.stopPropagation(),e.parent().cancel(),n.undoManager.transact(function(){Pr.insert(n,e.lastX+1,e.lastY+1)}),n.addVisual())}}]};function g(t){return function(){n.execCommand(t)}}var p={text:"Table properties",context:"table",onPostRender:l,onclick:m.curry(Ta,n,!0)},h={text:"Delete table",context:"table",onPostRender:l,cmd:"mceTableDelete"},v={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:g("mceTableInsertRowBefore"),onPostRender:s},{text:"Insert row after",onclick:g("mceTableInsertRowAfter"),onPostRender:s},{text:"Delete row",onclick:g("mceTableDeleteRow"),onPostRender:s},{text:"Row properties",onclick:g("mceTableRowProps"),onPostRender:s},{text:"-"},{text:"Cut row",onclick:g("mceTableCutRow"),onPostRender:s},{text:"Copy row",onclick:g("mceTableCopyRow"),onPostRender:s},{text:"Paste row before",onclick:g("mceTablePasteRowBefore"),onPostRender:s},{text:"Paste row after",onclick:g("mceTablePasteRowAfter"),onPostRender:s}]},b={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:g("mceTableInsertColBefore"),onPostRender:s},{text:"Insert column after",onclick:g("mceTableInsertColAfter"),onPostRender:s},{text:"Delete column",onclick:g("mceTableDeleteCol"),onPostRender:s}]},y={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:g("mceTableCellProps"),onPostRender:s},{text:"Merge cells",onclick:g("mceTableMergeCells"),onPostRender:function(){var n=this;i.push(n),e.fold(function(){a(n)},function(t){n.disabled(t.mergable().isNone())})}},{text:"Split cell",onclick:g("mceTableSplitCells"),onPostRender:function(){var n=this;u.push(n),e.fold(function(){a(n)},function(t){n.disabled(t.unmergable().isNone())})}}]};n.addMenuItem("inserttable",d),n.addMenuItem("tableprops",p),n.addMenuItem("deletetable",h),n.addMenuItem("row",v),n.addMenuItem("column",b),n.addMenuItem("cell",y)}};f.add("table",function(n){var t=oc(n),e=Ps(n,t.lazyResize),r=ha(n,t.lazyWire),o=Ws(n);Ia.registerCommands(n,r,e,o),Nr.registerEvents(n,o,r,e),Ls.addMenuItems(n,o),Ms.addButtons(n),Ms.addToolbars(n),n.on("PreInit",function(){n.serializer.addTempAttr(br.firstSelected()),n.serializer.addTempAttr(br.lastSelected())}),!1!==n.settings.table_tab_navigation&&n.on("keydown",function(e){ml.handle(e,n,r,t.lazyWire)}),n.on("remove",function(){t.destroy(),e.destroy()}),this.insertTable=function(t,e){return Pr.insert(n,t,e)},this.setClipboardRows=Ia.setClipboardRows,this.getClipboardRows=Ia.getClipboardRows})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),n=tinymce.util.Tools.resolve("tinymce.EditorManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Delay"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=tinymce.util.Tools.resolve("tinymce.util.VK"),r={getTabFocus:function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))}},c=t.DOM,s=function(e){e.keyCode!==u.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},a=function(e){function t(t){var s,a,y,f;if(!(t.keyCode!==u.TAB||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(1===(y=l.explode(r.getTabFocus(e))).length&&(y[1]=y[0],y[0]=":prev"),a=t.shiftKey?":prev"===y[0]?m(-1):c.get(y[0]):":next"===y[1]?m(1):c.get(y[1]))){var d=n.get(a.id||a.name);a.id&&d?d.focus():o.setTimeout(function(){i.webkit||window.focus(),a.focus()},10),t.preventDefault()}function m(i){function o(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&n.get(t.id)&&-1!==e.tabIndex&&function i(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&i(e.parentNode)}(e)}if(a=c.select(":input:enabled,*[tabindex]:not(iframe)"),l.each(a,function(t,n){if(t.id===e.id)return s=n,!1}),i>0){for(f=s+1;f<a.length;f++)if(o(a[f]))return a[f]}else for(f=s-1;f>=0;f--)if(o(a[f]))return a[f];return null}}e.on("init",function(){e.inline&&c.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",s),i.gecko?e.on("keypress keydown",t):e.on("keydown",t)})};e.add("tabfocus",function(e){a(e)})}();!function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!t.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},r=function(e,t){return{clipboard:e,quirks:t}},a={firePastePreProcess:function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},firePastePostProcess:function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},firePastePlainTextToggle:function(e,t){return e.fire("PastePlainTextToggle",{state:t})},firePaste:function(e,t){return e.fire("paste",{ieFake:t})}},i={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("paste_retain_style_properties")},getWordValidElements:function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},o=function(e,t,n){var r,o,s;"text"===t.pasteFormat?(t.pasteFormat="html",a.firePastePlainTextToggle(e,!1)):(t.pasteFormat="text",a.firePastePlainTextToggle(e,!0),s=e,!1===n.get()&&i.shouldPlainTextInform(s)&&(o="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=e).notificationManager.open({text:r.translate(o),type:"info"}),n.set(!0))),e.focus()},s=function(e,t,n){e.addCommand("mceTogglePlainTextPaste",function(){o(e,t,n)}),e.addCommand("mceInsertClipboardContent",function(e,n){n.content&&t.pasteHtml(n.content,n.internal),n.text&&t.pasteText(n.text)})},l=tinymce.util.Tools.resolve("tinymce.Env"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d="x-tinymce/html",m="\x3c!-- "+d+" --\x3e",p={mark:function(e){return m+e},unmark:function(e){return e.replace(m,"")},isMarked:function(e){return-1!==e.indexOf(m)},internalHtmlMime:function(){return d}},g=tinymce.util.Tools.resolve("tinymce.html.Entities"),v=function(e){return e.replace(/\r?\n/g,"<br>")},h=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+g.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),i="</"+t+">",o=c.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===o.length?o[0]:c.map(o,function(e){return a+e+i}).join("")},P={isPlainText:function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},convert:function(e,t,n){return t?h(e,t,n):v(e)},toBRs:v,toBlockElements:h},y=tinymce.util.Tools.resolve("tinymce.html.DomParser"),b=tinymce.util.Tools.resolve("tinymce.html.Node"),x=tinymce.util.Tools.resolve("tinymce.html.Schema"),w=tinymce.util.Tools.resolve("tinymce.html.Serializer");function T(e,t){return c.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var C={filter:T,innerText:function(e){var t=x(),n=y({},t),r="",a=t.getShortEndedElements(),i=c.makeMap("script noscript style textarea video audio iframe object"," "),o=t.getBlockElements();return e=T(e,[/<!\[[^\]]+\]>/g]),function s(e){var t=e.name,n=e;if("br"!==t)if(a[t]&&(r+=" "),i[t])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))do{s(e)}while(e=e.next);o[t]&&n.next&&(r+="\n","p"===t&&(r+="\n"))}else r+="\n"}(n.parse(e)),r},trimHtml:function(e){return e=T(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function _(e){var t,n;return n=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),c.each(n,function(n){if(n.test(e))return t=!0,!1}),t}function D(e){var t,n,r=1;function a(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)do{t+=a(e)}while(e=e.next);return t}function i(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!i(e,t))return!1}while(e=e.next);return!0}function o(e,a,o){var s=e._listLevel||r;s!==r&&(s<r?t&&(t=t.parent.parent):(n=t,t=null)),t&&t.name===a?t.append(e):(n=n||t,t=new b(a,1),o>1&&t.attr("start",""+o),e.wrap(t)),e.name="li",s>r&&n&&n.lastChild.append(t),r=s,function l(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)do{l(e)}while(e=e.next)}(e),i(e,/^\u00a0+/),i(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(e,/^\u00a0+/)}for(var s=[],l=e.firstChild;void 0!==l&&null!==l;)if(s.push(l),null!==(l=l.walk()))for(;void 0!==l&&l.parent!==e;)l=l.walk();for(var u=0;u<s.length;u++)if("p"===(e=s[u]).name&&e.firstChild){var c=a(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){o(e,"ul");continue}if(_(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),o(e,"ol",d);continue}if(e._listLevel){o(e,"ul",1);continue}t=null}else n=t,t=null}function k(e,t,n,r){var a,o={},s=e.dom.parseStyle(r);return c.each(s,function(s,l){switch(l){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(a[1],10)),/Ignore/i.test(s)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":l="text-align";break;case"vert-align":l="vertical-align";break;case"font-color":case"mso-foreground":l="color";break;case"mso-background":case"mso-highlight":l="background";break;case"font-weight":case"font-style":return void("normal"!==s&&(o[l]=s));case"mso-element":if(/^(comment|comment-list)$/i.test(s))return void n.remove()}0!==l.indexOf("mso-comment")?0!==l.indexOf("mso-")&&("all"===i.getRetainStyleProps(e)||t&&t[l])&&(o[l]=s):n.remove()}),/(bold)/i.test(o["font-weight"])&&(delete o["font-weight"],n.wrap(new b("b",1))),/(italic)/i.test(o["font-style"])&&(delete o["font-style"],n.wrap(new b("i",1))),(o=e.dom.serializeStyle(o,n.name))||null}var R={preProcess:function(e,t){return i.shouldUseDefaultFilters(e)?function(e,t){var n,r;(n=i.getRetainStyleProps(e))&&(r=c.makeMap(n.split(/[, ]/))),t=C.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var a=i.getWordValidElements(e),o=x({valid_elements:a,valid_children:"-li[p]"});c.each(o.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var s=y({},o);s.addAttributeFilter("style",function(t){for(var n,a=t.length;a--;)(n=t[a]).attr("style",k(e,r,n,n.attr("style"))),"span"===n.name&&n.parent&&!n.attributes.length&&n.unwrap()}),s.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),s.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),s.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)if(n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var l=s.parse(t);return i.shouldConvertWordFakeLists(e)&&D(l),t=w({validate:e.settings.validate},o).serialize(l)}(e,t):t},isWordContent:function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}},E=function(e,t){return{content:e,cancelled:t}},F=function(e,t,n,r){var i,o,s,l,u,c,f=a.firePastePreProcess(e,t,n,r);return e.hasEventListeners("PastePostProcess")&&!f.isDefaultPrevented()?(i=e,o=f.content,s=n,l=r,u=i.dom.create("div",{style:"display:none"},o),c=a.firePastePostProcess(i,u,s,l),E(c.node.innerHTML,c.isDefaultPrevented())):E(f.content,f.isDefaultPrevented())},M={process:function(e,t,n){var r=R.isWordContent(t),a=r?R.preProcess(e,t):t;return F(e,a,n,r)}},S=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},I=function(e){return S(e)&&/.(gif|jpe?g|png)$/.test(e)},A=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!S(t)||(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),0));var r,a,i},O=function(e,t,n){return!!I(t)&&(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.insertContent('<img src="'+a+'">')}),!0);var r,a,i},B=function(e,t){return e.insertContent(t,{merge:i.shouldMergeFormats(e),paste:!0}),!0},H={isImageUrl:I,isAbsoluteUrl:S,insertContent:function(e,t){var n,r;!1===i.isSmartPasteEnabled(e)?B(e,t):(n=e,r=t,c.each([A,O,B],function(e){return!0!==e(n,r,B)}))}},N=function(e){var t,n,r,o,s,d,m=this,g=0,v=(t=e,r="%MCEPASTEBIN%",{create:function(){var e,a,i=t.dom,o=t.getBody(),s=t.dom.getViewPort(t.getWin()).y,u=20;if(n=t.selection.getRng(),t.inline&&(a=t.selection.getScrollContainer())&&a.scrollTop>0&&(s=a.scrollTop),n.getClientRects){var c=function(e){var t,r,a,o=e.startContainer;if((t=e.getClientRects()).length)return t[0];if(e.collapsed&&1===o.nodeType){for(a=o.childNodes[n.startOffset];a&&3===a.nodeType&&!a.data.length;)a=a.nextSibling;if(a)return"BR"===a.tagName&&(r=i.doc.createTextNode("\ufeff"),a.parentNode.insertBefore(r,a),(e=i.createRng()).setStartBefore(r),e.setEndAfter(r),t=e.getClientRects(),i.remove(r)),t.length?t[0]:void 0}}(n);if(c)u=s+(c.top-i.getPos(o).y);else{u=s;var f=n.startContainer;f&&(3===f.nodeType&&f.parentNode!==o&&(f=f.parentNode),1===f.nodeType&&(u=i.getPos(f,a||o).y))}}e=t.dom.add(t.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+u+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"},r),(l.ie||l.gecko)&&i.setStyle(e,"left","rtl"===i.getStyle(o,"direction",!0)?65535:-65535),i.bind(e,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),e.focus(),t.selection.select(e,!0)},remove:function(){if(o()){for(var e=void 0;e=t.dom.get("mcepastebin");)t.dom.remove(e),t.dom.unbind(e);n&&t.selection.setRng(n)}n=null},getEl:o=function(){return t.dom.get("mcepastebin")},getHtml:function(){var e,n,r,a,i,o=function(e,n){e.appendChild(n),t.dom.remove(n,!0)};for(n=c.grep(t.getBody().childNodes,function(e){return"mcepastebin"===e.id}),e=n.shift(),c.each(n,function(t){o(e,t)}),r=(a=t.dom.select("div[id=mcepastebin]",e)).length-1;r>=0;r--)i=t.dom.create("div"),e.insertBefore(i,a[r]),o(i,a[r]);return e?e.innerHTML:""},getLastRng:function(){return n},isDefault:function(){var e,t=o();return(e=t)&&"mcepastebin"===e.id&&s(t.innerHTML)},isDefaultContent:s=function(e){return e===r}}),h="data:text/mce-internal,",y=C.createIdGenerator("mceclip");function b(t,n){var r=n||p.isMarked(t),a=M.process(e,p.unmark(t),r);!1===a.cancelled&&H.insertContent(e,a.content)}function x(t){t=e.dom.encode(t).replace(/\r\n/g,"\n"),b(t=P.convert(t,e.settings.forced_root_block,e.settings.forced_root_block_attrs),!1)}function w(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&n.length>0&&-1===n.indexOf(h)&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var a=e.types[r];try{t[a]=e.getData(a)}catch(i){t[a]=""}}}return t}function T(e){return k(e,"text/html")||k(e,"text/plain")}function _(t,n,r){t&&(e.selection.setRng(t),t=null);var a,i,o,s,l,u,c=n.result,f=-1!==(i=(a=c).indexOf(","))?a.substr(i+1):null,d=y(),m=e.settings.images_reuse_filename&&r.name?(o=r.name,(s=o.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?e.dom.encode(s[1]):null):d,p=new Image;if(p.src=c,l=e.settings,u=p,!l.images_dataimg_filter||l.images_dataimg_filter(u)){var g,v=e.editorUpload.blobCache,h=void 0;(g=v.findFirst(function(e){return e.base64()===f}))?h=g:(h=v.create(d,r,f,m),v.add(h)),b('<img src="'+h.blobUri()+'">',!1)}else b('<img src="'+c+'">',!1)}function D(t,n){var r=t.clipboardData||t.dataTransfer;function a(e){var r,a,i,o=!1;if(e)for(r=0;r<e.length;r++)if(a=e[r],/^image\/(jpeg|png|gif|bmp)$/.test(a.type)){var s=a.getAsFile?a.getAsFile():a;(i=new window.FileReader).onload=_.bind(null,n,i,s),i.readAsDataURL(s),t.preventDefault(),o=!0}return o}if(e.settings.paste_data_images&&r)return a(r.items)||a(r.files)}function k(e,t){return t in e&&e[t].length>0}function R(e){return f.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode}function E(){function t(t,n,r,a){var i,o;k(t,"text/html")?i=t["text/html"]:(i=v.getHtml(),a=a||p.isMarked(i),v.isDefaultContent(i)&&(r=!0)),i=C.trimHtml(i),v.remove(),o=!1===a&&P.isPlainText(i),i.length&&!o||(r=!0),r&&(i=k(t,"text/plain")&&o?t["text/plain"]:C.innerText(i)),v.isDefaultContent(i)?n||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):r?x(i):b(i,a)}e.on("keydown",function(t){function n(e){R(e)&&!e.isDefaultPrevented()&&v.remove()}if(R(t)&&!t.isDefaultPrevented()){if((d=t.shiftKey&&86===t.keyCode)&&l.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),g=(new Date).getTime(),l.ie&&d)return t.preventDefault(),void a.firePaste(e,!0);v.remove(),v.create(),e.once("keyup",n),e.once("paste",function(){e.off("keyup",n)})}}),e.on("paste",function(n){var r,a,i=(new Date).getTime(),o=(r=w(n.clipboardData||e.getDoc().dataTransfer),C.isMsEdge()?c.extend(r,{"text/html":""}):r),s=(new Date).getTime()-i,f=(new Date).getTime()-g-s<1e3,h="text"===m.pasteFormat||d,P=k(o,p.internalHtmlMime());d=!1,n.isDefaultPrevented()||(a=n.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&a&&a.items&&0===a.items.length)?v.remove():T(o)||!D(n,v.getLastRng()||e.selection.getRng())?(f||n.preventDefault(),!l.ie||f&&!n.ieFake||k(o,"text/html")||(v.create(),e.dom.bind(v.getEl(),"paste",function(e){e.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),o["text/html"]=v.getHtml()),k(o,"text/html")?(n.preventDefault(),P||(P=p.isMarked(o["text/html"])),t(o,f,h,P)):u.setEditorTimeout(e,function(){t(o,f,h,P)},0)):v.remove()})}m.pasteFormat=i.isPasteAsTextEnabled(e)?"text":"html",m.pasteHtml=b,m.pasteText=x,m.pasteImageData=D,m.getDataTransferItems=w,m.hasHtmlOrText=T,m.hasContentType=k,e.on("preInit",function(){var t;E(),e.parser.addNodeFilter("img",function(n,r,a){function i(e){e.attr("data-mce-object")||t===l.transparentSrc||e.remove()}if(!e.settings.paste_data_images&&(s=a).data&&!0===s.data.paste)for(var o=n.length;o--;)(t=n[o].attributes.map.src)&&(0===t.indexOf("webkit-fake-url")?i(n[o]):e.settings.allow_html_data_urls||0!==t.indexOf("data:")||i(n[o]));var s})})},L=function(){},$=function(e,t,n){if(r=e,!1!==l.iOS||r===undefined||"function"!=typeof r.setData||!0===C.isMsEdge())return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(p.internalHtmlMime(),t),!0}catch(a){return!1}var r},W=function(e,t,n,r){$(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},j=function(e){return function(t,n){var r=p.mark(t),a=e.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=e.dom.create("div",{contenteditable:"true"},r);e.dom.setStyles(a,{position:"fixed",left:"-3000px",width:"1000px",overflow:"hidden"}),a.appendChild(i),e.dom.add(e.getBody(),a);var o=e.selection.getRng();i.focus();var s=e.dom.createRng();s.selectNodeContents(i),e.selection.setRng(s),setTimeout(function(){a.parentNode.removeChild(a),e.selection.setRng(o),n()},0)}},U=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},V=function(e){var t,n;e.on("cut",(t=e,function(e){!1===t.selection.isCollapsed()&&W(e,U(t),j(t),function(){setTimeout(function(){t.execCommand("Delete")},0)})})),e.on("copy",(n=e,function(e){!1===n.selection.isCollapsed()&&W(e,U(n),j(n),L)}))},z=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),K=function(e,t){return z.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},G=function(e,t){e.focus(),e.selection.setRng(t)},X=function(e,t,n){i.shouldBlockDrop(e)&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),i.shouldPasteDataImages(e)||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.on("drop",function(r){var a,o;if(o=K(e,r),!r.isDefaultPrevented()&&!n.get()){a=t.getDataTransferItems(r.dataTransfer);var s,l=t.hasContentType(a,p.internalHtmlMime());if((t.hasHtmlOrText(a)&&(!(s=a["text/plain"])||0!==s.indexOf("file://"))||!t.pasteImageData(r,o))&&o&&i.shouldFilterDrop(e)){var c=a["mce-internal"]||a["text/html"]||a["text/plain"];c&&(r.preventDefault(),u.setEditorTimeout(e,function(){e.undoManager.transact(function(){a["mce-internal"]&&e.execCommand("Delete"),G(e,o),c=C.trimHtml(c),a["text/html"]?t.pasteHtml(c,l):t.pasteText(c)})}))}}}),e.on("dragstart",function(e){n.set(!0)}),e.on("dragover dragend",function(t){i.shouldPasteDataImages(e)&&!1===n.get()&&(t.preventDefault(),G(e,K(e,t))),"dragend"===t.type&&n.set(!1)})},q=function(e){var t=e.plugins.paste,n=i.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=i.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})};function Y(e,t){e.on("PastePreProcess",function(n){n.content=t(e,n.content,n.internal,n.wordContent)})}function Z(e,t){if(!R.isWordContent(t))return t;var n=[];c.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return t=C.filter(t,[[r,"$1"]]),t=C.filter(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function J(e,t,n,r){if(r||n)return t;var a=i.getWebkitStyles(e);if(!1===i.shouldRemoveWebKitStyles(e)||"all"===a)return t;if(a&&(a=a.split(/[, ]/)),a){var o=e.dom,s=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var i=o.parseStyle(o.decode(n),"span"),l={};if("none"===a)return t+r;for(var u=0;u<a.length;u++){var c=i[a[u]],f=o.getStyle(s,a[u],!0);/color/.test(a[u])&&(c=o.toHex(c),f=o.toHex(f)),f!==c&&(l[a[u]]=c)}return(l=o.serializeStyle(l,"span"))?t+' style="'+l+'"'+r:t+r})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function Q(e,t){e.$("a",t).find("font,u").each(function(t,n){e.dom.remove(n,!0)})}var ee=function(e){var t,n;l.webkit&&Y(e,J),l.ie&&(Y(e,Z),n=Q,(t=e).on("PastePostProcess",function(e){n(t,e.node)}))},te=function(e){return function(){return e}},ne=function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var a=t.concat(n);return e.apply(null,a)}},re=(te(!1),te(!0),function(e,t){var n=ne((te(!1),te(!0),function(e,t,n){var r=n.control;r.active("text"===t.pasteFormat),e.on("PastePlainTextToggle",function(e){r.active(e.state)})}),e,t);e.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:t.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})}),ae=e(!1);t.add("paste",function(t){if(!1===n(t)){var a=new N(t),i=ee(t),o=e(!1);return re(t,a),s(t,a,ae),q(t),V(t),X(t,a,o),r(a,i)}})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.VK"),n=function(t){return t.target_list},o=function(t){return t.rel_list},i=function(t){return t.link_class_list},r=function(t){return"boolean"==typeof t.link_assume_external_targets&&t.link_assume_external_targets},a=function(t){return"boolean"==typeof t.link_context_toolbar&&t.link_context_toolbar},l=function(t){return t.link_list},u=function(t){return"string"==typeof t.default_link_target},c=function(t){return t.default_link_target},s=n,f=function(t,e){t.settings.target_list=e},d=function(t){return!1!==n(t)},m=o,v=function(t){return o(t)!==undefined},g=i,h=function(t){return i(t)!==undefined},x=function(t){return!1!==t.link_title},p=function(t){return"boolean"==typeof t.allow_unsafe_link_target&&t.allow_unsafe_link_target},y=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),k=tinymce.util.Tools.resolve("tinymce.Env"),b=function(t){if(!k.ie||k.ie>10){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r=e,a=n,document.body.appendChild(r),r.dispatchEvent(a),document.body.removeChild(r)}else{var o=window.open("","_blank");if(o){o.opener=null;var i=o.document;i.open(),i.write('<meta http-equiv="refresh" content="0; url='+y.DOM.encode(t)+'">'),i.close()}}var r,a},_=tinymce.util.Tools.resolve("tinymce.util.Tools"),w=function(t,e){var n,o,i=["noopener"],r=t?t.split(/\s+/):[],a=function(t){return t.filter(function(t){return-1===_.inArray(i,t)})};return(r=e?(n=a(n=r)).length?n.concat(i):i:a(r)).length?(o=r,_.trim(o.sort().join(" "))):null},T=function(t,e){return e=e||t.selection.getNode(),M(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},C=function(t){return t&&"A"===t.nodeName&&t.href},M=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},O=function(t,e){var n,o;(o=t.dom.select("img",e)[0])&&(n=t.dom.getParents(o,"a[href]",e)[0])&&(n.parentNode.insertBefore(o,n),t.dom.remove(n))},N=function(t,e,n){var o,i;(i=t.dom.select("img",e)[0])&&(o=t.dom.create("a",n),i.parentNode.insertBefore(o,i),o.appendChild(i))},R=function(t,e){return function(n){t.undoManager.transact(function(){var o=t.selection.getNode(),i=T(t,o),r={href:n.href,target:n.target?n.target:null,rel:n.rel?n.rel:null,"class":n["class"]?n["class"]:null,title:n.title?n.title:null};v(t.settings)||!1!==p(t.settings)||(r.rel=w(r.rel,"_blank"===r.target)),n.href===e.href&&(e.attach(),e={}),i?(t.focus(),n.hasOwnProperty("text")&&("innerText"in i?i.innerText=n.text:i.textContent=n.text),t.dom.setAttribs(i,r),t.selection.select(i),t.undoManager.add()):M(o)?N(t,o,r):n.hasOwnProperty("text")?t.insertContent(t.dom.createHTML("a",r,t.dom.encode(n.text))):t.execCommand("mceInsertLink",!1,r)})}},A=function(t){return function(){t.undoManager.transact(function(){var e=t.selection.getNode();M(e)?O(t,e):t.execCommand("unlink")})}},L=C,P=function(t){return _.grep(t,C).length>0},E=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},K=T,S=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return n.replace(/\uFEFF/g,"")},U=w,D=tinymce.util.Tools.resolve("tinymce.util.Delay"),I=tinymce.util.Tools.resolve("tinymce.util.XHR"),B={},F=function(t,e,n){var o=function(t,n){return n=n||[],_.each(t,function(t){var i={text:t.text||t.title};t.menu?i.menu=o(t.menu):(i.value=t.value,e&&e(i)),n.push(i)}),n};return o(t,n||[])},q=function(t,e,n){var o=t.selection.getRng();D.setEditorTimeout(t,function(){t.windowManager.confirm(e,function(e){t.selection.setRng(o),n(e)})})},V=function(t,e){var n,o,i,a,l,y,k,b,w,T,C,M={},O=t.selection,N=t.dom,L=function(t){var e=i.find("#text");(!e.value()||t.lastControl&&e.value()===t.lastControl.text())&&e.value(t.control.text()),i.find("#href").value(t.control.value())},P=function(){o||!a||M.text||this.parent().parent().find("#text")[0].value(this.value())};a=E(O.getContent()),n=K(t),M.text=o=S(t.selection,n),M.href=n?N.getAttrib(n,"href"):"",n?M.target=N.getAttrib(n,"target"):u(t.settings)&&(M.target=c(t.settings)),(C=N.getAttrib(n,"rel"))&&(M.rel=C),(C=N.getAttrib(n,"class"))&&(M["class"]=C),(C=N.getAttrib(n,"title"))&&(M.title=C),a&&(l={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){M.text=this.value()}}),e&&(y={type:"listbox",label:"Link list",values:F(e,function(e){e.value=t.convertURL(e.value||e.url,"href")},[{text:"None",value:""}]),onselect:L,value:t.convertURL(M.href,"href"),onPostRender:function(){y=this}}),d(t.settings)&&(s(t.settings)===undefined&&f(t,[{text:"None",value:""},{text:"New window",value:"_blank"}]),b={name:"target",type:"listbox",label:"Target",values:F(s(t.settings))}),v(t.settings)&&(k={name:"rel",type:"listbox",label:"Rel",values:F(m(t.settings),function(e){!1===p(t.settings)&&(e.value=U(e.value,"_blank"===M.target))})}),h(t.settings)&&(w={name:"class",type:"listbox",label:"Class",values:F(g(t.settings),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({inline:"a",classes:[e.value]})})})}),x(t.settings)&&(T={name:"title",type:"textbox",label:"Title",value:M.title}),i=t.windowManager.open({title:"Insert link",data:M,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(e){var n=e.meta||{};y&&y.value(t.convertURL(this.value(),"href")),_.each(e.meta,function(t,e){var n=i.find("#"+e);"text"===e?0===o.length&&(n.value(t),M.text=t):n.value(t)}),n.attach&&(B={href:this.value(),attach:n.attach}),n.text||P.call(this)},onkeyup:P,onbeforecall:function(t){t.meta=i.toJSON()}},l,T,function(e){var n=[];if(_.each(t.dom.select("a:not([href])"),function(t){var o=t.name||t.id;o&&n.push({text:o,value:"#"+o,selected:-1!==e.indexOf("#"+o)})}),n.length)return n.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:n,onselect:L}}(M.href),y,k,b,w],onSubmit:function(e){var n=r(t.settings),i=R(t,B),l=A(t),u=_.extend({},M,e.data),c=u.href;c?(a&&u.text!==o||delete u.text,c.indexOf("@")>0&&-1===c.indexOf("//")&&-1===c.indexOf("mailto:")?q(t,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(u.href="mailto:"+c),i(u)}):!0===n&&!/^\w+:/i.test(c)||!1===n&&/^\s*www[\.|\d\.]/i.test(c)?q(t,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(u.href="http://"+c),i(u)}):i(u)):l()}})},z=function(t){var e,n,o;n=V,"string"==typeof(o=l((e=t).settings))?I.send({url:o,success:function(t){n(e,JSON.parse(t))}}):"function"==typeof o?o(function(t){n(e,t)}):n(e,o)},H=function(t,e){return t.dom.getParent(e,"a[href]")},J=function(t){return H(t,t.selection.getStart())},$=function(t,e){if(e){var n=(i=e).getAttribute("data-mce-href")||i.getAttribute("href");if(/^#/.test(n)){var o=t.$(n);o.length&&t.selection.scrollIntoView(o[0],!0)}else b(e.href)}var i},j=function(t){return function(){z(t)}},G=function(t){return function(){$(t,J(t))}},X=function(t){return function(e){var n,o,i,r,l;return!!(a(t.settings)&&(r=t,l=r.plugins.contextmenu,!l||!l.isContextMenuVisible())&&L(e)&&3===(i=(o=(n=t.selection).getRng()).startContainer).nodeType&&n.isCollapsed()&&o.startOffset>0&&o.startOffset<i.data.length)}},Q=function(t){t.on("click",function(n){var o=H(t,n.target);o&&e.metaKeyPressed(n)&&(n.preventDefault(),$(t,o))}),t.on("keydown",function(e){var n,o=J(t);o&&13===e.keyCode&&!0===(n=e).altKey&&!1===n.shiftKey&&!1===n.ctrlKey&&!1===n.metaKey&&(e.preventDefault(),$(t,o))})},W=function(t){return function(){var e=this;t.on("nodechange",function(n){e.active(!t.readonly&&!!K(t,n.element))})}},Y=function(t){return function(){var e=this,n=function(t){P(t.parents)?e.show():e.hide()};P(t.dom.getParents(t.selection.getStart()))||e.hide(),t.on("nodechange",n),e.on("remove",function(){t.off("nodechange",n)})}},Z=function(t){t.addCommand("mceLink",j(t))},tt=function(t){t.addShortcut("Meta+K","",j(t))},et=function(t){t.addButton("link",{active:!1,icon:"link",tooltip:"Insert/edit link",onclick:j(t),onpostrender:W(t)}),t.addButton("unlink",{active:!1,icon:"unlink",tooltip:"Remove link",onclick:A(t),onpostrender:W(t)}),t.addContextToolbar&&t.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:G(t)})},nt=function(t){t.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:G(t),onPostRender:Y(t),prependToContext:!0}),t.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:j(t),stateSelector:"a[href]",context:"insert",prependToContext:!0})},ot=function(t){t.addContextToolbar&&t.addContextToolbar(X(t),"openlink | link unlink")};t.add("link",function(t){et(t),nt(t),ot(t),Q(t),Z(t),tt(t)})}();!function(){"use strict";var n=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(o){n(o),t(o)})}();!function(){"use strict";var e=function(t){var n=t,i=function(){return n};return{get:i,set:function(e){n=e},clone:function(){return e(i())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return{isFullscreen:function(){return null!==e.get()}}},i=function(e,t){e.fire("FullscreenStateChanged",{state:t})},r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils").DOM,l=function(e,t){var n,l,o,c,s,u,d=document.body,a=document.documentElement,h=t.get(),f=function(){var e,t,n,i;r.setStyle(o,"height",(n=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}).h-(l.clientHeight-o.clientHeight))},m=function(){r.unbind(window,"resize",f)};if(n=(l=e.getContainer()).style,c=(o=e.getContentAreaContainer().firstChild).style,h)c.width=h.iframeWidth,c.height=h.iframeHeight,h.containerWidth&&(n.width=h.containerWidth),h.containerHeight&&(n.height=h.containerHeight),r.removeClass(d,"mce-fullscreen"),r.removeClass(a,"mce-fullscreen"),r.removeClass(l,"mce-fullscreen"),s=h.scrollPos,window.scrollTo(s.x,s.y),r.unbind(window,"resize",h.resizeHandler),e.off("remove",h.removeHandler),t.set(null),i(e,!1);else{var g={scrollPos:(u=r.getViewPort(),{x:u.x,y:u.y}),containerWidth:n.width,containerHeight:n.height,iframeWidth:c.width,iframeHeight:c.height,resizeHandler:f,removeHandler:m};c.width=c.height="100%",n.width=n.height="",r.addClass(d,"mce-fullscreen"),r.addClass(a,"mce-fullscreen"),r.addClass(l,"mce-fullscreen"),r.bind(window,"resize",f),e.on("remove",m),f(),t.set(g),i(e,!0)}},o=function(e,t){e.addCommand("mceFullScreen",function(){l(e,t)})},c=function(e){return function(t){var n=t.control;e.on("FullscreenStateChanged",function(e){n.active(e.state)})}},s=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:c(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:c(e)})};t.add("fullscreen",function(t){var i=e(null);return o(t,i),s(t),t.addShortcut("Ctrl+Shift+F","","mceFullScreen"),n(i)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,i){var n,o=t.dom,c=t.selection.getSelectedBlocks();c.length&&(n=o.getAttrib(c[0],"dir"),e.each(c,function(t){o.getParent(t.parentNode,'*[dir="'+i+'"]',o.getRoot())||o.setAttrib(t,"dir",n!==i?i:null)}),t.nodeChanged())},n=function(t){t.addCommand("mceDirectionLTR",function(){i(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){i(t,"rtl")})},o=function(t){var i=[];return e.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(e){i.push(e+"[dir="+t+"]")}),i.join(",")},c=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:o("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:o("rtl")})};t.add("directionality",function(t){n(t),c(t)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),e=function(t){return t.getParam("code_dialog_width",600)},o=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},i=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},c=function(t){return t.getContent({source_view:!0})},d=function(t){var n=e(t),d=o(t);t.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:n,minHeight:d,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(n){i(t,n.data.code)}}).find("#code").value(c(t))},u=function(t){t.addCommand("mceCodeEditor",function(){d(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){d(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){d(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,t){return e.fire("insertCustomChar",{chr:t})},a=function(e,a){var i=t(e,a).chr;e.execCommand("mceInsertContent",!1,i)},i=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.settings.charmap},n=function(e){return e.settings.charmap_append},o=i.isArray,l=function(e){return o(e)?[].concat((t=e,i.grep(t,function(e){return o(e)&&2===e.length}))):"function"==typeof e?e():[];var t},c=function(e){return function(e,t){var a=r(e);a&&(t=l(a));var i=n(e);return i?[].concat(t).concat(l(i)):t}(e,[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["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","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]])},s=function(e){return{getCharMap:function(){return c(e)},insertChar:function(t){a(e,t)}}},u=function(e){var t,a,i,r=Math.min(e.length,25),n=Math.ceil(e.length/r);for(t='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>',i=0;i<n;i++){for(t+="<tr>",a=0;a<r;a++){var o=i*r+a;if(o<e.length){var l=e[o],c=parseInt(l[0],10),s=l?String.fromCharCode(c):"&nbsp;";t+='<td title="'+l[1]+'"><div tabindex="-1" title="'+l[1]+'" role="button" data-chr="'+c+'">'+s+"</div></td>"}else t+="<td />"}t+="</tr>"}return t+="</tbody></table>"},d=function(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}},m=function(e){var t,i={type:"container",html:u(c(e)),onclick:function(i){var r=i.target;if(/^(TD|DIV)$/.test(r.nodeName)){var n=d(r).firstChild;if(n&&n.hasAttribute("data-chr")){var o=n.getAttribute("data-chr"),l=parseInt(o,10);isNaN(l)||a(e,String.fromCharCode(l)),i.ctrlKey||t.close()}}},onmouseover:function(e){var a=d(e.target);a&&a.firstChild?(t.find("#preview").text(a.firstChild.firstChild.data),t.find("#previewTitle").text(a.title)):(t.find("#preview").text(" "),t.find("#previewTitle").text(" "))}};t=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[i,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){t.close()}}]})},g=function(e){e.addCommand("mceShowCharmap",function(){m(e)})},p=function(e){e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};e.add("charmap",function(e){return g(e),p(e),s(e)})}();!function(){"use strict";var t=function(e){var n=e,i=function(){return n};return{get:i,set:function(t){n=t},clone:function(){return t(i())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),i=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},r=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},a=function(t){return t.getParam("autoresize_overflow_padding",1)},u=function(t){return t.getParam("autoresize_bottom_margin",50)},s=function(t){return t.getParam("autoresize_on_init",!0)},l=function(t,e,n,o,r){i.setEditorTimeout(t,function(){c(t,e),n--?l(t,e,n,o,r):r&&r()},o)},g=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},c=function(t,e){var i,a,u,s,l,f,d,m,p,y,h,v=t.dom;if(a=t.getDoc())if((S=t).plugins.fullscreen&&S.plugins.fullscreen.isFullscreen())g(t,!0);else{var S;u=a.body,s=o(t),f=v.getStyle(u,"margin-top",!0),d=v.getStyle(u,"margin-bottom",!0),m=v.getStyle(u,"padding-top",!0),p=v.getStyle(u,"padding-bottom",!0),y=v.getStyle(u,"border-top-width",!0),h=v.getStyle(u,"border-bottom-width",!0),l=u.offsetHeight+parseInt(f,10)+parseInt(d,10)+parseInt(m,10)+parseInt(p,10)+parseInt(y,10)+parseInt(h,10),(isNaN(l)||l<=0)&&(l=n.ie?u.scrollHeight:n.webkit&&0===u.clientHeight?0:u.offsetHeight),l>o(t)&&(s=l);var _=r(t);_&&l>_?(s=_,g(t,!0)):g(t,!1),s!==e.get()&&(i=s-e.get(),v.setStyle(t.iframeElement,"height",s+"px"),e.set(s),n.webkit&&i<0&&c(t,e))}},f={setup:function(t,e){t.on("init",function(){var e,n,i=t.dom;e=a(t),n=u(t),!1!==e&&i.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e}),!1!==n&&i.setStyles(t.getBody(),{paddingBottom:n})}),t.on("nodechange setcontent keyup FullscreenStateChanged",function(n){c(t,e)}),s(t)&&t.on("init",function(){l(t,e,20,100,function(){l(t,e,5,1e3)})})},resize:c},d=function(t,e){t.addCommand("mceAutoResize",function(){f.resize(t,e)})};e.add("autoresize",function(e){if(!e.inline){var n=t(0);d(e,n),f.setup(e,n)}})}();!function(){"use strict";var t=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},n=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},o=function(o){var r=e(o);o.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:r},onsubmit:function(e){var r,a,i=e.data.id;r=o,(t(a=i)?(n(r,a),0):(r.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&e.preventDefault()}})},r=function(t){t.addCommand("mceAnchor",function(){o(t)})},a=function(t){return function(e){for(var n=0;n<e.length;n++)(o=e[n]).attr("href")||!o.attr("id")&&!o.attr("name")||o.firstChild||e[n].attr("contenteditable",t);var o}},i=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",a("false")),t.serializer.addNodeFilter("a",a(null))})},c=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};tinymce.util.Tools.resolve("tinymce.PluginManager").add("anchor",function(t){i(t),r(t),c(t)})}();!function(){"use strict";var e,t,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return!1!==u(e)},u=function(e){return e.getParam("menubar")},c=function(e){return e.getParam("toolbar_items_size")},d=function(e){return e.getParam("menu")},f=function(e){return!1===e.settings.skin},h=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},m=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),p=tinymce.util.Tools.resolve("tinymce.util.I18n"),v=function(e){return e.fire("SkinLoaded")},b=function(e){return e.fire("ResizeEditor")},y=function(e){return e.fire("BeforeRenderUI")},x=function(e,t){return function(){var n=e.find(t)[0];n&&n.focus(!0)}},w=function(e,t){e.shortcuts.add("Alt+F9","",x(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",x(t,"toolbar")),e.shortcuts.add("Alt+F11","",x(t,"elementpath")),t.on("cancel",function(){e.focus()})},_=tinymce.util.Tools.resolve("tinymce.Env"),R=tinymce.util.Tools.resolve("tinymce.geom.Rect"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),k=function(e){return function(){return e}},E={noop:function(){},noarg:function(e){return function(){return e()}},compose:function(e,t){return function(){return e(t.apply(null,arguments))}},constant:k,identity:function(e){return e},tripleEquals:function(e,t){return e===t},curry:function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var r=t.concat(n);return e.apply(null,r)}},not:function(e){return function(){return!e.apply(null,arguments)}},die:function(e){return function(){throw new Error(e)}},apply:function(e){return e()},call:function(e){e()},never:k(!1),always:k(!0)},H=E.never,S=E.always,M=function(){return T},T=(i={fold:function(e,t){return e()},is:H,isSome:H,isNone:S,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},or:n,orThunk:t,map:M,ap:M,each:function(){},bind:M,flatten:M,exists:H,forall:S,filter:M,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:E.constant("none()")},Object.freeze&&Object.freeze(i),i),P=function(e){var t=function(){return e},n=function(){return r},i=function(t){return t(e)},r={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:S,isNone:H,getOr:t,getOrThunk:t,getOrDie:t,or:n,orThunk:n,map:function(t){return P(t(e))},ap:function(t){return t.fold(M,function(t){return P(t(e))})},each:function(t){t(e)},bind:i,flatten:t,exists:i,forall:i,filter:function(t){return t(e)?r:T},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(H,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},W={some:P,none:M,from:function(e){return null===e||e===undefined?T:P(e)}},D=function(){var e=_.container;if(e&&"static"!==m.DOM.getStyle(e,"position",!0)){var t=m.DOM.getPos(e),n=e.scrollLeft-t.x,i=e.scrollTop-t.y;return W.some({x:n,y:i})}return W.none()},N=function(e,t,n){var i,r=[];if(t)return a.each(t.split(/[ ,]/),function(t){var o,s=function(){var n=e.selection;t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?i=null:(i||(i={type:"buttongroup",items:[]},r.push(i)),e.buttons[t]&&(o=t,"function"==typeof(t=e.buttons[o])&&(t=t()),t.type=t.type||"button",t.size=n,t=g.create(t),i.items.push(t),e.initialized?s():e.on("init",s)))}),{type:"toolbar",layout:"flow",items:r}},A=N,B=function(e,t){var n,i,r=[];if(a.each(!1===(i=(n=e).getParam("toolbar"))?[]:a.isArray(i)?a.grep(i,function(e){return e.length>0}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return n.length>0?n:o}(n.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(n){var i;(i=n)&&r.push(N(e,i,t))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},O=m.DOM,z=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},L=function(e,t){e.moveTo(t.left,t.top)},I=function(e,t,n,i,r,o){return o=z({x:t,y:n,w:o.w,h:o.h}),e&&(o=e({elementRect:z(i),contentAreaRect:z(r),panelRect:o})),o},F=function(e){var t,n=function(){return e.contextToolbars||[]},i=function(t,n){var i,r,o,s,l,u,c,d=e.getParam("inline_toolbar_position_handler");if(!e.removed){if(!t||!t.toolbar.panel)return f=e,void a.each(f.contextToolbars,function(e){e.panel&&e.panel.hide()});var f,h,m,g,p;c=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],l=t.toolbar.panel,n&&l.show(),h=t.element,m=O.getPos(e.getContentAreaContainer()),g=e.dom.getRect(h),"BODY"===(p=e.dom.getRoot()).nodeName&&(g.x-=p.ownerDocument.documentElement.scrollLeft||p.scrollLeft,g.y-=p.ownerDocument.documentElement.scrollTop||p.scrollTop),g.x+=m.x,g.y+=m.y,o=g,r=O.getRect(l.getEl()),s=O.getRect(e.getContentAreaContainer()||e.getBody());var v,b,y,x=D().getOr({x:0,y:0});if(o.x+=x.x,o.y+=x.y,r.x+=x.x,r.y+=x.y,s.x+=x.x,s.y+=x.y,"inline"!==O.getStyle(t.element,"display",!0)){var w=t.element.getBoundingClientRect();o.w=w.width,o.h=w.height}e.inline||(s.w=e.getDoc().documentElement.offsetWidth),e.selection.controlSelection.isResizable(t.element)&&o.w<25&&(o=R.inflate(o,0,8)),i=R.findBestRelativePosition(r,o,s,c),o=R.clamp(o,s),i?(u=R.relativePosition(r,o,i),L(l,I(d,u.x,u.y,o,s,r))):(s.h+=r.h,(o=R.intersect(s,o))?(i=R.findBestRelativePosition(r,o,s,["bc-tc","bl-tl","br-tr"]))?(u=R.relativePosition(r,o,i),L(l,I(d,u.x,u.y,o,s,r))):L(l,I(d,o.x,o.y,o,s,r)):l.hide()),v=l,y=function(e,t){return e===t},b=(b=i)?b.substr(0,2):"",a.each({t:"down",b:"up"},function(e,t){v.classes.toggle("arrow-"+e,y(t,b.substr(0,1)))}),a.each({l:"left",r:"right"},function(e,t){v.classes.toggle("arrow-"+e,y(t,b.substr(1,1)))})}},r=function(t){return function(){C.requestAnimationFrame(function(){e.selection&&i(l(e.selection.getNode()),t)})}},o=function(n){var o;if(n.toolbar.panel)return n.toolbar.panel.show(),void i(n);!function(){if(!t){var n=r(!0);t=e.selection.getScrollContainer()||e.getWin(),O.bind(t,"scroll",n),O.bind(_.container,"scroll",n),e.on("remove",function(){O.unbind(t,"scroll",n),O.unbind(_.container,"scroll",n)})}}(),o=g.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:A(e,n.toolbar.items),oncancel:function(){e.focus()}}),n.toolbar.panel=o,o.renderTo().reflow(),i(n)},s=function(){a.each(n(),function(e){e.panel&&e.panel.hide()})},l=function(t){var i,r,o,s=n();for(i=(o=e.$(t).parents().add(t)).length-1;i>=0;i--)for(r=s.length-1;r>=0;r--)if(s[r].predicate(o[i]))return{toolbar:s[r],element:o[i]};return null};e.on("click keyup setContent ObjectResized",function(t){("setcontent"!==t.type||t.selection)&&C.setEditorTimeout(e,function(){var t;(t=l(e.selection.getNode()))?(s(),o(t)):s()})}),e.on("blur hide contextmenu",s),e.on("ObjectResizeStart",function(){var t=l(e.selection.getNode());t&&t.toolbar.panel&&t.toolbar.panel.hide()}),e.on("ResizeEditor ResizeWindow",r(!0)),e.on("nodeChange",r(!1)),e.on("remove",function(){a.each(n(),function(e){e.panel&&e.panel.remove()}),e.contextToolbars={}}),e.shortcuts.add("ctrl+shift+e > ctrl+shift+p","",function(){var t=l(e.selection.getNode());t&&t.toolbar.panel&&t.toolbar.panel.items()[0].focus()})},V=(r=Array.prototype.indexOf)===undefined?function(e,t){return J(e,t)}:function(e,t){return r.call(e,t)},U=function(e,t){return V(e,t)>-1},Y=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r,e)}return i},$=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n,e)},j=function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n,e)},q=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i,e)&&n.push(o)}return n},X=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n,e))return W.some(n);return W.none()},J=function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return n;return-1},G=Array.prototype.push,K=function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);G.apply(t,e[n])}return t},Z=function(e,t){for(var n=0,i=e.length;n<i;++n)if(!0!==t(e[n],n,e))return!1;return!0},Q=Array.prototype.slice,ee={map:Y,each:$,eachr:j,partition:function(e,t){for(var n=[],i=[],r=0,o=e.length;r<o;r++){var s=e[r];(t(s,r,e)?n:i).push(s)}return{pass:n,fail:i}},filter:q,groupBy:function(e,t){if(0===e.length)return[];for(var n=t(e[0]),i=[],r=[],o=0,s=e.length;o<s;o++){var a=e[o],l=t(a);l!==n&&(i.push(r),r=[]),n=l,r.push(a)}return 0!==r.length&&i.push(r),i},indexOf:function(e,t){var n=V(e,t);return-1===n?W.none():W.some(n)},foldr:function(e,t,n){return j(e,function(e){n=t(n,e)}),n},foldl:function(e,t,n){return $(e,function(e){n=t(n,e)}),n},find:function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n,e))return W.some(r)}return W.none()},findIndex:X,flatten:K,bind:function(e,t){var n=Y(e,t);return K(n)},forall:Z,exists:function(e,t){return X(e,t).isSome()},contains:U,equal:function(e,t){return e.length===t.length&&Z(e,function(e,n){return e===t[n]})},reverse:function(e){var t=Q.call(e,0);return t.reverse(),t},chunk:function(e,t){for(var n=[],i=0;i<e.length;i+=t){var r=e.slice(i,i+t);n.push(r)}return n},difference:function(e,t){return q(e,function(e){return!U(t,e)})},mapToObject:function(e,t){for(var n={},i=0,r=e.length;i<r;i++){var o=e[i];n[String(o)]=t(o,i)}return n},pure:function(e){return[e]},sort:function(e,t){var n=Q.call(e,0);return n.sort(t),n},range:function(e,t){for(var n=[],i=0;i<e;i++)n.push(t(i));return n},head:function(e){return 0===e.length?W.none():W.some(e[0])},last:function(e){return 0===e.length?W.none():W.some(e[e.length-1])}},te={file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck"},table:{title:"Table"},help:{title:"Help"}},ne=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},ie=function(e){return e&&"|"===e.item.text},re=function(e,t,n,i){var r,o,s,l,u,c,d,f;return t?(o=t[i],l=!0):o=te[i],o&&(r={text:o.title},s=[],a.each((o.items||"").split(/[ ,]/),function(t){var n=ne(t,e[t]);n&&s.push(n)}),l||a.each(e,function(e,t){var n,r;e.context!==i||(n=s,r=t,ee.findIndex(n,function(e){return e.name===r}).isSome())||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ne(t,e)):s.push(ne(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),r.menu=ee.map((u=s,c=n,d=ee.filter(u,function(e){return!1===c.hasOwnProperty(e.name)}),f=ee.filter(d,function(e,t,n){return!ie(e)||!ie(n[t-1])}),ee.filter(f,function(e,t,n){return!ie(e)||t>0&&t<n.length-1})),function(e){return e.item}),!r.menu.length)?null:r},oe=function(e){for(var t,n=[],i=function(e){var t,n=[],i=d(e);if(i)for(t in i)n.push(t);else for(t in te)n.push(t);return n}(e),r=a.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=u(e),s="string"==typeof o?o.split(/[ ,]/):i,l=0;l<s.length;l++){var c=s[l],f=re(e.menuItems,d(e),r,c);f&&n.push(f)}return n},se=m.DOM,ae=function(e){return{width:e.clientWidth,height:e.clientHeight}},le=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=ae(i),s=ae(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),se.setStyle(i,"width",t+(o.width-s.width)),se.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),se.setStyle(r,"height",n),b(e)},ue=le,ce=function(e,t,n){var i=e.getContentAreaContainer();le(e,i.clientWidth+t,i.clientHeight+n)},de=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},fe=function(e,t,n){return function(i){var r,o,s,l,u,c=i.control,d=c.parents().filter("panel")[0],f=d.find("#"+t)[0],h=(r=n,o=t,a.grep(r,function(e){return e.name===o})[0]);s=t,l=d,u=n,a.each(u,function(e){var t=l.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==s&&(de(e,t,"onhide"),t.visible(!1))}),c.parent().items().each(function(e){e.active(!1)}),f&&f.visible()?(de(h,f,"onhide"),f.hide(),c.active(!1)):(f?(f.show(),de(h,f,"onshow")):(f=g.create({type:"container",name:t,layout:"stack",classes:"sidebar-panel",html:""}),d.prepend(f),de(h,f,"onrender"),de(h,f,"onshow")),c.active(!0)),b(e)}},he=function(e){return!(_.ie&&!(_.ie>=11)||!e.sidebars)&&e.sidebars.length>0},me=function(e){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:a.map(e.sidebars,function(t){var n=t.settings;return{type:"button",icon:n.icon,image:n.image,tooltip:n.tooltip,onclick:fe(e,t.name,e.sidebars)}})}]}},ge=function(e){var t=function(){e._skinLoaded=!0,v(e)};return function(){e.initialized?t():e.on("init",t)}},pe=m.DOM,ve=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},be=function(e,t,n){var i,r,o,s,a;if(!1===f(e)&&n.skinUiCss?pe.styleSheetLoader.load(n.skinUiCss,ge(e)):ge(e)(),i=t.panel=g.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===l(e)?null:{type:"menubar",border:"0 0 1 0",items:oe(e)},B(e,c(e))]},he(e)?(s=e,{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[ve("0"),me(s)]}):ve("1 0 0 0")]}),"none"!==h(e)&&(r={type:"resizehandle",direction:h(e),onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;o={width:t.clientWidth,height:t.clientHeight}},onResize:function(t){"both"===h(e)?ue(e,o.width+t.deltaX,o.height+t.deltaY):ue(e,null,o.height+t.deltaY)}}),e.getParam("statusbar",!0,"boolean")){var u=p.translate(["Powered by {0}",'<a href="https://www.tinymce.com/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>']),d=e.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+u}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:e},r,d]})}return y(e),e.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),e.getParam("readonly",!1,"boolean")&&e.setMode("readonly"),n.width&&pe.setStyle(i.getEl(),"width",n.width),e.on("remove",function(){i.remove(),i=null}),w(e,i),F(e),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},ye=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),xe=0,we={id:function(){return"mceu_"+xe++},create:function(e,t,n){var i=document.createElement(e);return m.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:a.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return m.DOM.createFragment(e)},getWindowSize:function(){return m.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return m.DOM.getPos(e,t||we.getContainer())},getContainer:function(){return _.container?_.container:document.body},getViewPort:function(e){return m.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return m.DOM.addClass(e,t)},removeClass:function(e,t){return m.DOM.removeClass(e,t)},hasClass:function(e,t){return m.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return m.DOM.toggleClass(e,t,n)},css:function(e,t,n){return m.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return m.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return m.DOM.bind(e,t,n,i)},off:function(e,t,n){return m.DOM.unbind(e,t,n)},fire:function(e,t,n){return m.DOM.fire(e,t,n)},innerHtml:function(e,t){m.DOM.setHTML(e,t)}};function _e(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=we.getViewPort(),o=(r=we.getPos(t)).x,s=r.y,e.state.get("fixed")&&"static"===we.getRuntimeStyle(document.body,"position")&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=we.getSize(i)).width,l=f.height,u=(f=we.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Re={testMoveRel:function(e,t){for(var n=we.getViewPort(),i=0;i<t.length;i++){var r=_e(this,e,t[i]);if(this.state.get("fixed")){if(r.x>0&&r.x+r.w<n.w&&r.y>0&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w+n.x&&r.y>n.y&&r.y+r.h<n.h+n.y)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=_e(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:e+n>t&&(e=t-n)<0?0:e}if(n.settings.constrainToViewport){var r=we.getViewPort(window),o=n.layoutRect();e=i(e,r.w+r.x,o.w),t=i(t,r.h+r.y,o.h)}return n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},Ce=tinymce.util.Tools.resolve("tinymce.util.Class"),ke=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Ee=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},He=function(e,t){function n(t){var n=parseFloat(function(t){var n=e.ownerDocument.defaultView;if(n){var i=n.getComputedStyle(e,null);return i?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),i.getPropertyValue(t)):null}return e.currentStyle[t]}(t));return isNaN(n)?0:n}return{top:n(t+"TopWidth"),right:n(t+"RightWidth"),bottom:n(t+"BottomWidth"),left:n(t+"LeftWidth")}};function Se(){}function Me(e){this.cls=[],this.cls._map={},this.onchange=e||Se,this.prefix=""}a.extend(Me.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Me.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Te,Pe,We,De=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,Ne=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Ae=/^\s*|\s*$/g,Be=Ce.extend({init:function(e){var t=this.match;function n(e,n,r){var o;function s(e){e&&n.push(e)}return s(function(e){if(e)return e=e.toLowerCase(),function(t){return"*"===e||t.type===e}}((o=De.exec(e.replace(Ae,"")))[1])),s(function(e){if(e)return function(t){return t._name===e}}(o[2])),s(function(e){if(e)return e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}}(o[3])),s(function(e,t,n){if(e)return function(i){var r=i[e]?i[e]():"";return t?"="===t?r===n:"*="===t?r.indexOf(n)>=0:"~="===t?(" "+r+" ").indexOf(" "+n+" ")>=0:"!="===t?r!==n:"^="===t?0===r.indexOf(n):"$="===t&&r.substr(r.length-n.length)===n:!!n}}(o[4],o[5],o[6])),s(function(e){var n;if(e)return(e=/(?:not\((.+)\))|(.+)/i.exec(e))[1]?(n=i(e[1],[]),function(e){return!t(e,n)}):(e=e[2],function(t,n,i){return"first"===e?0===n:"last"===e?n===i-1:"even"===e?n%2==0:"odd"===e?n%2==1:!!t[e]&&t[e]()})}(o[7])),n.pseudo=!!o[7],n.direct=r,n}function i(e,t){var r,o,s,a=[];do{if(Ne.exec(""),(o=Ne.exec(e))&&(e=o[3],a.push(o[1]),o[2])){r=o[3];break}}while(o);for(r&&i(r,t),e=[],s=0;s<a.length;s++)">"!==a[s]&&e.push(n(a[s],[],">"===a[s-1]));return t.push(e),t}this._selectors=i(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]).length)-1;r>=0;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,i=[],r=this._selectors;function o(e,t,n){var r,s,a,l,u,c=t[n];for(r=0,s=e.length;r<s;r++){for(u=e[r],a=0,l=c.length;a<l;a++)if(!c[a](u,r,s)){a=l+1;break}if(a===l)n===t.length-1?i.push(u):u.items&&o(u.items(),t,n+1);else if(c.direct)return;u.items&&o(u.items(),t,n)}}if(e.items){for(t=0,n=r.length;t<n;t++)o(e.items(),r[t],0);n>1&&(i=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(i))}return Te||(Te=Be.Collection),new Te(i)}}),Oe=Array.prototype.push,ze=Array.prototype.slice;We={length:0,init:function(e){e&&this.add(e)},add:function(e){return a.isArray(e)?Oe.apply(this,e):e instanceof Pe?this.add(e.toArray()):Oe.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)delete n[t];return n},filter:function(e){var t,n,i,r,o=[];for("string"==typeof e?(e=new Be(e),r=function(t){return e.match(t)}):r=e,t=0,n=this.length;t<n;t++)r(i=this[t])&&o.push(i);return new Pe(o)},slice:function(){return new Pe(ze.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return a.each(this,e),this},toArray:function(){return a.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Pe(a.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(e,t){var n;return t!==undefined?(this.each(function(n){n[e]&&n[e](t)}),this):(n=this[0])&&n[e]?n[e]():void 0},exec:function(e){var t=a.toArray(arguments).slice(1);return this.each(function(n){n[e]&&n[e].apply(n,t)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},a.each("fire on off show hide append prepend before after reflow".split(" "),function(e){We[e]=function(){var t=a.toArray(arguments);return this.each(function(n){e in n&&n[e].apply(n,t)}),this}}),a.each("text name disabled active selected checked visible parent value data".split(" "),function(e){We[e]=function(t){return this.prop(e,t)}}),Pe=Ce.extend(We),Be.Collection=Pe;var Le=Pe,Ie=function(e){this.create=e.create};Ie.create=function(e,t){return new Ie({create:function(n,i){var r,o=function(e){n.set(i,e.value)};return n.on("change:"+i,function(n){e.set(t,n.value)}),e.on("change:"+t,o),(r=n._bindings)||(r=n._bindings=[],n.on("destroy",function(){for(var e=r.length;e--;)r[e]()})),r.push(function(){e.off("change:"+t,o)}),e.get(t)}})};var Fe=tinymce.util.Tools.resolve("tinymce.util.Observable");function Ve(e){return e.nodeType>0}var Ue,Ye,$e=Ce.extend({Mixins:[Fe],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof Ie&&(e[t]=n.create(this,t));this.data=e},set:function(e,t){var n,i,r=this.data[e];if(t instanceof Ie&&(t=t.create(this,e)),"object"==typeof e){for(n in e)this.set(n,e[n]);return this}return function o(e,t){var n,i;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(a.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(Ve(e)||Ve(t))return e===t;for(n in i={},t){if(!o(e[n],t[n]))return!1;i[n]=!0}for(n in e)if(!i[n]&&!o(e[n],t[n]))return!1;return!0}(r,t)||(this.data[e]=t,i={target:this,name:e,value:t,oldValue:r},this.fire("change:"+e,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return Ie.create(this,e)},destroy:function(){this.fire("destroy")}}),je={},qe={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;je[t._id]||(je[t._id]=t),Ue||(Ue=!0,C.requestAnimationFrame(function(){var e,t;for(e in Ue=!1,je)(t=je[e]).state.get("rendered")&&t.reflow();je={}},document.body))}},remove:function(e){je[e._id]&&delete je[e._id]}},Xe="onmousewheel"in document,Je=!1,Ge=0,Ke={Statics:{classPrefix:"mce-"},isRtl:function(){return Ye.rtl},classPrefix:"mce-",init:function(e){var t,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=e=a.extend({},i.Defaults,e),i._id=e.id||"mceu_"+Ge++,i._aria={role:e.role},i._elmCache={},i.$=ye,i.state=new $e({visible:!0,active:!1,disabled:!1,value:""}),i.data=new $e(e.data),i.classes=new Me(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(t=e.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&t!==n&&r(n),r(t)),a.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=e,i.borderBox=Ee(e.border),i.paddingBox=Ee(e.padding),i.marginBox=Ee(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return we.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||He(f,"border"),c.paddingBox=c.paddingBox||He(f,"padding"),c.marginBox=c.marginBox||He(f,"margin"),u=we.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=Ye.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(u>=0?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(u>=0?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(u>=0?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(u>=0?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,we.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return Ze(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return Ze(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=Ze(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return Ze(this).has(e)},parents:function(e){var t,n=new Le;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new Le(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=ye("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return Ye.translate?Ye.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var e,t,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(t=o.length;t--;)o[t].remove()}r&&r.items&&(e=[],r.items().each(function(t){t!==n&&e.push(t)}),r.items().set(e),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&ye(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return ye(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return ye(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=ye(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}Qe(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),a.controlIdLookup[o._id]=o,o._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),qe.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),e=t,t=t.parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){qe.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function Ze(e){return e._eventDispatcher||(e._eventDispatcher=new ke({scope:e,toggleEvent:function(t,n){n&&ke.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&Qe(e))}})),e._eventDispatcher}function Qe(e){var t,n,i,r,o,s;function a(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function l(){var e=r._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),r._lastHoverCtrl=null)}function u(t){var n,i,o,s=e.getParentCtrl(t.target),a=r._lastHoverCtrl,l=0;if(s!==a){if(r._lastHoverCtrl=s,(i=s.parents().toArray().reverse()).push(s),a){for((o=a.parents().toArray().reverse()).push(a),l=0;l<o.length&&i[l]===o[l];l++);for(n=o.length-1;n>=l;n--)(a=o[n]).fire("mouseleave",{target:a.getEl()})}for(n=l;n<i.length;n++)(s=i[n]).fire("mouseenter",{target:s.getEl()})}}function c(t){t.preventDefault(),"mousewheel"===t.type?(t.deltaY=-.025*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-.025*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}if(o=e._nativeEvents){for((i=e.parents().toArray()).unshift(e),t=0,n=i.length;!r&&t<n;t++)r=i[t]._eventsRoot;for(r||(r=i[i.length-1]||e),e._eventsRoot=r,n=t,t=0;t<n;t++)i[t]._eventsRoot=r;var d=r._delegates;for(s in d||(d=r._delegates={}),o){if(!o)return!1;"wheel"!==s||Je?("mouseenter"===s||"mouseleave"===s?r._hasMouseEnter||(ye(r.getEl()).on("mouseleave",l).on("mouseover",u),r._hasMouseEnter=1):d[s]||(ye(r.getEl()).on(s,a),d[s]=!0),o[s]=!1):Xe?ye(e.getEl()).on("mousewheel",c):ye(e.getEl()).on("DOMMouseScroll",c)}}}a.each("text title visible disabled active value".split(" "),function(e){Ke[e]=function(t){return 0===arguments.length?this.state.get(e):(void 0!==t&&this.state.set(e,t),this)}});var et=Ye=Ce.extend(Ke),tt=function(e){return!!e.getAttribute("data-mce-tabstop")},nt=function(e){var t,n,i=e.root;function r(e){return e&&1===e.nodeType}try{t=document.activeElement}catch(y){t=document.body}function o(e){return r(e=e||t)?e.getAttribute("role"):null}function s(e){for(var n,i=e||t;i=i.parentNode;)if(n=o(i))return n}function a(e){var n=t;if(r(n))return n.getAttribute("aria-"+e)}function l(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function u(e){var t=[];return function n(e){if(1===e.nodeType&&"none"!==e.style.display&&!e.disabled){var i;(l(i=e)&&!i.hidden||tt(i)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(o(i)))&&t.push(e);for(var r=0;r<e.childNodes.length;r++)n(e.childNodes[r])}}(e||i.getEl()),t}function c(e){var t,i;(i=(e=e||n).parents().toArray()).unshift(e);for(var r=0;r<i.length&&!(t=i[r]).settings.ariaRoot;r++);return t}function d(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function f(e,n){var i=-1,r=c();n=n||u(r.getEl());for(var o=0;o<n.length;o++)n[o]===t&&(i=o);i+=e,r.lastAriaIndex=d(i,n)}function h(){"tablist"===s()?f(-1,u(t.parentNode)):n.parent().submenu?v():f(-1)}function m(){var e=o(),n=s();"tablist"===n?f(1,u(t.parentNode)):"menuitem"===e&&"menu"===n&&a("haspopup")?b():f(1)}function g(){f(-1)}function p(){var e=o(),t=s();"menuitem"===e&&"menubar"===t?b():"button"===e&&a("haspopup")?b({key:"down"}):f(1)}function v(){n.fire("cancel")}function b(e){e=e||{},n.fire("click",{target:t,aria:e})}return n=i.getParentCtrl(t),i.on("keydown",function(e){function i(e,n){l(t)||tt(t)||"slider"!==o(t)&&!1!==n(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:i(e,h);break;case 39:i(e,m);break;case 38:i(e,g);break;case 40:i(e,p);break;case 27:v();break;case 14:case 13:case 32:i(e,b);break;case 9:!function(e){if("tablist"===s()){var t=u(n.getEl("body"))[0];t&&t.focus()}else f(e.shiftKey?-1:1)}(e),e.preventDefault()}}),i.on("focusin",function(e){t=e.target,n=e.control}),{focusFirst:function(e){var t=c(e),n=u(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?d(t.lastAriaIndex,n):d(0,n)}}},it={},rt=et.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new Le,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new Me(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=g.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=it[e]=it[e]||new Be(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}r>=0&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return a.isArray(e)||(e=[e]),a.each(e,function(e){e&&(e instanceof et||("string"==typeof e&&(e={type:e}),t=a.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=g.create(t)),i.push(e))}),i},renderNew:function(){var e=this;return e.items().each(function(t,n){var i;t.parent(e),t.state.get("rendered")||((i=e.getEl("body")).hasChildNodes()&&n<=i.childNodes.length-1?ye(i.childNodes[n]).before(t.renderHtml()):ye(i).append(t.renderHtml()),t.postRender(),qe.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var e={};return this.find("*").each(function(t){var n=t.name(),i=t.value();n&&void 0!==i&&(e[n]=i)}),e},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=nt({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(qe.remove(this),this.visible()){for(et.repaintControls=[],et.repaintControls.map={},this.recalc(),e=et.repaintControls.length;e--;)et.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),et.repaintControls=[]}return this}});function ot(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}var st,at,lt,ut,ct=function(e,t){var n,i,r,o,s,a,l,u=t.document||document;function c(){return u.getElementById(t.handle||e)}t=t||{},r=function(e){var r,d,f,h,m,g,p,v,b,y,x,w,_=(r=u,y=Math.max,d=r.documentElement,f=r.body,h=y(d.scrollWidth,f.scrollWidth),m=y(d.clientWidth,f.clientWidth),g=y(d.offsetWidth,f.offsetWidth),p=y(d.scrollHeight,f.scrollHeight),v=y(d.clientHeight,f.clientHeight),b=y(d.offsetHeight,f.offsetHeight),{width:h<g?m:h,height:p<b?v:p});ot(e),e.preventDefault(),i=e.button,x=c(),a=e.screenX,l=e.screenY,w=window.getComputedStyle?window.getComputedStyle(x,null).getPropertyValue("cursor"):x.runtimeStyle.cursor,n=ye("<div></div>").css({position:"absolute",top:0,left:0,width:_.width,height:_.height,zIndex:2147483647,opacity:1e-4,cursor:w}).appendTo(u.body),ye(u).on("mousemove touchmove",s).on("mouseup touchend",o),t.start(e)},s=function(e){if(ot(e),e.button!==i)return o(e);e.deltaX=e.screenX-a,e.deltaY=e.screenY-l,e.preventDefault(),t.drag(e)},o=function(e){ot(e),ye(u).off("mousemove touchmove",s).off("mouseup touchend",o),n.remove(),t.stop&&t.stop(e)},this.destroy=function(){ye(c()).off()},ye(c()).on("mousedown touchstart",r)},dt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var e=this,t=2;function n(){var n,i,r;function o(r,o,s,a,l,u){var c,d,f,h,m,g,p,v;if(d=e.getEl("scroll"+r)){if(p=o.toLowerCase(),v=s.toLowerCase(),ye(e.getEl("absend")).css(p,e.layoutRect()[a]-1),!l)return void ye(d).css("display","none");ye(d).css("display","block"),c=e.getEl("body"),f=e.getEl("scroll"+r+"t"),h=c["client"+s]-2*t,m=(h-=n&&i?d["client"+u]:0)/c["scroll"+s],(g={})[p]=c["offset"+o]+t,g[v]=h,ye(d).css(g),(g={})[p]=c["scroll"+o]*m,g[v]=h*m,ye(f).css(g)}}r=e.getEl("body"),n=r.scrollWidth>r.clientWidth,i=r.scrollHeight>r.clientHeight,o("h","Left","Width","contentW",n,"Height"),o("v","Top","Height","contentH",i,"Width")}e.settings.autoScroll&&(e._hasScroll||(e._hasScroll=!0,function(){function n(n,i,r,o,s){var a,l=e._id+"-scroll"+n,u=e.classPrefix;ye(e.getEl()).append('<div id="'+l+'" class="'+u+"scrollbar "+u+"scrollbar-"+n+'"><div id="'+l+'t" class="'+u+'scrollbar-thumb"></div></div>'),e.draghelper=new ct(l+"t",{start:function(){a=e.getEl("body")["scroll"+i],ye("#"+l).addClass(u+"active")},drag:function(l){var u,c,d,f,h=e.layoutRect();c=h.contentW>h.innerW,d=h.contentH>h.innerH,f=e.getEl("body")["client"+r]-2*t,u=(f-=c&&d?e.getEl("scroll"+n)["client"+s]:0)/e.getEl("body")["scroll"+r],e.getEl("body")["scroll"+i]=a+l["delta"+o]/u},stop:function(){ye("#"+l).removeClass(u+"active")}})}e.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}(),e.on("wheel",function(t){var i=e.getEl("body");i.scrollLeft+=10*(t.deltaX||0),i.scrollTop+=10*t.deltaY,n()}),ye(e.getEl("body")).on("scroll",n)),n())}},ft=rt.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[dt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),ht={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=we.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},mt=[],gt=[];function pt(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function vt(){st||(st=function(e){2!==e.button&&function(e){for(var t=mt.length;t--;){var n=mt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(pt(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},ye(document).on("click touchstart",st))}function bt(e){var t=we.getViewPort().y;function n(t,n){for(var i,r=0;r<mt.length;r++)if(mt[r]!==e)for(i=mt[r].parent();i&&(i=i.parent());)i===e&&mt[r].fixed(t).moveBy(0,n).repaint()}e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>t&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),n(!1,e._autoFixY-t)):(e._autoFixY=e.layoutRect().y,e._autoFixY<t&&(e.fixed(!0).layoutRect({y:0}).repaint(),n(!0,t-e._autoFixY))))}function yt(e,t){var n,i,r=xt.zIndex||65535;if(e)gt.push(t);else for(n=gt.length;n--;)gt[n]===t&&gt.splice(n,1);if(gt.length)for(n=0;n<gt.length;n++)gt[n].modal&&(r++,i=gt[n]),gt[n].getEl().style.zIndex=r,gt[n].zIndex=r,r++;var o=ye("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?ye(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),ut=!1),xt.currentZIndex=r}var xt=ft.extend({Mixins:[Re,ht],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(vt(),function(){if(!lt){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;lt=function(){document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,xt.hideAll())},ye(window).on("resize",lt)}}(),mt.push(t)),e.autofix&&(at||(at=function(){var e;for(e=mt.length;e--;)bt(mt[e])},ye(window).on("scroll",at)),t.on("move",function(){bt(this)})),t.on("postrender show",function(e){if(e.control===t){var n,i=t.classPrefix;t.modal&&!ut&&((n=ye("#"+i+"modal-block",t.getContainerElm()))[0]||(n=ye('<div id="'+i+'modal-block" class="'+i+"reset "+i+'fade"></div>').appendTo(t.getContainerElm())),C.setTimeout(function(){n.addClass(i+"in"),ye(t.getEl()).addClass(i+"in")}),ut=!0),yt(!0,t)}}),t.on("show",function(){t.parents().each(function(e){if(e.state.get("fixed"))return t.fixed(!0),!1})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=we.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=mt.length;e--&&mt[e]!==this;);return-1===e&&mt.push(this),t},hide:function(){return wt(this),yt(!1,this),this._super()},hideAll:function(){xt.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),yt(!1,this)),this},remove:function(){wt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function wt(e){var t;for(t=mt.length;t--;)mt[t]===e&&mt.splice(t,1);for(t=gt.length;t--;)gt[t]===e&&gt.splice(t,1)}xt.hideAll=function(){for(var e=mt.length;e--;){var t=mt[e];t&&t.settings.autohide&&(t.hide(),mt.splice(e,1))}};var _t,Rt=function(e){return!(!e||_.container)},Ct=function(e,t,n){var i,r,o=m.DOM,s=e.getParam("fixed_toolbar_container");s&&(r=o.select(s)[0]);var a=function(){if(i&&i.moveRel&&i.visible()&&!i._fixed){var t=e.selection.getScrollContainer(),n=e.getBody(),r=0,s=0;if(t){var a=o.getPos(n),l=o.getPos(t);r=Math.max(0,l.x-a.x),s=Math.max(0,l.y-a.y)}i.fixed(!1).moveRel(n,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(r,s)}},u=function(){i&&(i.show(),a(),o.addClass(e.getBody(),"mce-edit-focus"))},d=function(){i&&(i.hide(),xt.hideAll(),o.removeClass(e.getBody(),"mce-edit-focus"))},h=function(){i?i.visible()||u():(i=t.panel=g.create({type:r?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:Rt(r),fixed:Rt(r),border:1,items:[!1===l(e)?null:{type:"menubar",border:"0 0 1 0",items:oe(e)},B(e,c(e))]}),y(e),r?i.renderTo(r).reflow():i.renderTo().reflow(),w(e,i),u(),F(e),e.on("nodeChange",a),e.on("ResizeWindow",a),e.on("activate",u),e.on("deactivate",d),e.nodeChanged())};return e.settings.content_editable=!0,e.on("focus",function(){!1===f(e)&&n.skinUiCss?o.styleSheetLoader.load(n.skinUiCss,h,h):h()}),e.on("blur hide",d),e.on("remove",function(){i&&(i.remove(),i=null)}),!1===f(e)&&n.skinUiCss?o.styleSheetLoader.load(n.skinUiCss,ge(e)):ge(e)(),{}},kt=function(e,t){var n,i,r=this,o=et.classPrefix;r.show=function(s,a){function l(){n&&(ye(e).append('<div class="'+o+"throbber"+(t?" "+o+"throbber-inline":"")+'"></div>'),a&&a())}return r.hide(),n=!0,s?i=C.setTimeout(l,s):l(),r},r.hide=function(){var t=e.lastChild;return C.clearTimeout(i),t&&-1!==t.className.indexOf("throbber")&&t.parentNode.removeChild(t),n=!1,r}},Et=function(e,t){var n;e.on("ProgressState",function(e){n=n||new kt(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Ht=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):s.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),Et(e,t),e.getParam("inline",!1,"boolean")?Ct(e,t,n):be(e,t,n)},St=et.extend({Mixins:[Re],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Mt=et.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&!1!==Mt.tooltips&&(t.on("mouseenter",function(n){var i=t.tooltip().moveTo(-65535);if(n.control===t){var r=i.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);i.classes.toggle("tooltip-n","bc-tc"===r),i.classes.toggle("tooltip-nw","bc-tl"===r),i.classes.toggle("tooltip-ne","bc-tr"===r),i.moveRel(t.getEl(),r)}else i.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return _t||(_t=new St({type:"tooltip"})).renderTo(),_t},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var e=this;function t(t){e.aria("disabled",t),e.classes.toggle("disabled",t)}function n(t){e.aria("pressed",t),e.classes.toggle("active",t)}return e.state.on("change:disabled",function(e){t(e.value)}),e.state.on("change:active",function(e){n(e.value)}),e.state.get("disabled")&&t(!0),e.state.get("active")&&n(!0),e._super()},remove:function(){this._super(),_t&&(_t.remove(),_t=null)}}),Tt=Mt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var e=this;function t(t){t=e.settings.filter(t),e.getEl().lastChild.innerHTML=t+"%",e.getEl().firstChild.firstChild.style.width=t+"%"}return e.state.on("change:value",function(e){t(e.value)}),t(e.state.get("value")),e._super()}}),Pt=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Wt=et.extend({Mixins:[Re],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Tt),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progressBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return C.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),Pt(e,e.state.get("text"))},100),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().firstChild.innerHTML=t.value,Pt(e,t.value)}),e.progressBar&&(e.progressBar.bindStates(),e.progressBar.state.on("change:value",function(t){Pt(e,e.state.get("text"))})),e._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}}),Dt=function(e){var t=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(n,i){var r,o=a.extend(n,{maxWidth:(r=t(e),we.getSize(r).width)}),s=new Wt(o);return s.args=o,o.timeout>0&&(s.timer=setTimeout(function(){s.close(),i()},o.timeout)),s.on("close",function(){i()}),s.renderTo(),s},close:function(e){e.close()},reposition:function(n){var i;i=n,ee.each(i,function(e){e.moveTo(0,0)}),function(n){if(n.length>0){var i=n.slice(0,1)[0],r=t(e);i.moveRel(r,"tc-tc"),ee.each(n,function(e,t){t>0&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(n)},getArgs:function(e){return e.args}}},Nt=[],At="";function Bt(e){var t,n=ye("meta[name=viewport]")[0];!1!==_.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==At&&(At=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":At))}function Ot(e,t){(function(){for(var e=0;e<Nt.length;e++)if(Nt[e]._fullscreen)return!0;return!1})()&&!1===t&&ye([document.documentElement,document.body]).removeClass(e+"fullscreen")}var zt=xt.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var t=this;t._super(e),t.isRtl()&&t.classes.add("rtl"),t.classes.add("window"),t.bodyClasses.add("window-body"),t.state.set("fixed",!0),e.buttons&&(t.statusbar=new ft({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:t.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),t.statusbar.classes.add("foot"),t.statusbar.parent(t)),t.on("click",function(e){var n=t.classPrefix+"close";(we.hasClass(e.target,n)||we.hasClass(e.target.parentNode,n))&&t.close()}),t.on("cancel",function(){t.close()}),t.aria("describedby",t.describedBy||t._id+"-none"),t.aria("label",e.title),t._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(we.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=we.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=we.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var t,n,i=this,r=document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(ye(window).on("resize",function(){var e;if(i._fullscreen)if(t)i._timer||(i._timer=C.setTimeout(function(){var e=we.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var n=we.getWindowSize();i.moveTo(0,0).resizeTo(n.w,n.h),(new Date).getTime()-e>50&&(t=!0)}}),n=i.layoutRect(),i._fullscreen=e,e){i._initial={x:n.x,y:n.y,w:n.w,h:n.h},i.borderBox=Ee("0"),i.getEl("head").style.display="none",n.deltaH-=n.headerH+2,ye([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=we.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Ee(i.settings.border),i.getEl("head").style.display="",n.deltaH+=n.headerH,ye([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var e,t=this;setTimeout(function(){t.classes.add("in"),t.fire("open")},0),t._super(),t.statusbar&&t.statusbar.postRender(),t.focus(),this.dragHelper=new ct(t._id+"-dragh",{start:function(){e={x:t.layoutRect().x,y:t.layoutRect().y}},drag:function(n){t.moveTo(e.x+n.deltaX,e.y+n.deltaY)}}),t.on("submit",function(e){e.isDefaultPrevented()||t.close()}),Nt.push(t),Bt(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),Ot(t.classPrefix,!1),e=Nt.length;e--;)Nt[e]===t&&Nt.splice(e,1);Bt(Nt.length>0)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!_.desktop){var e={w:window.innerWidth,h:window.innerHeight};C.setInterval(function(){var t=window.innerWidth,n=window.innerHeight;e.w===t&&e.h===n||(e={w:t,h:n},ye(window).trigger("resize"))},100)}ye(window).on("resize",function(){var e,t,n=we.getWindowSize();for(e=0;e<Nt.length;e++)t=Nt[e].layoutRect(),Nt[e].moveTo(Nt[e].settings.x||Math.max(0,n.w/2-t.w/2),Nt[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Lt=zt.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,n=e.callback||function(){};function i(e,t,i){return{type:"button",text:e,subtype:i?"primary":"",onClick:function(e){e.control.parents()[1].close(),n(t)}}}switch(e.buttons){case Lt.OK_CANCEL:t=[i("Ok",!0,!0),i("Cancel",!1)];break;case Lt.YES_NO:case Lt.YES_NO_CANCEL:t=[i("Yes",1,!0),i("No",0)],e.buttons===Lt.YES_NO_CANCEL&&t.push(i("Cancel",-1));break;default:t=[i("Ok",!0,!0)]}return new zt({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){n(!1)}}).renderTo(document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,Lt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=Lt.OK_CANCEL,Lt.msgBox(e)}}}),It=function(e){return{renderUI:function(t){return Ht(e,this,t)},resizeTo:function(t,n){return ue(e,t,n)},resizeBy:function(t,n){return ce(e,t,n)},getNotificationManagerImpl:function(){return Dt(e)},getWindowManagerImpl:function(){return{open:function(e,t,n){var i;return e.title=e.title||" ",e.url=e.url||e.file,e.url&&(e.width=parseInt(e.width||320,10),e.height=parseInt(e.height||240,10)),e.body&&(e.items={defaults:e.defaults,type:e.bodyType||"form",items:e.body,data:e.data,callbacks:e.commands}),e.url||e.buttons||(e.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new zt(e)).on("close",function(){n(i)}),e.data&&i.on("postRender",function(){this.find("*").each(function(t){var n=t.name();n in e.data&&t.value(e.data[n])})}),i.features=e||{},i.params=t||{},i=i.renderTo().reflow()},alert:function(e,t,n){var i;return(i=Lt.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=Lt.confirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},Ft=Ce.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=a.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),Vt=Ft.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),Ut=Mt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var e=this,t=e.$,n=e.classPrefix+"txt";function i(i){var r=t("span."+n,e.getEl());i?(r[0]||(t("button:first",e.getEl()).append('<span class="'+n+'"></span>'),r=t("span."+n,e.getEl())),r.html(e.encode(i))):r.remove(),e.classes.toggle("btn-has-text",!!i)}return e.state.on("change:text",function(e){i(e.value)}),e.state.on("change:icon",function(t){var n=t.value,r=e.classPrefix;e.settings.icon=n,n=n?r+"ico "+r+"i-"+e.settings.icon:"";var o=e.getEl().firstChild,s=o.getElementsByTagName("i")[0];n?(s&&s===o.firstChild||(s=document.createElement("i"),o.insertBefore(s,o.firstChild)),s.className=n):s&&o.removeChild(s),i(e.state.get("text"))}),e._super()}}),Yt=Ut.extend({init:function(e){e=a.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var e=this,t=we.create("input",{type:"file",id:e._id+"-browse",accept:e.settings.accept});e._super(),ye(t).on("change",function(t){var n=t.target.files;e.value=function(){return n.length?e.settings.multiple?n:n[0]:null},t.preventDefault(),n.length&&e.fire("change",t)}),ye(t).on("click",function(e){e.stopPropagation()}),ye(e.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),e.getEl().appendChild(t)},remove:function(){ye(this.getEl("button")).off(),ye(this.getEl("input")).off(),this._super()}}),$t=rt.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),jt=Mt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){var e=this;function t(t){e.classes.toggle("checked",t),e.aria("checked",t)}return e.state.on("change:text",function(t){e.getEl("al").firstChild.data=e.translate(t.value)}),e.state.on("change:checked change:value",function(n){e.fire("change"),t(n.value)}),e.state.on("change:icon",function(t){var n=t.value,i=e.classPrefix;if(void 0===n)return e.settings.icon;e.settings.icon=n,n=n?i+"ico "+i+"i-"+e.settings.icon:"";var r=e.getEl().firstChild,o=r.getElementsByTagName("i")[0];n?(o&&o===r.firstChild||(o=document.createElement("i"),r.insertBefore(o,r.firstChild)),o.className=n):o&&r.removeChild(o)}),e.state.get("checked")&&t(!0),e._super()}}),qt=tinymce.util.Tools.resolve("tinymce.util.VK"),Xt=Mt.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,r=t.getEl();if(ye.contains(r,i)||i===r)for(;i&&i!==r;)i.id&&-1!==i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){var n;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),t.parents().reverse().each(function(e){if(e.toJSON)return n=e,!1}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){if("INPUT"===e.target.nodeName){var n=t.state.get("value"),i=e.target.value;i!==n&&(t.state.set("value",i),t.fire("autocomplete",e))}}),t.on("mouseover",function(e){var n=t.tooltip().moveTo(-65535);if(t.statusLevel()&&-1!==e.target.className.indexOf(t.classPrefix+"status")){var i=t.statusMessage()||"Ok",r=n.text(i).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);n.classes.toggle("tooltip-n","bc-tc"===r),n.classes.toggle("tooltip-nw","bc-tl"===r),n.classes.toggle("tooltip-ne","bc-tr"===r),n.moveRel(e.target,r)}})},statusLevel:function(e){return arguments.length>0&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return arguments.length>0&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=g.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show"),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(we.getRuntimeStyle(a,"padding-right"),10)-parseInt(we.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-we.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(t=n.layoutRect().h-2+"px"),ye(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var e=this;return ye(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,t){var n=this;if(0!==e.length){n.menu?n.menu.items().remove():n.menu=g.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(n).renderTo(),a.each(e,function(e){var i,r;n.menu.add({text:e.title,url:e.previewUrl,match:t,classes:"menu-item-ellipsis",onclick:(i=e.value,r=e.title,function(){n.fire("selectitem",{title:r,value:i})})})}),n.menu.renderNew(),n.hideMenu(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()});var i=n.layoutRect().w;n.menu.layoutRect({w:i,minW:0,maxW:i}),n.menu.repaint(),n.menu.reflow(),n.menu.show(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else n.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var e=this;e.state.on("change:value",function(t){e.getEl("inp").value!==t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e.state.on("change:statusLevel",function(t){var n=e.getEl("status"),i=e.classPrefix,r=t.value;we.css(n,"display","none"===r?"none":""),we.toggleClass(n,i+"i-checkmark","ok"===r),we.toggleClass(n,i+"i-warning","warn"===r),we.toggleClass(n,i+"i-error","error"===r),e.classes.toggle("has-status","none"!==r),e.repaint()}),we.on(e.getEl("status"),"mouseleave",function(){e.tooltip().hide()}),e.on("cancel",function(t){e.menu&&e.menu.visible()&&(t.stopPropagation(),e.hideMenu())});var t=function(e,t){t&&t.items().length>0&&t.items().eq(e)[0].focus()};return e.on("keydown",function(n){var i=n.keyCode;"INPUT"===n.target.nodeName&&(i===qt.DOWN?(n.preventDefault(),e.fire("autocomplete"),t(0,e.menu)):i===qt.UP&&(n.preventDefault(),t(-1,e.menu)))}),e._super()},remove:function(){ye(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),Jt=Xt.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}}),Gt=Ut.extend({showPanel:function(){var e=this,t=e.settings;if(e.classes.add("opened"),e.panel)e.panel.show();else{var n=t.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,e.panel=new xt(n).on("hide",function(){e.classes.remove("opened")}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}var i=e.panel.testMoveRel(e.getEl(),t.popoverAlign||(e.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl"]));e.panel.classes.toggle("start","bc-tl"===i),e.panel.classes.toggle("end","bc-tr"===i),e.panel.moveRel(e.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),Kt=m.DOM,Zt=Gt.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(n){n.aria&&"down"===n.aria.key||n.control!==e||Kt.getParent(n.target,"."+e.classPrefix+"open")||(n.stopImmediatePropagation(),t.call(e,n))}),delete e.settings.onclick,e._super()}}),Qt=tinymce.util.Tools.resolve("tinymce.util.Color"),en=Mt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var e,t,n,i,r,o=this,s=o.color();function a(e,t){var n,i,r=we.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function l(e,t){var s=(360-e.h)/360;we.css(n,{top:100*s+"%"}),t||we.css(r,{left:e.s+"%",top:100-e.v+"%"}),i.style.background=Qt({s:100,v:100,h:e.h}).toHex(),o.color().parse({s:e.s,v:e.v,h:e.h})}function u(t){var n;n=a(i,t),e.s=100*n.x,e.v=100*(1-n.y),l(e),o.fire("change")}function c(n){var i;i=a(t,n),(e=s.toHsv()).h=360*(1-i.y),l(e,!0),o.fire("change")}t=o.getEl("h"),n=o.getEl("hp"),i=o.getEl("sv"),r=o.getEl("svp"),o._repaint=function(){l(e=s.toHsv())},o._super(),o._svdraghelper=new ct(o._id+"-sv",{start:u,drag:u}),o._hdraghelper=new ct(o._id+"-h",{start:c,drag:c}),o._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=Qt()),this._color},renderHtml:function(){var e,t=this._id,n=this.classPrefix,i="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+n+'colorpicker-h" style="background: -ms-linear-gradient(top,'+i+");background: linear-gradient(to bottom,"+i+');">'+function(){var e,t,r,o,s="";for(r="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(o=i.split(",")).length-1;e<t;e++)s+='<div class="'+n+'colorpicker-h-chunk" style="height:'+100/t+"%;"+r+o[e]+",endColorstr="+o[e+1]+");-ms-"+r+o[e]+",endColorstr="+o[e+1]+')"></div>';return s}()+'<div id="'+t+'-hp" class="'+n+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+n+'colorpicker-sv"><div class="'+n+'colorpicker-overlay1"><div class="'+n+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+n+'colorpicker-selector1"><div class="'+n+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),tn=Mt.extend({init:function(e){e=a.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=we.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&we.css(t,"height",n.height+"px"),n.width&&we.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var e=this,t=function(t){t.preventDefault(),e.classes.toggle("dragenter"),e.getEl().className=e.classes};e._super(),e.$el.on("dragover",function(e){e.preventDefault()}),e.$el.on("dragenter",t),e.$el.on("dragleave",t),e.$el.on("drop",function(t){if(t.preventDefault(),!e.state.get("disabled")){var n=function(t){var n=e.settings.accept;if("string"!=typeof n)return t;var i=new RegExp("("+n.split(/\s*,\s*/).join("|")+")$","i");return a.grep(t,function(e){return i.test(e.name)})}(t.dataTransfer.files);e.value=function(){return n.length?e.settings.multiple?n:n[0]:null},n.length&&e.fire("change",t)}})},remove:function(){this.$el.off(),this._super()}}),nn=Mt.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n;(n=e.target.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(t>0?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),rn=nn.extend({postRender:function(){var e=this,t=e.settings.editor;function n(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==t.settings.elementpath&&(e.on("select",function(e){t.focus(),t.selection.select(this.row()[e.index].element),t.nodeChanged()}),t.on("nodeChange",function(i){for(var r=[],o=i.parents,s=o.length;s--;)if(1===o[s].nodeType&&!n(o[s])){var a=t.fire("ResolveName",{name:o[s].nodeName.toLowerCase(),target:o[s]});if(a.isDefaultPrevented()||r.push({name:a.name,element:o[s]}),a.isPropagationStopped())break}e.row(r)})),e._super()}}),on=rt.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),sn=rt.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,t=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),t.each(function(t){var n,i=t.settings.label;i&&((n=new on(a.extend({items:{type:"label",id:t._id+"-l",text:i,flex:0,forId:t._id,disabled:t.disabled()}},e.settings.formItemDefaults))).type="formitem",t.aria("labelledby",t._id+"-l"),"undefined"==typeof t.settings.flex&&(t.settings.flex=1),e.replace(t,n),n.add(t))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var e=this;function t(){var t,n,i=0,r=[];if(!1!==e.settings.labelGapCalc)for(("children"===e.settings.labelGapCalc?e.find("formitem"):e.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=n>i?n:i,r.push(t)}),n=e.settings.labelGap||0,t=r.length;t--;)r[t].settings.minWidth=i+n}e._super(),e.on("show",t),t()}}),an=sn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),ln=0,un=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++ln+String(t)},cn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:E.constant(e)}},dn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return cn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return cn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return cn(n)},fromDom:cn,fromPoint:function(e,t,n){return W.from(e.dom().elementFromPoint(t,n)).map(cn)}},fn=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(null,arguments)),t}},hn=8,mn=9,gn=1,pn=3,vn=function(e){return e.dom().nodeName.toLowerCase()},bn=function(e){return e.dom().nodeType},yn=function(e){return function(t){return bn(t)===e}},xn=yn(gn),wn=yn(pn),_n=yn(mn),Rn={name:vn,type:bn,value:function(e){return e.dom().nodeValue},isElement:xn,isText:wn,isDocument:_n,isComment:function(e){return bn(e)===hn||"#comment"===vn(e)}},Cn=(fn(function(){return Cn(dn.fromDom(document))}),function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return dn.fromDom(t)}),kn=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(t)===e}},En=(kn("string"),kn("object"),kn("array"),kn("null"),kn("boolean"),kn("undefined"),kn("function"),kn("number"),Object.keys,undefined,function(){var e=arguments;return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var i={};return ee.each(e,function(e,n){i[e]=E.constant(t[n])}),i}}),Hn=("undefined"!=typeof window?window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return Mn(i(1),i(2))}),Sn=function(){return Mn(0,0)},Mn=function(e,t){return{major:e,minor:t}},Tn={nu:Mn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Sn():Hn(e,n)},unknown:Sn},Pn="Firefox",Wn=function(e,t){return function(){return t===e}},Dn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Wn("Edge",t),isChrome:Wn("Chrome",t),isIE:Wn("IE",t),isOpera:Wn("Opera",t),isFirefox:Wn(Pn,t),isSafari:Wn("Safari",t)}},Nn={unknown:function(){return Dn({current:undefined,version:Tn.unknown()})},nu:Dn,edge:E.constant("Edge"),chrome:E.constant("Chrome"),ie:E.constant("IE"),opera:E.constant("Opera"),firefox:E.constant(Pn),safari:E.constant("Safari")},An="Windows",Bn="Android",On="Solaris",zn="FreeBSD",Ln=function(e,t){return function(){return t===e}},In=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Ln(An,t),isiOS:Ln("iOS",t),isAndroid:Ln(Bn,t),isOSX:Ln("OSX",t),isLinux:Ln("Linux",t),isSolaris:Ln(On,t),isFreeBSD:Ln(zn,t)}},Fn={unknown:function(){return In({current:undefined,version:Tn.unknown()})},nu:In,windows:E.constant(An),ios:E.constant("iOS"),android:E.constant(Bn),linux:E.constant("Linux"),osx:E.constant("OSX"),solaris:E.constant(On),freebsd:E.constant(zn)},Vn=function(e,t){var n=String(t).toLowerCase();return ee.find(e,function(e){return e.search(n)})},Un=function(e,t){return Vn(e,t).map(function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Yn=function(e,t){return Vn(e,t).map(function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},$n=function(e,t){return-1!==e.indexOf(t)},jn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,qn=function(e){return function(t){return $n(t,e)}},Xn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return $n(e,"edge/")&&$n(e,"chrome")&&$n(e,"safari")&&$n(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,jn],search:function(e){return $n(e,"chrome")&&!$n(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return $n(e,"msie")||$n(e,"trident")}},{name:"Opera",versionRegexes:[jn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:qn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:qn("firefox")},{name:"Safari",versionRegexes:[jn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return($n(e,"safari")||$n(e,"mobile/"))&&$n(e,"applewebkit")}}],Jn=[{name:"Windows",search:qn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return $n(e,"iphone")||$n(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:qn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:qn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:qn("linux"),versionRegexes:[]},{name:"Solaris",search:qn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:qn("freebsd"),versionRegexes:[]}],Gn={browsers:E.constant(Xn),oses:E.constant(Jn)},Kn=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=Gn.browsers(),h=Gn.oses(),m=Un(f,e).fold(Nn.unknown,Nn.nu),g=Yn(h,e).fold(Fn.unknown,Fn.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:E.constant(r),isiPhone:E.constant(o),isTablet:E.constant(l),isPhone:E.constant(c),isTouch:E.constant(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:E.constant(d)})}},Zn=gn,Qn=mn,ei=function(e){return e.nodeType!==Zn&&e.nodeType!==Qn||0===e.childElementCount},ti={all:function(e,t){var n=t===undefined?document:t.dom();return ei(n)?[]:ee.map(n.querySelectorAll(e),dn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==Zn)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return ei(n)?W.none():W.from(n.querySelector(e)).map(dn.fromDom)}},ni=(fn(function(){var e=navigator.userAgent;return Kn(e)})().browser.isIE(),En("element","offset"),function(e,t){return ti.all(t,e)}),ii=a.trim,ri=function(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},oi=ri("true"),si=ri("false"),ai=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},li=function(e){return e.innerText||e.textContent},ui=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&di(e);var t},ci=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},di=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return oi(e)}return!1}(e)&&!si(e)},fi=function(e){return ci(e)&&di(e)},hi=function(e){var t,n,i=(t=e).id?t.id:un("h");return ai("header",li(e),"#"+i,ci(n=e)?parseInt(n.nodeName.substr(1),10):0,function(){e.id=i})},mi=function(e){var t=e.id||e.name,n=li(e);return ai("anchor",n||"#"+t,"#"+t,0,E.noop)},gi=function(e){var t,n;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,ee.map(ni(dn.fromDom(n),t),function(e){return e.dom()})},pi=function(e){return ii(e.title).length>0},vi=function(e){var t,n,i=gi(e);return ee.filter((n=i,ee.map(ee.filter(n,fi),hi)).concat((t=i,ee.map(ee.filter(t,ui),mi))),pi)},bi={},yi=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},xi=function(e,t){return{title:e,value:{title:e,url:t,attach:E.noop}}},wi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},_i=function(e,t,n,i){var r,o,s,l,u={title:"-"},c=function(e){var i=e.hasOwnProperty(n)?e[n]:[],r=ee.filter(i,function(e){return n=e,i=t,!ee.exists(i,function(e){return e.url===n});var n,i});return a.map(r,function(e){return{title:e,value:{title:e,url:e,attach:E.noop}}})},d=function(e){var n,i=ee.filter(t,function(t){return t.type===e});return n=i,a.map(n,yi)};return!1===i.typeahead_urls?[]:"file"===n?(r=[Ri(e,c(bi)),Ri(e,d("header")),Ri(e,(o=d("anchor"),s=wi(i,"anchor_top","#top"),l=wi(i,"anchor_bottom","#bottom"),null!==s&&o.unshift(xi("<top>",s)),null!==l&&o.push(xi("<bottom>",l)),o))],ee.foldl(r,function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(u,t)},[])):Ri(e,c(bi))},Ri=function(e,t){var n=e.toLowerCase(),i=a.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},Ci=function(e,t,n,i){var r=function(r){var o=vi(n),s=_i(r,o,i,t);e.showAutoComplete(s,r)};e.on("autocomplete",function(){r(e.value())}),e.on("selectitem",function(t){var n=t.value;e.value(n.url);var r,o=(r=n.title).raw?r.raw:r;"image"===i?e.fire("change",{meta:{alt:o,attach:n.attach}}):e.fire("change",{meta:{text:o,attach:n.attach}}),e.focus()}),e.on("click",function(t){0===e.value().length&&"INPUT"===t.target.nodeName&&r("")}),e.on("PostRender",function(){e.getRoot().on("submit",function(t){var n,r,o;t.isDefaultPrevented()||(n=e.value(),o=bi[r=i],/^https?/.test(n)&&(o?-1===ee.indexOf(o,n)&&(bi[r]=o.slice(0,5).concat(n)):bi[r]=[n]))})})},ki=function(e,t,n){var i=t.filepicker_validator_handler;i&&e.state.on("change:value",function(t){var r;0!==(r=t.value).length?i({url:r,type:n},function(t){var n,i,r,o=(i=(n=t).status,r=n.message,"valid"===i?{status:"ok",message:r}:"unknown"===i?{status:"warn",message:r}:"invalid"===i?{status:"warn",message:r}:{status:"none",message:""});e.statusMessage(o.message),e.statusLevel(o.status)}):e.statusLevel("none")})},Ei=Xt.extend({Statics:{clearHistory:function(){bi={}}},init:function(e){var t,n,i,r=this,o=window.tinymce?window.tinymce.activeEditor:s.activeEditor,l=o.settings,u=e.filetype;e.spellcheck=!1,(i=l.file_picker_types||l.file_browser_callback_types)&&(i=a.makeMap(i,/[, ]/)),i&&!i[u]||(!(n=l.file_picker_callback)||i&&!i[u]?!(n=l.file_browser_callback)||i&&!i[u]||(t=function(){n(r.getEl("inp").id,r.value(),u,window)}):t=function(){var e=r.fire("beforecall").meta;e=a.extend({filetype:u},e),n.call(o,function(e,t){r.value(e).fire("change",{meta:t})},r.value(),e)}),t&&(e.icon="browse",e.onaction=t),r._super(e),r.classes.add("filepicker"),Ci(r,l,o.getBody(),u),ki(r,l,u)}}),Hi=Vt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),Si=Vt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,k,E,H,S,M,T,P,W,D,N,A,B,O,z=[],L=Math.max,I=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(C="y",_="h",R="minH",k="maxH",H="innerH",E="top",S="deltaH",M="contentH",N="left",W="w",T="x",P="innerW",D="minW",A="right",B="deltaW",O="contentW"):(C="x",_="w",R="minW",k="maxW",H="innerW",E="left",S="deltaW",M="contentW",N="top",W="h",T="y",P="innerH",D="minH",A="bottom",B="deltaH",O="contentH"),d=r[H]-o[E]-o[E],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),g=h.settings.flex,d-=t<n-1?u:0,g>0&&(c+=g,m[k]&&z.push(h),m.flex=g),d-=m[R],(p=o[N]+m[D]+o[A])>w&&(w=p);if((y={})[R]=d<0?r[R]-d+r[S]:r[H]-d+r[S],y[D]=w+r[B],y[M]=r[H]-d,y[O]=w,y.minW=I(y.minW,r.maxW),y.minH=I(y.minH,r.maxH),y.minW=L(y.minW,r.startMinWidth),y.minH=L(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=z.length;t<n;t++)v=(m=(h=z[t]).layoutRect())[k],(p=m[R]+m.flex*b)>v?(d-=m[k]-m[R],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[E],y={},0===c&&("end"===l?x=d+o[E]:"center"===l?(x=Math.round(r[H]/2-(r[H]-d)/2)+o[E])<0&&(x=o[E]):"justify"===l&&(x=o[E],u=Math.floor(d/(i.length-1)))),y[T]=o[N],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[R],"center"===a?y[T]=Math.round(r[P]/2-m[W]/2):"stretch"===a?(y[W]=L(m[D]||0,r[P]-o[N]-o[A]),y[T]=o[N]):"end"===a&&(y[T]=r[P]-m[W]-o.top),m.flex>0&&(p+=m.flex*b),y[_]=p,y[C]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),Mi=Ft.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}}),Ti=function(e,t){return ti.one(t,e)},Pi=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},Wi=function(e,t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}},Di=function(e){e.addMenuItem("align",{text:"Align",menu:[{text:"Left",icon:"alignleft",onclick:Pi(e,"alignleft")},{text:"Center",icon:"aligncenter",onclick:Pi(e,"aligncenter")},{text:"Right",icon:"alignright",onclick:Pi(e,"alignright")},{text:"Justify",icon:"alignjustify",onclick:Pi(e,"alignjustify")}]}),a.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{active:!1,tooltip:t[0],cmd:t[1],onPostRender:Wi(e,n)})})},Ni=function(e){return function(t,n){return W.from(n).map(dn.fromDom).filter(Rn.isElement).bind(function(n){return function(e,t,n){for(;n!==t;){if(n.style[e]){var i=n.style[e];return""!==i?W.some(i):W.none()}n=n.parentNode}return W.none()}(e,t,n.dom()).or((i=e,r=n.dom(),W.from(m.DOM.getStyle(r,i,!0))));var i,r}).getOr("")}},Ai={getFontSize:Ni("fontSize"),getFontFamily:E.compose(function(e){return e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")},Ni("fontFamily")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r}},Bi=function(e){return e?e.split(",")[0]:""},Oi=function(e,t){return function(){var n=this;e.on("init nodeChange",function(i){var r,o,s,l=Ai.getFontFamily(e.getBody(),i.element),u=(r=t,o=l,a.each(r,function(e){e.value.toLowerCase()===o.toLowerCase()&&(s=e.value)}),a.each(r,function(e){s||Bi(e.value).toLowerCase()!==Bi(o).toLowerCase()||(s=e.value)}),s);n.value(u||null),!u&&l&&n.text(Bi(l))})}},zi=function(e){e.addButton("fontselect",function(){var t,n=(t=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),a.map(t,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:Oi(e,n),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}})},Li=function(e){zi(e)},Ii=function(e,t,n){var i;return a.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},Fi=function(e){e.addButton("fontsizeselect",function(){var t,n,i,r=(t=e.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",a.map(t.split(" "),function(e){var t=e,n=e,i=e.split("=");return i.length>1&&(t=i[0],n=i[1]),{text:t,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:r,fixedWidth:!0,onPostRender:(n=e,i=r,function(){var e=this;n.on("init nodeChange",function(t){var r,o,s,a;if(r=Ai.getFontSize(n.getBody(),t.element))for(s=3;!a&&s>=0;s--)o=Ai.toPt(r,s),a=Ii(i,o,r);e.value(a||null),a||e.text(o)})}),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}})},Vi=function(e){Fi(e)},Ui=function(e,t){return function(){var n,i,r,o=[];return a.each(t,function(t){o.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:t[0][0],values:o,fixedWidth:!0,onselect:function(t){if(t.control){var n=t.control.value();Pi(e,n)()}},onPostRender:(n=e,i=o,function(){var e=this;n.on("nodeChange",function(t){var o=n.formatter,s=null;a.each(t.parents,function(e){if(a.each(i,function(t){if(r?o.matchNode(e,r,{value:t.value})&&(s=t.value):o.matchNode(e,t.value)&&(s=t.value),s)return!1}),s)return!1}),e.value(s)})})}}},Yi=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,a.map(n,function(e){return{text:e[0],onclick:Pi(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",Ui(e,i))},$i=function(e,t){var n=t.length;return a.each(t,function(t){t.menu&&(t.hidden=0===$i(e,t.menu));var i=t.format;i&&(t.hidden=!e.formatter.canApply(i)),t.hidden&&n--}),n},ji=function(e,t){var n=t.items().length;return t.items().each(function(t){t.menu&&t.visible(ji(e,t.menu)>0),!t.menu&&t.settings.menu&&t.visible($i(e,t.settings.menu)>0);var i=t.settings.format;i&&t.visible(e.formatter.canApply(i)),t.visible()||n--}),n},qi=function(e){var t,n,i,r,o,s,l,u,c=(n=0,i=[],r=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],o=function(e){var t=[];if(e)return a.each(e,function(e){var r={text:e.title,icon:e.icon};if(e.items)r.menu=o(e.items);else{var s=e.format||"custom"+n++;e.format||(e.name=s,i.push(e)),r.format=s,r.cmd=e.cmd}t.push(r)}),t},(t=e).on("init",function(){a.each(i,function(e){t.formatter.register(e.name,e)})}),{type:"menu",items:t.settings.style_formats_merge?t.settings.style_formats?o(r.concat(t.settings.style_formats)):o(r):o(t.settings.style_formats||r),onPostRender:function(e){t.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return t.formatter.getCssText(this.settings.format)},onPostRender:function(){var e=this;e.parent().on("show",function(){var n,i;(n=e.settings.format)&&(e.disabled(!t.formatter.canApply(n)),e.active(t.formatter.match(n))),(i=e.settings.cmd)&&e.active(t.queryCommandState(i))})},onclick:function(){this.settings.format&&Pi(t,this.settings.format)(),this.settings.cmd&&t.execCommand(this.settings.cmd)}}});s=c,e.addMenuItem("formats",{text:"Formats",menu:s}),u=c,(l=e).addButton("styleselect",{type:"menubutton",text:"Formats",menu:u,onShowMenu:function(){l.settings.style_formats_autohide&&ji(l,this.menu)}})},Xi=function(e,t){var n,i;if("string"==typeof t)i=t.split(" ");else if(a.isArray(t))return ee.flatten(a.map(t,function(t){return Xi(e,t)}));return n=a.grep(i,function(t){return"|"===t||t in e.menuItems}),a.map(n,function(t){return"|"===t?{text:"-"}:e.menuItems[t]})},Ji=function(e){return e&&"-"===e.text},Gi=function(e){var t=ee.filter(e,function(e,t,n){return!Ji(e)||!Ji(n[t-1])});return ee.filter(t,function(e,t,n){return!Ji(e)||t>0&&t<n.length-1})},Ki=function(e){var t,n,i,r,o=e.settings.insert_button_items;return Gi(o?Xi(e,o):(t=e,n="insert",i=[{text:"-"}],r=a.grep(t.menuItems,function(e){return e.context===n}),a.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},Zi=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(Ki(t)),this.menu.renderNew()}})},Qi=function(e){var t,n,i;t=e,a.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,n){t.addButton(n,{active:!1,tooltip:e,onPostRender:Wi(t,n),onclick:Pi(t,n)})}),n=e,a.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){n.addButton(t,{tooltip:e[0],cmd:e[1]})}),i=e,a.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Wi(i,t)})})},er=function(e){var t;Qi(e),t=e,a.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,n){t.addMenuItem(n,{text:e[0],icon:n,shortcut:e[2],cmd:e[1]})}),t.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:Pi(t,"code")})},tr=function(e,t){return function(){var n=this,i=function(){var n="redo"===t?"hasRedo":"hasUndo";return!!e.undoManager&&e.undoManager[n]()};n.disabled(!i()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){n.disabled(e.readonly||!i())})}},nr=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:tr(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:tr(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:tr(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:tr(n,"redo"),cmd:"redo"})},ir=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var e=this;n.on("VisualAid",function(t){e.active(t.hasVisual)}),e.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},rr={setup:function(e){var t;e.rtl&&(et.rtl=!0),e.on("mousedown",function(){xt.hideAll()}),(t=e).settings.ui_container&&(_.container=Ti(dn.fromDom(document.body),t.settings.ui_container).fold(E.constant(null),function(e){return e.dom()})),Mt.tooltips=!_.iOS,et.translate=function(e){return s.translate(e)},Yi(e),Di(e),er(e),nr(e),Vi(e),Li(e),qi(e),ir(e),Zi(e)}},or=Vt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,k,E,H,S,M=[],T=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,S="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)M.push(0);for(f=0;f<n;f++)T.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)C=(u=c.layoutRect()).minW,k=u.minH,M[d]=C>M[d]?C:M[d],T[f]=k>T[f]?k:T[f];for(E=o.innerW-p.left-p.right,_=0,d=0;d<i;d++)_+=M[d]+(d>0?b:0),E-=(d>0?b:0)+M[d];for(H=o.innerH-p.top-p.bottom,R=0,f=0;f<n;f++)R+=T[f]+(f>0?y:0),H-=(f>0?y:0)+T[f];if(_+=p.left+p.right,R+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=R+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var P;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),P="start"===t.packV?0:H>0?Math.floor(H/n):0;var W=0,D=t.flexWidths;if(D)for(d=0;d<D.length;d++)W+=D[d];else W=i;var N=E/W;for(d=0;d<i;d++)M[d]+=D?D[d]*N:N;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=T[f]+P,d=0;d<i&&(c=r[S?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(M[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var A=e.parent();A&&(A._lastRect=null,A.recalc())}}}),sr=Mt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):C.setTimeout(function(){n.html(e)}),this}}),ar=Mt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}}),lr=Mt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(we.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,we.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}}),ur=rt.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),cr=ur.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),dr=Ut.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=g.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof cr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(t.target,e.getEl())&&(e.focus(),e.showMenu(!t.aria),t.aria&&e.menu.items().filter(":visible")[0].focus())}),e.on("mouseenter",function(t){var n,i=t.control,r=e.parent();i&&r&&i instanceof dr&&i.parent()===r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==i&&(e.menu&&e.menu.visible()&&(n=!0),e.hideMenu())}),n&&(i.focus(),i.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),fr=xt.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=a.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==_.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var e,t=this;function n(){t.throbber&&(t.throbber.hide(),t.throbber=null)}t.settings.itemsFactory&&(t.throbber||(t.throbber=new kt(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",n)),t.requestTime=e=(new Date).getTime(),t.settings.itemsFactory(function(i){0!==i.length?t.requestTime===e&&(t.getEl().style.width="",t.getEl("body").style.width="",n(),t.items().remove(),t.getEl("body").innerHTML="",t.add(i),t.renderNew(),t.fire("loaded")):t.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;if(n.icon||n.image||n.selectable)return e._hasIcons=!0,!1}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e.on("show hide",function(t){t.control===e&&("show"===t.type?C.setTimeout(function(){e.classes.add("in")},0):e.classes.remove("in"))}),e._super()}}),hr=dr.extend({init:function(e){var t,n,i,r,o=this;o._super(e),e=o.settings,o._values=t=e.values,t&&("undefined"!=typeof e.value&&function s(t){for(var r=0;r<t.length;r++){if(n=t[r].selected||e.value===t[r].value)return i=i||t[r].text,o.state.set("value",t[r].value),!0;if(t[r].menu&&s(t[r].menu))return!0}}(t),!n&&t.length>0&&(i=t[0].text,o.state.set("value",t[0].value)),o.state.set("menu",t)),o.state.set("text",e.text||i),o.classes.add("listbox"),o.on("select",function(t){var n=t.control;r&&(t.lastControl=r),e.multiple?n.active(!n.active()):o.value(t.control.value()),r=n})},bindStates:function(){var e=this;return e.on("show",function(t){var n,i;n=t.control,i=e.value(),n instanceof fr&&n.items().each(function(e){e.hasMenus()||e.active(e.value()===i)})}),e.state.on("change:value",function(t){var n=function i(e,t){var n;if(e)for(var r=0;r<e.length;r++){if(e[r].value===t)return e[r];if(e[r].menu&&(n=i(e[r].menu,t)))return n}}(e.state.get("menu"),t.value);n?e.text(n.text):e.text(e.settings.text)}),e._super()}}),mr=Mt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e,t=this,n=t.settings,i=t.parent();if(i.items().each(function(e){e!==t&&e.hideMenu()}),n.menu){(e=t.menu)?e.show():((e=n.menu).length?e={type:"menu",animate:!0,items:e}:(e.type=e.type||"menu",e.animate=!0),i.settings.itemDefaults&&(e.itemDefaults=i.settings.itemDefaults),(e=t.menu=g.create(e).parent(t).renderTo()).reflow(),e.on("cancel",function(n){n.stopPropagation(),t.focus(),e.hide()}),e.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),e.on("hide",function(n){n.control===e&&t.classes.remove("selected")}),e.submenu=!0),e._parentMenu=i,e.classes.add("menu-sub");var r=e.testMoveRel(t.getEl(),t.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);e.moveRel(t.getEl(),r),e.rel=r,r="menu-sub-"+r,e.classes.remove(e._lastRel).add(r),e._lastRel=r,t.classes.add("selected"),t.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=_.mac?{alt:"&#x2325;",ctrl:"&#x2318;",shift:"&#x21E7;",meta:"&#x2318;"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&(i.setAttribute("style",n),e._textStyle=n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),C.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),gr=jt.extend({Defaults:{classes:"radio",role:"radio"}}),pr=Mt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new ct(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!==e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function vr(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var br=Mt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13===e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){if(e.toJSON)return n=e,!1}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=vr(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(t){e.getEl().innerHTML=vr(t.value)}),e._super()}});function yr(e,t,n){return e<t&&(e=t),e>n&&(e=n),e}function xr(e,t,n){e.setAttribute("aria-"+t,n)}function wr(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-we.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",xr(s,"valuenow",t),xr(s,"valuetext",""+e.settings.previewFilter(t)),xr(s,"valuemin",e._minValue),xr(s,"valuemax",e._maxValue)}var _r=Mt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(e,t){function n(n){var i,r,o;i=yr(i=(((i=m.value())+(o=e))/(t-o)+.05*n)*(t-(r=e))-r,e,t),m.value(i),m.fire("dragstart",{value:i}),m.fire("drag",{value:i}),m.fire("dragend",{value:i})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:n(-1);break;case 39:case 40:n(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new ct(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-we.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=yr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),wr(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){wr(e,t.value)}),e._super()}}),Rr=Mt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),Cr=dr.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,ye(e).css({width:i.w-we.getSize(t).width,height:i.h-2}),ye(t).css({height:i.h-2}),this},activeMenu:function(e){ye(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this.settings.onclick;return this.on("click",function(t){var n=t.target;if(t.control===this)for(;n;){if(t.aria&&"down"!==t.aria.key||"BUTTON"===n.nodeName&&-1===n.className.indexOf("open"))return t.stopImmediatePropagation(),void(e&&e.call(this,t));n=n.parentNode}}),delete this.settings.onclick,this._super()}}),kr=Mi.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),Er=ft.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var t;this.activeTabId&&(t=this.getEl(this.activeTabId),ye(t).removeClass(this.classPrefix+"active"),t.setAttribute("aria-selected","false")),this.activeTabId="t"+e,(t=this.getEl("t"+e)).setAttribute("aria-selected","true"),ye(t).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!==n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",i=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,r){var o=e._id+"-t"+r;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+i+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+i+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(n&&n.id===e._id+"-head")for(var i=n.childNodes.length;i--;)n.childNodes[i]===t.target&&e.activateTab(i)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=we.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=we.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),Hr=Mt.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13===e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){if(e.toJSON)return n=e,!1}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var e,t,n=this,i=n.settings;return e={id:n._id,hidefocus:"1"},a.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(t){e[t]=i[t]}),n.disabled()&&(e.disabled="disabled"),i.subtype&&(e.type=i.subtype),(t=we.create(i.multiline?"textarea":"input",e)).value=n.state.get("value"),t.className=n.classes,t.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!==t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}}),Sr=function(){return{Selector:Be,Collection:Le,ReflowQueue:qe,Control:et,Factory:g,KeyboardNavigation:nt,Container:rt,DragHelper:ct,Scrollable:dt,Panel:ft,Movable:Re,Resizable:ht,FloatPanel:xt,Window:zt,MessageBox:Lt,Tooltip:St,Widget:Mt,Progress:Tt,Notification:Wt,Layout:Ft,AbsoluteLayout:Vt,Button:Ut,ButtonGroup:$t,Checkbox:jt,ComboBox:Xt,ColorBox:Jt,PanelButton:Gt,ColorButton:Zt,ColorPicker:en,Path:nn,ElementPath:rn,FormItem:on,Form:sn,FieldSet:an,FilePicker:Ei,FitLayout:Hi,FlexLayout:Si,FlowLayout:Mi,FormatControls:rr,GridLayout:or,Iframe:sr,InfoBox:ar,Label:lr,Toolbar:ur,MenuBar:cr,MenuButton:dr,MenuItem:mr,Throbber:kt,Menu:fr,ListBox:hr,Radio:gr,ResizeHandle:pr,SelectBox:br,Slider:_r,Spacer:Rr,SplitButton:Cr,StackLayout:kr,TabPanel:Er,TextBox:Hr,DropZone:tn,BrowseButton:Yt}},Mr=function(e){e.ui?a.each(Sr(),function(t,n){e.ui[n]=t}):e.ui=Sr()};a.each(Sr(),function(e,t){g.add(t,e)}),Mr(window.tinymce?window.tinymce:{}),o.add("modern",function(e){return rr.setup(e),It(e)})}();
1
+ // 4.8.3 (2018-09-13)
2
+ !function(){"use strict";var e,t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},q=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},H=function(e){return function(){return e}},j=function(e){return e},b=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},y=H(!1),C=H(!0),x=y,w=C,N=function(){return E},E=(r={fold:function(e,t){return e()},is:x,isSome:x,isNone:w,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:x,forall:w,filter:N,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:H("none()")},Object.freeze&&Object.freeze(r),r),S=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:w,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return S(e(n))},ap:function(e){return e.fold(N,function(e){return S(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:E},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(x,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:S,none:N,from:function(e){return null===e||e===undefined?E:S(e)}},T=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},k=T("string"),_=T("object"),R=T("array"),D=T("null"),B=T("boolean"),O=T("function"),P=T("number"),L=(o=Array.prototype.indexOf)===undefined?function(e,t){return X(e,t)}:function(e,t){return o.call(e,t)},I=function(e,t){return-1<L(e,t)},M=function(e,t){return K(e,t).isSome()},$=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},F=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},z=function(e,t,n){return F(e,function(e){n=t(n,e)}),n},V=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},X=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},Y=Array.prototype.push,G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}($(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},Q=Array.prototype.slice,Z=function(e,t){return U(e,function(e){return!I(t,e)})},ee=function(e){return 0===e.length?A.none():A.some(e[0])},te=function(e){return 0===e.length?A.none():A.some(e[e.length-1])},ne=O(Array.from)?Array.from:function(e){return Q.call(e)},re="undefined"!=typeof window?window:Function("return this;")(),oe=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:re,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ie={getOrDie:function(e,t){var n=oe(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},ae=function(){return ie.getOrDie("URL")},ue={createObjectURL:function(e){return ae().createObjectURL(e)},revokeObjectURL:function(e){ae().revokeObjectURL(e)}},se=navigator,ce=se.userAgent,le=function(e){return"matchMedia"in window&&matchMedia(e).matches};d=/Android/.test(ce),a=(a=!(i=/WebKit/.test(ce))&&/MSIE/gi.test(ce)&&/Explorer/gi.test(se.appName))&&/MSIE (\w+)\./.exec(ce)[1],u=-1!==ce.indexOf("Trident/")&&(-1!==ce.indexOf("rv:")||-1!==se.appName.indexOf("Netscape"))&&11,s=-1!==ce.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(ce),l=-1!==ce.indexOf("Mac"),f=/(iPad|iPhone)/.test(ce),m="FormData"in window&&"FileReader"in window&&"URL"in window&&!!ue.createObjectURL,g=le("only screen and (max-device-width: 480px)")&&(d||f),p=le("only screen and (min-width: 800px)")&&(d||f),h=-1!==ce.indexOf("Windows Phone"),s&&(i=!1);var fe,de,me,ge,pe,he,ve,be,ye,Ce,xe,we,Ne,Ee,Se,Te,ke,Ae,_e,Re={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:d,contentEditable:!f||m||534<=parseInt(ce.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:window.getSelection&&"Range"in window,documentMode:a&&!s?document.documentMode||7:10,fileApi:m,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!g&&!p,windowsPhone:h},De=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),Be=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},Oe=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},Pe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=Be(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},Le={requestAnimationFrame:function(e,t){fe?fe.then(e):fe=new De(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:Be,setInterval:Oe,setEditorTimeout:function(e,t,n){return Be(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=Oe(function(){e.removed?clearInterval(r):t()},n)},debounce:Pe,throttle:Pe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ie=/^(?:mouse|contextmenu)|click/,Me={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Fe=function(){return!1},Ue=function(){return!0},ze=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ve=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},qe=function(e,t){var n,r,o=t||{};for(n in e)Me[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||document),Re.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&Ie.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Ue,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Ue,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Ue,o.stopPropagation()})==((r=o).isDefaultPrevented===Ue||r.isDefaultPrevented===Fe)&&(o.isDefaultPrevented=Fe,o.isPropagationStopped=Fe,o.isImmediatePropagationStopped=Fe),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},He=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ve(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void Le.setTimeout(s)}a()};!r.addEventListener||Re.ie&&Re.ie<11?(ze(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():ze(e,"DOMContentLoaded",a),ze(e,"load",a)}},je=function(){var m,g,p,h,v,b=this,y={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in document.documentElement,p="onfocusin"in document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,b.domLoaded=!1,b.events=y;var C=function(e,t){var n,r,o,i,a=y[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};b.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=window,d=function(e){C(qe(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,y[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),b.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,qe({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=qe(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=qe(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=y[o][u])?"ready"===u&&b.domLoaded?n({type:u}):i.push({func:n,scope:r}):(y[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?He(e,c,b):ze(e,s||u,c,l)));return e=i=0,n}},b.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return b;if(r=e[g]){if(s=y[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],Ve(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ve(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return b;delete y[r];try{delete e[g]}catch(d){e[g]=null}}return b},b.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return b;for((n=qe(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return b},b.clean=function(e){var t,n,r=b.unbind;if(!e||3===e.nodeType||8===e.nodeType)return b;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return b},b.destroy=function(){y={}},b.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};je.Event=new je,je.Event.bind(window,"ready",function(){});var $e="sizzle"+-new Date,We=window.document,Ke=0,Xe=0,Ye=kt(),Ge=kt(),Je=kt(),Qe=function(e,t){return e===t&&(we=!0),0},Ze=typeof undefined,et={}.hasOwnProperty,tt=[],nt=tt.pop,rt=tt.push,ot=tt.push,it=tt.slice,at=tt.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ut="[\\x20\\t\\r\\n\\f]",st="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ct="\\["+ut+"*("+st+")(?:"+ut+"*([*^$|!~]?=)"+ut+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+st+"))|)"+ut+"*\\]",lt=":("+st+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ct+")*)|.*)\\)|)",ft=new RegExp("^"+ut+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ut+"+$","g"),dt=new RegExp("^"+ut+"*,"+ut+"*"),mt=new RegExp("^"+ut+"*([>+~]|"+ut+")"+ut+"*"),gt=new RegExp("="+ut+"*([^\\]'\"]*?)"+ut+"*\\]","g"),pt=new RegExp(lt),ht=new RegExp("^"+st+"$"),vt={ID:new RegExp("^#("+st+")"),CLASS:new RegExp("^\\.("+st+")"),TAG:new RegExp("^("+st+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ut+"*(even|odd|(([+-]|)(\\d*)n|)"+ut+"*(?:([+-]|)"+ut+"*(\\d+)|))"+ut+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ut+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ut+"*((?:-\\d)?\\d*)"+ut+"*\\)|)(?=[^-]|$)","i")},bt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=/[+~]/,Nt=/'|\\/g,Et=new RegExp("\\\\([\\da-f]{1,6}"+ut+"?|("+ut+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ot.apply(tt=it.call(We.childNodes),We.childNodes),tt[We.childNodes.length].nodeType}catch(nN){ot={apply:tt.length?function(e,t){rt.apply(e,it.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var Tt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:We)!==Ee&&Ne(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Ee).nodeType)&&9!==u)return[];if(Te&&!r){if(o=xt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&_e(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ot.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&me.getElementsByClassName)return ot.apply(n,t.getElementsByClassName(a)),n}if(me.qsa&&(!ke||!ke.test(e))){if(f=l=$e,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=ve(e),(l=t.getAttribute("id"))?f=l.replace(Nt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Lt(c[s]);d=wt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return ot.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return ye(e.replace(ft,"$1"),t,n,r)};function kt(){var r=[];return function e(t,n){return r.push(t+" ")>ge.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function At(e){return e[$e]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Rt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Dt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Bt(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Ze&&e}for(de in me=Tt.support={},he=Tt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Ne=Tt.setDocument=function(e){var t,s=e?e.ownerDocument||e:We,n=s.defaultView;return s!==Ee&&9===s.nodeType&&s.documentElement?(Se=(Ee=s).documentElement,Te=!he(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Ne()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Ne()})),me.attributes=!0,me.getElementsByTagName=!0,me.getElementsByClassName=Ct.test(s.getElementsByClassName),me.getById=!0,ge.find.ID=function(e,t){if(typeof t.getElementById!==Ze&&Te){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},ge.filter.ID=function(e){var t=e.replace(Et,St);return function(e){return e.getAttribute("id")===t}},ge.find.TAG=me.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ze)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},ge.find.CLASS=me.getElementsByClassName&&function(e,t){if(Te)return t.getElementsByClassName(e)},Ae=[],ke=[],me.disconnectedMatch=!0,ke=ke.length&&new RegExp(ke.join("|")),Ae=Ae.length&&new RegExp(Ae.join("|")),t=Ct.test(Se.compareDocumentPosition),_e=t||Ct.test(Se.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Qe=t?function(e,t){if(e===t)return we=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!me.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===We&&_e(We,e)?-1:t===s||t.ownerDocument===We&&_e(We,t)?1:xe?at.call(xe,e)-at.call(xe,t):0:4&n?-1:1)}:function(e,t){if(e===t)return we=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:xe?at.call(xe,e)-at.call(xe,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===We?-1:u[r]===We?1:0},s):Ee},Tt.matches=function(e,t){return Tt(e,null,null,t)},Tt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ee&&Ne(e),t=t.replace(gt,"='$1']"),me.matchesSelector&&Te&&(!Ae||!Ae.test(t))&&(!ke||!ke.test(t)))try{var n=(void 0).call(e,t);if(n||me.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(nN){}return 0<Tt(t,Ee,null,[e]).length},Tt.contains=function(e,t){return(e.ownerDocument||e)!==Ee&&Ne(e),_e(e,t)},Tt.attr=function(e,t){(e.ownerDocument||e)!==Ee&&Ne(e);var n=ge.attrHandle[t.toLowerCase()],r=n&&et.call(ge.attrHandle,t.toLowerCase())?n(e,t,!Te):undefined;return r!==undefined?r:me.attributes||!Te?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},Tt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},Tt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(we=!me.detectDuplicates,xe=!me.sortStable&&e.slice(0),e.sort(Qe),we){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return xe=null,e},pe=Tt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=pe(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=pe(t);return n},(ge=Tt.selectors={cacheLength:50,createPseudo:At,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Et,St),e[3]=(e[3]||e[4]||e[5]||"").replace(Et,St),"~="===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]||Tt.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]&&Tt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=ve(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Et,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ut+")"+e+"("+ut+"|$)"))&&Ye(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ze&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=Tt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[$e]||(l[$e]={}))[m]||[])[0]===Ke&&r[1],a=r[0]===Ke&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Ke,u,a];break}}else if(d&&(r=(e[$e]||(e[$e]={}))[m])&&r[0]===Ke)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[$e]||(i[$e]={}))[m]=[Ke,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=ge.pseudos[e]||ge.setFilters[e.toLowerCase()]||Tt.error("unsupported pseudo: "+e);return a[$e]?a(i):1<a.length?(t=[e,e,"",i],ge.setFilters.hasOwnProperty(e.toLowerCase())?At(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=at.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:At(function(e){var r=[],o=[],u=be(e.replace(ft,"$1"));return u[$e]?At(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:At(function(t){return function(e){return 0<Tt(t,e).length}}),contains:At(function(t){return t=t.replace(Et,St),function(e){return-1<(e.textContent||e.innerText||pe(e)).indexOf(t)}}),lang:At(function(n){return ht.test(n||"")||Tt.error("unsupported lang: "+n),n=n.replace(Et,St).toLowerCase(),function(e){var t;do{if(t=Te?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===Se},focus:function(e){return e===Ee.activeElement&&(!Ee.hasFocus||Ee.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!ge.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return bt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Bt(function(){return[0]}),last:Bt(function(e,t){return[t-1]}),eq:Bt(function(e,t,n){return[n<0?n+t:n]}),even:Bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=ge.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})ge.pseudos[de]=Rt(de);for(de in{submit:!0,reset:!0})ge.pseudos[de]=Dt(de);function Pt(){}function Lt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Xe++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Ke,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[$e]||(e[$e]={}))[u])&&r[0]===Ke&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Mt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Ut(m,g,p,h,v,e){return h&&!h[$e]&&(h=Ut(h)),v&&!v[$e]&&(v=Ut(v,e)),At(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)Tt(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?at.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):ot.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=ge.relative[e[0].type],a=i||ge.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<at.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Ce)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=ge.relative[e[u].type])l=[It(Mt(l),t)];else{if((t=ge.filter[e[u].type].apply(null,e[u].matches))[$e]){for(n=++u;n<o&&!ge.relative[e[n].type];n++);return Ut(1<u&&Mt(l),1<u&&Lt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ft,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&Lt(e))}l.push(t)}return Mt(l)}Pt.prototype=ge.filters=ge.pseudos,ge.setFilters=new Pt,ve=Tt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ge[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=ge.preFilter;a;){for(i in n&&!(r=dt.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=mt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ft," ")}),a=a.slice(n.length)),ge.filter)!(r=vt[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?Tt.error(e):Ge(e,u).slice(0)},be=Tt.compile=function(e,t){var n,h,v,b,y,r,o=[],i=[],a=Je[e+" "];if(!a){for(t||(t=ve(e)),n=t.length;n--;)(a=zt(t[n]))[$e]?o.push(a):i.push(a);(a=Je(e,(h=i,b=0<(v=o).length,y=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Ce,m=e||y&&ge.find.TAG("*",o),g=Ke+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Ce=t!==Ee&&t);c!==p&&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Ke=g)}b&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=nt.call(r));f=Ft(f)}ot.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&Tt.uniqueSort(r)}return o&&(Ke=g,Ce=d),l},b?At(r):r))).selector=e}return a},ye=Tt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&ve(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&me.getById&&9===t.nodeType&&Te&&ge.relative[i[1].type]){if(!(t=(ge.find.ID(a.matches[0].replace(Et,St),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=vt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!ge.relative[u=a.type]);)if((s=ge.find[u])&&(r=s(a.matches[0].replace(Et,St),wt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Lt(i)))return ot.apply(n,r),n;break}}return(c||be(e,l))(r,t,!Te,n,wt.test(e)&&Ot(t.parentNode)||t),n},me.sortStable=$e.split("").sort(Qe).join("")===$e,me.detectDuplicates=!!we,Ne(),me.sortDetached=!0;var Vt=Array.isArray,qt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},Ht=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},jt={isArray:Vt,toArray:function(e){var t,n,r=e;if(!Vt(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:qt,map:function(n,r){var o=[];return qt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return qt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:Ht,find:function(e,t,n){var r=Ht(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},$t=/^\s*|\s*$/g,Wt=function(e){return null===e||e===undefined?"":(""+e).replace($t,"")},Kt=function(e,t){return t?!("array"!==t||!jt.isArray(e))||typeof e===t:e!==undefined},Xt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),jt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Xt(e,n,r,o)}))},Yt={trim:Wt,isArray:jt.isArray,is:Kt,toArray:jt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:jt.each,map:jt.map,grep:jt.filter,inArray:jt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Xt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Kt(e,"array")?e:jt.map(e.split(t||","),Wt)},_addCacheSuffix:function(e){var t=Re.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Gt=document,Jt=Array.prototype.push,Qt=Array.prototype.slice,Zt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,en=je.Event,tn=Yt.makeMap("children,contents,next,prev"),nn=function(e){return void 0!==e},rn=function(e){return"string"==typeof e},on=function(e,t){var n,r,o;for(o=(t=t||Gt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},an=function(e,t,n,r){var o;if(rn(t))t=on(t,Cn(e[0]));else if(t.length&&!t.nodeType){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)an(e,t[o],n,r);else for(o=0;o<t.length;o++)an(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},un=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},sn=function(e,t,n){var r,o;return t=pn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},cn=Yt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),ln=Yt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),fn={"for":"htmlFor","class":"className",readonly:"readOnly"},dn={"float":"cssFloat"},mn={},gn={},pn=function(e,t){return new pn.fn.init(e,t)},hn=/^\s*|\s*$/g,vn=function(e){return null===e||e===undefined?"":(""+e).replace(hn,"")},bn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return bn(e,function(e,t){n(t,e)&&r.push(t)}),r},Cn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Gt};pn.fn=pn.prototype={constructor:pn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return pn(e).attr(t);o.context=t=document}if(rn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Zt.exec(e)))return pn(t).find(e);if(n[1])for(r=on(e,Cn(t)).firstChild;r;)Jt.call(o,r),r=r.nextSibling;else{if(!(r=Cn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Yt.toArray(this)},add:function(e,t){var n,r,o=this;if(rn(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Jt.apply(o,pn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)bn(t,function(e,t){r.attr(e,t)});else{if(!nn(n)){if(r[0]&&1===r[0].nodeType){if((e=mn[t])&&e.get)return e.get(r[0],t);if(ln[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=mn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=fn[e]||e))bn(e,function(e,t){n.prop(e,t)});else{if(!nn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)bn(n,function(e,t){i.css(e,t)});else if(nn(r))n=t(n),"number"!=typeof r||cn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=gn[n])&&o.set)o.set(this,r);else{try{this.style[dn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=gn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],en.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(nn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){pn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(nn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return pn(e).append(this),this},prependTo:function(e){return pn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return sn(this,e)},wrapAll:function(e){return sn(this,e,!0)},wrapInner:function(e){return this.each(function(){pn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){pn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),pn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?bn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=un(t,o))!==i&&(n=t.className,r?t.className=vn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return un(this[0],e)},each:function(e){return bn(this,e)},on:function(e,t){return this.each(function(){en.bind(this,e,t)})},off:function(e,t){return this.each(function(){en.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?en.fire(this,e.type,e):en.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new pn(Qt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)pn.find(e,this[t],r);return pn(r)},filter:function(n){return pn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):pn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof pn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&pn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),pn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Jt,sort:[].sort,splice:[].splice},Yt.extend(pn,{extend:Yt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Yt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Yt.isArray,each:bn,trim:vn,grep:yn,find:Tt,expr:Tt.selectors,unique:Tt.uniqueSort,text:Tt.getText,contains:Tt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?pn.find.matchesSelector(t[0],e)?[t[0]]:[]:pn.find.matches(e,t)}});var xn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof pn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&pn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},wn=function(e,t,n,r){var o=[];for(r instanceof pn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&pn(e).is(r))break}o.push(e)}return o},Nn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};bn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xn(e,"parentNode")},next:function(e){return Nn(e,"nextSibling",1)},prev:function(e){return Nn(e,"previousSibling",1)},children:function(e){return wn(e.firstChild,"nextSibling",1)},contents:function(e){return Yt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){pn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(tn[e]||(n=pn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=pn(n),t?n.filter(t):n}}),bn({parentsUntil:function(e,t){return xn(e,"parentNode",t)},nextUntil:function(e,t){return wn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return wn(e,"previousSibling",1,t).slice(1)}},function(r,o){pn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=pn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=pn(n),e?n.filter(e):n}}),pn.fn.is=function(e){return!!e&&0<this.filter(e).length},pn.fn.init.prototype=pn.fn,pn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return pn.extend(o,this),o};var En=function(n,r,e){bn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};Re.ie&&Re.ie<8&&(En(mn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),En(mn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),Re.ie&&Re.ie<9&&(dn["float"]="styleFloat",En(gn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),pn.attrHooks=mn,pn.cssHooks=gn;var Sn=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Tn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return An(r(1),r(2))},kn=function(){return An(0,0)},An=function(e,t){return{major:e,minor:t}},_n={nu:An,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?kn():Tn(e,n)},unknown:kn},Rn="Firefox",Dn=function(e,t){return function(){return t===e}},Bn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Dn("Edge",t),isChrome:Dn("Chrome",t),isIE:Dn("IE",t),isOpera:Dn("Opera",t),isFirefox:Dn(Rn,t),isSafari:Dn("Safari",t)}},On={unknown:function(){return Bn({current:undefined,version:_n.unknown()})},nu:Bn,edge:H("Edge"),chrome:H("Chrome"),ie:H("IE"),opera:H("Opera"),firefox:H(Rn),safari:H("Safari")},Pn="Windows",Ln="Android",In="Solaris",Mn="FreeBSD",Fn=function(e,t){return function(){return t===e}},Un=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Fn(Pn,t),isiOS:Fn("iOS",t),isAndroid:Fn(Ln,t),isOSX:Fn("OSX",t),isLinux:Fn("Linux",t),isSolaris:Fn(In,t),isFreeBSD:Fn(Mn,t)}},zn={unknown:function(){return Un({current:undefined,version:_n.unknown()})},nu:Un,windows:H(Pn),ios:H("iOS"),android:H(Ln),linux:H("Linux"),osx:H("OSX"),solaris:H(In),freebsd:H(Mn)},Vn=function(e,t){var n=String(t).toLowerCase();return V(e,function(e){return e.search(n)})},qn=function(e,n){return Vn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Hn=function(e,n){return Vn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},jn=function(e,t){return-1!==e.indexOf(t)},$n=function(e){return e.replace(/^\s+|\s+$/g,"")},Wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Kn=function(t){return function(e){return jn(e,t)}},Xn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return jn(e,"edge/")&&jn(e,"chrome")&&jn(e,"safari")&&jn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Wn],search:function(e){return jn(e,"chrome")&&!jn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return jn(e,"msie")||jn(e,"trident")}},{name:"Opera",versionRegexes:[Wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Kn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Kn("firefox")},{name:"Safari",versionRegexes:[Wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(jn(e,"safari")||jn(e,"mobile/"))&&jn(e,"applewebkit")}}],Yn=[{name:"Windows",search:Kn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return jn(e,"iphone")||jn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Kn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Kn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Kn("linux"),versionRegexes:[]},{name:"Solaris",search:Kn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Kn("freebsd"),versionRegexes:[]}],Gn={browsers:H(Xn),oses:H(Yn)},Jn=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Gn.browsers(),m=Gn.oses(),g=qn(d,e).fold(On.unknown,On.nu),p=Hn(m,e).fold(zn.unknown,zn.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:H(o),isiPhone:H(i),isTablet:H(s),isPhone:H(l),isTouch:H(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:H(f)})}},Qn={detect:Sn(function(){var e=navigator.userAgent;return Jn(e)})},Zn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:H(e)}},er={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return Zn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Zn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Zn(n)},fromDom:Zn,fromPoint:function(e,t,n){var r=e.dom();return A.from(r.elementFromPoint(t,n)).map(Zn)}},tr={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},nr=function(e){return e.dom().nodeName.toLowerCase()},rr=function(e){return e.dom().nodeType},or=function(t){return function(e){return rr(e)===t}},ir=or(tr.ELEMENT),ar=or(tr.TEXT),ur=or(tr.DOCUMENT),sr={name:nr,type:rr,value:function(e){return e.dom().nodeValue},isElement:ir,isText:ar,isDocument:ur,isComment:function(e){return rr(e)===tr.COMMENT||"#comment"===nr(e)}},cr=Object.keys,lr=function(e,t){for(var n=cr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},fr=function(r,o){var i={};return lr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},dr=function(e,t,n){if(!(k(n)||B(n)||P(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},mr=function(e,t,n){dr(e.dom(),t,n)},gr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},pr=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},hr={clone:function(e){return z(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:mr,setAll:function(e,t){var n=e.dom();lr(t,function(e,t){dr(n,t,e)})},get:gr,has:pr,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){sr.isElement(o)&&sr.isElement(i)&&F(e,function(e){var t,n,r;n=i,pr(t=o,r=e)&&!pr(n,r)&&mr(n,r,gr(t,r))})}},vr=Sn(function(){return br(er.fromDom(document))}),br=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return er.fromDom(t)},yr={body:vr,getBody:br,inBody:function(e){var t=sr.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},Cr=function(e){return e.style!==undefined},xr=function(e,t,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Cr(e)&&e.style.setProperty(t,n)},wr=function(e,t){return Cr(e)?e.style.getPropertyValue(t):""},Nr=function(e,t){var n=e.dom(),r=wr(n,t);return A.from(r).filter(function(e){return 0<e.length})},Er=function(e,t){var n=e.dom();lr(t,function(e,t){xr(n,t,e)})},Sr=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||yr.inBody(e)?r:wr(n,t);return null===o?undefined:o},Tr=Nr,kr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return F(t,function(e,t){r[e]=H(n[t])}),r}},Ar=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},_r=function(){return ie.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Dr=function(e,t){return Rr(e,t,_r().DOCUMENT_POSITION_CONTAINED_BY)},Br=tr.ELEMENT,Or=tr.DOCUMENT,Pr=function(e){return e.nodeType!==Br&&e.nodeType!==Or||0===e.childElementCount},Lr={all:function(e,t){var n=t===undefined?document:t.dom();return Pr(n)?[]:$(n.querySelectorAll(e),er.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==Br)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Pr(n)?A.none():A.from(n.querySelector(e)).map(er.fromDom)}},Ir=function(e,t){return e.dom()===t.dom()},Mr=Qn.detect().browser.isIE()?function(e,t){return Dr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Fr={eq:Ir,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return M(t,b(Ir,e))},contains:Mr,is:Lr.is},Ur=function(e){var t=e.dom();return A.from(t.parentNode).map(er.fromDom)},zr=function(e){var t=e.dom();return A.from(t.previousSibling).map(er.fromDom)},Vr=function(e){var t=e.dom();return A.from(t.nextSibling).map(er.fromDom)},qr=function(e){var t=e.dom();return $(t.childNodes,er.fromDom)},Hr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(er.fromDom)},jr=kr("element","offset"),$r={owner:function(e){return er.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return er.fromDom(t)},documentElement:function(e){return er.fromDom(e.dom().ownerDocument.documentElement)},parent:Ur,findIndex:function(n){return Ur(n).bind(function(e){var t=qr(e);return K(t,function(e){return Fr.eq(n,e)})})},parents:function(e,t){for(var n=O(t)?t:H(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=er.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(t){return Ur(t).map(qr).map(function(e){return U(e,function(e){return!Fr.eq(t,e)})}).getOr([])},prevSibling:zr,offsetParent:function(e){var t=e.dom();return A.from(t.offsetParent).map(er.fromDom)},prevSiblings:function(e){return t=Ar(e,zr),(n=Q.call(t,0)).reverse(),n;var t,n},nextSibling:Vr,nextSiblings:function(e){return Ar(e,Vr)},children:qr,child:Hr,firstChild:function(e){return Hr(e,0)},lastChild:function(e){return Hr(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=qr(e);return 0<n.length&&t<n.length?jr(n[t],0):jr(e,t)}},Wr=Qn.detect().browser,Kr=function(e){return V(e,sr.isElement)},Xr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Sr(er.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=er.fromDom(t),Wr.isFirefox()&&"table"===sr.name(i)?Kr($r.children(i)).filter(function(e){return"caption"===sr.name(e)}).bind(function(o){return Kr($r.nextSiblings(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Yr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){F(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Yr(function(t){r(function(e){t(n(e))})})},isReady:o}},Gr={nu:Yr,pure:function(t){return Yr(function(e){e(t)})}},Jr=function(t){var e=function(e){var r;t((r=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){r.apply(n,e)},0)}))},n=function(){return Gr.nu(e)};return{map:function(r){return Jr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Jr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Jr(function(t){e(function(e){n.get(t)})})},toLazy:n,toCached:function(){var t=null;return Jr(function(e){null===t&&(t=n()),t.get(e)})},get:e}},Qr={nu:Jr,pure:function(t){return Jr(function(e){e(t)})}},Zr=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):F(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},eo=function(e){return Zr(e,Qr.nu)},to=function(n){return{is:function(e){return n===e},isValue:C,isError:y,getOr:H(n),getOrThunk:H(n),getOrDie:H(n),or:function(e){return to(n)},orThunk:function(e){return to(n)},fold:function(e,t){return t(n)},map:function(e){return to(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},no=function(n){return{is:y,isValue:y,isError:C,getOr:j,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return no(n)},each:v,bind:function(e){return no(n)},exists:y,forall:C,toOption:A.none}},ro={value:to,error:no};function oo(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var io,ao,uo,so=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,H(!0))).hasOwnProperty(sr.name(e))}},co=so(["h1","h2","h3","h4","h5","h6"]),lo=so(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),fo=function(e){return sr.isElement(e)&&!lo(e)},mo=function(e){return sr.isElement(e)&&"br"===sr.name(e)},go=so(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),po=so(["ul","ol","dl"]),ho=so(["li","dd","dt"]),vo=so(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),bo=so(["thead","tbody","tfoot"]),yo=so(["td","th"]),Co=so(["pre","script","textarea","style"]),xo=function(t){return function(e){return!!e&&e.nodeType===t}},wo=xo(1),No=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},Eo=function(t){return function(e){if(wo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},So=xo(3),To=xo(8),ko=xo(9),Ao=No("br"),_o=Eo("true"),Ro=Eo("false"),Do={isText:So,isElement:wo,isComment:To,isDocument:ko,isBr:Ao,isContentEditableTrue:_o,isContentEditableFalse:Ro,matchNodeNames:No,hasPropValue:function(t,n){return function(e){return wo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return wo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return wo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(wo(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return wo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return wo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return wo(e)&&"TABLE"===e.tagName}},Bo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Oo=function(e,t){var n,r=t.childNodes;if(!Do.isElement(t)||!Bo(t)){for(n=r.length-1;0<=n;n--)Oo(e,r[n]);if(!1===Do.isDocument(t)){if(Do.isText(t)&&0<t.nodeValue.length){var o=Yt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(Do.isElement(t)&&(1===(r=t.childNodes).length&&Bo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||vo(er.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Po={trimNode:Oo},Lo=Yt.makeMap,Io=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,zo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ao={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},uo={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};var Vo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),ao[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};io=Vo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var qo=function(e,t){return e.replace(t?Io:Mo,function(e){return ao[e]||e})},Ho=function(e,t){return e.replace(t?Io:Mo,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":ao[e]||"&#"+e.charCodeAt(0)+";"})},jo=function(e,t,n){return n=n||io,e.replace(t?Io:Mo,function(e){return ao[e]||n[e]||e})},$o={encodeRaw:qo,encodeAllRaw:function(e){return(""+e).replace(Fo,function(e){return ao[e]||e})},encodeNumeric:Ho,encodeNamed:jo,getEncodeFunc:function(e,t){var n=Vo(t)||io,r=Lo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Io:Mo,function(e){return ao[e]!==undefined?ao[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return jo(e,t,n)}:jo:r.numeric?Ho:qo},decode:function(e){return e.replace(Uo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):zo[t]||String.fromCharCode(t):uo[e]||io[e]||(n=e,(r=er.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Wo={},Ko={},Xo=Yt.makeMap,Yo=Yt.each,Go=Yt.extend,Jo=Yt.explode,Qo=Yt.inArray,Zo=function(e,t){return(e=Yt.trim(e))?e.split(t||" "):[]},ei=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=Zo(n)),r=(e=Zo(e)).length;r--;)i={attributes:a(o=Zo([u,t].join(" "))),attributesOrder:o,children:a(n,Ko)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=Zo(e)).length,t=Zo(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return Wo[e]?Wo[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Yo(Zo(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Yo(Zo(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Yo(Zo("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Wo[e]=s)},ti=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Yo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Xo(e,/[, ]/):Jo(e,/[, ]/)})),r};function ni(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=Xo(r,/[, ]/,Xo(r.toUpperCase(),/[, ]/)):(r=Wo[e])||(r=Xo(t," ",Xo(t.toUpperCase()," ")),r=Go(r,n),Wo[e]=r),r};n=ei((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ti(i.valid_styles),t=ti(i.invalid_styles,"map"),s=ti(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),c=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Yo((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},b=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=Zo(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(b in h)d[b]=h[b];m.push.apply(m,v)}if(s)for(r=0,o=(s=Zo(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],y=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(Qo(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:y}),u.defaultValue=y),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:y}),u.forcedValue=y),"<"===g&&(u.validValues=Xo(y,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},y=function(e){N={},E=[],b(e),Yo(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Wo.text_block_elements=Wo.block_elements=null,Yo(Zo(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Go({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Yo(g,function(e,t){e[r]&&(g[t]=e=Go({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Wo[i.schema]=null,e&&Yo(Zo(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],Yo(Zo(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?y(i.valid_elements):(Yo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&Yo(Zo("strong/b em/i"),function(e){e=Zo(e,"/"),N[e[1]].outputName=e[0]}),Yo(Zo("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Yo(Zo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Yo(Zo("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),b(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),Yo({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=Zo(e))}),i.invalid_elements&&Yo(Jo(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||b("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:b,setValidElements:y,addCustomElements:C,addValidChildren:x}}var ri=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function oi(y,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},T="\ufeff";for(y=y||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),C=0;C<t.length;C++)S[t[C]]=T+C,S[T+C]=t[C];return{toHex:function(e){return e.replace(x,ri)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=y.url_converter,f=y.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},b=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!y.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!y.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(T)||-1!==n.indexOf('"'))continue;if(!y.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,ri)).replace(w,b),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var ii,ai=Yt.each,ui=Yt.grep,si=Re.ie,ci=/^([a-z0-9],?)+$/i,li=/^[ \t\r\n]*$/,fi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},di=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},mi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function gi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function(m,e){var g,p=0,h={};g=(e=e||{}).maxLoadTime||5e3;var v=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<g?Le.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Yt._addCacheSuffix(e),h[e]?a=h[e]:(a={passed:[],failed:[]},h[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+p++,o.async=!1,o.defer=!1,i=(new Date).getTime(),"onload"in o&&!((d=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void v(r);l()}var d;v(o),o.href=e}else s();else u()},t=function(t){return Qr.nu(function(e){n(t,q(e,H(ro.value(t))),q(e,H(ro.error(t))))})},o=function(e){return e.fold(j,j)};return{load:n,loadAll:function(e,n,r){eo($(e,t)).get(function(e){var t=W(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a),l=[],f=u.schema?u.schema:ni({}),d=oi({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new je(u.proxy):je.Event,n=f.getBlockElements(),g=pn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=p(e);return t?t.attributes:[]},y=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Xr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=Re.ie&&Re.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(ci.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<Tt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Yt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Yt.isArray(t)&&(t.length||0===t.length))return o=[],ai(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){ai(t,function(e,t){y(n,t,e)})})},_=function(e,r){var t=h(e);si?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){pn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&_(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},B=$o.decode,O=$o.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},L=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&pn(this).attr("class",null)})},I=function(t,e,n){return k(e,function(e){return Yt.is(e,"array")&&(t=t.cloneNode(!0)),n&&ai(ui(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(Yt.isArray(e)){for(var o=e.length;o--;)e[o]=F(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},U=function(e,t,n){var r;if(Yt.isArray(e)){for(r=e.length;r--;)e[r]=U(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},z=function(e){if(e&&Do.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!si||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return ai(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(e,t){return Tt(e,p(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+O(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&di(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&di(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==gi.DOM&&a===document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===gi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],ai(e.split(","),function(e){var t;e=Yt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):gi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){L(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:L,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:_,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return Do.isElement(t)?t.outerHTML:pn("<div></div>").append(pn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(pn(this).html(t),!0)})},decode:B,encode:O,insertAfter:function(e,t){var r=p(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),ai(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),I(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Yt.trim(e))},run:k,getAttribs:b,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new oo(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Do.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=b(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!li.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&li.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:mi,split:function(e,t,n){var r,o,i,a=M();if(e&&t)return a.setStart(e.parentNode,mi(e)),a.setEnd(t.parentNode,mi(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,mi(t)+1),a.setEnd(e.parentNode,mi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Po.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Po.trimNode(V,o),e),P(e),n||t},bind:F,unbind:U,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:z,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=z(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}Tt.setDocument&&Tt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=fi(d,u,function(){return V}),V}(ii=gi||(gi={})).DOM=ii(document),ii.nodeIndex=mi;var pi=gi,hi=pi.DOM,vi=Yt.each,bi=Yt.grep,yi=function(e){return"function"==typeof e},Ci=function(){var l={},o=[],i={},a=[],f=0;this.isDone=function(e){return 2===l[e]},this.markDone=function(e){l[e]=2},this.add=this.load=function(e,t,n,r){l[e]===undefined&&(o.push(e),l[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete l[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var u,s=[],c=function(t,e){vi(i[e],function(e){yi(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(u=function(){var e=bi(n);if(n.length=0,vi(e,function(e){var t,n,r,o,i,a;2!==l[e]?3!==l[e]?1!==l[e]&&(l[e]=1,f++,t=e,n=function(){l[e]=2,f--,c("success",e),u()},r=function(){l[e]=3,f--,s.push(e),c("failure",e),u()},i=(a=hi).uniqueId(),(o=document.createElement("script")).id=i,o.type="text/javascript",o.src=Yt._addCacheSuffix(t),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){yi(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)):c("failure",e):c("success",e)}),!f){var t=a.slice(0);a.length=0,vi(t,function(e){0===s.length?yi(e.success)&&e.success.call(e.scope):yi(e.failure)&&e.failure.call(e.scope,s)})}})()}};Ci.ScriptLoader=new Ci;var xi,wi=Yt.each;function Ni(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);wi(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(Ci))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Ni.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):Ci.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Ni.language;if(n&&!1!==Ni.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Ci.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=W(i,function(e){return e.name===t});return i=r.fail,wi(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];wi(t,function(e){Ci.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(xi=Ni||(Ni={})).PluginManager=xi(),xi.ThemeManager=xi();var Ei=function(t,n){$r.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Si=function(e,t){e.dom().appendChild(t.dom())},Ti={before:Ei,after:function(e,t){$r.nextSibling(e).fold(function(){$r.parent(e).each(function(e){Si(e,t)})},function(e){Ei(e,t)})},prepend:function(t,n){$r.firstChild(t).fold(function(){Si(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Si,appendAt:function(e,t,n){$r.child(e,n).fold(function(){Si(e,t)},function(e){Ei(e,t)})},wrap:function(e,t){Ei(e,t),Si(t,e)}},ki=function(t,e){F(e,function(e){Ti.before(t,e)})},Ai=function(t,e){F(e,function(e){Ti.append(t,e)})},_i=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Ri={empty:function(e){e.dom().textContent="",F($r.children(e),function(e){_i(e)})},remove:_i,unwrap:function(e){var t=$r.children(e);0<t.length&&ki(e,t),_i(e)}},Di=function(n,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=setTimeout(function(){n.apply(null,e),o=null},r))}}},Bi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Bi(n())}}},Oi=function(e,t){var n=hr.get(e,t);return n===undefined||""===n?[]:n.split(" ")},Pi=Oi,Li=function(e,t,n){var r=Oi(e,t).concat([n]);return hr.set(e,t,r.join(" ")),!0},Ii=function(e,t,n){var r=U(Oi(e,t),function(e){return e!==n});return 0<r.length?hr.set(e,t,r.join(" ")):hr.remove(e,t),!1},Mi=function(e){return Pi(e,"class")},Fi=function(e,t){return Li(e,"class",t)},Ui=function(e,t){return Ii(e,"class",t)},zi=Mi,Vi=Fi,qi=Ui,Hi=function(e,t){return I(Mi(e),t)?Ui(e,t):Fi(e,t)},ji=function(e){return e.dom().classList!==undefined},$i=function(e,t){return ji(e)&&e.dom().classList.contains(t)},Wi={add:function(e,t){ji(e)?e.dom().classList.add(t):Vi(e,t)},remove:function(e,t){var n;ji(e)?e.dom().classList.remove(t):qi(e,t),0===(ji(n=e)?n.dom().classList:zi(n)).length&&hr.remove(n,"class")},toggle:function(e,t){return ji(e)?e.dom().classList.toggle(t):Hi(e,t)},toggler:function(e,t){var n,r,o,i,a,u,s=ji(e),c=e.dom().classList;return n=function(){s?c.remove(t):qi(e,t)},r=function(){s?c.add(t):Vi(e,t)},o=$i(e,t),i=o||!1,{on:a=function(){r(),i=!0},off:u=function(){n(),i=!1},toggle:function(){(i?u:a)()},isOn:function(){return i}}},has:$i},Ki=function(e,t){return Lr.all(t,e)};function Xi(e,t,n,r,o){return e(n,r)?A.some(n):O(o)&&o(n)?A.none():t(n,r,o)}var Yi,Gi=function(e,t,n){for(var r=e.dom(),o=O(n)?n:H(!1);r.parentNode;){r=r.parentNode;var i=er.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},Ji=function(e,t){return V(e.dom().childNodes,q(t,er.fromDom)).map(er.fromDom)},Qi=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(er.fromDom(e.childNodes[t])))return A.some(er.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return A.none()};return o(e.dom())},Zi={first:function(e){return Qi(yr.body(),e)},ancestor:Gi,closest:function(e,t,n){return Xi(function(e){return t(e)},Gi,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Ji(er.fromDom(e.parentNode),function(e){return!Fr.eq(t,e)&&n(e)}):A.none()},child:Ji,descendant:Qi},ea=function(e,t,n){return Zi.ancestor(e,function(e){return Lr.is(e,t)},n)},ta=ea,na=function(e,t){return Lr.one(t,e)},ra=function(e,t,n){return Xi(Lr.is,ea,e,t,n)},oa=H("mce-annotation"),ia=H("data-mce-annotation"),aa=H("data-mce-annotation-uid"),ua=function(r,e){var t=r.selection.getRng(),n=er.fromDom(t.startContainer),o=er.fromDom(r.getBody()),i=e.fold(function(){return"."+oa()},function(e){return"["+ia()+'="'+e+'"]'}),a=$r.child(n,t.startOffset).getOr(n),u=ra(a,i,function(e){return Fr.eq(e,o)}),s=function(e,t){return hr.has(e,t)?A.some(hr.get(e,t)):A.none()};return u.bind(function(e){return s(e,""+aa()).bind(function(n){return s(e,""+ia()).map(function(e){var t=sa(r,n);return{uid:n,name:e,elements:t}})})})},sa=function(e,t){var n=er.fromDom(e.getBody());return Ki(n,"["+aa()+'="'+t+'"]')},ca=function(i,e){var n,r,o,a=Bi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Bi(A.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=cr(r),(n=Q.call(e,0)).sort(t),n);F(o,function(e){u(e,function(u){var s=u.previous.get();return ua(i,A.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){F(e.listeners,function(e){return e(!1,t)})}),u.previous.set(A.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){F(e.listeners,function(e){return e(!0,t,{uid:n,nodes:$(r,function(e){return e.dom()})})})}),u.previous.set(A.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&clearTimeout(o),o=setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},la=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){F(e,function(t){var e;(e=t,A.from(e.attributes.map[ia()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},fa=0,da=function(t,e){F(e,function(e){Wi.add(t,e)})},ma=function(e,t){return er.fromDom(e.dom().cloneNode(t))},ga=function(e){return ma(e,!0)},pa=function(e){return ma(e,!1)},ha=ga,va=[].slice,ba=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=va.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return ba.apply(this,e)}},ya={constant:function(e){return function(){return e}},negate:function(t){return function(e){return!t(e)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=va.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=va.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},curry:ba,compose:function(t,n){return function(e){return t(n(e))}},noop:function(){}},Ca="\ufeff",xa=function(e){return e===Ca},wa=Ca,Na=function(e){return e.replace(new RegExp(Ca,"g"),"")},Ea=Do.isElement,Sa=Do.isText,Ta=function(e){return Sa(e)&&(e=e.parentNode),Ea(e)&&e.hasAttribute("data-mce-caret")},ka=function(e){return Sa(e)&&xa(e.data)},Aa=function(e){return Ta(e)||ka(e)},_a=function(e){return e.firstChild!==e.lastChild||!Do.isBr(e.firstChild)},Ra=function(e){var t=e.container();return e&&Do.isText(t)&&t.data.charAt(e.offset())===wa},Da=function(e){var t=e.container();return e&&Do.isText(t)&&t.data.charAt(e.offset()-1)===wa},Ba=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Oa=function(e){return Sa(e)&&e.data[0]===wa},Pa=function(e){return Sa(e)&&e.data[e.data.length-1]===wa},La=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Do.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Ia=Do.isContentEditableTrue,Ma=Do.isContentEditableFalse,Fa=Do.isBr,Ua=Do.isText,za=Do.matchNodeNames("script style textarea"),Va=Do.matchNodeNames("img input textarea hr iframe video audio object"),qa=Do.matchNodeNames("table"),Ha=Aa,ja=function(e){return!Ha(e)&&(Ua(e)?!za(e.parentNode):Va(e)||Fa(e)||qa(e)||$a(e))},$a=function(e){return!1===(t=e,Do.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Ma(e);var t},Wa=function(e,t){return ja(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if($a(e))return!1;if(Ia(e))return!0}return!0}(e,t)},Ka=Math.round,Xa=function(e){return e?{left:Ka(e.left),top:Ka(e.top),bottom:Ka(e.bottom),right:Ka(e.right),width:Ka(e.width),height:Ka(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Ya=function(e,t){return e=Xa(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Ga=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Ja=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&Ga(t.top-e.bottom,e,t)},Qa=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Ga(t.bottom-e.top,e,t)},Za=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},eu=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},tu=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),nu=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&tu.test(e)},ru=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},ou=Do.isElement,iu=ja,au=Do.matchStyleValues("display","block table"),uu=Do.matchStyleValues("float","left right"),su=ya.and(ou,iu,ya.negate(uu)),cu=ya.negate(Do.matchStyleValues("white-space","pre pre-line pre-wrap")),lu=Do.isText,fu=Do.isBr,du=pi.nodeIndex,mu=eu,gu=function(e){return"createRange"in e?e.createRange():pi.DOM.createRng()},pu=function(e){return e&&/[\r\n\t ]/.test(e)},hu=function(e){return!!e.setStart&&!!e.setEnd},vu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(pu(e.toString())&&cu(n.parentNode)&&Do.isText(n)&&(t=n.data,pu(t[r-1])||pu(t[r+1])))},bu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},yu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?Xa(n[0]):Xa(e.getBoundingClientRect()),!hu(e)&&fu(e)&&bu(t)?(i=(r=e).ownerDocument,a=gu(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=Xa(a.getBoundingClientRect()),s.removeChild(u),o):bu(t)&&hu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Do.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),yu(i)}return null}(e):t},Cu=function(e,t){var n=Ya(e,t);return n.width=1,n.right=n.left+1,n},xu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=gu(e.ownerDocument);if(t<e.data.length){if(nu(e.data[t]))return r;if(nu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!vu(n)))return o(Cu(yu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),vu(n)||o(Cu(yu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),vu(n)||o(Cu(yu(n),!0)))};if(lu(e.container()))return i(e.container(),e.offset()),r;if(ou(e.container()))if(e.isAtEnd())n=mu(e.container(),e.offset()),lu(n)&&i(n,n.data.length),su(n)&&!fu(n)&&o(Cu(yu(n),!1));else{if(n=mu(e.container(),e.offset()),lu(n)&&i(n,0),su(n)&&e.isAtEnd())return o(Cu(yu(n),!1)),r;t=mu(e.container(),e.offset()-1),su(t)&&!fu(t)&&(au(t)||au(n)||!su(n))&&o(Cu(yu(t),!1)),su(n)&&o(Cu(yu(n),!0))}return r};function wu(t,n,e){var r=function(){return e||(e=xu(wu(t,n))),e};return{container:ya.constant(t),offset:ya.constant(n),toRange:function(){var e;return(e=gu(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return lu(t),0===n},isAtEnd:function(){return lu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return mu(t,e?n-1:n)}}}(Yi=wu||(wu={})).fromRangeStart=function(e){return Yi(e.startContainer,e.startOffset)},Yi.fromRangeEnd=function(e){return Yi(e.endContainer,e.endOffset)},Yi.after=function(e){return Yi(e.parentNode,du(e)+1)},Yi.before=function(e){return Yi(e.parentNode,du(e))},Yi.isAbove=function(e,t){return ru([ee(t.getClientRects()),te(e.getClientRects())],Ja).getOr(!1)},Yi.isBelow=function(e,t){return ru([te(t.getClientRects()),ee(e.getClientRects())],Qa).getOr(!1)},Yi.isAtStart=function(e){return!!e&&e.isAtStart()},Yi.isAtEnd=function(e){return!!e&&e.isAtEnd()},Yi.isTextPosition=function(e){return!!e&&Do.isText(e.container())},Yi.isElementPosition=function(e){return!1===Yi.isTextPosition(e)};var Nu,Eu,Su=wu,Tu=Do.isText,ku=Do.isBogus,Au=pi.nodeIndex,_u=function(e){var t=e.parentNode;return ku(t)?_u(t):t},Ru=function(e){return e?jt.reduce(e.childNodes,function(e,t){return ku(t)&&"BR"!==t.nodeName?e=e.concat(Ru(t)):e.push(t),e},[]):[]},Du=function(t){return function(e){return t===e}},Bu=function(e){var t,r,n,o;return(Tu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Ru(_u(t=e)),n=jt.findIndex(r,Du(t),t),r=r.slice(0,n+1),o=jt.reduce(r,function(e,t,n){return Tu(t)&&Tu(r[n-1])&&e++,e},0),r=jt.filter(r,Do.matchNodeNames(t.nodeName)),(n=jt.findIndex(r,Du(t),t))-o)+"]"},Ou=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Tu(n)?o=function(e,t){for(;(e=e.previousSibling)&&Tu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Bu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=jt.filter(a,ya.negate(Do.isBogus)),(u=u.concat(jt.map(a,function(e){return Bu(e)}))).reverse().join("/")+","+o},Pu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=jt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Ru(n),i=jt.filter(i,function(e,t){return!Tu(e)||!Tu(i[t-1])}),(i=jt.filter(i,Do.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Tu(r)?function(e,t){for(var n,r=e,o=0;Tu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!Tu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Tu(e)&&t>e.data.length&&(t=e.data.length),Su(e,t)}(r,parseInt(o,10)):(o="after"===o?Au(r)+1:Au(r),Su(r.parentNode,o)):null):null},Lu=Do.isContentEditableFalse,Iu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(Do.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Do.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},Mu=function(e){Do.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},Fu=function(e,t,n){var r=0;return Yt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Uu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Do.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},zu=function(e){return Uu(e,!0),Uu(e,!1),e},Vu=function(e,t){var n;if(Do.isElement(e)&&(e=eu(e,t),Lu(e)))return e;if(Aa(e)){if(Do.isText(e)&&Ta(e)&&(e=e.parentNode),n=e.previousSibling,Lu(n))return n;if(n=e.nextSibling,Lu(n))return n}},qu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Lu(r)||"IMG"===o)return{name:o,index:Fu(n.dom,o,r)};var a,u,s,c,l,f,d,m=Vu((a=i).startContainer,a.startOffset)||Vu(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:Fu(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Iu(f,u,c,l,!0),s.isCollapsed()||(d.end=Iu(f,u,c,l,!1)),d)},Hu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},ju=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Fu(n,u,a)};var s=zu(r.cloneRange());if(!i){s.collapse(!1);var c=Hu(n,o+"_end",t);s.insertNode(c),Mu(c.nextSibling)}(r=zu(r)).collapse(!0);var l=Hu(n,o+"_start",t);return r.insertNode(l),Mu(l.previousSibling),Mu(l.nextSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},$u={getBookmark:function(e,t,n){return 2===t?qu(Na,n,e):3===t?(o=(r=e).getRng(),{start:Ou(r.dom.getRoot(),Su.fromRangeStart(o)),end:Ou(r.dom.getRoot(),Su.fromRangeEnd(o))}):t?{rng:e.getRng()}:ju(e,!1);var r,o},getUndoBookmark:b(qu,j,!0),getPersistentBookmark:ju},Wu="_mce_caret",Ku=function(e){return Do.isElement(e)&&e.id===Wu},Xu=function(e,t){for(;t&&t!==e;){if(t.id===Wu)return t;t=t.parentNode}return null},Yu=Do.isElement,Gu=Do.isText,Ju=function(e){var t=e.parentNode;t&&t.removeChild(e)},Qu=function(e,t){0===t.length?Ju(e):e.nodeValue=t},Zu=function(e){var t=Na(e);return{count:e.length-t.length,text:t}},es=function(e,t){return rs(e),t},ts=function(e,t){var n,r,o,i=t.container(),a=(n=ne(i.childNodes),r=e,o=L(n,r),-1===o?A.none():A.some(o)).map(function(e){return e<t.offset()?Su(i,t.offset()-1):t}).getOr(t);return rs(e),a},ns=function(e,t){return Gu(e)&&t.container()===e?(r=t,o=Zu((n=e).data.substr(0,r.offset())),i=Zu(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(Qu(n,a),Su(n,r.offset()-o.count)):r):es(e,t);var n,r,o,i,a},rs=function(e){if(Yu(e)&&Aa(e)&&(_a(e)?e.removeAttribute("data-mce-caret"):Ju(e)),Gu(e)){var t=Na(function(e){try{return e.nodeValue}catch(t){return""}}(e));Qu(e,t)}},os={removeAndReposition:function(e,t){return Su.isTextPosition(t)?ns(e,t):(n=e,(r=t).container()===n.parentNode?ts(n,r):es(n,r));var n,r},remove:rs},is=Do.isContentEditableTrue,as=Do.isContentEditableFalse,us=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},ss=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},cs=function(e,t,n){var r=Gc(1,e.getBody(),t),o=Su.fromRangeStart(r),i=o.getNode();if(as(i))return us(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(as(a))return us(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return as(e)||is(e)});return as(u)?us(1,e,u,!1,n):null},ls=function(e,t,n){if(!t||!t.collapsed)return t;var r=cs(e,t,n);return r||t};(Eu=Nu||(Nu={}))[Eu.Backwards=-1]="Backwards",Eu[Eu.Forwards=1]="Forwards";var fs,ds,ms=Do.isContentEditableFalse,gs=Do.isText,ps=Do.isElement,hs=Do.isBr,vs=ja,bs=function(e){return Va(e)||!!$a(t=e)&&!0!==jt.reduce(t.getElementsByTagName("*"),function(e,t){return e||Ia(t)},!1);var t},ys=Wa,Cs=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},xs=function(e,t){if(Uc(e)){if(vs(t.previousSibling)&&!gs(t.previousSibling))return Su.before(t);if(gs(t))return Su(t,0)}if(zc(e)){if(vs(t.nextSibling)&&!gs(t.nextSibling))return Su.after(t);if(gs(t))return Su(t,t.data.length)}return zc(e)?hs(t)?Su.before(t):Su.after(t):Su.before(t)},ws=function(e,t,n){var r,o,i,a,u;if(!ps(n)||!t)return null;if(t.isEqual(Su.after(n))&&n.lastChild){if(u=Su.after(n.lastChild),zc(e)&&vs(n.lastChild)&&ps(n.lastChild))return hs(n.lastChild)?Su.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(gs(f)){if(zc(e)&&0<d)return Su(f,--d);if(Uc(e)&&d<f.length)return Su(f,++d);r=f}else{if(zc(e)&&0<d&&(o=Cs(f,d-1),vs(o)))return!bs(o)&&(i=qc(o,e,ys,o))?gs(i)?Su(i,i.data.length):Su.after(i):gs(o)?Su(o,o.data.length):Su.before(o);if(Uc(e)&&d<f.childNodes.length&&(o=Cs(f,d),vs(o)))return hs(o)&&n.lastChild===o?null:(s=o,c=n,Do.isBr(s)&&(l=ws(1,Su.after(s),c))&&!jc(Su.before(s),Su.before(l),c)?ws(e,Su.after(o),n):!bs(o)&&(i=qc(o,e,ys,o))?gs(i)?Su(i,0):Su.before(i):gs(o)?Su(o,0):Su.after(o));r=o||u.getNode()}return(Uc(e)&&u.isAtEnd()||zc(e)&&u.isAtStart())&&(r=qc(r,e,ya.constant(!0),n,!0),ys(r,n))?xs(e,r):(o=qc(r,e,ys,n),!(a=jt.last(jt.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),ms)))||o&&a.contains(o)?o?xs(e,o):null:u=Uc(e)?Su.after(a):Su.before(a))},Ns=function(t){return{next:function(e){return ws(Nu.Forwards,e,t)},prev:function(e){return ws(Nu.Backwards,e,t)}}};(ds=fs||(fs={}))[ds.Br=0]="Br",ds[ds.Block=1]="Block",ds[ds.Wrap=2]="Wrap",ds[ds.Eol=3]="Eol";var Es,Ss,Ts,ks,As,_s=function(e,t){return e===Nu.Backwards?t.reverse():t},Rs=function(e,t,n,r){for(var o,i,a,u,s,c,l=Ns(n),f=r,d=[];f&&(s=l,c=f,o=t===Nu.Forwards?s.next(c):s.prev(c));){if(Do.isBr(o.getNode(!1)))return t===Nu.Forwards?{positions:_s(t,d).concat([o]),breakType:fs.Br,breakAt:A.some(o)}:{positions:_s(t,d),breakType:fs.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,Do.isBr(u.getNode(i===Nu.Forwards))?fs.Br:!1===jc(a,u)?fs.Block:fs.Wrap);return{positions:_s(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:_s(t,d),breakType:fs.Eol,breakAt:A.none()}},Ds=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Nu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},Bs=function(e,i){return z(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return ru([ee(r.getClientRects()),ee(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},Os=function(t,e){return ee(e.getClientRects()).bind(function(e){return Bs(t,e.left)})},Ps=b(Rs,wu.isAbove,-1),Ls=b(Rs,wu.isBelow,1),Is=b(Ds,-1,Ps),Ms=b(Ds,1,Ls),Fs=function(e,t,n,r,o){var i,a,u,s,c=Ki(er.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Xa(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,z(a,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},Us=b(Fs,function(e){return e.bottom},function(e,t){return e.y<t}),zs=b(Fs,function(e){return e.top},function(e,t){return e.y>t}),Vs=function(t,n){return ee(n.getClientRects()).bind(function(e){return Us(t,e.left,e.top)}).bind(function(e){return Os((t=e,fl.lastPositionIn(t).map(function(e){return Ps(t,e).positions.concat(e)}).getOr([])),n);var t})},qs=function(t,n){return te(n.getClientRects()).bind(function(e){return zs(t,e.left,e.top)}).bind(function(e){return Os((t=e,fl.firstPositionIn(t).map(function(e){return[e].concat(Ls(t,e).positions)}).getOr([])),n);var t})},Hs=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},js=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&Do.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Hs(t).y-Hs(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},$s=function(d,e){ee(wu.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},Ws=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},Ks=function(e){return e.getParam("iframe_attrs",{})},Xs=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Ys=function(e){return e.getParam("document_base_url","")},Gs=function(e){return Ws(e,"body_id","tinymce")},Js=function(e){return Ws(e,"body_class","")},Qs=function(e){return e.getParam("content_security_policy","")},Zs=function(e){return e.getParam("br_in_pre",!0)},ec=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},tc=function(e){return e.getParam("forced_root_block_attrs",{})},nc=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},rc=function(e){return e.getParam("no_newline_selector","")},oc=function(e){return e.getParam("keep_styles",!0)},ic=function(e){return e.getParam("end_container_on_empty_block",!1)},ac=function(e){return Yt.explode(e.getParam("font_size_style_values",""))},uc=function(e){return Yt.explode(e.getParam("font_size_classes",""))},sc=function(e){return e.getParam("images_dataimg_filter",H(!0),"function")},cc=function(e){return e.getParam("automatic_uploads",!0,"boolean")},lc=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},fc=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},dc=function(e){return e.getParam("images_upload_url","","string")},mc=function(e){return e.getParam("images_upload_base_path","","string")},gc=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},pc=function(e){return e.getParam("images_upload_handler",null,"function")},hc=Qn.detect().browser,vc=function(){return hc.isIE()||hc.isEdge()||hc.isFirefox()},bc=function(e,t){e.selection.setRng(t),$s(e,t)},yc=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===fs.Wrap&&0===a.positions.length||!Do.isBr(n.getNode())&&(i=u).breakType===fs.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},Cc=ya.curry(yc,Ps),xc=ya.curry(yc,Ls),wc=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(vc()&&(o=t,i=s,a=n,u=Su.fromRangeStart(i),fl.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=us(c,e,n,!t,!0);return bc(e,l),!0}return!1},Nc=function(e,t){var n=t.getNode(e);return Do.isElement(n)&&"TABLE"===n.nodeName?A.some(n):A.none()},Ec=function(u,s,c){var e=Nc(!!s,c),t=!1===s;e.fold(function(){return bc(u,c.toRange())},function(a){return fl.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return bc(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=ec(r=u))?r.undoManager.transact(function(){var e=er.fromTag(i);hr.setAll(e,tc(r)),Ti.append(e,er.fromTag("br")),n?Ti.after(er.fromDom(o),e):Ti.before(er.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),bc(r,t)}):bc(r,t.toRange()));var n,r,o,t,i})})},Sc=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Su.fromRangeStart(l),d=e.getBody();if(!t&&Cc(r,f)){var m=(u=d,Vs(s=n,c=f).orThunk(function(){return ee(c.getClientRects()).bind(function(e){return Bs(Is(u,Su.before(s)),e.left)})}).getOr(Su.before(s)));return Ec(e,t,m),!0}return!(!t||!xc(r,f))&&(o=d,m=qs(i=n,a=f).orThunk(function(){return ee(a.getClientRects()).bind(function(e){return Bs(Ms(o,Su.after(i)),e.left)})}).getOr(Su.after(i)),Ec(e,t,m),!0)},Tc=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return wc(t,n,e)})}).getOr(!1)}},kc=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return Sc(n,r,e,t)})}).getOr(!1)}},Ac=Do.isContentEditableFalse,_c=function(e,t,n){var r,o,i,a,u,s=Ya(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Rc=function(a,u,e){var t,s,c=Bi(A.none()),l=function(){!function(e){var t,n,r,o,i;for(t=pn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Pa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Oa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(os.remove(s),s=null),c.get().each(function(e){pn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=Le.setInterval(function(){e()?pn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):pn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,Do.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(wa),o=e.parentNode,t){if(n=e.previousSibling,Sa(n)){if(Aa(n))return n;if(Pa(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Sa(n)){if(Aa(n))return n;if(Oa(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),Ac(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=Ba("p",e,t),n=_c(a,e,t),pn(s).css("top",n.top);var i=pn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=_c(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return Le.clearInterval(t)}}},Dc=function(e){return Ac(e)||Do.isTable(e)&&vc()},Bc=Do.isContentEditableFalse,Oc=Do.matchStyleValues("display","block table table-cell table-caption list-item"),Pc=Aa,Lc=Ta,Ic=ya.curry,Mc=Do.isElement,Fc=ja,Uc=function(e){return 0<e},zc=function(e){return e<0},Vc=function(e,t){for(var n;n=e(t);)if(!Lc(n))return n;return null},qc=function(e,t,n,r,o){var i=new oo(e,r);if(zc(t)){if((Bc(e)||Lc(e))&&n(e=Vc(i.prev,!0)))return e;for(;e=Vc(i.prev,o);)if(n(e))return e}if(Uc(t)){if((Bc(e)||Lc(e))&&n(e=Vc(i.next,!0)))return e;for(;e=Vc(i.next,o);)if(n(e))return e}return null},Hc=function(e,t){for(;e&&e!==t;){if(Oc(e))return e;e=e.parentNode}return null},jc=function(e,t,n){return Hc(e.container(),n)===Hc(t.container(),n)},$c=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),Mc(n)?n.childNodes[r+e]:null):null},Wc=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Kc=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],Pc(r)&&(r=r[o]),Bc(r)){if(a=n,Hc(r,i=t)===Hc(a,i))return r;break}if(Fc(r))break;n=n.parentNode}return null},Xc=Ic(Wc,!0),Yc=Ic(Wc,!1),Gc=function(e,t,n){var r,o,i,a,u=Ic(Kc,!0,t),s=Ic(Kc,!1,t);if(o=n.startContainer,i=n.startOffset,Ta(o)){if(Mc(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,Dc(r)))return Xc(r);if("after"===a&&(r=o.previousSibling,Dc(r)))return Yc(r)}if(!n.collapsed)return n;if(Do.isText(o)){if(Pc(o)){if(1===e){if(r=s(o))return Xc(r);if(r=u(o))return Yc(r)}if(-1===e){if(r=u(o))return Yc(r);if(r=s(o))return Xc(r)}return n}if(Pa(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Xc(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Yc(r):n;if(i===o.data.length)return(r=s(o))?Xc(r):n;if(0===i)return(r=u(o))?Yc(r):n}return n},Jc=function(e,t){var n=$c(e,t);return Bc(n)&&!Do.isBogusAll(n)},Qc=function(e,t){return Do.isTable($c(e,t))},Zc=function(e,t){return A.from($c(e?0:-1,t)).filter(Bc)},el=function(e,t,n){var r=Gc(e,t,n);return-1===e?wu.fromRangeStart(r):wu.fromRangeEnd(r)},tl=Ic(Jc,0),nl=Ic(Jc,-1),rl=Ic(Qc,0),ol=Ic(Qc,-1),il=function(e){return Su.isTextPosition(e)?0===e.offset():ja(e.getNode())},al=function(e){if(Su.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return ja(e.getNode(!0))},ul=function(e,t){return!Su.isTextPosition(e)&&!Su.isTextPosition(t)&&e.getNode()===t.getNode(!0)},sl=function(e,t,n){return e?!ul(t,n)&&(r=t,!(!Su.isTextPosition(r)&&Do.isBr(r.getNode())))&&al(t)&&il(n):!ul(n,t)&&il(t)&&al(n);var r},cl=function(e,t,n){var r=Ns(t);return A.from(e?r.next(n):r.prev(n))},ll=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Do.isText(u)?A.some(Su(u,e?0:u.data.length)):u?ja(u)?A.some(e?Su.before(u):(a=u,Do.isBr(a)?Su.before(a):Su.after(a))):(r=t,o=u,i=(n=e)?Su.before(o):Su.after(o),cl(n,r,i)):A.none()},fl={fromPosition:cl,nextPosition:b(cl,!0),prevPosition:b(cl,!1),navigate:function(t,n,r){return cl(t,n,r).bind(function(e){return jc(r,e,n)&&sl(t,r,e)?cl(t,n,e):A.some(e)})},positionIn:ll,firstPositionIn:b(ll,!0),lastPositionIn:b(ll,!1)},dl=function(e,t){return!e.isBlock(t)||t.innerHTML||Re.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},ml=function(e,t){return fl.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},gl=function(e,t,n){return!(!1!==t.hasChildNodes()||!Xu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(wa),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},pl=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,gl(c,i,r))return!0;if(s[o]>u.length-1)return!!gl(c,i,r)||ml(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},hl=function(e){return Do.isText(e)&&0<e.data.length},vl=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):hl(c.nextSibling)?(r=c.nextSibling,o=0):hl(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):hl(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Yt.each(Yt.grep(c.childNodes),function(e){Do.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&Do.isText(a)&&!Re.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(Su(u,s))}return A.none()},bl=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=e.dom;if(t){if(v=t,Yt.isArray(v.start))return p=t,h=(g=b).createRng(),pl(g,!0,p,h)&&pl(g,!1,p,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=b).createRng(),m=Pu(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Pu(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=vl(o=b,"start",i=t),c=vl(o,"end",i),ru([s,(a=c,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(dl(o,e.container()),e.offset()),n.setEnd(dl(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=b,r=t,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.none()},yl=function(e,t,n){return $u.getBookmark(e,t,n)},Cl=function(t,e){bl(t,e).each(function(e){t.setRng(e)})},xl=function(e){return Do.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},wl=function(e){return e&&/^(IMG)$/.test(e.nodeName)},Nl=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},El=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},Sl={isInlineBlock:wl,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!wl(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new oo(u=i[a],e.getParent(u,e.isBlock)):(r=new oo(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!Nl(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!Nl(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:Nl,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:El,getStyle:function(e,t,n){return El(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Tl=xl,kl=Sl.getParents,Al=Sl.isWhiteSpaceNode,_l=Sl.isTextBlock,Rl=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Dl=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Bl=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1===(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)||t||o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Ol=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Bl(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new oo(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||Tl(u.parentNode)){if(e.isBlock(u)||Sl.isEq(u,"BR"))break}else if(-1!==(s=Bl(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},Pl=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=kl(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Ll=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&_l(t,e)},u)}if(o&&e[0].wrapper&&(o=kl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Sl.isEq(o,"br")););return o||n},Il=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!Al(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Tl(c)&&!Al(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Ml=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=eu(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=eu(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Dl(c,i),u=Dl(c,u),(Tl(i.parentNode)||Tl(i))&&(i=Tl(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(Tl(u.parentNode)||Tl(u))&&(u=Tl(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=Ol(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Ol(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=Rl(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Rl(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Il(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Il(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=Pl(c,n,t,i,"previousSibling"),u=Pl(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Ll(e,n,i,"previousSibling"),u=Ll(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Il(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Il(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Fl=Yt.each,Ul=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Fl(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=y(l,n)||l,i=y(d,n)||d,C(l,r,!0),(s=b(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},zl=(Es=sr.isText,Ss="text",Ts=function(e){return Es(e)?A.from(e.dom().nodeValue):A.none()},ks=Qn.detect().browser,{get:function(e){if(!Es(e))throw new Error("Can only get "+Ss+" value of a "+Ss+" node");return As(e).getOr("")},getOption:As=ks.isIE()&&10===ks.version.major?function(e){try{return Ts(e)}catch(nN){return A.none()}}:Ts,set:function(e,t){if(!Es(e))throw new Error("Can only set raw "+Ss+" value of a "+Ss+" node");e.dom().nodeValue=t}}),Vl=function(e){return zl.get(e)},ql=function(r,o,i,a){return $r.parent(o).fold(function(){return"skipping"},function(e){return"br"===a||(n=o,sr.isText(n)&&"\ufeff"===Vl(n))?"skipping":(t=o,sr.isElement(t)&&Wi.has(t,oa())?"existing":Ku(o)?"caret":Sl.isValid(r,i,a)&&Sl.isValid(r,sr.name(e),i)?"valid":"invalid-child");var t,n})},Hl=undefined&&undefined.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},jl=function(r,e,t,n,o){var i,a,u=o.uid,s=void 0===u?(i="mce-annotation",a=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++fa+String(a)):u,c=Hl(o,["uid"]),l=[],f=er.fromTag("span");Wi.add(f,oa()),hr.set(f,""+aa(),s),hr.set(f,""+ia(),t);var d=n(s,c),m=d.attributes,g=void 0===m?{}:m,p=d.classes,h=void 0===p?[]:p;hr.setAll(f,g),da(f,h);var v=Bi(A.none()),b=function(){v.set(A.none())},y=function(e){F(e,C)},C=function(e){switch(ql(r,e,"span",sr.name(e))){case"invalid-child":b();var t=$r.children(e);y(t),b();break;case"valid":var n=v.get().getOrThunk(function(){var e=pa(f);return l.push(e),v.set(A.some(e)),e});Ti.wrap(e,n)}};return Ul(r.dom,e,function(e){var t;b(),t=$(e,er.fromDom),y(t)}),l},$l=function(a,u,s,c){a.undoManager.transact(function(){var e,t,n,r=a.selection.getRng();r.collapsed&&(n=Ml(e=a,t=r,[{inline:!0}],!1),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t));var o=$u.getPersistentBookmark(a.selection,!0),i=a.selection.getRng();jl(a,i,u,s.decorate,c),a.selection.moveToBookmark(o)})};function Wl(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?A.from(n[e]).map(function(e){return e.settings}):A.none()}});la(s,r);var o=ca(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){$l(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ua(s,A.some(e)).each(function(e){var t=e.elements;F(t,Ri.unwrap)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=er.fromDom(t.getBody()),o=Ki(r,"["+ia()+'="'+n+'"]'),i={},F(o,function(e){var t=hr.get(e,aa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return $(e,function(e){return e.dom()})},fr(u,function(e,t,n){return{k:t,v:a(e,t,n)}})}}}var Kl=function(e){return Yt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Xl=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||Do.isBr(t));var t},Yl=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Xl(t))?e.slice(0,-1):e;var t},Gl=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Jl=function(e,t){var n=Su.after(e),r=Ns(t).prev(n);return r?r.toRange():null},Ql=function(t,e,n){var r,o,i,a,u=t.parentNode;return Yt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Su.before(r),(a=Ns(o).next(i))?a.toRange():null},Zl=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},ef=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=Gl(o,i.startContainer),S=Yl(Kl(N.firstChild)),T=o.getRoot(),k=function(e){var t=Su.fromRangeStart(i),n=Ns(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Gl(o,r.getNode())!==E};return k(1)?Ql(E,S,T):k(2)?(f=E,d=S,m=T,o.insertAfter(d.reverse(),f),Jl(d[0],m)):(p=S,h=T,v=g=E,y=(b=i).cloneRange(),C=b.cloneRange(),y.setStartBefore(v),C.setEndAfter(v),x=[y.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Yt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),Jl(p[p.length-1],h))},tf=function(e,t){return!!Gl(e,t)},nf=Yt.each,rf=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return nf(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||xl(e)||xl(t))}},of=function(e){var t=Ki(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(er.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),mo);t.length===n.length&&F(n,Ri.remove)},af=function(e){Ri.empty(e),Ti.append(e,er.fromHtml('<br data-mce-bogus="1">'))},uf=function(n){$r.lastChild(n).each(function(t){$r.prevSibling(t).each(function(e){lo(n)&&mo(t)&&lo(e)&&Ri.remove(t)})})},sf=Yt.makeMap;function cf(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=sf(e.indent_before||""),c=sf(e.indent_after||""),l=$o.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function lf(t,g){void 0===g&&(g=ni());var p=cf(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var ff=function(a){var u=Su.fromRangeStart(a),s=Su.fromRangeEnd(a),c=a.commonAncestorContainer;return fl.fromPosition(!1,c,s).map(function(e){return!jc(u,s,c)&&jc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},df=function(e){return e.collapsed?e:ff(e)},mf=Do.matchNodeNames("td th"),gf=function(o,e,t){var n,r,i,a,u,s,c,l,f,d,m,g,p=o.schema.getTextInlineElements(),h=o.selection,v=o.dom;if(/^ | $/.test(e)&&(e=function(e){var t,n,r;t=h.getRng(),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?e=e.replace(/^&nbsp;/," "):o("previousSibling")||(e=e.replace(/^ /,"&nbsp;")),r<n.length?e=e.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(e=e.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),e}(e)),n=o.parser,g=t.merge,r=lf({validate:o.settings.validate},o.schema),m='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',s={content:e,format:"html",selection:!0,paste:t.paste},(s=o.fire("BeforeSetContent",s)).isDefaultPrevented())o.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=s.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,m);var b,y,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=o.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(b=N.firstChild)&&!o.schema.getShortEndedElements()[b.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(o.selection.setRng(df(o.selection.getRng())),o.getDoc().execCommand("Delete",!1,null),C=(y=h.getRng()).startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))));var E,S,T,k={context:(i=h.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0};if(u=n.parse(e,k),!0===t.paste&&Zl(o.schema,u)&&tf(v,i))return l=ef(r,v,o.selection.getRng(),u),o.selection.setRng(l),void o.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!v.isBlock(f.name)){o.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(o._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(h.setContent(m),i=h.getNode(),a=o.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;e=i===a?a.innerHTML:v.getOuterHTML(i),e=r.serialize(n.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return r.serialize(u)}))),i===a?v.setHTML(a,e):v.setOuterHTML(i,e)}else e=r.serialize(u),function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t)}}(o,e,i);!function(){if(g){var n=o.getBody(),r=new rf(v);Yt.each(v.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==n;t=t.parentNode)p[e.nodeName.toLowerCase()]&&r.compare(t,e)&&v.remove(e,!0)})}}(),function(e){var t,n,r;if(e){if(h.scrollIntoView(e),t=function(e){for(var t=o.getBody();e&&e!==t;e=e.parentNode)if("false"===o.dom.getContentEditable(e))return e;return null}(e))return v.remove(e),h.select(t);l=v.createRng(),(f=e.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),Re.ie||(d=e.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(e),l.setEndBefore(e)),n=v.getParent(e,v.isBlock),v.remove(e),n&&v.isEmpty(n)&&(o.$(n).empty(),l.setStart(n,0),l.setEnd(n,0),mf(n)||n.getAttribute("data-mce-fragment")||!(r=function(e){var t=Su.fromRangeStart(e);if(t=Ns(o.getBody()).next(t))return t.toRange()}(l))?v.add(n,v.create("br",{"data-mce-bogus":"1"})):(l=r,v.remove(n))),h.setRng(l)}}(v.get("mce_marker")),E=o.getBody(),Yt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=o.dom,T=o.selection.getStart(),A.from(S.getParent(T,"td,th")).map(er.fromDom).each(uf),o.fire("SetContent",s),o.addVisual()}},pf=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Yt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};gf(e,o.content,o.details)},hf=kr("sections","settings"),vf=Qn.detect().deviceType.isTouch(),bf=["lists","autolink","autosave"],yf={theme:"mobile"},Cf=function(e){var t=R(e)?e.join(" "):e,n=$(k(t)?t.split(" "):[],$n);return U(n,function(e){return 0<e.length})},xf=function(n,e){var r,o,i,t=(r=function(e,t){return I(n,t)},o={},i={},lr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return hf(t.t,t.f)},wf=function(e,t){return e.sections().hasOwnProperty(t)},Nf=function(e,t,n,r){var o,i=Cf(n.forced_plugins),a=Cf(r.plugins),u=e&&wf(t,"mobile")?U(a,b(I,bf)):a,s=(o=u,[].concat(Cf(i)).concat(Cf(o)));return Yt.extend(r,{plugins:s.join(" ")})},Ef=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=xf(["mobile"],r),p=Yt.extend(t,n,g.settings(),(f=e,m=(d=g).settings().inline,f&&wf(d,"mobile")&&!m?(u="mobile",s=yf,c=g.sections(),l=c.hasOwnProperty(u)?c[u]:{},Yt.extend({},s,l)):{}),{validate:!0,content_editable:g.settings().inline,external_plugins:(o=n,i=g.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Yt.extend({},o.external_plugins,a):a)});return Nf(e,g,n,p)},Sf=function(e,t,n){return A.from(t.settings[n]).filter(e)},Tf=b(Sf,k),kf=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?F(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Yt.trim(t[0])]=Yt.trim(t[1]):a[Yt.trim(t[0])]=Yt.trim(t)}):a=i,a):"string"===r?Sf(k,e,t).getOr(n):"number"===r?Sf(P,e,t).getOr(n):"boolean"===r?Sf(B,e,t).getOr(n):"object"===r?Sf(_,e,t).getOr(n):"array"===r?Sf(R,e,t).getOr(n):"string[]"===r?Sf((o=k,function(e){return R(e)&&J(e,o)}),e,t).getOr(n):"function"===r?Sf(O,e,t).getOr(n):u},Af=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,_f=function(e,t){var n=t.container(),r=t.offset();return e?ka(n)?Do.isText(n.nextSibling)?Su(n.nextSibling,0):Su.after(n):Ra(t)?Su(n,r+1):t:ka(n)?Do.isText(n.previousSibling)?Su(n.previousSibling,n.previousSibling.data.length):Su.before(n):Da(t)?Su(n,r-1):t},Rf={isInlineTarget:function(e,t){var n=Tf(e,"inline_boundaries_selector").getOr("a[href],code");return Lr.is(er.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(pi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===pi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Af.test(t));var t},isAtZwsp:function(e){return Ra(e)||Da(e)},normalizePosition:_f,normalizeForwards:b(_f,!0),normalizeBackwards:b(_f,!1),hasSameParentBlock:function(e,t,n){var r=Hc(t,e),o=Hc(n,e);return r&&r===o}},Df=function(e,t){return Fr.contains(e,t)?Zi.closest(t,function(e){return go(e)||ho(e)},(n=e,function(e){return Fr.eq(n,er.fromDom(e.dom().parentNode))})):A.none();var n},Bf=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},Of=function(i,a,u){return ru([fl.firstPositionIn(u),fl.lastPositionIn(u)],function(e,t){var n=Rf.normalizePosition(!0,e),r=Rf.normalizePosition(!1,t),o=Rf.normalizePosition(!1,a);return i?fl.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):fl.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Pf=function(e,t,n){return ta(e,t,n).isSome()},Lf=function(e,t){return Do.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===(n=e,r=t,o=er.fromDom(n),i=er.fromDom(r),Pf(i,"pre,code",b(Fr.eq,o)));var n,r,o,i},If=function(e,t){return ja(t)&&!1===Lf(e,t)||(n=t,Do.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Mf(t);var n},Mf=Do.hasAttribute("data-mce-bookmark"),Ff=Do.hasAttribute("data-mce-bogus"),Uf=Do.hasAttributeValue("data-mce-bogus","all"),zf=function(e){return function(e){var t,n,r=0;if(If(e,e))return!1;if(!(n=e.firstChild))return!0;t=new oo(n,e);do{if(Uf(n))n=t.next(!0);else if(Ff(n))n=t.next();else if(Do.isBr(n))r++,n=t.next();else{if(If(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Vf=kr("block","position"),qf=kr("from","to"),Hf=function(e,t){var n=er.fromDom(e),r=er.fromDom(t.container());return Df(n,r).map(function(e){return Vf(e,t)})},jf=function(o,i,e){var t=Hf(o,Su.fromRangeStart(e)),n=t.bind(function(e){return fl.fromPosition(i,o,e.position()).bind(function(e){return Hf(o,e).map(function(e){return t=o,n=i,r=e,Do.isBr(r.position().getNode())&&!1===zf(r.block())?fl.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?fl.fromPosition(n,t,e).bind(function(e){return Hf(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return ru([t,n],qf).filter(function(e){return r=e,!1===Fr.eq(r.from().block(),r.to().block())&&(n=e,$r.parent(n.from().block()).bind(function(t){return $r.parent(n.to().block()).filter(function(e){return Fr.eq(t,e)})}).isSome())&&(t=e,!1===Do.isContentEditableFalse(t.from().block())&&!1===Do.isContentEditableFalse(t.to().block()));var t,n,r})},$f=function(e,t,n){return n.collapsed?jf(e,t,n):A.none()},Wf=function(e,t,n){return Fr.contains(t,e)?$r.parents(e,function(e){return n(e)||Fr.eq(e,t)}).slice(0,-1):[]},Kf=function(e,t){return Wf(e,t,H(!1))},Xf=Kf,Yf=function(e,t){return[e].concat(Kf(e,t))},Gf=function(e){var t,n,r=(t=e,n=$r.children(t),K(n,lo).fold(function(){return n},function(e){return n.slice(0,e)}));return F(r,Ri.remove),r},Jf=function(e,t){var n=Yf(t,e);return V(n.reverse(),zf).each(Ri.remove)},Qf=function(e,t,n,r){if(zf(n))return af(n),fl.firstPositionIn(n.dom());var o;o=r,0===U($r.prevSiblings(o),function(e){return!zf(e)}).length&&zf(t)&&Ti.before(r,er.fromTag("br"));var i=fl.prevPosition(n.dom(),Su.before(r.dom()));return F(Gf(t),function(e){Ti.before(r,e)}),Jf(e,t),i},Zf=function(e,t,n){if(zf(n))return Ri.remove(n),zf(t)&&af(t),fl.firstPositionIn(t.dom());var r=fl.lastPositionIn(n.dom());return F(Gf(t),function(e){Ti.append(n,e)}),Jf(e,t),r},ed=function(e,t){return Fr.contains(t,e)?(n=Yf(e,t),A.from(n[n.length-1])):A.none();var n},td=function(e,t){fl.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(er.fromDom).filter(mo).each(Ri.remove)},nd=function(e,t,n){return td(!0,t),td(!1,n),ed(t,n).fold(b(Zf,e,t,n),b(Qf,e,t,n))},rd=function(e,t,n,r){return t?nd(e,r,n):nd(e,n,r)},od=function(t,n){var e,r=er.fromDom(t.getBody());return(e=$f(r.dom(),n,t.selection.getRng()).bind(function(e){return rd(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},id=function(e,t){var n=er.fromDom(t),r=b(Fr.eq,e);return Zi.ancestor(n,yo,r).isSome()},ad=function(e,t){var n,r,o=fl.prevPosition(e.dom(),Su.fromRangeStart(t)).isNone(),i=fl.nextPosition(e.dom(),Su.fromRangeEnd(t)).isNone();return!(id(n=e,(r=t).startContainer)||id(n,r.endContainer))&&o&&i},ud=function(e){var n,r,o,t,i=er.fromDom(e.getBody()),a=e.selection.getRng();return ad(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru([Df(n,er.fromDom(o.startContainer)),Df(n,er.fromDom(o.endContainer))],function(e,t){return!1===Fr.eq(e,t)&&(o.deleteContents(),rd(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},sd=function(e,t){return!e.selection.isCollapsed()&&ud(e)},cd=function(a){if(!R(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return F(a,function(e,r){var t=cr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!R(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=cr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return I(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},ld=cd([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),fd=function(e,t,n,r){var o=r.getNode(!1===t);return Df(er.fromDom(e),er.fromDom(n.getNode())).map(function(e){return zf(e)?ld.remove(e.dom()):ld.moveToElement(o)}).orThunk(function(){return A.some(ld.moveToElement(o))})},dd=function(u,s,c){return fl.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),yo(er.fromDom(a))||ho(er.fromDom(a))?A.none():(t=u,o=e,i=function(e){return fo(er.fromDom(e))&&!jc(r,o,t)},Zc(!(n=s),r=c).fold(function(){return Zc(n,o).fold(H(!1),i)},i)?A.none():s&&Do.isContentEditableFalse(e.getNode())?fd(u,s,c,e):!1===s&&Do.isContentEditableFalse(e.getNode(!0))?fd(u,s,c,e):s&&nl(c)?A.some(ld.moveToPosition(e)):!1===s&&tl(c)?A.some(ld.moveToPosition(e)):A.none());var t,n,r,o,i,a})},md=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Do.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&Do.isContentEditableFalse(n.nextSibling)?A.some(ld.moveToElement(n.nextSibling)):!1===t&&Do.isContentEditableFalse(n.previousSibling)?A.some(ld.moveToElement(n.previousSibling)):A.none()).fold(function(){return dd(r,e,o)},A.some):dd(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(ld.remove(e))},function(e){return A.some(ld.moveToElement(e))},function(e){return jc(n,e,t)?A.none():A.some(ld.moveToPosition(e))});var t,n});var t,n,i,a,u},gd=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Su.isTextPosition(n)&&o===r.parentNode&&i>Su.before(r).offset()?Su(t.container(),t.offset()-1):t;var n,r,o,i},pd=function(e){return ja(e.previousSibling)?A.some((t=e.previousSibling,Do.isText(t)?Su(t,t.data.length):Su.after(t))):e.previousSibling?fl.lastPositionIn(e.previousSibling):A.none();var t},hd=function(e){return ja(e.nextSibling)?A.some((t=e.nextSibling,Do.isText(t)?Su(t,0):Su.before(t))):e.nextSibling?fl.firstPositionIn(e.nextSibling):A.none();var t},vd=function(r,o){return pd(o).orThunk(function(){return hd(o)}).orThunk(function(){return e=r,t=o,n=Su.before(t.previousSibling?t.previousSibling:t.parentNode),fl.prevPosition(e,n).fold(function(){return fl.nextPosition(e,Su.after(t))},A.some);var e,t,n})},bd=function(n,r){return hd(r).orThunk(function(){return pd(r)}).orThunk(function(){return e=n,t=r,fl.nextPosition(e,Su.after(t)).fold(function(){return fl.prevPosition(e,Su.before(t))},A.some);var e,t})},yd=function(e,t,n){return(r=e,o=t,i=n,r?bd(o,i):vd(o,i)).map(b(gd,n));var r,o,i},Cd=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},xd=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(sr.name(t))},wd=function(e){if(zf(e)){var t=er.fromHtml('<br data-mce-bogus="1">');return Ri.empty(e),Ti.append(e,t),A.some(Su.before(t.dom()))}return A.none()},Nd=function(t,n,e){var r,a,o,i=yd(n,t.getBody(),e.dom()),u=Zi.ancestor(e,b(xd,t),(r=t.getBody(),function(e){return e.dom()===r})),s=(a=e,o=i,ru([$r.prevSibling(a),$r.nextSibling(a),o],function(e,t,n){var r,o=e.dom(),i=t.dom();return Do.isText(o)&&Do.isText(i)?(r=o.data.length,o.appendData(i.data),Ri.remove(t),Ri.remove(a),n.container()===i?Su(o,r):n):(Ri.remove(a),n)}).orThunk(function(){return Ri.remove(a),o}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(wd).fold(function(){Cd(t,n,s)},function(e){Cd(t,n,A.some(e))})},Ed=function(a,u){var e,t,n,r,o;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Gc(t?1:-1,e,n),o=Su.fromRangeStart(r),!1===t&&nl(o)?A.some(ld.remove(o.getNode(!0))):t&&tl(o)?A.some(ld.remove(o.getNode())):md(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),Nd(o,i,er.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Su.before(e):Su.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},Sd=function(e,t){var n,r=e.selection.getNode();return!!Do.isContentEditableFalse(r)&&(n=er.fromDom(e.getBody()),F(Ki(n,".mce-offscreen-selection"),Ri.remove),Nd(e,t,er.fromDom(e.selection.getNode())),Bf(e),!0)},Td=function(e,t){return e.selection.isCollapsed()?Ed(e,t):Sd(e,t)},kd=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Do.isContentEditableTrue(t)||Do.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Do.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Su.before(t).toRange())),!0},Ad=Do.isText,_d=function(e){return Ad(e)&&e.data[0]===wa},Rd=function(e){return Ad(e)&&e.data[e.data.length-1]===wa},Dd=function(e){return e.ownerDocument.createTextNode(wa)},Bd=function(e,t){return e?function(e){if(Ad(e.previousSibling))return Rd(e.previousSibling)||e.previousSibling.appendData(wa),e.previousSibling;if(Ad(e))return _d(e)||e.insertData(0,wa),e;var t=Dd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(Ad(e.nextSibling))return _d(e.nextSibling)||e.nextSibling.insertData(0,wa),e.nextSibling;if(Ad(e))return Rd(e)||e.appendData(wa),e;var t=Dd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Od=b(Bd,!0),Pd=b(Bd,!1),Ld=function(e,t){return Do.isText(e.container())?Bd(t,e.container()):Bd(t,e.getNode())},Id=function(e,t){var n=t.get();return n&&e.container()===n&&ka(n)},Md=function(n,e){return e.fold(function(e){os.remove(n.get());var t=Od(e);return n.set(t),A.some(Su(t,t.length-1))},function(e){return fl.firstPositionIn(e).map(function(e){if(Id(e,n))return Su(n.get(),1);os.remove(n.get());var t=Ld(e,!0);return n.set(t),Su(t,1)})},function(e){return fl.lastPositionIn(e).map(function(e){if(Id(e,n))return Su(n.get(),n.get().length-1);os.remove(n.get());var t=Ld(e,!1);return n.set(t),Su(t,t.length-1)})},function(e){os.remove(n.get());var t=Pd(e);return n.set(t),A.some(Su(t,1))})},Fd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return A.none()},Ud=cd([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),zd=function(e,t){var n=Hc(t,e);return n||e},Vd=function(e,t,n){var r=Rf.normalizeForwards(n),o=zd(t,r.container());return Rf.findRootInline(e,o,r).fold(function(){return fl.nextPosition(o,r).bind(b(Rf.findRootInline,e,o)).map(function(e){return Ud.before(e)})},A.none)},qd=function(e,t){return null===Xu(e,t)},Hd=function(e,t,n){return Rf.findRootInline(e,t,n).filter(b(qd,t))},jd=function(e,t,n){var r=Rf.normalizeBackwards(n);return Hd(e,t,r).bind(function(e){return fl.prevPosition(e,r).isNone()?A.some(Ud.start(e)):A.none()})},$d=function(e,t,n){var r=Rf.normalizeForwards(n);return Hd(e,t,r).bind(function(e){return fl.nextPosition(e,r).isNone()?A.some(Ud.end(e)):A.none()})},Wd=function(e,t,n){var r=Rf.normalizeBackwards(n),o=zd(t,r.container());return Rf.findRootInline(e,o,r).fold(function(){return fl.prevPosition(o,r).bind(b(Rf.findRootInline,e,o)).map(function(e){return Ud.after(e)})},A.none)},Kd=function(e){return!1===Rf.isRtl(Yd(e))},Xd=function(e,t,n){return Fd([Vd,jd,$d,Wd],[e,t,n]).filter(Kd)},Yd=function(e){return e.fold(j,j,j,j)},Gd=function(e){return e.fold(H("before"),H("start"),H("end"),H("after"))},Jd=function(e){return e.fold(Ud.before,Ud.before,Ud.after,Ud.after)},Qd=function(n,e,r,t,o,i){return ru([Rf.findRootInline(e,r,t),Rf.findRootInline(e,r,o)],function(e,t){return e!==t&&Rf.hasSameParentBlock(r,e,t)?Ud.after(n?e:t):i}).getOr(i)},Zd=function(e,r){return e.fold(H(!0),function(e){return n=r,!(Gd(t=e)===Gd(n)&&Yd(t)===Yd(n));var t,n})},em=function(e,t){return e?t.fold(q(A.some,Ud.start),A.none,q(A.some,Ud.after),A.none):t.fold(A.none,q(A.some,Ud.before),A.none,q(A.some,Ud.end))},tm=function(a,u,s,c){var e=Rf.normalizePosition(a,c),l=Xd(u,s,e);return Xd(u,s,e).bind(b(em,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=Rf.normalizePosition(t,e),fl.fromPosition(t,r,i).map(b(Rf.normalizePosition,t)).fold(function(){return o.map(Jd)},function(e){return Xd(n,r,e).map(b(Qd,t,n,r,i,e)).filter(b(Zd,o))}).filter(Kd);var t,n,r,o,e,i})},nm=Xd,rm=tm,om=(b(tm,!1),b(tm,!0),Jd),im=function(e){return e.fold(Ud.start,Ud.start,Ud.end,Ud.end)},am=function(e){return O(e.selection.getSel().modify)},um=function(e,t,n){var r=e?1:-1;return t.setRng(Su(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},sm=function(e,t){var n=t.selection.getRng(),r=e?Su.fromRangeEnd(n):Su.fromRangeStart(n);return!!am(t)&&(e&&Ra(r)?um(!0,t.selection,r):!(e||!Da(r))&&um(!1,t.selection,r))},cm=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},lm=function(e){return!1!==e.settings.inline_boundaries},fm=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},dm=function(t,e,n){return Md(e,n).map(function(e){return cm(t,e),n})},mm=function(e,t,n){return function(){return!!lm(t)&&sm(e,t)}},gm={move:function(a,u,s){return function(){return!!lm(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Su.fromRangeStart(t.selection.getRng()),i=b(Rf.isInlineTarget,t),rm(e,i,r,o).bind(function(e){return dm(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:b(mm,!0),movePrevWord:b(mm,!1),setupSelectedState:function(a){var u=Bi(null),s=b(Rf.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;lm(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-mce-selected="inline-boundary"]'),t),i=U(r,t),F(Z(o,i),b(fm,!1)),F(Z(i,o),b(fm,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Su.fromRangeStart(e.selection.getRng());Su.isTextPosition(n)&&!1===Rf.isAtZwsp(n)&&(cm(e,os.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);F(t,function(e){var t=Su.fromRangeStart(r.selection.getRng());nm(n,r.getBody(),t).bind(function(e){return dm(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:cm},pm=function(t,n){return function(e){return Md(n,e).map(function(e){return gm.setCaretPosition(t,e),!0}).getOr(!1)}},hm=function(r,o,i,a){var u=r.getBody(),s=b(Rf.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),nm(s,u,Su.fromRangeStart(r.selection.getRng())).map(im).map(pm(r,o))}),r.nodeChanged()},vm=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),Hc(t,e)||e),u=b(Rf.isInlineTarget,n),s=nm(u,a,o);return s.bind(function(e){return i?e.fold(H(A.some(im(e))),A.none,H(A.some(om(e))),A.none):e.fold(A.none,H(A.some(om(e))),A.none,H(A.some(im(e))))}).map(pm(n,r)).getOrThunk(function(){var t=fl.navigate(i,a,o),e=t.bind(function(e){return nm(u,a,e)});return s.isSome()&&e.isSome()?Rf.findRootInline(u,a,o).map(function(e){return o=e,!!ru([fl.firstPositionIn(o),fl.lastPositionIn(o)],function(e,t){var n=Rf.normalizePosition(!0,e),r=Rf.normalizePosition(!1,t);return fl.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(Nd(n,i,er.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?hm(n,r,o,e):hm(n,r,e,o),!0})}).getOr(!1)})},bm=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Su.fromRangeStart(e.selection.getRng());return vm(e,t,n,r)}return!1},ym=kr("start","end"),Cm=kr("rng","table","cells"),xm=cd([{removeTable:["element"]},{emptyCells:["cells"]}]),wm=function(e,t){return ra(er.fromDom(e),"td,th",t)},Nm=function(e,t){return ta(e,"table",t)},Em=function(e){return!1===Fr.eq(e.start(),e.end())},Sm=function(e,n){return Nm(e.start(),n).bind(function(t){return Nm(e.end(),n).bind(function(e){return Fr.eq(t,e)?A.some(t):A.none()})})},Tm=function(e){return Ki(e,"td,th")},km=function(r,e){var t=wm(e.startContainer,r),n=wm(e.endContainer,r);return e.collapsed?A.none():ru([t,n],ym).fold(function(){return t.fold(function(){return n.bind(function(t){return Nm(t,r).bind(function(e){return ee(Tm(e)).map(function(e){return ym(e,t)})})})},function(t){return Nm(t,r).bind(function(e){return te(Tm(e)).map(function(e){return ym(t,e)})})})},function(e){return Am(r,e)?A.none():(n=r,Nm((t=e).start(),n).bind(function(e){return te(Tm(e)).map(function(e){return ym(t.start(),e)})}));var t,n})},Am=function(e,t){return Sm(t,e).isSome()},_m=function(e,t){var n,r,o,i,a,u=(n=e,b(Fr.eq,n));return(r=t,o=u,i=wm(r.startContainer,o),a=wm(r.endContainer,o),ru([i,a],ym).filter(Em).filter(function(e){return Am(o,e)}).orThunk(function(){return km(o,r)})).bind(function(e){return Sm(t=e,u).map(function(e){return Cm(t,e,Tm(e))});var t})},Rm=function(e,t){return K(e,function(e){return Fr.eq(e,t)})},Dm=function(n){return(r=n,ru([Rm(r.cells(),r.rng().start()),Rm(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?xm.removeTable(n.table()):xm.emptyCells(e)});var r},Bm=function(e,t){return _m(e,t).bind(Dm)},Om=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Pm=Om,Lm=function(e){return G(e,function(e){var t=Za(e);return t?[er.fromDom(t)]:[]})},Im=function(e){return 1<Om(e).length},Mm=function(e){return U(Lm(e),yo)},Fm=function(e){return Ki(e,"td[data-mce-selected],th[data-mce-selected]")},Um=function(e,t){var n=Fm(t),r=Mm(e);return 0<n.length?n:r},zm=Um,Vm=function(e){return Um(Pm(e.selection.getSel()),er.fromDom(e.getBody()))},qm=function(e,t){return F(t,af),e.selection.setCursorLocation(t[0].dom(),0),!0},Hm=function(e,t){return Nd(e,!1,t),!0},jm=function(n,e,r,t){return Wm(e,t).fold(function(){return t=n,Bm(e,r).map(function(e){return e.fold(b(Hm,t),b(qm,t))});var t},function(e){return Km(n,e)}).getOr(!1)},$m=function(e,t){return V(Yf(t,e),yo)},Wm=function(e,t){return V(Yf(t,e),function(e){return"caption"===sr.name(e)})},Km=function(e,t){return af(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Xm=function(u,s,c,l,f){return fl.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,fl.firstPositionIn(r.dom()).bind(function(t){return fl.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Km(u,l):(t=l,n=e,Wm(s,er.fromDom(n.getNode())).map(function(e){return!1===Fr.eq(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},Ym=function(a,u,s,e){var c=Su.fromRangeStart(a.selection.getRng());return $m(s,e).bind(function(e){return zf(e)?Km(a,e):(t=a,n=s,r=u,o=e,i=c,fl.navigate(r,t.getBody(),i).bind(function(e){return $m(n,er.fromDom(e.getNode())).map(function(e){return!1===Fr.eq(e,o)})}));var t,n,r,o,i})},Gm=function(a,u,e){var s=er.fromDom(a.getBody());return Wm(s,e).fold(function(){return Ym(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Su.fromRangeStart(t.selection.getRng()),zf(o)?Km(t,o):Xm(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},Jm=function(e,t){var n,r,o,i,a,u=er.fromDom(e.selection.getStart(!0)),s=Vm(e);return e.selection.isCollapsed()&&0===s.length?Gm(e,t,u):(n=e,r=u,o=er.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Vm(n)).length?qm(n,a):jm(n,o,i,r))},Qm=function(e,t){e.getDoc().execCommand(t,!1,null)},Zm=function(e){Td(e,!1)||bm(e,!1)||od(e,!1)||Jm(e)||sd(e,!1)||(Qm(e,"Delete"),Bf(e))},eg=function(e){Td(e,!0)||bm(e,!0)||od(e,!0)||Jm(e)||sd(e,!0)||Qm(e,"ForwardDelete")},tg=function(s){return function(u,e){return A.from(e).map(er.fromDom).filter(sr.isElement).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return Tr(e,r)},Zi.closest(er.fromDom(i),function(e){return a(e).isSome()},function(e){return Fr.eq(er.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),A.from(pi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},ng={getFontSize:tg("font-size"),getFontFamily:q(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},tg("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},rg=function(e){return fl.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Do.isText(t)?t.parentNode:t})},og=function(o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},ig=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=ac(e),o=uc(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},ag=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},ug=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},sg=function(e,t,n){return ug(e,t,function(e){return e.nodeName===n})},cg=function(e){return e&&"TABLE"===e.nodeName},lg=function(e,t,n){for(var r=new oo(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Do.isBr(t))return!0},fg=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&Do.isBr(o)&&t&&e.isEmpty(u))return A.some(wu(o.parentNode,e.nodeIndex(o)));for(i=new oo(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Aa(c=s)&&!1===ug(c,l,Ku)))return A.none();if(Do.isText(s)&&0<s.nodeValue.length)return!1===sg(s,f,"A")?A.some(wu(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(wu(a,0)):A.none()},dg=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Do.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Aa(o))return A.none();if(Do.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Do.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Aa(u))return A.none();if(s[u.nodeName]||cg(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Do.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&cg(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(Do.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||Aa(o))return A.none();if(o.hasChildNodes()&&!1===cg(o)){a=new oo(u=o,g);do{if(Do.isContentEditableFalse(u)||Aa(u)){p=!1;break}if(Do.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Do.isText(o)&&0===i&&fg(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),Do.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Do.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||lg(e,u,!1)||lg(e,u,!0)||fg(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&Do.isText(o)&&i===o.nodeValue.length&&fg(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?A.some(wu(o,i)):A.none()},mg=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=wu.fromRangeStart(t);return dg(e,n,!0,r).each(function(e){n&&wu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||dg(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),ag(t,r)?A.none():A.some(r)},gg=function(e,t,n){var r=e.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},pg=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},hg=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();mg(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new oo(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),gg(i,o,n),pg(i,o,n,r),e.undoManager.add()},vg=function(e,t){var n=er.fromTag("br");Ti.before(er.fromDom(t),n),e.undoManager.add()},bg=function(e,t){yg(e.getBody(),t)||Ti.after(er.fromDom(t),er.fromTag("br"));var n=er.fromTag("br");Ti.after(er.fromDom(t),n),gg(e.dom,e.selection,n.dom()),pg(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},yg=function(e,t){return n=Su.after(t),!!Do.isBr(n.getNode())||fl.nextPosition(e,Su.after(t)).map(function(e){return Do.isBr(e.getNode())}).getOr(!1);var n},Cg=function(e){return e&&"A"===e.nodeName&&"href"in e},xg=function(e){return e.fold(H(!1),Cg,Cg,H(!1))},wg=function(e,t){t.fold(v,b(vg,e),b(bg,e),v)},Ng=function(e,t){var n,r,o,i=(n=e,r=b(Rf.isInlineTarget,n),o=Su.fromRangeStart(n.selection.getRng()),nm(r,n.getBody(),o).filter(xg));i.isSome()?i.each(b(wg,e)):hg(e,t)},Eg=cd([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Sg=(Eg.before,Eg.on,Eg.after,function(e){return e.fold(j,j,j)}),Tg=cd([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),kg=kr("start","soffset","finish","foffset"),Ag={domRange:Tg.domRange,relative:Tg.relative,exact:Tg.exact,exactFromRange:function(e){return Tg.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:kg,getWin:function(e){var t=e.match({domRange:function(e){return er.fromDom(e.startContainer)},relative:function(e,t){return Sg(e)},exact:function(e,t,n,r){return e}});return $r.defaultView(t)}},_g=Qn.detect().browser,Rg=function(e,t){var n=sr.isText(t)?Vl(t).length:$r.children(t).length+1;return n<e?n:e<0?0:e},Dg=function(e){return Ag.range(e.start(),Rg(e.soffset(),e.start()),e.finish(),Rg(e.foffset(),e.finish()))},Bg=function(e,t){return Fr.contains(e,t)||Fr.eq(e,t)},Og=function(t){return function(e){return Bg(t,e.start())&&Bg(t,e.finish())}},Pg=function(e){return!0===e.inline||_g.isIE()},Lg=function(e){return Ag.range(er.fromDom(e.startContainer),e.startOffset,er.fromDom(e.endContainer),e.endOffset)},Ig=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map(Lg)},Mg=function(e){var t=$r.defaultView(e);return Ig(t.dom()).filter(Og(e))},Fg=function(e,t){return A.from(t).filter(Og(e)).map(Dg)},Ug=function(e){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},zg=function(e){return(e.bookmark?e.bookmark:A.none()).bind(b(Fg,er.fromDom(e.getBody()))).bind(Ug)},Vg=function(e){var t=Pg(e)?Mg(er.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},qg=function(t){zg(t).each(function(e){t.selection.setRng(e)})},Hg=zg,jg=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||(n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),F(o.getSelectedBlocks(),function(e){return function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)&&"LI"!==i.nodeName){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e)}))},$g=Yt.each,Wg=Yt.extend,Kg=Yt.map,Xg=Yt.inArray;function Yg(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",$g(e,function(t,e){$g(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};Wg(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?qg(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if($g(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");Re.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),$g("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:ig(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:ig(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){pf(s,n)},mceInsertRawHTML:function(e,t,n){var r=s.getContent();i.setContent("tiny_mce_marker"),s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){jg(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Do.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Zm(s)},forwardDelete:function(){eg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return Ng(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=Kg(e,function(e){return!!a.matchNode(e,n)});return-1!==Xg(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return og(t=s).fold(function(){return rg(t).map(function(e){return ng.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return ng.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return og(t=s).fold(function(){return rg(t).map(function(e){return ng.getFontSize(t.getBody(),e)}).getOr("")},function(e){return ng.getFontSize(t.getBody(),e)});var t},this)}var Gg=Yt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),Jg=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Yt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};Jg.isNative=function(e){return!!Gg[e.toLowerCase()]};var Qg,Zg=function(n){return n._eventDispatcher||(n._eventDispatcher=new Jg({scope:n,toggleEvent:function(e,t){Jg.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},ep={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Zg(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Zg(this).on(e,t,n)},off:function(e,t){return Zg(this).off(e,t)},once:function(e,t){return Zg(this).once(e,t)},hasEventListeners:function(e){return Zg(this).has(e)}},tp=function(e,t){return e.fire("PreProcess",t)},np=function(e,t){return e.fire("PostProcess",t)},rp=function(e){return e.fire("remove")},op=function(e,t){return e.fire("SwitchMode",{mode:t})},ip=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},ap=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},up=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},sp=function(e,t){var n,r,o;n=er.fromDom(e.getBody()),r="mce-content-readonly",o=t,Wi.has(n,r)&&!1===o?Wi.remove(n,r):o&&Wi.add(n,r),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",up(e,"StyleWithCSS",!1),up(e,"enableInlineTableEditing",!1),up(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},cp=function(e){return e.readonly?"readonly":"design"},lp=pi.DOM,fp=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=lp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},dp=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},mp=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=fp(i,a),i.settings.event_root){if(Qg||(Qg={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&Qg){for(e in Qg)i.dom.unbind(fp(i,e));Qg=null}})),Qg[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||lp.isChildOf(t,o))&&dp(n[r],a,e)}},Qg[a]=t,lp.bind(e,a,t)}else t=function(e){dp(i,a,e)},lp.bind(e,a,t),i.delegates[a]=t},gp={bindPendingEventDelegates:function(){var t=this;Yt.each(t._pendingNativeEvents,function(e){mp(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?mp(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(fp(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(fp(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},pp=gp=Yt.extend({},ep,gp),hp=Yt.each,vp=Yt.explode,bp={f9:120,f10:121,f11:122},yp=Yt.makeMap("alt,ctrl,shift,meta,access");function Cp(i){var a={},r=[],u=function(e){var t,n,r={};for(n in hp(vp(e,"+"),function(e){e in yp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=bp[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],yp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,Re.mac?r.ctrl=!0:r.shift=!0),r.meta&&(Re.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Yt.map(vp(e,">"),u))[o.length-1]=Yt.extend(o[o.length-1],{func:n,scope:r||i}),Yt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(hp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Yt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),hp(vp(Yt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var xp=function(e){var t=e!==undefined?e.dom():document;return A.from(t.activeElement).map(er.fromDom)},wp=function(e){var t=$r.owner(e).dom();return e.dom()===t.activeElement},Np=function(t){return xp($r.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},Ep=function(t,e){return(n=e,n.collapsed?A.from(eu(n.startContainer,n.startOffset)).map(er.fromDom):A.none()).bind(function(e){return bo(e)?A.some(e):!1===Fr.contains(t,e)?A.some(t):A.none()});var n},Sp=function(t,e){Ep(er.fromDom(t.getBody()),e).bind(function(e){return fl.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Tp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},kp=function(e){var t,n=e.getBody();return n&&(t=er.fromDom(n),wp(t)||Np(t).isSome())},Ap=function(e){return e.inline?kp(e):(t=e).iframeElement&&wp(er.fromDom(t.iframeElement));var t},_p=function(e){return e.editorManager.setActive(e)},Rp=function(e,t){e.removed||(t?_p(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return Tp(u),Sp(t,o),_p(t);t.bookmark!==undefined&&!1===Ap(t)&&Hg(t).each(function(e){t.selection.setRng(e),o=e}),n||(Re.opera||Tp(r),t.getWin().focus()),(Re.gecko||n)&&(Tp(r),Sp(t,o)),_p(t)}(e))},Dp=Ap,Bp=function(e,t){return t.dom()[e]},Op=function(e,t){return parseInt(Sr(t,e),10)},Pp=b(Bp,"clientWidth"),Lp=b(Bp,"clientHeight"),Ip=b(Op,"margin-top"),Mp=b(Op,"margin-left"),Fp=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m=er.fromDom(e.getBody()),g=e.inline?m:$r.documentElement(m),p=(r=e.inline,i=t,a=n,u=(o=g).dom().getBoundingClientRect(),{x:i-(r?u.left+o.dom().clientLeft+Mp(o):0),y:a-(r?u.top+o.dom().clientTop+Ip(o):0)});return c=p.x,l=p.y,f=Pp(s=g),d=Lp(s),0<=c&&0<=l&&c<=f&&l<=d},Up=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(er.fromDom)).map(function(e){return Fr.contains($r.owner(e),e)}).getOr(!1)};function zp(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){K(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Up(n))return V(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){Le.requestAnimationFrame(a)}),t.on("remove",function(){F(o,function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function Vp(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){K(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return A.from(o[o.length-1])};return r.on("remove",function(){F(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Vg(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var qp=Ni.PluginManager,Hp=function(e,t){var n=function(e,t){for(var n in qp.urls)if(qp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},jp=function(e,t){e.notificationManager.open({type:"error",text:t})},$p=function(e,t){e._skinLoaded?jp(e,t):e.on("SkinLoaded",function(){jp(e,t)})},Wp=function(e,t){$p(e,Hp(e,t))},Kp=function(e,t){$p(e,"Failed to upload image: "+t)},Xp=$p,Yp=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},Gp=Ni.PluginManager,Jp=Ni.ThemeManager;function Qp(){return new(ie.getOrDie("XMLHttpRequest"))}function Zp(u,s){var r={},n=function(e,r,o,t){var i,n;(i=new Qp).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Yt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Yt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),De.all(Yt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new De(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new De(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===O(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new De(function(e){e([])})}}}function eh(){return new(ie.getOrDie("FileReader"))}function th(e){return new(ie.getOrDie("Uint8Array"))(e)}var nh=function(e){return ie.getOrDie("atob")(e)},rh=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},oh=function(e){return 0===e.indexOf("blob:")?(i=e,new De(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=new Qp;r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?(a=e,new De(function(e){var t,n,r,o=rh(a);try{t=nh(o.data)}catch(nN){return void e(new Blob([]))}for(n=new th(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new Blob([n],{type:o.type}))})):null;var i,a},ih=function(n){return new De(function(e){var t=new eh;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},ah=rh,uh=0,sh=function(e){return(e||"blobid")+uh++},ch=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=ah(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):oh(r.src).then(function(e){a=n.create(sh(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):oh(r.src).then(function(t){ih(t).then(function(e){i=ah(e).data,a=n.create(sh(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},lh=function(e){return e?e.getElementsByTagName("img"):[]},fh=0,dh={uuid:function(e){return e+fh+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function mh(u){var n,o,i,t,e,a,r,s,c,l,f=(n=[],o=ya.constant,i=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||dh.uuid("blobid"),n=e.name||t,{id:o(t),name:o(n),filename:o(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:o(e.blob),base64:o(e.base64),blobUri:o(e.blobUri||ue.createObjectURL(e.blob)),uri:o(e.uri)}},{create:function(e,t,n,r){if(k(e))return i({id:e,name:r,blob:t,base64:n});if(_(e))return i(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return jt.filter(n,e)[0]},removeByUri:function(t){n=jt.filter(n,function(e){return e.blobUri()!==t||(ue.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){jt.each(n,function(e){ue.revokeObjectURL(e.blobUri())}),n=[]}}),d=(s={},c=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:l=function(e){return e in s},getResultUri:function(e){var t=s[e];return t?t.resultUri:null},isPending:function(e){return!!l(e)&&1===s[e].status},isUploaded:function(e){return!!l(e)&&2===s[e].status},markPending:function(e){s[e]=c(1,null)},markUploaded:function(e,t){s[e]=c(2,t)},removeFailed:function(e){delete s[e]},destroy:function(){s={}}}),m=[],g=function(t){return function(e){return u.selection?t(e):[]}},p=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},h=function(e,t,n){return e=p(e,'src="'+t+'"','src="'+n+'"'),e=p(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},v=function(t,n){F(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=$(e.fragments,function(e){return h(e,t,n)}):e.content=h(e.content,t,n)})},b=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},y=function(e,t){f.removeByUri(e.src),v(e.src,t),u.$(e).attr({src:lc(u)?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},C=function(n){return a||(a=Zp(d,{url:dc(u),basePath:mc(u),credentials:gc(u),handler:pc(u)})),N().then(g(function(r){var e;return e=$(r,function(e){return e.blobInfo}),a.upload(e,b).then(g(function(e){var t=$(e,function(e,t){var n=r[t].image;return e.status&&fc(u)?y(n,e.url):e.error&&Kp(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},x=function(e){if(cc(u))return C(e)},w=function(t){return!1!==J(m,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||sc(u)(t))},N=function(){var o,i,a;return r||(o=d,i=f,a={},r={findAll:function(e,n){var t;n||(n=ya.constant(!0)),t=jt.filter(lh(e),function(e){var t=e.src;return!!Re.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===Re.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=jt.map(t,function(n){if(a[n.src])return new De(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new De(function(e,t){ch(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return De.all(r)}}),r.findAll(u.getBody(),w).then(g(function(e){return e=U(e,function(e){return"string"!=typeof e||(Xp(u,e),!1)}),F(e,function(e){v(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},E=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=d.getResultUri(n);if(t)return'src="'+t+'"';var r=f.getByUri(n);return r||(r=z(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){cc(u)?x():N()}),u.on("RawSaveContent",function(e){e.content=E(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=E(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){F(e,function(e){var t=e.attr("src");if(!f.getByUri(t)){var n=d.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:f,addFilter:function(e){m.push(e)},uploadImages:C,uploadImagesAuto:x,scanForImages:N,destroy:function(){f.destroy(),d.destroy(),r=a=null}}}var gh=function(e,t){return e.hasOwnProperty(t.nodeName)},ph=function(e,t){if(Do.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||gh(e,t.nextSibling)))return!0}return!1},hh=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),b=e.getBody();if(f=d.forced_root_block,v&&Do.isElement(v)&&f&&(l=b.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&(y=h,C=b,x=v,!M(Xf(er.fromDom(x),er.fromDom(C)),function(e){return gh(y,e.dom())})))){var y,C,x,w,N;for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=Dp(e),v=b.firstChild;v;)if(w=h,N=v,Do.isText(N)||Do.isElement(N)&&!gh(w,N)&&!xl(N)){if(ph(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},vh=function(e){e.settings.forced_root_block&&e.on("NodeChange",b(hh,e))},bh=function(t){return $r.firstChild(t).fold(H([t]),function(e){return[t].concat(bh(e))})},yh=function(t){return $r.lastChild(t).fold(H([t]),function(e){return"br"===sr.name(e)?$r.prevSibling(e).map(function(e){return[t].concat(yh(e))}).getOr([]):[t].concat(yh(e))})},Ch=function(o,e){return ru([(i=e,a=i.startContainer,u=i.startOffset,Do.isText(a)?0===u?A.some(er.fromDom(a)):A.none():A.from(a.childNodes[u]).map(er.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Do.isText(n)?r===n.data.length?A.some(er.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(er.fromDom))],function(e,t){var n=V(bh(o),b(Fr.eq,e)),r=V(yh(o),b(Fr.eq,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},xh=function(e,t,n,r){var o=n,i=new oo(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Yt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(Re.ie&&Re.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},wh=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Nh(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&ag(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!Re.range&&i.selection.isCollapsed()||wh(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&wh(i)&&("IMG"===i.selection.getNode().nodeName?Le.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Eh,Sh,Th=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},kh=function(e,t){return n=(u=e).inline?Th(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Th(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},Ah=Do.isContentEditableFalse,_h=Do.isContentEditableTrue,Rh=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Dh=function(u,s){return function(e){if(0===e.button){var t=jt.find(s.dom.getParents(e.target),ya.or(Ah,_h));if(i=s.getBody(),Ah(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},Bh=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!Ah(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Rh(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Oh(l)}},Oh=function(e){e.dragging=!1,e.element=null,Rh(e.ghost)},Ph=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=pi.DOM,a=document,n=Dh(c,e),p=c,h=e,v=Le.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=kh(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Bh(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Oh(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Lh=function(e){var n;Ph(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ah(t)||Ah(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Ih=function(e){return jt.reduce(e,function(e,t){return e.concat(function(t){var e=function(e){return jt.map(e,function(e){return(e=Xa(e)).node=t,e})};if(Do.isElement(t))return e(t.getClientRects());if(Do.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Sh=Eh||(Eh={}))[Sh.Up=-1]="Up",Sh[Sh.Down=1]="Down";var Mh=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=Ih([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,jt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=jt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=qc(r,e,Wa,t);)if(n(r))return}(o,e,r,n)),l},Fh=b(Mh,Eh.Up,Ja,Qa),Uh=b(Mh,Eh.Down,Qa,Ja),zh=function(n){return function(e){return t=n,e.line>t;var t}},Vh=function(n){return function(e){return t=n,e.line===t;var t}},qh=Do.isContentEditableFalse,Hh=qc,jh=function(e,t){return Math.abs(e.left-t)},$h=function(e,t){return Math.abs(e.right-t)},Wh=function(e,t){return e>=t.left&&e<=t.right},Kh=function(e,o){return jt.reduce(e,function(e,t){var n,r;return n=Math.min(jh(e,o),$h(e,o)),r=Math.min(jh(t,o),$h(t,o)),Wh(o,t)?t:Wh(o,e)?e:r===n&&qh(t.node)?t:r<n?t:e})},Xh=function(e,t,n,r){for(;r=Hh(r,e,Wa,t);)if(n(r))return},Yh=function(e,t,n){var r,o,i,a,u,s,c,l,f=Ih((o=e,jt.filter(jt.toArray(o.getElementsByTagName("*")),Dc))),d=jt.filter(f,function(e){return n>=e.top&&n<=e.bottom});return(r=Kh(d,t))&&(r=Kh((u=e,l=function(t,e){var n;return n=jt.filter(Ih([e]),function(e){return!t(e,s)}),c=c.concat(n),0===n.length},(c=[]).push(s=r),Xh(Eh.Up,u,b(l,Ja),s.node),Xh(Eh.Down,u,b(l,Qa),s.node),c),t))&&Dc(r.node)?(a=t,{node:(i=r).node,before:jh(i,a)<$h(i,a)}):null},Gh=function(i,a,e){return!e.collapsed&&z(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},Jh=function(t){var e=Di(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ls(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Qh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return Re.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Zh=Do.isContentEditableTrue,ev=Do.isContentEditableFalse,tv=nl,nv=tl,rv=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Zh(t)||ev(t))return t;t=t.parentNode}return null},ov=function(g){var p,e,t,a=g.getBody(),o=Rc(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return Dp(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=Gc(e,a,t),-1===e?Su.fromRangeStart(t):Su.fromRangeEnd(t)},n=function(e){return Aa(e)||Oa(e)||Pa(e)},y=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(c=b(-1,e),Dc(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(Dc(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=b(1,e),Dc(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(Dc(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&ev(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),ev(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=na(er.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&Re.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),F(Ki(er.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){hr.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),na(er.fromDom(g.getBody()),"#"+h).each(Ri.remove),p=null),na(er.fromDom(g.getBody()),"#"+h).each(Ri.remove),p=null},C=function(){o.hide()};return Re.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&Fp(g,e.clientX,e.clientY)&&u(cs(g,t,!1))}),g.on("click",function(e){var t;(t=rv(g,e.target))&&(ev(t)&&(e.preventDefault(),g.focus()),Zh(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==ev(rv(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Ns(e);if(!e.firstChild)return!1;var n=Su.before(e.firstChild),r=t.next(n);return r&&!nv(r)&&!tv(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=rv(n,e.target);ev(t)&&(r||(e.preventDefault(),c(ss(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==Fp(g,e.clientX,e.clientY))if(t=rv(g,n))ev(t)?(e.preventDefault(),c(ss(g,t))):(l(),Zh(t)&&e.shiftKey||Gh(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===Dc(n)){l(),C();var r=Yh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Qh.modifierPressed(e)||(e.keyCode,ev(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;y(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!Re.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Lh(g),Jh(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(La(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},iv=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function av(F,U){void 0===U&&(U=ni());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var z=F.comment?F.comment:e,V=F.cdata?F.cdata:e,q=F.text?F.text:e,H=F.start?F.start:e,j=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,b,y,C,x,w,N,E,S,T,k,A,_,R=0,D=[],B=0,O=$o.decode,P=Yt.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&j(e.name);D.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:O(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=F.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=F.validate,u=F.remove_internals,_=F.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(R<t.index&&q(O(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),I(n);else if(n=t[7]){if(t.index+t[0].length>e.length){q(O(e.substr(t.index))),R=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,_&&E[n]&&0<D.length&&D[D.length-1].name===n&&I(n),!p||(l=U.getElementRule(n))){if(f=!0,p&&(b=l.attributes,y=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(T,M)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){R=iv(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}}f&&H(n,d,c)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),R=t.index+t[0].length):(i=e.substr(R),R=e.length),f&&(0<i.length&&q(i,!0),j(n)),S.lastIndex=R;continue}c||(v&&v.indexOf("/")===v.length-1?f&&j(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),z(n)):(n=t[2])?V(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);R=t.index+t[0].length}for(R<e.length&&q(O(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&j(n.name)}}}(av||(av={})).findEndTag=iv;var uv=av,sv=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:uv.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return Na(l)},cv={trimExternal:sv,trimInternal:sv},lv=0,fv=2,dv=1,mv=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},b=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},gv=function(e){return Do.isElement(e)?e.outerHTML:Do.isText(e)?$o.encodeRaw(e.data,!1):Do.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},pv=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},hv=function(e){return jt.filter(jt.map(e.childNodes,gv),function(e){return 0<e.length})},vv=function(e,t){var n,r,o,i=jt.map(t.childNodes,gv);return n=mv(i,e),r=t,o=0,jt.each(n,function(e){e[0]===lv?o++:e[0]===dv?(pv(r,e[1],o),o++):e[0]===fv&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},bv=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,$r.children(er.fromDom(n))},yv=function(e){return e.dom().innerHTML},Cv=yv,xv=function(e,t){var n=$r.owner(e).dom(),r=er.fromDom(n.createDocumentFragment()),o=bv(t,n);Ai(r,o),Ri.empty(e),Ti.append(e,r)},wv=Bi(A.none()),Nv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Ev=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Sv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Tv=function(e){var t=er.fromTag("body",wv.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return wv.set(A.some(e)),e}));return xv(t,Sv(e)),F(Ki(t,"*[data-mce-bogus]"),Ri.unwrap),Cv(t)},kv=function(n){var e,t,r;return e=hv(n.getBody()),-1!==(t=(r=G(e,function(e){var t=cv.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Nv(r):Ev(t)},Av=function(e,t,n){"fragmented"===t.type?vv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},_v=function(e,t){return!(!e||!t)&&(r=t,Sv(e)===Sv(r)||(n=t,Tv(e)===Tv(n)));var n,r};function Rv(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===_v(kv(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=$u.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=kv(u),e=e||{},e=Yt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&_v(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=$u.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],Av(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Av(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!_v(kv(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],Av(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var Dv,Bv,Ov=Sl.isEq,Pv=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Lv=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Pv(t,e,n)||e.parentNode===o||!!Fv(t,e,n,r,!0)}),Fv(t,e,n,r))},Iv=function(e,t,n){return!!Ov(t,n.inline)||!!Ov(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Mv=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):Sl.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Ov(u,Sl.normalizeStyleValue(e,Sl.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):Sl.getStyle(e,t,c[s]))return n;return n},Fv=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Iv(e.dom,t,i)&&Mv(l,t,i,"attributes",o,r)&&Mv(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Uv={matchNode:Fv,matchName:Iv,match:function(e,t,n,r){var o;return r?Lv(e,r,t,n):(r=e.selection.getNode(),!!Lv(e,r,t,n)||!((o=e.selection.getStart())===r||!Lv(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Fv(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=Sl.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:Pv},zv=function(e,t){return e.splitText(t)},Vv=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Do.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=zv(t,n)).previousSibling,n<o?(t=r=zv(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Do.isText(t)&&0<n&&n<t.nodeValue.length&&(t=zv(t,n),n=0),Do.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=zv(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},qv=wa,Hv="_mce_caret",jv=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==qv||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},$v=function(e){var t;if(e)for(e=(t=new oo(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Wv=function(e){var t=er.fromTag("span");return hr.setAll(t,{id:Hv,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Ti.append(t,er.fromText(qv)),t},Kv=function(e,t,n,r){var o,i,a,u;o=t.getRng(!0),i=e.getParent(n,e.isBlock),jv(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):((u=$v(n))&&u.nodeValue.charAt(0)===qv&&u.deleteData(0,1),a=u,o.startContainer===a&&0<o.startOffset&&o.setStart(a,o.startOffset-1),o.endContainer===a&&0<o.endOffset&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&af(er.fromDom(i)),t.setRng(o)},Xv=function(e,t,n,r,o){if(r)Kv(t,n,r,o);else if(!(r=Xu(e,n.getStart())))for(;r=t.get(Hv);)Kv(t,n,r,!1)},Yv=function(e,t,n){var r=e.dom,o=r.getParent(n,ya.curry(Sl.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(of(er.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Gv=function(e,t){return e.appendChild(t),t},Jv=function(e,t){var n,r,o=(n=function(e,t){return Gv(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){r=n(r,e)}),r);return Gv(o,o.ownerDocument.createTextNode(qv))},Qv=function(e){var i=e.dom,a=e.selection,u=e.getBody();e.on("mouseup keydown",function(e){var t,n,r,o;t=u,n=i,r=a,o=e.keyCode,Xv(t,n,r,null,!1),8===o&&r.isCollapsed()&&r.getStart().innerHTML===qv&&Xv(t,n,r,Xu(t,r.getStart())),37!==o&&39!==o||Xv(t,n,r,Xu(t,r.getStart()))})},Zv=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(sr.name(t))&&!Ku(t.dom())&&!Do.isBogus(t.dom())},eb={},tb=jt.filter,nb=jt.each;Bv=function(e){var t,n,r=e.selection.getRng();t=Do.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),nb(tb(tb(n,t),function(e){return t(e.previousSibling)&&-1!==jt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,pn(n=e).remove(),pn(t).append("<br><br>").append(n.childNodes)}))},eb[Dv="pre"]||(eb[Dv]=[]),eb[Dv].push(Bv);var rb=function(e,t){nb(eb[e],function(e){e(t)})},ob=/^(src|href|style)$/,ib=Yt.each,ab=Sl.isEq,ub=function(e){return/^(TH|TD)$/.test(e.nodeName)},sb=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Do.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Do.isText(r)&&n&&o>=r.nodeValue.length&&(r=new oo(r,e.getBody()).next()||r),Do.isText(r)&&!n&&0===o&&(r=new oo(r,e.getBody()).prev()||r),r},cb=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},lb=function(e,t,n,r){return!(t=Sl.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},fb=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom;if(c=y,!(ab(l=o,(f=n).inline)||ab(l,f.block)||(f.selector?Do.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(ib(n.styles,function(e,t){e=Sl.normalizeStyleValue(y,Sl.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||ab(Sl.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),ib(n.attributes,function(e,t){var n;if(e=Sl.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||ab(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",ib(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),ob.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),ib(n.classes,function(e){e=Sl.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,b=d.settings.forced_root_block,g.block&&(b?h===v.getRoot()&&(g.list_block&&ab(m,g.list_block)||ib(Yt.grep(m.childNodes),function(e){Sl.isValid(d,b,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=cb(v,e,b),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(lb(v,m,!1)||lb(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),lb(v,m,!0)||lb(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!ab(g.inline,m)||v.remove(m,1),!0):void 0},db=fb,mb=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,ib(Sl.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Uv.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(fb(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(Do.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Yt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!fb(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t=u.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return xl(n)&&(n=n[e?"firstChild":"lastChild"]),Do.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),u.remove(t,!0),n},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Ml(s,e,d,!0),m.split){if(e=Vv(e),(t=sb(s,e,!0))!==(n=sb(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&ub(n)&&n.firstChild&&(n=n.firstChild||n),u.isChildOf(t,n)&&t!==n&&!u.isBlock(n)&&!ub(t)&&!ub(n)){var o=function(e,t,n,r,o){var i=(r?"next":"previous")+"Sibling",a=e.create(n,o);t.parentNode.insertBefore(a,t);for(var u=[t],s=t;s=s[i];)u.push(s);return u.forEach(function(e){return a.appendChild(e)}),a}(u,t,"span",!0,{id:"_start","data-mce-type":"bookmark"});return i(o),void(t=p(!0))}t=cb(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=cb(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Ul(u,e,function(e){ib(e,function(e){g(e),Do.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===Sl.getTextDecoration(u,e.parentNode)&&fb(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Uv.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Ml(e,g,e.formatter.get(t),!0);p=Vv(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Xu(e.getBody(),c);var h=Wv(!1).dom(),v=Jv(m,h);Yv(e,h,l||c),Kv(f,d,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=$u.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&Uv.match(s,c,l,r.getStart())&&Sl.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!fb(s,d[h],l,e,e));h++);}},gb=Yt.each,pb=function(e){return e&&1===e.nodeType&&!xl(e)&&!Ku(e)&&!Do.isBogus(e)},hb=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!xl(n))return n}return e},vb=function(e,t,n){var r,o,i=new rf(e);if(t&&n&&(t=hb(t,"previousSibling"),n=hb(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Yt.each(Yt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},bb=function(e,t,n){gb(e.childNodes,function(e){pb(e)&&(t(e)&&n(e),e.hasChildNodes()&&bb(e,t,n))})},yb=function(n,e){return b(function(e,t){return!(!t||!Sl.getStyle(n,t,e))},e)},Cb=function(r,e,t){return b(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),xb(r,n)},e,t)},xb=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},wb=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=Sl.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},Nb=function(n,e,r,o){gb(e,function(t){gb(n.dom.select(t.inline,o),function(e){pb(e)&&db(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";gb(r.select(n,t),function(n){pb(n)&&gb(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Eb=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Yt.walk(r,b(wb,e),"childNodes"),wb(e,r))},Sb=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&bb(r,yb(e,"fontSize"),Cb(e,"backgroundColor",Sl.replaceVars(t.styles.backgroundColor,n)))},Tb=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(bb(r,yb(e,"fontSize"),Cb(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},kb=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=vb(e,Sl.getNonWhiteSpaceSibling(r),r),r=vb(e,r,Sl.getNonWhiteSpaceSibling(r,!0)))},Ab=function(t,n,r,o,i){Uv.matchNode(t,i.parentNode,r,o)&&db(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Uv.matchNode(t,e,r,o))return db(t,n,o,i),!0})},_b=Yt.each,Rb=function(g,p,h,r){var e,t,v=g.formatter.get(p),b=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,y=function(n,e){if(e=e||b,n){if(e.onformat&&e.onformat(n,e,h,r),_b(e.styles,function(e,t){i.setStyle(n,t,Sl.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}_b(e.attributes,function(e,t){i.setAttrib(n,t,Sl.replaceVars(e,h))}),_b(e.classes,function(e){e=Sl.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!b.selector&&(_b(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Ku(t)?(y(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=b.inline||b.block,f=s.create(l),y(f),Ul(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),Sl.isEq(t,"br"))return a=0,void(b.block&&s.remove(e));if(b.wrapper&&Uv.matchNode(g,e,p,h))a=0;else{if(m&&!r&&b.block&&!b.wrapper&&Sl.isTextBlock(g,t)&&Sl.isValid(g,n,l))return e=s.rename(e,l),y(e),d.push(e),void(a=0);if(b.selector){var i=C(v,e);if(!b.inline||i)return void(a=0)}!m||r||!Sl.isValid(g,l,t)||!Sl.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Ku(e)||b.inline&&s.isBlock(e)?(a=0,_b(Yt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};_b(e,u)}),!0===b.links&&_b(d,function(e){var t=function(e){"A"===e.nodeName&&y(e,b),_b(Yt.grep(e.childNodes),t)};t(e)}),_b(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return _b(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!xl(t)&&!Ku(t)&&!Do.isBogus(t))return n=e,!1;var t}),n};n=0,_b(e.childNodes,function(e){Sl.isWhiteSpaceNode(e)||xl(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(b.inline||b.wrapper)&&(b.exact||1!==t||((o=a(r=e))&&!xl(o)&&Uv.matchName(s,o,b)&&(i=s.clone(o,!1),y(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Nb(g,v,h,e),Ab(g,b,p,h,e),Sb(s,b,h,e),Tb(s,b,h,e),kb(s,b,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(b){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Ml(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&b.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Xu(e.getBody(),c.getStart()))&&(i=$v(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Ml(e,r,e.formatter.get(t)),r=Vv(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===qv||(l=e.getDoc(),f=Wv(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Rb(g,v[0].defaultBlock),g.selection.setRng(df(g.selection.getRng())),e=$u.getPersistentBookmark(g.selection,!0),a(i,Ml(g,n.getRng(),v)),b.styles&&Eb(i,b,h,u),n.moveToBookmark(e),Sl.moveStart(i,n,n.getRng()),g.nodeChanged()}rb(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void y(r,v[s])}},Db={applyFormat:Rb},Bb=Yt.each,Ob=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=Sl.getParents(a.dom,n.element),o={};r=Yt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),Bb(i.get(),function(e,n){Bb(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(Bb(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Uv.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),Bb(u,function(e,t){o[t]||(delete u[t],Bb(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),Bb(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},Pb={get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){Yt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Yt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},Lb=Yt.each,Ib=pi.DOM,Mb=function(e,t){var n,o,r,m=t&&t.schema||ni({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Ib.create(o.name),n=t,(r=o).classes.length&&Ib.addClass(n,r.classes.join(" ")),Ib.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Yt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=Ib.create("div")).appendChild(n),Yt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=Ib.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},Fb=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Yt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Yt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Ub=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Yt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Yt.map(e.split(/(?:~\+|~|\+)/),Fb),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},zb=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Ub(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=Mb(i,n)):r=Mb([t],n),o=Ib.select(t,r)[0]||r.firstChild,Lb(e.styles,function(e,t){(e=c(e))&&Ib.setStyle(o,t,e)}),Lb(e.attributes,function(e,t){(e=c(e))&&Ib.setAttrib(o,t,e)}),Lb(e.classes,function(e){e=c(e),Ib.hasClass(o,e)||Ib.addClass(o,e)}),n.fire("PreviewFormats"),Ib.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Ib.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Lb(u.split(" "),function(e){var t=Ib.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Ib.getStyle(n.getBody(),e,!0),"#ffffff"===Ib.toHex(t).toLowerCase())||"color"===e&&"#000000"===Ib.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Ib.remove(r),s)},Vb=function(e,t,n,r,o){var i=t.get(n);!Uv.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Db.applyFormat(e,n,r,o):mb(e,n,r,o)},qb=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Hb(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Yt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Yt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Pb.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Bi(null);return qb(e),Qv(e),{get:o.get,register:o.register,unregister:o.unregister,apply:b(Db.applyFormat,e),remove:b(mb,e),toggle:b(Vb,e,o),match:b(Uv.match,e),matchAll:b(Uv.matchAll,e),matchNode:b(Uv.matchNode,e),canApply:b(Uv.canApply,e),formatChanged:b(Ob,e,i),getCssText:b(zb,e)}}var jb,$b=Object.prototype.hasOwnProperty,Wb=(jb=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)$b.call(o,i)&&(n[i]=jb(n[i],o[i]))}return n}),Kb={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=$o.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){F(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},Xb={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Yt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),tp(r,Wb(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Yb=function(e,a,u){e.addNodeFilter("font",function(e){F(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,F(["color","face","size"],function(e){t.attr(e,null)})})})},Gb=function(e,t){var n,r=oi();t.convert_fonts_to_spans&&Yb(e,r,Yt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){F(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Jb={register:function(e,t){t.inline_styles&&Gb(e,t)}},Qb=/^[ \t\r\n]*$/,Zb={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},ey=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},ty=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,Zb[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=ey(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=ey(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Qb.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Qb.test(i.value))return!1;if(n&&n(i))return!1}while(i=ey(i,this));return!0},a.prototype.walk=function(e){return ey(this,null,e)},a}(),ny=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new ty("br",1)).shortEnded=!0:r.empty().append(new ty("#text",3)).value="\xa0"},ry=function(e){return oy(e,"#text")&&"\xa0"===e.firstChild.value},oy=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},iy=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},ay=function(e,t){return e&&(t[e.name]||"br"===e.name)},uy=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Yt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),iy(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&ny(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new ty("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Yt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new ty("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},sy=Yt.makeMap,cy=Yt.each,ly=Yt.explode,fy=Yt.extend;function dy(T,k){void 0===k&&(k=ni());var A={},_=[],R={},D={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var B=function(e){var t,n,r;n in A&&((r=R[n])?r.push(e):R[n]=[e]),t=_.length;for(;t--;)(n=_[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:k,addAttributeFilter:function(e,n){cy(ly(e),function(e){var t;for(t=0;t<_.length;t++)if(_[t].name===e)return void _[t].callbacks.push(n);_.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(_)},addNodeFilter:function(e,n){cy(ly(e),function(e){var t=A[e];t||(A[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in A)A.hasOwnProperty(t)&&e.push({name:t,callbacks:A[t]});return e},filterNode:B,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},R={},D={},l=fy(sy("script,style,head,html,body,title,meta,param"),k.getBlockElements());var g=k.getNonEmptyElements(),p=k.children,h=T.validate,v="forced_root_block"in a?a.forced_root_block:T.forced_root_block,b=k.getWhiteSpaceElements(),y=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=b.hasOwnProperty(a.context)||b.hasOwnProperty(T.root_name);var N=function(e,t){var n,r=new ty(e,t);return e in A&&((n=R[e])?n.push(r):R[e]=[r]),r},E=function(e){var t,n,r,o,i=k.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=uv({validate:h,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(k.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),ay(d.lastChild,l)&&(e=e.replace(y,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?k.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&m.push(r),o=_.length;o--;)(a=_[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&b[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?k.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(y,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&b[e]&&(f=!1),n.removeEmpty&&iy(k,g,b,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(ry(d)||iy(k,g,b,d))&&ny(T,a,l,d),d=d.parent}}},k);var S=d=new ty(a.context||T.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=sy("tr,td,th,tbody,thead,tfoot,table"),l=k.getNonEmptyElements(),f=k.getWhiteSpaceElements(),m=k.getTextBlockElements(),g=k.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!k.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=B(o[0].clone()),c=0;c<o.length-1;c++){for(k.isValidChild(a.name,o[c].name)?(u=B(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}iy(k,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(iy(k,l,f,r)||oy(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(B(new ty("ul",1)));continue}k.isValidChild(n.parent.name,"div")&&k.isValidChild("div",n.name)?n.wrap(B(new ty("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(y,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(k.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(T.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in R){for(s=A[c],i=(n=R[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=_.length;r<o;r++)if((s=_[r]).name in D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return uy(e,T),Jb.register(e,T),e}var my=function(e,t,n){-1===Yt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},gy=function(e,t,n){var r=Na(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||Co(er.fromDom(t))?r:Yt.trim(r)},py=function(e,t,n){var r=n.selection?Wb({forced_root_block:!1},n):n,o=e.parse(t,r);return Kb.trimTrailingBr(o),o},hy=function(e,t,n,r,o){var i,a,u,s,c=(i=r,lf(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?np(a,Wb(u,{content:s})).content:s};function vy(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:pi.DOM,c=u&&u.schema?u.schema:ni(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=dy(a,c),Kb.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=Wb({format:"html"},t||{}),r=Xb.process(u,e,n),o=gy(s,r,n),i=py(l,o,n);return"tree"===n.format?i:hy(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:b(my,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function by(e){return{getBookmark:b(yl,e),moveToBookmark:b(Cl,e)}}(by||(by={})).isBookmarkNode=xl;var yy=by,Cy=Do.isContentEditableFalse,xy=Do.isContentEditableTrue,wy=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,b,i,y,C,x,w,N=a.dom,E=Yt.each,S=a.getDoc(),T=document,k=Math.abs,A=Math.round,_=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(Re.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!R(t.target)||Gh(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},B=function(e){var t=a.settings.object_resizing;return!1!==t&&!Re.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Lr.is(er.fromDom(e),t))},O=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,y=t*f[2]+h,C=n*f[3]+v,y=y<5?5:y,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!Qh.modifierPressed(e):Qh.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=A(y*b),y=A(C/b)):(y=A(C/b),C=A(y*b))),N.setStyles(D(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=y+" &times; "+C,f[2]<0&&s.clientWidth<=y&&N.setStyle(s,"left",g+(h-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=_.scrollWidth-x)+(n=_.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(ip(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",y),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",O),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),ap(a,u,y,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,_),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),B(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(_,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===Re.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,b=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=_.scrollWidth,w=_.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),_.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",O),N.bind(T,"mouseup",P)),c=N.add(_,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" &times; "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],_)&&(U(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return Cy(function(e,t){for(;t&&t!==e;){if(xy(t)||Cy(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},U=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){U(),Re.ie&&11<=Re.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(_,"mscontrolselect",function(e){var t=function(e){Le.setEditorTimeout(a,function(){a.selection.select(e)})};if(M(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=Le.throttle(function(e){a.composing||I(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:B,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},Ny=function(e){return Do.isContentEditableTrue(e)||Do.isContentEditableFalse(e)},Ey=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Yt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Do.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ny))?null:i}return r},Sy=function(n,e){return $(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ty=function(e,t){var n=(t||document).createDocumentFragment();return F(e,function(e){n.appendChild(e.dom())}),er.fromDom(n)},ky=kr("element","width","rows"),Ay=kr("element","cells"),_y=kr("x","y"),Ry=function(e,t){var n=parseInt(hr.get(e,t),10);return isNaN(n)?1:n},Dy=function(e){return z(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},By=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Fr.eq(o[i],t))return A.some(_y(i,r));return A.none()},Oy=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Ay(a[u].element(),c))}return i},Py=function(e){var o=ky(pa(e),0,[]);return F(Ki(e,"tr"),function(n,r){F(Ki(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Ry(o,"rowspan"),a=Ry(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=Ay(ha(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:pa(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),ky(o.element(),Dy(o.rows()),o.rows())},Ly=function(e){return n=$((t=e).rows(),function(e){var t=$(e.cells(),function(e){var t=ha(e);return hr.remove(t,"colspan"),hr.remove(t,"rowspan"),t}),n=pa(e.element());return Ai(n,t),n}),r=pa(t.element()),o=er.fromTag("tbody"),Ai(o,n),Ti.append(r,o),r;var t,n,r,o},Iy=function(l,e,t){return By(l,e).bind(function(c){return By(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?Oy(t,o,i,a,u):Oy(t,o,u,a,i),ky(t.element(),Dy(s),s);var t,n,r,o,i,a,u,s})})},My=function(n,t){return V(n,function(e){return"li"===sr.name(e)&&Ch(e,t)}).fold(H([]),function(e){return(t=n,V(t,function(e){return"ul"===sr.name(e)||"ol"===sr.name(e)})).map(function(e){return[er.fromTag("li"),er.fromTag(sr.name(e))]}).getOr([]);var t})},Fy=function(e,t){var n,r=er.fromDom(t.commonAncestorContainer),o=Yf(r,e),i=U(o,function(e){return fo(e)||co(e)}),a=My(o,t),u=i.concat(a.length?a:ho(n=r)?$r.parent(n).filter(po).fold(H([]),function(e){return[n,e]}):po(n)?[n]:[]);return $(u,pa)},Uy=function(){return Ty([])},zy=function(e,t){return n=er.fromDom(t.cloneContents()),r=Fy(e,t),o=z(r,function(e,t){return Ti.append(t,e),t},n),0<r.length?Ty([o]):o;var n,r,o},Vy=function(e,o){return(t=e,n=o[0],ta(n,"table",b(Fr.eq,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Py(e);return Iy(r,t,n).map(function(e){return Ty([Ly(e)])})}).getOrThunk(Uy);var t,n},qy=function(e,t){var n,r,o=zm(t,e);return 0<o.length?Vy(e,o):(n=e,0<(r=t).length&&r[0].collapsed?Uy():zy(n,r[0]))},Hy=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=Sy(e,Pm(i));if((t=t||{}).get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return e.selection.isCollapsed()?"":Na(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?qy(er.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},jy=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},$y=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(er.fromDom).map(function(e){return r&&t.collapsed?e:$r.child(e,o(e,a)).getOr(e)}).bind(function(e){return sr.isElement(e)?A.some(e):$r.parent(e)}).map(function(e){return e.dom()}).getOr(e)},Wy=function(e,t,n){return $y(e,t,!0,n,function(e,t){return Math.min($r.childNodesCount(e),t)})},Ky=function(e,t,n){return $y(e,t,!1,n,function(e,t){return 0<t?t-1:t})},Xy=function(e,t){for(var n=e;e&&Do.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Yy=Yt.each,Gy=function(e){return!!e.select},Jy=function(e){return!(!e||!e.ownerDocument)&&Fr.contains(er.fromDom(e.ownerDocument),er.fromDom(e))},Qy=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return jy(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===Dp(c)){var i=Hg(c);if(i.isSome())return i.map(function(e){return Sy(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=Sy(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(Gy(o)||Jy(o.startContainer)&&Jy(o.endContainer))){var o,i=Gy(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||Re.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(xh(u,n,c.getBody(),!0),i(n))},getContent:function(e){return Hy(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,A.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(xh(r,n,e,!0),xh(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Xy(r.nextSibling,!0):r.parentNode,o=0===a?Xy(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return Wy(c.getBody(),m(),e)},getEnd:function(e){return Ky(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Wy(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Ky(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new oo(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!Im(t)&&wh(c)){var n=mg(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};Yy(a,function(e,n){Yy(r,function(t){if(u.is(t,n))return i[n]||(Yy(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),Yy(i,function(e,t){o[t]||(delete i[t],Yy(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return js(c,e,t)},placeCaretAt:function(e,t){return i(Ey(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Su.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=yy(p),t=wy(p,c),p.bookmarkManager=n,p.controlSelection=t,p},Zy=Do.isContentEditableFalse,eC=Za,tC=nl,nC=tl,rC=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},oC=function(e,t,n,r){var o,i,a,u,s,c,l=e===Nu.Forwards,f=l?nC:tC;return!r.collapsed&&(o=eC(r),Zy(o))?us(e,t,o,e===Nu.Backwards,!0):(u=Ta(r.startContainer),f(i=el(e,t.getBody(),r))?ss(t,i.getNode(!l)):(i=n(i))?f(i)?us(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=jc(s=i,a))&&Do.isBr(s.getNode())||c)?us(e,t,a.getNode(!l),l,!0):u?ls(t,i.toRange(),!0):null:u?r:null)},iC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=eC(r),o=el(e,t.getBody(),r),i=n(t.getBody(),zh(1),o),a=jt.filter(i,Vh(1)),s=jt.last(o.getClientRects()),(nC(o)||rl(o))&&(d=o.getNode()),(tC(o)||ol(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=Kh(a,c))&&Zy(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),us(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Ns(t),f=[],d=0,m=function(e){return jt.last(e.getClientRects())};1===e?(o=l.next,i=Qa,a=Ja,u=Su.after(r)):(o=l.prev,i=Ja,a=Qa,u=Su.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,jt.last(f))&&d++,(s=Xa(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),zh(1),d);if(u=Kh(jt.filter(m,Vh(1)),c))return ls(t,u.position.toRange(),!0);if(u=jt.last(jt.filter(m,Vh(0))))return ls(t,u.position.toRange(),!0)}},aC=function(e,t,n){var r,o,i,a,u=Ns(e.getBody()),s=ya.curry(rC,u.next),c=ya.curry(rC,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Su.fromRangeStart(n)):c(Su.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!Re.ie||11<=Re.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},uC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ns((e=l).getBody()),o=ya.curry(rC,r.next),i=ya.curry(rC,r.prev),a=t?Nu.Forwards:Nu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=oC(a,e,u,s))?n:(n=aC(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},sC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Uh:Fh,i=(e=u).selection.getRng(),(n=iC(r,e,o,i))?n:(n=aC(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},cC=function(e,r){return G($(e,function(e){return Wb({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:v},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},lC=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},fC=function(e,t){return V(cC(e,t),function(e){return e.action()})},dC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=Qn.detect().os,fC([{keyCode:Qh.RIGHT,action:uC(t,!0)},{keyCode:Qh.LEFT,action:uC(t,!1)},{keyCode:Qh.UP,action:sC(t,!1)},{keyCode:Qh.DOWN,action:sC(t,!0)},{keyCode:Qh.RIGHT,action:Tc(t,!0)},{keyCode:Qh.LEFT,action:Tc(t,!1)},{keyCode:Qh.UP,action:kc(t,!1)},{keyCode:Qh.DOWN,action:kc(t,!0)},{keyCode:Qh.RIGHT,action:gm.move(t,n,!0)},{keyCode:Qh.LEFT,action:gm.move(t,n,!1)},{keyCode:Qh.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:gm.moveNextWord(t,n)},{keyCode:Qh.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:gm.movePrevWord(t,n)}],r).each(function(e){r.preventDefault()}))})},mC=function(e){return 1===$r.children(e).length},gC=function(e,t,n,r){var o,i,a,u,s=b(Zv,t),c=$(U(r,s),function(e){return e.dom()});if(0===c.length)Nd(t,e,n);else{var l=(o=n.dom(),i=c,a=Wv(!1),u=Jv(i,a.dom()),Ti.before(er.fromDom(o),a),Ri.remove(er.fromDom(o)),Su(u,0));t.selection.setRng(l.toRange())}},pC=function(n,r){var t,e=er.fromDom(n.getBody()),o=er.fromDom(n.selection.getStart()),i=U((t=Yf(o,e),K(t,lo).fold(H(t),function(e){return t.slice(0,e)})),mC);return te(i).map(function(e){var t=Su.fromRangeStart(n.selection.getRng());return!!Of(r,t,e.dom())&&(gC(r,n,e,i),!0)}).getOr(!1)},hC=function(e,t){return!!e.selection.isCollapsed()&&pC(e,t)},vC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,fC([{keyCode:Qh.BACKSPACE,action:lC(Td,t,!1)},{keyCode:Qh.DELETE,action:lC(Td,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(bm,t,n,!1)},{keyCode:Qh.DELETE,action:lC(bm,t,n,!0)},{keyCode:Qh.BACKSPACE,action:lC(Jm,t,!1)},{keyCode:Qh.DELETE,action:lC(Jm,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(sd,t,!1)},{keyCode:Qh.DELETE,action:lC(sd,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(od,t,!1)},{keyCode:Qh.DELETE,action:lC(od,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(hC,t,!1)},{keyCode:Qh.DELETE,action:lC(hC,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,fC([{keyCode:Qh.BACKSPACE,action:lC(kd,t)},{keyCode:Qh.DELETE,action:lC(kd,t)}],n))})},bC=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},yC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new oo(t,t);r=n.current();){if(Do.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Do.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},CC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},xC=bC,wC=function(e){return bC(e).fold(H(""),function(e){return e.nodeName.toUpperCase()})},NC=function(e){return bC(e).filter(function(e){return ho(er.fromDom(e))}).isSome()},EC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},SC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},TC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},kC=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Do.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},AC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;SC(u=n)&&SC(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(kC(n,r,!0)&&kC(n,r,!1))EC(n,"LI")?i.insertAfter(l,TC(n)):i.replace(l,n);else if(kC(n,r,!0))EC(n,"LI")?(i.insertAfter(l,TC(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(kC(n,r,!1))i.insertAfter(l,TC(n));else{n=TC(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),yC(e,l)}},_C=function(e){e.innerHTML='<br data-mce-bogus="1">'},RC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},DC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},BC=function(e,t,n){return!1===Do.isText(t)?n:e?1===n&&t.data.charAt(n-1)===wa?0:n:n===t.data.length-1&&t.data.charAt(n)===wa?t.data.length:n},OC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},PC=function(e,t){var n=ec(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,tc(e))},LC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,b,y,C=a.dom,x=a.schema,w=x.getNonEmptyElements(),N=a.selection.getRng(),E=function(e){var t,n,r,o=s,i=x.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=C.create(e||m),PC(a,t)):t=c.cloneNode(!1),r=t,!1===oc(a))C.setAttrib(t,"style",null),C.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Ku(o))continue;n=o.cloneNode(!1),C.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return _C(r),t},S=function(e){var t,n,r,o;if(o=BC(e,s,i),Do.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&Do.isElement(s)&&s===c.firstChild)return!0;if(RC(s,"TABLE")||RC(s,"HR"))return g&&!e||!g&&e;for(t=new oo(s,c),Do.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Do.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),w[r]&&"br"!==r))return!1}else if(Do.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},T=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?E(m):E(),ic(a)&&DC(C,l)&&C.isEmpty(c)?r=C.split(l,c):C.insertAfter(r,c),yC(a,r)};mg(C,N).each(function(e){N.setStart(e.startContainer,e.startOffset),N.setEnd(e.endContainer,e.endOffset)}),s=N.startContainer,i=N.startOffset,m=ec(a),n=e.shiftKey,Do.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&Do.isText(s)?s.nodeValue.length:0),(u=OC(C,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=OC(m,r);if(!(a=m.getParent(r,m.isBlock))||!DC(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),PC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),PC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,N,s,i)),c=C.getParent(s,C.isBlock),l=c?C.getParent(c.parentNode,C.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(c)?AC(a,E,l,c,m):m&&c===a.getBody()||(m=m||"P",Ta(c)?(r=La(c),C.isEmpty(c)&&_C(c),yC(a,r)):S()?T():S(!0)?(r=c.parentNode.insertBefore(E(),c),yC(a,RC(c,"HR")?r:c)):((t=(b=N,y=b.cloneRange(),y.setStart(b.startContainer,BC(!0,b.startContainer,b.startOffset)),y.setEnd(b.endContainer,BC(!1,b.endContainer,b.endOffset)),y).cloneRange()).setEndAfter(c),function(e){for(;Do.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o=t.extractContents()),r=o.firstChild,C.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Do.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===Yt.trim(Na(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,r),p=C,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),C.isEmpty(c)&&_C(c),r.normalize(),C.isEmpty(r)?(C.remove(r),T()):yC(a,r)),C.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},IC=function(e,t){return xC(e).filter(function(e){return 0<t.length&&Lr.is(er.fromDom(e),t)}).isSome()},MC=function(e){return IC(e,nc(e))},FC=function(e){return IC(e,rc(e))},UC=cd([{br:[]},{block:[]},{none:[]}]),zC=function(e,t){return FC(e)},VC=function(n){return function(e,t){return""===ec(e)===n}},qC=function(n){return function(e,t){return NC(e)===n}},HC=function(n,r){return function(e,t){return wC(e)===n.toUpperCase()===r}},jC=function(e){return HC("pre",e)},$C=function(n){return function(e,t){return Zs(e)===n}},WC=function(e,t){return MC(e)},KC=function(e,t){return t},XC=function(e){var t=ec(e),n=CC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},YC=function(e,t){return function(n,r){return z(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},GC=function(e,t){return Fd([YC([zC],UC.none()),YC([HC("summary",!0)],UC.br()),YC([jC(!0),$C(!1),KC],UC.br()),YC([jC(!0),$C(!1)],UC.block()),YC([jC(!0),$C(!0),KC],UC.block()),YC([jC(!0),$C(!0)],UC.br()),YC([qC(!0),KC],UC.br()),YC([qC(!0)],UC.block()),YC([VC(!0),KC,XC],UC.block()),YC([VC(!0)],UC.br()),YC([WC],UC.br()),YC([VC(!1),KC],UC.br()),YC([XC],UC.block())],[e,t.shiftKey]).getOr(UC.none())},JC=function(e,t){GC(e,t).fold(function(){Ng(e,t)},function(){LC(e,t)},v)},QC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===Qh.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),JC(t,n)})))})},ZC=function(e,t,n){return u=t,!(!ex(n)||!Do.isText(u.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,u},ex=function(e){return e.fold(H(!1),H(!0),H(!0),H(!1))},tx=function(e){return!!e.selection.isCollapsed()&&(t=e,n=b(Rf.isInlineTarget,t),r=Su.fromRangeStart(t.selection.getRng()),nm(n,t.getBody(),r).map(b(ZC,t,r)).getOr(!1));var t,n,r},nx=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,fC([{keyCode:Qh.SPACEBAR,action:lC(tx,t)}],n).each(function(e){n.preventDefault()}))})},rx=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(La(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},ox=function(e,t){var n,r=(n=e,na(er.fromDom(n.getBody()),"*[data-mce-caret]").fold(H(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void rx(e,r)):void(_a(r)&&(rx(e,r),e.undoManager.add()))},ix=function(e){e.on("keyup compositionstart",b(ox,e))},ax=function(e){var t=gm.setupSelectedState(e);ix(e),dC(e,t),vC(e,t),QC(e),nx(e)};function ux(u){var s,n,r,o=Yt.each,c=Qh.BACKSPACE,l=Qh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=Re.gecko,a=Re.ie,m=Re.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},b=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<Re.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===Qh.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),Re.windowsPhone||u.on("keyup focusin mouseup",function(e){Qh.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Aa(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),y(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),Re.iOS?(u.inline||u.on("keydown",function(){document.activeElement===document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),11<=Re.ie&&(C(),y()),Re.ie&&(b(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Ey(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),Le.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),Le.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),Re.mac&&u.on("keydown",function(e){!Qh.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var sx=function(e){return Do.isElement(e)&&go(er.fromDom(e))},cx=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=wu.fromRangeStart(t),r=wu.fromRangeEnd(t);if(wu.isElementPosition(n)){var o=n.container();sx(o)&&fl.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}wu.isElementPosition(r)&&(o=n.container(),sx(o)&&fl.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(df(t))}(t)})},lx=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){F(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){F(e,function(e){var t=e.attr("data-mce-open");e.attr("open",k(t)?t:null),e.attr("data-mce-open",null)})})},fx=pi.DOM,dx=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&Le.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},mx=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();fx.removeClass(e,"mce-content-body"),fx.removeClass(e,"mce-edit-focus"),fx.setAttrib(e,"contentEditable",null)}),fx.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||document,t.contentWindow=f.content_window||window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===fx.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=mh(t),t.schema=ni(f),t.dom=pi(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=dy((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new ty("br",1)).shortEnded=!0)}),o),t.serializer=vy(f,t),t.selection=Qy(t.dom,t.getWin(),t.serializer,t),t.annotator=Wl(t),t.formatter=Hb(t),t.undoManager=Rv(t),t._nodeChangeDispatcher=new Nh(t),t._selectionOverrides=ov(t),lx(t),cx(t),ax(t),vh(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,fx.setAttrib(n,"spellcheck","false")),t.quirks=ux(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){Yt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Yt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?fx.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){dx(t)},function(e){dx(t)}),f.content_style&&(a=t,s=f.content_style,c=er.fromDom(a.getDoc().head),l=er.fromTag("style"),hr.set(l,"type","text/css"),Ti.append(l,er.fromText(s)),Ti.append(c,l))},gx=pi.DOM,px=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=Ks(e),s=er.fromTag("iframe"),hr.setAll(s,i),hr.setAll(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Er(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(document.domain!==window.location.hostname&&Re.ie&&Re.ie<12){var n=dh.uuid("mce");e[n]=function(){mx(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return gx.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=Xs(f=e)+"<html><head>",Ys(f)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=Gs(f),m=Js(f),Qs(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+Qs(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),gx.add(t.iframeContainer,l),p},hx=function(e,t){var n=px(e,t);t.editorContainer&&(gx.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=gx.isHidden(t.editorContainer)),e.getElement().style.display="none",gx.setAttrib(e.id,"aria-hidden","true"),n||mx(e)},vx=pi.DOM,bx=function(t,n,e){var r,o,i=Gp.get(e);if(r=Gp.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=Yt.trim(e),i&&-1===Yt.inArray(n,e)){if(Yt.each(Gp.dependencies(e),function(e){bx(t,n,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},yx=function(e){return e.replace(/^\-/,"")},Cx=function(e){return{editorContainer:e,iframeContainer:e}},xx=function(e){var t,n,r=e.getElement();return e.inline?Cx(null):(t=r,n=vx.create("div"),vx.insertAfter(n,t),Cx(n))},wx=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,k(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||vx.getStyle(f,"width")||"100%",a=l.height||vx.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):O(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):xx(e)},Nx=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||vx.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,k(o)?(n.settings.theme=yx(o),r=Jp.get(o),n.theme=new r(n,Jp.urls[o]),n.theme.init&&n.theme.init(n,Jp.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Yt.each(i.settings.plugins.split(/[ ,]/),function(e){bx(i,a,yx(e))}),e=wx(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&Yt.each(Yt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?mx(t):hx(t,e)},Ex=pi.DOM,Sx=function(e){return"-"===e.charAt(0)},Tx=function(i,a){var u=Ci.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(k(i)){if(!Sx(i)&&!Jp.urls.hasOwnProperty(i)){var a=o.theme_url;a?Jp.load(i,t.documentBaseURI.toAbsolute(a)):Jp.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Jp.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Yt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Yt.each(r.external_plugins,function(e,t){Gp.load(t,e),r.plugins+=" "+t}),Yt.each(r.plugins.split(/[ ,]/),function(e){if((e=Yt.trim(e))&&!Gp.urls[e])if(Sx(e)){e=e.substr(1,e.length);var t=Gp.dependencies(e);Yt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=Gp.createUrl(t,e),Gp.load(e.resource,e)})}else Gp.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||Nx(i)},i,function(e){Wp(i,e[0]),i.removed||Nx(i)})})},kx=function(t){var e=t.settings,n=t.id,r=function(){Ex.unbind(window,"ready",r),t.render()};if(je.Event.domLoaded){if(t.getElement()&&Re.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||Ex.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(Ex.insertAfter(Ex.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Ex.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=Vp(t),t.notificationManager=zp(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=Ex.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Tx(t,t.suffix)}}else Ex.bind(window,"ready",r)},Ax=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},_x=Yt.each,Rx=Yt.trim,Dx="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Bx={ftp:21,http:80,https:443,mailto:25},Ox=function(r,e){var t,n,o=this;if(r=Rx(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new Ox(document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),_x(Dx,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};Ox.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new Ox(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new Ox(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Bx[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),_x(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},Ox.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Ox.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Px=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Yt.trim(cv.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=Na(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=ec(o),u=new RegExp("^(<"+a+"[^>]*>(&nbsp;|&#160;|\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Co(er.fromDom(n))?t.content=r:t.content=Yt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Lx=function(e,t){t(e),e.firstChild&&Lx(e.firstChild,t),e.next&&Lx(e.next,t)},Ix=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Lx(t.firstChild,function(t){F(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),F(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);F(r,function(t){F(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Mx=function(e){return e instanceof ty},Fx=function(e,t){var r;e.dom.setHTML(e.getBody(),t),Dp(r=e)&&fl.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Do.isTable(t)?fl.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},Ux=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Mx(s)?"":s,Mx(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(H(s),function(e){return Mx(s)?function(e,t,n,r){Ix(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=lf({validate:e.validate},e.schema).serialize(n);return r.content=Co(er.fromDom(t))?o:Yt.trim(o),Fx(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=ec(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),Fx(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=lf({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Co(er.fromDom(n))?r:Yt.trim(r),Fx(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},zx=pi.DOM,Vx=function(e){return A.from(e).each(function(e){return e.destroy()})},qx=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&zx.remove(o.nextSibling),!e.inline&&r&&(i=e,zx.setStyle(i.id,"display",i.orgDisplay)),rp(e),e.editorManager.remove(e),zx.remove(e.getContainer()),Vx(t),Vx(n),e.destroy()}var i},Hx=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Vx(i),Vx(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),zx.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},jx=pi.DOM,$x=Yt.extend,Wx=Yt.each,Kx=Yt.resolve,Xx=Re.ie,Yx=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=Ef(vf,c,a,u),l.settings=t,Ni.language=t.language||"en",Ni.languageLoad=t.language_load,Ni.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new Ox(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Cp(l),l.loadedCSS={},l.editorCommands=new Yg(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(Re.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(Re.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=pn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};$x(Yx.prototype={render:function(){kx(this)},focus:function(e){Rp(this,e)},hasFocus:function(){return Dp(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Kx(r):0,o=Kx(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Yt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return kf(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return Ax(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:dh.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(jx.show(this.getContainer()),jx.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Xx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(jx.hide(e.getContainer()),jx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=jx.getParent(r.id,"form"))&&Wx(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return Ux(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(H("tree"===n.format?new ty("body",11):""),function(e){return Px(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=$x({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==cp(t=this)&&(t.initialized?sp(t,"readonly"===n):t.on("init",function(){sp(t,"readonly"===n)}),op(t,n))},getContainer:function(){return this.container||(this.container=jx.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=jx.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Wx(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){qx(this)},destroy:function(e){Hx(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},pp);var Gx,Jx,Qx,Zx={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},ew=function(n,e){var t,r;Qn.detect().browser.isIE()?(r=n).on("focusout",function(){Vg(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Vg(n)})},tw=function(e){var t,n,r,o=Di(function(){Vg(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},pi.DOM.bind(document,"mouseup",r),t.on("remove",function(){pi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){ew(e,o)}),e.on("remove",function(){o.cancel()})},nw=pi.DOM,rw=function(e){return Zx.isEditorUIElement(e)},ow=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==nw.getParent(e,function(e){return rw(e)||!!n&&t.dom.is(e,n)})},iw=function(r,e){var t=e.editor;tw(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;Le.setEditorTimeout(t,function(){var e=r.focusedEditor;ow(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Gx||(Gx=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===document&&(t===document.body||ow(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},nw.bind(document,"focusin",Gx))},aw=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(nw.unbind(document,"focusin",Gx),Gx=null)},uw=function(e){e.on("AddEditor",b(iw,e)),e.on("RemoveEditor",b(aw,e))},sw={},cw="en",lw={setCode:function(e){e&&(cw=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return cw},rtl:!1,add:function(e,t){var n=sw[e];for(var r in n||(sw[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=sw[cw]||{},n=function(e){return Yt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Yt.is(e,"undefined")},o=function(e){return e=n(e),Yt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Yt.is(e,"object")&&Yt.hasOwn(e,"raw"))return n(e.raw);if(Yt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Yt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:sw},fw=pi.DOM,dw=Yt.explode,mw=Yt.each,gw=Yt.extend,pw=0,hw=!1,vw=[],bw=[],yw=function(t){mw(Qx.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},Cw=function(e){e!==hw&&(e?pn(window).on("resize scroll",yw):pn(window).off("resize scroll",yw),hw=e)},xw=function(t){var e=bw;delete vw[t.id];for(var n=0;n<vw.length;n++)if(vw[n]===t){vw.splice(n,1);break}return bw=U(bw,function(e){return t!==e}),Qx.activeEditor===t&&(Qx.activeEditor=0<bw.length?bw[0]:null),Qx.focusedEditor===t&&(Qx.focusedEditor=null),e.length!==bw.length};gw(Qx={defaultSettings:{},$:pn,majorVersion:"4",minorVersion:"8.3",releaseDate:"2018-09-13",editors:vw,i18n:lw,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=Ox.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new Ox(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new Ox(this.baseURL),this.suffix=o,uw(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new Ox(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Ox(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Ni.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Yt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!fw.get(t)?e.name:fw.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):fw.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Yx(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};fw.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=pn.unique(function(t){var e,n=[];if(Re.ie&&Re.ie<11)return Yp("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(t.types)return mw(t.types,function(e){n=n.concat(fw.select(e.selector))}),n;if(t.selector)return fw.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&mw(dw(e),function(t){var e;(e=fw.get(t))?n.push(e):mw(document.forms,function(e){mw(e.elements,function(e){e.name===t&&(t="mce_editor_"+pw++,fw.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":mw(fw.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?mw(r.types,function(t){Yt.each(o,function(e){return!fw.is(e,t.selector)||(n(c(e),gw({},r,t),e),!1)})}):(Yt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(xw(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Yt.grep(o,function(e){return!s.get(e.id)})).length?f([]):mw(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?Yp("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,fw.bind(window,"ready",e),new De(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?bw.slice(0):k(t)?V(bw,function(e){return e.id===t}).getOr(null):P(t)&&bw[t]?bw[t]:null},add:function(e){var t=this;return vw[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(vw[e.id]=e),vw.push(e),bw.push(e)),Cw(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Jx||(Jx=function(){t.fire("BeforeUnload")},fw.bind(window,"beforeunload",Jx))),e},createEditor:function(e,t){return this.add(new Yx(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!k(e))return n=e,D(r.get(n.id))?null:(xw(n)&&r.fire("RemoveEditor",{editor:n}),0===bw.length&&fw.unbind(window,"beforeunload",Jx),n.remove(),Cw(0<bw.length),n);mw(fw.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=bw.length-1;0<=t;t--)r.remove(bw[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Yx(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){mw(bw,function(e){e.save()})},addI18n:function(e,t){lw.add(e,t)},translate:function(e){return lw.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},ep),Qx.setup();var ww,Nw=Qx;function Ew(n){return{walk:function(e,t){return Ul(n,e,t)},split:Vv,normalize:function(t){return mg(n,t).fold(H(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(ww=Ew||(Ew={})).compareRanges=ag,ww.getCaretRangeFromPoint=Ey,ww.getSelectedNode=Za,ww.getNode=eu;var Sw,Tw,kw=Ew,Aw=Math.min,_w=Math.max,Rw=Math.round,Dw=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=Rw(s/2)),"c"===n[1]&&(r+=Rw(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=Rw(a/2)),"c"===n[4]&&(r-=Rw(i/2)),Bw(r,o,i,a)},Bw=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},Ow={inflate:function(e,t,n){return Bw(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Dw,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=Dw(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=_w(e.x,t.x),r=_w(e.y,t.y),o=Aw(e.x+e.w,t.x+t.w),i=Aw(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Bw(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=_w(0,t.x-u),o=_w(0,t.y-s),i=_w(0,c-f),a=_w(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),Bw(u,s,(c-=i)-u,(l-=a)-s)},create:Bw,fromClientRect:function(e){return Bw(e.left,e.top,e.width,e.height)}},Pw={},Lw={add:function(e,t){Pw[e.toLowerCase()]=t},has:function(e){return!!Pw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=Pw.hasOwnProperty(t)?Pw[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=Pw[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},Iw=Yt.each,Mw=Yt.extend,Fw=function(){};Fw.extend=Sw=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!Tw&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in Tw=!0,e=new this,Tw=!1,n.Mixins&&(Iw(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&Iw(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&Iw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&Iw(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=Mw({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=Sw,i};var Uw=Math.min,zw=Math.max,Vw=Math.round,qw=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+qw(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+qw(e[i],n):"");return o+"}"}return""+e},Hw={serialize:qw,parse:function(e){try{return JSON.parse(e)}catch(t){}}},jw={callbacks:{},count:0,send:function(t){var n=this,r=pi.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},$w={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",$w.fire("beforeInitialize",{settings:e}),t=new Qp){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Yt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=$w.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Yt.extend($w,ep);var Ww,Kw,Xw,Yw,Gw=Yt.extend,Jw=function(e){this.settings=Gw({},e),this.count=0};Jw.sendRPC=function(e){return(new Jw).send(e)},Jw.prototype={send:function(n){var r=n.error,o=n.success;(n=Gw(this.settings,n)).success=function(e,t){void 0===(e=Hw.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=Hw.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",$w.send(n)}};try{Ww=window.localStorage}catch(nN){Kw={},Xw=[],Yw={getItem:function(e){var t=Kw[e];return t||null},setItem:function(e,t){Xw.push(e),Kw[e]=String(t)},key:function(e){return Xw[e]},removeItem:function(t){Xw=Xw.filter(function(e){return e===t}),delete Kw[t]},clear:function(){Xw=[],Kw={}},length:0},Object.defineProperty(Yw,"length",{get:function(){return Xw.length},configurable:!1,enumerable:!1}),Ww=Yw}var Qw,Zw=Nw,eN={geom:{Rect:Ow},util:{Promise:De,Delay:Le,Tools:Yt,VK:Qh,URI:Ox,Class:Fw,EventDispatcher:Jg,Observable:ep,I18n:lw,XHR:$w,JSON:Hw,JSONRequest:Jw,JSONP:jw,LocalStorage:Ww,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=zw(0,Uw(t,1)),n=zw(0,Uw(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=Vw(255*(u+a)),s=Vw(255*(s+a)),c=Vw(255*(c+a))}else u=s=c=Vw(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=Uw(e/=255,Uw(t/=255,n/=255)))===(a=zw(e,zw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:Vw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:Vw(100*r),v:Vw(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:je,Sizzle:Tt,DomQuery:pn,TreeWalker:oo,DOMUtils:pi,ScriptLoader:Ci,RangeUtils:kw,Serializer:vy,ControlSelection:wy,BookmarkManager:yy,Selection:Qy,Event:je.Event},html:{Styles:oi,Entities:$o,Node:ty,Schema:ni,SaxParser:uv,DomParser:dy,Writer:cf,Serializer:lf},ui:{Factory:Lw},Env:Re,AddOnManager:Ni,Annotator:Wl,Formatter:Hb,UndoManager:Rv,EditorCommands:Yg,WindowManager:Vp,NotificationManager:zp,EditorObservable:pp,Shortcuts:Cp,Editor:Yx,FocusManager:Zx,EditorManager:Nw,DOM:pi.DOM,ScriptLoader:Ci.ScriptLoader,PluginManager:Ni.PluginManager,ThemeManager:Ni.ThemeManager,trim:Yt.trim,isArray:Yt.isArray,is:Yt.is,toArray:Yt.toArray,makeMap:Yt.makeMap,each:Yt.each,map:Yt.map,grep:Yt.grep,inArray:Yt.inArray,extend:Yt.extend,create:Yt.create,walk:Yt.walk,createNS:Yt.createNS,resolve:Yt.resolve,explode:Yt.explode,_addCacheSuffix:Yt._addCacheSuffix,isOpera:Re.opera,isWebKit:Re.webkit,isIE:Re.ie,isGecko:Re.gecko,isMac:Re.mac},tN=Zw=Yt.extend(Zw,eN);Qw=tN,window.tinymce=Qw,window.tinyMCE=Qw,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(tN)}();!function(){"use strict";var e,t,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},C=function(e){return function(){return e}},u=function(e){return e},R=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var u=new Array(arguments.length-1),n=1;n<arguments.length;n++)u[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=u.concat(n);return i.apply(null,o)}},m=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},a=function(e){return e()},c=C(!1),l=C(!0),f=c,s=l,d=function(){return g},g=(r={fold:function(e,t){return e()},is:f,isSome:f,isNone:s,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:f,forall:s,filter:d,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(r),r),h=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return h(e(n))},ap:function(e){return e.fold(d,function(e){return h(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:g},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:h,none:d,from:function(e){return null===e||e===undefined?g:h(e)}},p=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},v=p("string"),b=p("array"),w=p("boolean"),T=p("function"),N=p("number"),D=(o=Array.prototype.indexOf)===undefined?function(e,t){return _(e,t)}:function(e,t){return o.call(e,t)},E=function(e,t){return-1<D(e,t)},O=function(e,t){return W(e,t).isSome()},A=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},k=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},P=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},I=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},B=function(e,t,n){return k(e,function(e){n=t(n,e)}),n},M=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return S.some(o)}return S.none()},W=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return S.some(n);return S.none()},_=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},L=Array.prototype.push,q=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t},F=function(e,t){var n=A(e,t);return q(n)},j=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},z=Array.prototype.slice,H=function(e){var t=z.call(e,0);return t.reverse(),t},U=(T(Array.from)&&Array.from,Object.keys),V=function(e,t){for(var n=U(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},G=function(e,r){return Y(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},Y=function(r,o){var i={};return V(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},X=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return k(t,function(e,t){r[e]=C(n[t])}),r}},K=function(e){return e.slice(0).sort()},J=function(e,t){throw new Error("All required keys ("+K(e).join(", ")+") were not specified. Specified keys were: "+K(t).join(", ")+".")},$=function(e){throw new Error("Unsupported keys for object: "+K(e).join(", "))},Q=function(t,e){if(!b(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");k(e,function(e){if(!v(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},Z=function(e){var n=K(e);M(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},ee=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Q("required",o),Q("optional",i),Z(u),function(t){var n=U(t);j(o,function(e){return E(n,e)})||J(o,n);var e=P(n,function(e){return!E(u,e)});0<e.length&&$(e);var r={};return k(o,function(e){r[e]=C(t[e])}),k(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?S.some(t[e]):S.none())}),r}},te=X("width","height"),ne=X("rows","columns"),re=X("row","column"),oe=X("x","y"),ie=X("element","rowspan","colspan"),ue=X("element","rowspan","colspan","isNew"),ae={dimensions:te,grid:ne,address:re,coords:oe,extended:X("element","rowspan","colspan","row","column"),detail:ie,detailnew:ue,rowdata:X("element","cells","section"),elementnew:X("element","isNew"),rowdatanew:X("element","cells","section","isNew"),rowcells:X("cells","section"),rowdetails:X("details","section"),bounds:X("startRow","startCol","finishRow","finishCol")},ce=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},le={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return ce(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return ce(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return ce(n)},fromDom:ce,fromPoint:function(e,t,n){var r=e.dom();return S.from(r.elementFromPoint(t,n)).map(ce)}},fe={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},se=fe.ELEMENT,de=fe.DOCUMENT,me=function(e){return e.nodeType!==se&&e.nodeType!==de||0===e.childElementCount},ge={all:function(e,t){var n=t===undefined?document:t.dom();return me(n)?[]:A(n.querySelectorAll(e),le.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==se)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return me(n)?S.none():S.from(n.querySelector(e)).map(le.fromDom)}},he=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},pe="undefined"!=typeof window?window:Function("return this;")(),ve=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:pe,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},be=function(e,t){var n=ve(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},we=function(){return be("Node")},ye=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},xe=function(e,t){return ye(e,t,we().DOCUMENT_POSITION_CONTAINED_BY)},Ce=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Re=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Te(r(1),r(2))},Se=function(){return Te(0,0)},Te=function(e,t){return{major:e,minor:t}},Ne={nu:Te,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Se():Re(e,n)},unknown:Se},De="Firefox",Ee=function(e,t){return function(){return t===e}},Oe=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ee("Edge",t),isChrome:Ee("Chrome",t),isIE:Ee("IE",t),isOpera:Ee("Opera",t),isFirefox:Ee(De,t),isSafari:Ee("Safari",t)}},Ae={unknown:function(){return Oe({current:undefined,version:Ne.unknown()})},nu:Oe,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(De),safari:C("Safari")},ke="Windows",Pe="Android",Ie="Solaris",Be="FreeBSD",Me=function(e,t){return function(){return t===e}},We=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Me(ke,t),isiOS:Me("iOS",t),isAndroid:Me(Pe,t),isOSX:Me("OSX",t),isLinux:Me("Linux",t),isSolaris:Me(Ie,t),isFreeBSD:Me(Be,t)}},_e={unknown:function(){return We({current:undefined,version:Ne.unknown()})},nu:We,windows:C(ke),ios:C("iOS"),android:C(Pe),linux:C("Linux"),osx:C("OSX"),solaris:C(Ie),freebsd:C(Be)},Le=function(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})},qe=function(e,n){return Le(e,n).map(function(e){var t=Ne.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Fe=function(e,n){return Le(e,n).map(function(e){var t=Ne.detect(e.versionRegexes,n);return{current:e.name,version:t}})},je=function(e,t){return-1!==e.indexOf(t)},ze=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,He=function(t){return function(e){return je(e,t)}},Ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ze],search:function(e){return je(e,"chrome")&&!je(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return je(e,"msie")||je(e,"trident")}},{name:"Opera",versionRegexes:[ze,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:He("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:He("firefox")},{name:"Safari",versionRegexes:[ze,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}}],Ve=[{name:"Windows",search:He("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return je(e,"iphone")||je(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:He("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:He("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:He("linux"),versionRegexes:[]},{name:"Solaris",search:He("sunos"),versionRegexes:[]},{name:"FreeBSD",search:He("freebsd"),versionRegexes:[]}],Ge={browsers:C(Ue),oses:C(Ve)},Ye=function(e){var t,n,r,o,i,u,a,c,l,f,s,d=Ge.browsers(),m=Ge.oses(),g=qe(d,e).fold(Ae.unknown,Ae.nu),h=Fe(m,e).fold(_e.unknown,_e.nu);return{browser:g,os:h,deviceType:(n=g,r=e,o=(t=h).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!c,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(c),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},Xe={detect:Ce(function(){var e=navigator.userAgent;return Ye(e)})},Ke=function(e,t){return e.dom()===t.dom()},Je=Xe.detect().browser.isIE()?function(e,t){return xe(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},$e={eq:Ke,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return O(t,R(Ke,e))},contains:Je,is:ge.is},Qe=function(e){var t=e.dom();return S.from(t.parentNode).map(le.fromDom)},Ze=function(e){var t=e.dom();return S.from(t.previousSibling).map(le.fromDom)},et=function(e){var t=e.dom();return S.from(t.nextSibling).map(le.fromDom)},tt=function(e){var t=e.dom();return A(t.childNodes,le.fromDom)},nt=function(e,t){var n=e.dom().childNodes;return S.from(n[t]).map(le.fromDom)},rt=X("element","offset"),ot={owner:function(e){return le.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return le.fromDom(t)},documentElement:function(e){return le.fromDom(e.dom().ownerDocument.documentElement)},parent:Qe,findIndex:function(n){return Qe(n).bind(function(e){var t=tt(e);return W(t,function(e){return $e.eq(n,e)})})},parents:function(e,t){for(var n=T(t)?t:C(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=le.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},siblings:function(t){return Qe(t).map(tt).map(function(e){return P(e,function(e){return!$e.eq(t,e)})}).getOr([])},prevSibling:Ze,offsetParent:function(e){var t=e.dom();return S.from(t.offsetParent).map(le.fromDom)},prevSiblings:function(e){return H(he(e,Ze))},nextSibling:et,nextSiblings:function(e){return he(e,et)},children:tt,child:nt,firstChild:function(e){return nt(e,0)},lastChild:function(e){return nt(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=tt(e);return 0<n.length&&t<n.length?rt(n[t],0):rt(e,t)}},it=function(e,t,n){return F(ot.children(e),function(e){return ge.is(e,t)?n(e)?[e]:[]:it(e,t,n)})},ut={firstLayer:function(e,t){return it(e,t,C(!0))},filterFirstLayer:it},at=function(e){return e.dom().nodeName.toLowerCase()},ct=function(e){return e.dom().nodeType},lt=function(t){return function(e){return ct(e)===t}},ft=lt(fe.ELEMENT),st=lt(fe.TEXT),dt=lt(fe.DOCUMENT),mt={name:at,type:ct,value:function(e){return e.dom().nodeValue},isElement:ft,isText:st,isDocument:dt,isComment:function(e){return ct(e)===fe.COMMENT||"#comment"===at(e)}},gt=function(e,t,n){if(!(v(n)||w(n)||N(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},ht=function(e,t,n){gt(e.dom(),t,n)},pt=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},vt=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},bt={clone:function(e){return B(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:ht,setAll:function(e,t){var n=e.dom();V(t,function(e,t){gt(n,t,e)})},get:pt,has:vt,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){mt.isElement(o)&&mt.isElement(i)&&k(e,function(e){var t,n,r;n=i,vt(t=o,r=e)&&!vt(n,r)&&ht(n,r,pt(t,r))})}},wt=Ce(function(){return yt(le.fromDom(document))}),yt=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return le.fromDom(t)},xt={body:wt,getBody:yt,inBody:function(e){var t=mt.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},Ct=function(e,t){var n=[];return k(ot.children(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ct(e,t))}),n},Rt={all:function(e){return Ct(xt.body(),e)},ancestors:function(e,t,n){return P(ot.parents(e,n),t)},siblings:function(e,t){return P(ot.siblings(e),t)},children:function(e,t){return P(ot.children(e),t)},descendants:Ct},St={all:function(e){return ge.all(e)},ancestors:function(e,t,n){return Rt.ancestors(e,function(e){return ge.is(e,t)},n)},siblings:function(e,t){return Rt.siblings(e,function(e){return ge.is(e,t)})},children:function(e,t){return Rt.children(e,function(e){return ge.is(e,t)})},descendants:function(e,t){return ge.all(t,e)}};function Tt(e,t,n,r,o){return e(n,r)?S.some(n):T(o)&&o(n)?S.none():t(n,r,o)}var Nt,Dt,Et,Ot,At,kt=function(e,t,n){for(var r=e.dom(),o=T(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=le.fromDom(r);if(t(i))return S.some(i);if(o(i))break}return S.none()},Pt=function(e,t){return M(e.dom().childNodes,x(t,le.fromDom)).map(le.fromDom)},It=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(le.fromDom(e.childNodes[t])))return S.some(le.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return S.none()};return o(e.dom())},Bt={first:function(e){return It(xt.body(),e)},ancestor:kt,closest:function(e,t,n){return Tt(function(e){return t(e)},kt,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Pt(le.fromDom(e.parentNode),function(e){return!$e.eq(t,e)&&n(e)}):S.none()},child:Pt,descendant:It},Mt=function(e,t,n){return Bt.ancestor(e,function(e){return ge.is(e,t)},n)},Wt={first:function(e){return ge.one(e)},ancestor:Mt,sibling:function(e,t){return Bt.sibling(e,function(e){return ge.is(e,t)})},child:function(e,t){return Bt.child(e,function(e){return ge.is(e,t)})},descendant:function(e,t){return ge.one(t,e)},closest:function(e,t,n){return Tt(ge.is,Mt,e,t,n)}},_t=function(e,t,n){var r=n!==undefined?n:C(!1);return r(t)?S.none():E(e,mt.name(t))?S.some(t):Wt.ancestor(t,e.join(","),function(e){return ge.is(e,"table")||r(e)})},Lt=function(t,e){return ot.parent(e).map(function(e){return St.children(e,t)})},qt=R(Lt,"th,td"),Ft=R(Lt,"tr"),jt=function(e,t){return parseInt(bt.get(e,t),10)},zt={cell:function(e,t){return _t(["td","th"],e,t)},firstCell:function(e){return Wt.descendant(e,"th,td")},cells:function(e){return ut.firstLayer(e,"th,td")},neighbourCells:qt,table:function(e,t){return Wt.closest(e,"table",t)},row:function(e,t){return _t(["tr"],e,t)},rows:function(e){return ut.firstLayer(e,"tr")},notCell:function(e,t){return _t(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:Ft,attr:jt,grid:function(e,t,n){var r=jt(e,t),o=jt(e,n);return ae.grid(r,o)}},Ht=function(e){var t=zt.rows(e);return A(t,function(e){var t=e,n=ot.parent(t).map(function(e){var t=mt.name(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=A(zt.cells(e),function(e){var t=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1,n=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1;return ae.detail(e,t,n)});return ae.rowdata(t,r,n)})},Ut=function(e,n){return A(e,function(e){var t=A(zt.cells(e),function(e){var t=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1,n=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1;return ae.detail(e,t,n)});return ae.rowdata(e,t,n.section())})},Vt=function(e,t){return e+","+t},Gt=function(e,t){var n=F(e.all(),function(e){return e.cells()});return P(n,t)},Yt={generate:function(e){var f={},t=[],n=e.length,s=0;k(e,function(e,c){var l=[];k(e.cells(),function(e,t){for(var n=0;f[Vt(c,n)]!==undefined;)n++;for(var r=ae.extended(e.element(),e.rowspan(),e.colspan(),c,n),o=0;o<e.colspan();o++)for(var i=0;i<e.rowspan();i++){var u=n+o,a=Vt(c+i,u);f[a]=r,s=Math.max(s,u+1)}l.push(r)}),t.push(ae.rowdata(e.element(),l,e.section()))});var r=ae.grid(n,s);return{grid:C(r),access:C(f),all:C(t)}},getAt:function(e,t,n){var r=e.access()[Vt(t,n)];return r!==undefined?S.some(r):S.none()},findItem:function(e,t,n){var r=Gt(e,function(e){return n(t,e.element())});return 0<r.length?S.some(r[0]):S.none()},filterItems:Gt,justCells:function(e){var t=A(e.all(),function(e){return e.cells()});return q(t)}},Xt=function(e){return e.style!==undefined},Kt=function(e,t,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Xt(e)&&e.style.setProperty(t,n)},Jt=function(e,t){Xt(e)&&e.style.removeProperty(t)},$t=function(e,t,n){var r=e.dom();Kt(r,t,n)},Qt=function(e,t){return Xt(e)?e.style.getPropertyValue(t):""},Zt=function(e,t){var n=e.dom(),r=Qt(n,t);return S.from(r).filter(function(e){return 0<e.length})},en={copy:function(e,t){var n=e.dom(),r=t.dom();Xt(n)&&Xt(r)&&(r.style.cssText=n.style.cssText)},set:$t,preserve:function(e,t){var n=bt.get(e,"style"),r=t(e);return(n===undefined?bt.remove:bt.set)(e,"style",n),r},setAll:function(e,t){var n=e.dom();V(t,function(e,t){Kt(n,t,e)})},setOptions:function(e,t){var n=e.dom();V(t,function(e,t){e.fold(function(){Jt(n,t)},function(e){Kt(n,t,e)})})},remove:function(e,t){var n=e.dom();Jt(n,t),bt.has(e,"style")&&""===bt.get(e,"style").replace(/^\s+|\s+$/g,"")&&bt.remove(e,"style")},get:function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||xt.inBody(e)?r:Qt(n,t);return null===o?undefined:o},getRaw:Zt,getAllRaw:function(e){var t={},n=e.dom();if(Xt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t},isValidValue:function(e,t,n){var r=le.fromTag(e);return $t(r,t,n),Zt(r,t).isSome()},reflow:function(e){return e.dom().offsetWidth},transfer:function(r,o,e){mt.isElement(r)&&mt.isElement(o)&&k(e,function(e){var t,n;t=o,Zt(r,n=e).each(function(e){Zt(t,n).isNone()&&$t(t,n,e)})})}},tn=function(t,n){ot.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},nn=function(e,t){e.dom().appendChild(t.dom())},rn={before:tn,after:function(e,t){ot.nextSibling(e).fold(function(){ot.parent(e).each(function(e){nn(e,t)})},function(e){tn(e,t)})},prepend:function(t,n){ot.firstChild(t).fold(function(){nn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:nn,appendAt:function(e,t,n){ot.child(e,n).fold(function(){nn(e,t)},function(e){tn(e,t)})},wrap:function(e,t){tn(e,t),nn(t,e)}},on={before:function(t,e){k(e,function(e){rn.before(t,e)})},after:function(r,o){k(o,function(e,t){var n=0===t?r:o[t-1];rn.after(n,e)})},prepend:function(t,e){k(e.slice().reverse(),function(e){rn.prepend(t,e)})},append:function(t,e){k(e,function(e){rn.append(t,e)})}},un=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},an={empty:function(e){e.dom().textContent="",k(ot.children(e),function(e){un(e)})},remove:un,unwrap:function(e){var t=ot.children(e);0<t.length&&on.before(e,t),un(e)}},cn=X("minRow","minCol","maxRow","maxCol"),ln=function(e,t){var n,i,r,u,a,c,l,o,f,s,d=function(e){return ge.is(e.element(),t)},m=Ht(e),g=Yt.generate(m),h=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),a=r,l=c=0,V(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:c<n&&(c=n),r<a?a=r:l<o&&(l=o)}}),cn(u,a,c,l)),p="th:not("+t+"),td:not("+t+")",v=ut.filterFirstLayer(e,"th,td",function(e){return ge.is(e,p)});return k(v,an.remove),function(e,t,n,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;l<c;l++)for(var f=!1,s=0;s<a;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(Yt.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=le.fromTag("td"),rn.append(u,le.fromTag("br")),(o?rn.append:rn.prepend)(i,u)):f=!0)}(m,g,h,d),o=e,f=h,s=P(ut.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),k(s,an.remove),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||k(ut.firstLayer(o,"th,td"),function(e){bt.remove(e,"rowspan"),bt.remove(e,"colspan")}),bt.remove(o,"width"),bt.remove(o,"height"),en.remove(o,"width"),en.remove(o,"height"),e},fn=function(e,t){return le.fromDom(e.dom().cloneNode(t))},sn=function(e){return fn(e,!0)},dn=function(e,t){var n=le.fromTag(t),r=bt.clone(e);return bt.setAll(n,r),n},mn=function(e){return fn(e,!1)},gn=sn,hn=function(e,t){var n=dn(e,t),r=ot.children(sn(e));return on.append(n,r),n},pn=(Nt=mt.isText,Dt="text",Et=function(e){return Nt(e)?S.from(e.dom().nodeValue):S.none()},Ot=Xe.detect().browser,{get:function(e){if(!Nt(e))throw new Error("Can only get "+Dt+" value of a "+Dt+" node");return At(e).getOr("")},getOption:At=Ot.isIE()&&10===Ot.version.major?function(e){try{return Et(e)}catch(t){return S.none()}}:Et,set:function(e,t){if(!Nt(e))throw new Error("Can only set raw "+Dt+" value of a "+Dt+" node");e.dom().nodeValue=t}}),vn={get:function(e){return pn.get(e)},getOption:function(e){return pn.getOption(e)},set:function(e,t){pn.set(e,t)}},bn=function(e){return"img"===mt.name(e)?1:vn.getOption(e).fold(function(){return ot.children(e).length},function(e){return e.length})},wn=["img","br"],yn=bn,xn=function(e){return vn.getOption(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||E(wn,mt.name(e))},Cn=function(e,i){var u=function(e){for(var t=ot.children(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return S.some(r);var o=u(r);if(o.isSome())return o}return S.none()};return u(e)},Rn={first:function(e){return Bt.descendant(e,xn)},last:function(e){return Cn(e,xn)}},Sn=function(){var e=le.fromTag("td");return rn.append(e,le.fromTag("br")),e},Tn=function(e,t,n){var r=hn(e,t);return V(n,function(e,t){null===e?bt.remove(r,t):bt.set(r,t,e)}),r},Nn=function(e){return e},Dn=function(e){return function(){return le.fromTag("tr",e.dom())}},En=function(c,e,l){return{row:Dn(e),cell:function(e){var r,o,i,t=ot.owner(e.element()),n=le.fromTag(mt.name(e.element()),t.dom()),u=l.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=0<u.length?(r=e.element(),o=n,i=u,Rn.first(r).map(function(e){var t=i.join(","),n=St.ancestors(e,t,function(e){return $e.eq(e,r)});return I(n,function(e,t){var n=mn(t);return bt.remove(n,"contenteditable"),rn.append(e,n),n},o)}).getOr(o)):n;return rn.append(a,le.fromTag("br")),en.copy(e.element(),n),en.remove(n,"height"),1!==e.colspan()&&en.remove(e.element(),"width"),c(e.element(),n),n},replace:Tn,gap:Sn}},On=function(e){return{row:Dn(e),cell:Sn,replace:Nn,gap:Sn}},An=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,ot.children(le.fromDom(n))},kn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Pn(){return{up:C({selector:Wt.ancestor,closest:Wt.closest,predicate:Bt.ancestor,all:ot.parents}),down:C({selector:St.descendants,predicate:Rt.descendants}),styles:C({get:en.get,getRaw:en.getRaw,set:en.set,remove:en.remove}),attrs:C({get:bt.get,set:bt.set,remove:bt.remove,copyTo:function(e,t){var n=bt.clone(e);bt.setAll(t,n)}}),insert:C({before:rn.before,after:rn.after,afterAll:on.after,append:rn.append,appendAll:on.append,prepend:rn.prepend,wrap:rn.wrap}),remove:C({unwrap:an.unwrap,remove:an.remove}),create:C({nu:le.fromTag,clone:function(e){return le.fromDom(e.dom().cloneNode(!1))},text:le.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:ot.prevSibling,nextSibling:ot.nextSibling}),property:C({children:ot.children,name:mt.name,parent:ot.parent,isText:mt.isText,isComment:mt.isComment,isElement:mt.isElement,getText:vn.get,setText:vn.set,isBoundary:function(e){return!!mt.isElement(e)&&("body"===mt.name(e)||E(kn,mt.name(e)))},isEmptyTag:function(e){return!!mt.isElement(e)&&E(["br","img","hr","input"],mt.name(e))}}),eq:$e.eq,is:$e.is}}var In=X("left","right"),Bn=function(e,t,n){var r=e.property().children(t);return W(r,R(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},Mn=function(n,r,o){return Bn(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),In(t,r)})},Wn=function(n,r,e){return Bn(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),In(r,t)})},_n=function(i,e,u,a){var r=X("first","second","splits"),c=function(e,t,o){var n=r(e,S.none(),o);return u(e)?r(e,t,o):i.property().parent(e).bind(function(r){return a(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return c(n,S.some(e.right()),o.concat(t))}).getOr(n)})};return c(e,S.none(),[])},Ln=function(r,o,e,t){var n=o(r,e);return I(t,function(e,t){var n=o(r,t);return qn(r,e,n)},n)},qn=function(t,e,n){return e.bind(function(e){return n.filter(R(t.eq,e))})},Fn=function(e,t,n){return 0<n.length?Ln(e,t,(r=n)[0],r.slice(1)):S.none();var r},jn=function(e,t){return R(e.eq,t)},zn=function(t,e,n,r){var o=r!==undefined?r:C(!1),i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return W(t,o).fold(function(){return t},function(e){return t.slice(0,e+1)})},c=a(i),l=a(u),f=M(c,function(e){return O(l,jn(t,e))});return{firstpath:C(c),secondpath:C(l),shared:C(f)}},Hn=function(t,e,n){var r=zn(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return S.some([e[0]]);if(o.eq(i,t[0]))return S.some([t[0]]);var n=function(e){var t=H(e),n=W(t,jn(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return W(u,jn(o,r))},r=n(e),a=n(t);return r.bind(function(r){return a.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},Un=zn,Vn=function(e,t,n){return Fn(e,t,n)},Gn=function(e,t,n){return Hn(e,t,n)},Yn=function(e,t,n,r){return Un(e,t,n,r)},Xn=function(e,t,n){return Mn(e,t,n)},Kn=function(e,t,n){return Wn(e,t,n)},Jn=function(e,t,n,r){return _n(e,t,n,r)},$n=Pn(),Qn={sharedOne:function(n,e){return Vn($n,function(e,t){return n(t)},e)},subset:function(e,t){return Gn($n,e,t)},ancestors:function(e,t,n){return Yn($n,e,t,n)},breakToLeft:function(e,t){return Xn($n,e,t)},breakToRight:function(e,t){return Kn($n,e,t)},breakPath:function(e,t,r){return Jn($n,e,t,function(e,t,n){return r(t,n)})}},Zn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},er=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},tr=function(e,t){for(var n=!0,r=R(Zn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&Yt.getAt(e,o,i).exists(r);return n?S.some(t):S.none()},nr=function(e,t,n){var r=Yt.findItem(e,t,$e.eq),o=Yt.findItem(e,n,$e.eq);return r.bind(function(r){return o.map(function(e){return t=r,n=e,ae.bounds(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},rr=nr,or=function(t,e,n){return nr(t,e,n).bind(function(e){return tr(t,e)})},ir=function(r,e,o,i){return Yt.findItem(r,e,$e.eq).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return Yt.getAt(r,t+o,n+i).map(function(e){return e.element()})})},ur=function(n,e,t){return rr(n,e,t).map(function(e){var t=Yt.filterItems(n,R(er,e));return A(t,function(e){return e.element()})})},ar=function(e,t){return Yt.findItem(e,t,function(e,t){return $e.contains(t,e)}).bind(function(e){return e.element()})},cr=function(e){var t=Ht(e);return Yt.generate(t)},lr=function(n,r,o){return zt.table(n).bind(function(e){var t=cr(e);return ir(t,n,r,o)})},fr=function(e,t,n){var r=cr(e);return ur(r,t,n)},sr=function(e,t,n,r,o){var i=cr(e),u=$e.eq(e,n)?t:ar(i,t),a=$e.eq(e,o)?r:ar(i,r);return ur(i,u,a)},dr=function(e,t,n){var r=cr(e);return or(r,t,n)},mr=function(e,t){return Wt.ancestor(e,"table")},gr=ee(["boxes","start","finish"],[]),hr=function(a,c,r){var l=function(t){return function(e){return r(e)||$e.eq(e,t)}};return $e.eq(a,c)?S.some(gr({boxes:S.some([a]),start:a,finish:c})):mr(a).bind(function(u){return mr(c).bind(function(i){if($e.eq(u,i))return S.some(gr({boxes:fr(u,a,c),start:a,finish:c}));if($e.contains(u,i)){var e=0<(t=St.ancestors(c,"td,th",l(u))).length?t[t.length-1]:c;return S.some(gr({boxes:sr(u,a,u,c,i),start:a,finish:e}))}if($e.contains(i,u)){var t,n=0<(t=St.ancestors(a,"td,th",l(i))).length?t[t.length-1]:a;return S.some(gr({boxes:sr(i,a,u,c,i),start:a,finish:n}))}return Qn.ancestors(a,c).shared().bind(function(e){return Wt.closest(e,"table",r).bind(function(e){var t=St.ancestors(c,"td,th",l(e)),n=0<t.length?t[t.length-1]:c,r=St.ancestors(a,"td,th",l(e)),o=0<r.length?r[r.length-1]:a;return S.some(gr({boxes:sr(e,a,u,c,i),start:o,finish:n}))})})})})},pr=hr,vr=function(e,t){var n=St.descendants(e,t);return 0<n.length?S.some(n):S.none()},br=function(e,t,n,r,o){return(i=e,u=o,M(i,function(e){return ge.is(e,u)})).bind(function(e){return lr(e,t,n).bind(function(e){return t=e,n=r,Wt.ancestor(t,"table").bind(function(e){return Wt.descendant(e,n).bind(function(e){return hr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},wr=function(e,t,r){return Wt.descendant(e,t).bind(function(n){return Wt.descendant(e,r).bind(function(t){return Qn.sharedOne(mr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},yr=function(e,t){return vr(e,t)},xr=function(o,e,t){return wr(o,e,t).bind(function(n){var e=function(e){return $e.eq(o,e)},t=Wt.ancestor(n.first(),"thead,tfoot,tbody,table",e),r=Wt.ancestor(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return $e.eq(t,e)?dr(n.table(),n.first(),n.last()):S.none()})})})},Cr="data-mce-selected",Rr="data-mce-first-selected",Sr="data-mce-last-selected",Tr={selected:C(Cr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(Rr),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(Sr),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},Nr=function(u){if(!b(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],n={};return k(u,function(e,r){var t=U(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!b(i))throw new Error("case arguments must be an array");a.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=U(e);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!j(a,function(e){return E(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:a,constructor:o,params:n})}}}}),n},Dr=Nr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Er={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Dr.none,multiple:Dr.multiple,single:Dr.single},Or=function(e,t){return Er.cata(t.get(),C([]),u,C([e]))},Ar=function(n,e){return Er.cata(e.get(),S.none,function(t,e){return 0===t.length?S.none():xr(n,Tr.firstSelectedSelector(),Tr.lastSelectedSelector()).bind(function(e){return 1<t.length?S.some({bounds:C(e),cells:C(t)}):S.none()})},S.none)},kr=function(e,t){var n=Or(e,t);return 0<n.length&&j(n,function(e){return bt.has(e,"rowspan")&&1<parseInt(bt.get(e,"rowspan"),10)||bt.has(e,"colspan")&&1<parseInt(bt.get(e,"colspan"),10)})?S.some(n):S.none()},Pr=Or,Ir=function(e){return{element:C(e),mergable:S.none,unmergable:S.none,selection:C([e])}},Br=X("element","clipboard","generators"),Mr={noMenu:Ir,forMenu:function(e,t,n){return{element:C(n),mergable:C(Ar(t,e)),unmergable:C(kr(n,e)),selection:C(Pr(n,e))}},notCell:function(e){return Ir(e)},paste:Br,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:S.none,unmergable:S.none,selection:C(Pr(n,e)),clipboard:C(r),generators:C(o)}}},Wr=function(a,e,c,l){a.on("BeforeGetContent",function(n){!0===n.selection&&Er.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,zt.table(t[0]).map(gn).map(function(e){return[ln(e,Tr.attributeSelector())]})).each(function(e){n.content=A(e,function(e){return t=e,a.selection.serializer.serialize(t.dom(),{});var t}).join("")})},y)}),a.on("BeforeSetContent",function(u){!0===u.selection&&!0===u.paste&&S.from(a.dom.getParent(a.selection.getStart(),"th,td")).each(function(e){var i=le.fromDom(e);zt.table(i).bind(function(t){var e=P(An(u.content),function(e){return"meta"!==mt.name(e)});if(1===e.length&&"table"===mt.name(e[0])){u.preventDefault();var n=le.fromDom(a.getDoc()),r=On(n),o=Mr.paste(i,e[0],r);c.pasteCells(t,o).each(function(e){a.selection.setRng(e),a.focus(),l.clear(t)})}})})})};function _r(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=en.get(e,r);return parseFloat(n)||0}return t},i=function(o,e){return B(e,function(e,t){var n=en.get(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!N(t)&&!t.match(/^[0-9]+$/))throw r+".set accepts only positive integer values. Value was "+t;var n=e.dom();Xt(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Lr=_r("height",function(e){var t=e.dom();return xt.inBody(e)?t.getBoundingClientRect().height:t.offsetHeight}),qr=function(e){return Lr.get(e)},Fr=function(e){return Lr.getOuter(e)},jr=_r("width",function(e){return e.dom().offsetWidth}),zr=function(e){return jr.get(e)},Hr=function(e){return jr.getOuter(e)},Ur=Xe.detect(),Vr=function(e,t,n){return r=en.get(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Gr=function(e){return Ur.browser.isIE()||Ur.browser.isEdge()?(n=Vr(t=e,"padding-top",0),r=Vr(t,"padding-bottom",0),o=Vr(t,"border-top-width",0),i=Vr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===en.get(t,"box-sizing")?u:u-n-r-(o+i)):Vr(e,"height",qr(e));var t,n,r,o,i,u},Yr=/(\d+(\.\d+)?)(\w|%)*/,Xr=/(\d+(\.\d+)?)%/,Kr=/(\d+(\.\d+)?)px|em/,Jr=function(e,t){en.set(e,"height",t+"px")},$r=function(e,t,n,r){var o,i,u,a,c,l,f,s,d,m=parseInt(e,10);return s=l="%",d=(f=e).length-l.length,""!==s&&(f.length<s.length||f.substr(d,d+s.length)!==s)||"table"===mt.name(t)?m:(o=t,i=m,u=n,a=r,c=zt.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),a(o,c),c)},Qr=function(e){var t,n=(t=e,en.getRaw(t,"height").getOrThunk(function(){return Gr(t)+"px"}));return n?$r(n,e,qr,Jr):qr(e)},Zr=function(e,t){return bt.has(e,t)?parseInt(bt.get(e,t),10):1},eo=function(e){return en.getRaw(e,"width").fold(function(){return S.from(bt.get(e,"width"))},function(e){return S.some(e)})},to=function(e,t){return e/t.pixelWidth()*100},no={percentageBasedSizeRegex:C(Xr),pixelBasedSizeRegex:C(Kr),setPixelWidth:function(e,t){en.set(e,"width",t+"px")},setPercentageWidth:function(e,t){en.set(e,"width",t+"%")},setHeight:Jr,getPixelWidth:function(t,n){return eo(t).fold(function(){return zr(t)},function(e){return function(e,t,n){if(Kr.test(t)){var r=Kr.exec(t);return parseInt(r[1],10)}if(Xr.test(t)){var o=Xr.exec(t),i=parseFloat(o[1]);return i/100*n.pixelWidth()}return zr(e)}(t,e,n)})},getPercentageWidth:function(t,n){return eo(t).fold(function(){var e=zr(t);return to(e,n)},function(e){return function(e,t,n){if(Xr.test(t)){var r=Xr.exec(t);return parseFloat(r[1])}var o=zr(e);return to(o,n)}(t,e,n)})},getGenericWidth:function(e){return eo(e).bind(function(e){if(Yr.test(e)){var t=Yr.exec(e);return S.some({width:C(t[1]),unit:C(t[3])})}return S.none()})},setGenericWidth:function(e,t,n){en.set(e,"width",t+n)},getHeight:function(e){return n="rowspan",Qr(t=e)/Zr(t,n);var t,n},getRawWidth:eo},ro=function(n,r){no.getGenericWidth(n).each(function(e){var t=e.width()/2;no.setGenericWidth(n,t,e.unit()),no.setGenericWidth(r,t,e.unit())})},oo=function(e,t){var n=t||le.fromDom(document.documentElement);return Bt.ancestor(e,R($e.eq,n)).isSome()},io=function(e){var t=e.dom();return t===t.window&&e instanceof Window?e:mt.isDocument(e)?t.defaultView||t.parentWindow:null},uo=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return uo(n+e,r+t)}}},ao=uo,co=function(e,t){return e!==undefined?e:t!==undefined?t:0},lo=function(e){var t,n=e.dom(),r=n.ownerDocument,o=r.body,i=le.fromDom(r.documentElement);return o===n?ao(o.offsetLeft,o.offsetTop):oo(e,i)?(t=n.getBoundingClientRect(),ao(t.left,t.top)):ao(0,0)},fo=function(e){var t=e.dom().ownerDocument,n=t.body,r=io(le.fromDom(t)),o=t.documentElement,i=co(r.pageYOffset,o.scrollTop),u=co(r.pageXOffset,o.scrollLeft),a=co(o.clientTop,n.clientTop),c=co(o.clientLeft,n.clientLeft);return lo(e).translate(u-c,i-a)},so=X("row","y"),mo=X("col","x"),go=function(e){return fo(e).left()+Hr(e)},ho=function(e){return fo(e).left()},po=function(e,t){return mo(e,ho(t))},vo=function(e,t){return mo(e,go(t))},bo=function(e){return fo(e).top()},wo=function(n,t,r){if(0===r.length)return[];var e=A(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},yo={delta:u,positions:R(wo,function(e,t){return so(e,bo(t))},function(e,t){return so(e,bo(t)+Fr(t))}),edge:bo},xo={delta:u,edge:ho,positions:R(wo,po,vo)},Co={height:yo,rtl:{delta:function(e,t){return-e},edge:go,positions:R(wo,vo,po)},ltr:xo},Ro={ltr:Co.ltr,rtl:Co.rtl};function So(t){var n=function(e){return t(e).isRtl()?Ro.rtl:Ro.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var To,No=function(e){var t=Ht(e);return Yt.generate(t).grid()},Do=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Do(n())}}},Eo=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Q("required",o),Z(o),function(t){var n=U(t);j(o,function(e){return E(n,e)})||J(o,n),r(o,n);var e=P(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+K(e).join(", ")+") were not.")}(e,i.label),t}},Oo=function(t,e){var n=P(e,function(e){return!E(t,e)});0<n.length&&$(n)},Ao=function(e){return Eo(Oo,e,{validate:T,label:"function"})},ko=function(e){var t=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1,n=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},Po=Ao(["cell","row","replace","gap"]),Io=function(r,e){Po(r);var n=Do(S.none()),o=e!==undefined?e:ko,i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(S.some(t)),a=S.some({item:e,replacement:t}),t},a=S.none();return{getOrInit:function(t,n){return a.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},Bo=function(o,a){return function(n){var r=Do(S.none());Po(n);var i=[],u=function(e){var t=n.replace(e,a,{scope:o});return i.push({item:e,sub:t}),r.get().isNone()&&r.set(S.some(t)),t};return{replaceOrInit:function(t,n){return(r=t,o=n,M(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:r.get}}},Mo=function(n){Po(n);var e=Do(S.none());return{combine:function(t){return e.get().isNone()&&e.set(S.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return en.remove(e,"width"),en.remove(t,"width"),e}},cursor:e.get}},Wo=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],_o=function(e,t){var n=e.property().name(t);return E(Wo,n)},Lo=function(e,t){return E(["br","img","hr","input"],e.property().name(t))},qo=_o,Fo=function(e,t){var n=e.property().name(t);return E(["ol","ul"],n)},jo=Lo,zo=Pn(),Ho=function(e){return qo(zo,e)},Uo=function(e){return Fo(zo,e)},Vo=function(e){return jo(zo,e)},Go=function(e){var t,i=function(e){return"br"===mt.name(e)},n=function(o){return Rn.last(o).bind(function(n){var e,r=(e=n,ot.nextSibling(e).map(function(e){return!!Ho(e)||(Vo(e)?"img"!==mt.name(e):void 0)}).getOr(!1));return ot.parent(n).map(function(e){return!0===r||(t=e,"li"===mt.name(t)||Bt.ancestor(t,Uo).isSome())||i(n)||Ho(e)&&!$e.eq(o,e)?[]:[le.fromTag("br")];var t})}).getOr([])},r=0===(t=F(e,function(e){var t=ot.children(e);return j(t,function(e){return i(e)||mt.isText(e)&&0===vn.get(e).trim().length})?[]:t.concat(n(e))})).length?[le.fromTag("br")]:t;an.empty(e[0]),on.append(e[0],r)},Yo=Object.prototype.hasOwnProperty,Xo=(To=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Yo.call(o,i)&&(n[i]=To(n[i],o[i]))}return n}),Ko=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Jo=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()},$o=function(e,t){return ae.rowcells(t,e.section())},Qo=function(e,t){return e.cells()[t]},Zo={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return $o(e,u)},setCells:$o,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:Qo,getCellElement:function(e,t){return Qo(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=A(n,t);return ae.rowcells(r,e.section())},cellLength:function(e){return e.cells().length}},ei=function(e,t){if(0===e.length)return 0;var n=e[0];return W(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},ti=function(e,t,n,r){var o,i,u,a,c=(o=e,i=t,o[i]).cells().slice(n),l=ei(c,r),f=(u=e,a=n,A(u,function(e){return Zo.getCell(e,a)})).slice(t),s=ei(f,r);return{colspan:C(l),rowspan:C(s)}},ni=function(o,i){var u=A(o,function(e,t){return A(e.cells(),function(e,t){return!1})});return A(o,function(e,r){var t=F(e.cells(),function(e,t){if(!1===u[r][t]){var n=ti(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[ae.detailnew(e.element(),n.rowspan(),n.colspan(),e.isNew())]}return[]});return ae.rowdetails(t,e.section())})},ri=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var a=Yt.getAt(e,o,u).map(function(e){return ae.elementnew(e.element(),n)}).getOrThunk(function(){return ae.elementnew(t.gap(),!0)});i.push(a)}var c=ae.rowcells(i,e.all()[o].section());r.push(c)}return r},oi=function(e,t,n,r){n===r?bt.remove(e,t):bt.set(e,t,n)},ii=function(o,e){var i=[],u=[],t=function(e,t){var n;0<e.length?function(e,t){var n=Wt.child(o,t).getOrThunk(function(){var e=le.fromTag(t,ot.owner(o).dom());return rn.append(o,e),e});an.empty(n);var r=A(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return an.empty(t),k(e.cells(),function(e){e.isNew()&&u.push(e.element()),oi(e.element(),"colspan",e.colspan(),1),oi(e.element(),"rowspan",e.rowspan(),1),rn.append(t,e.element())}),t});on.append(n,r)}(e,t):(n=t,Wt.child(o,n).each(an.remove))},n=[],r=[],a=[];return k(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":a.push(e)}}),t(n,"thead"),t(r,"tbody"),t(a,"tfoot"),{newRows:C(i),newCells:C(u)}},ui=function(e){return A(e,function(e){var n=mn(e.element());return k(e.cells(),function(e){var t=gn(e.element());oi(t,"colspan",e.colspan(),1),oi(t,"rowspan",e.rowspan(),1),rn.append(n,t)}),n})},ai=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},ci=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},li=function(t,n){if(n<0||n>=t.length-1)return S.none();var e=t[n].fold(function(){var e=H(t.slice(0,n));return Jo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return Jo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},fi=function(e,t,n){var r=e();return M(r,t).orThunk(function(){return S.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},si=function(n){var e=n.grid(),t=ci(0,e.columns()),r=ci(0,e.rows());return A(t,function(t){return fi(function(){return F(r,function(e){return Yt.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return Yt.getAt(n,0,t)})})},di=function(n){var e=n.grid(),t=ci(0,e.rows()),r=ci(0,e.columns());return A(t,function(t){return fi(function(){return F(r,function(e){return Yt.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return Yt.getAt(n,t,0)})})},mi=function(e,t,n,r,o){var i=le.fromTag("div");return en.setAll(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),bt.setAll(i,{"data-column":e,role:"presentation"}),i},gi=function(e,t,n,r,o){var i=le.fromTag("div");return en.setAll(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),bt.setAll(i,{"data-row":e,role:"presentation"}),i},hi=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},pi={resolve:hi("ephox-snooker").resolve},vi=function(e,t){var n=bt.get(e,t);return n===undefined||""===n?[]:n.split(" ")},bi=vi,wi=function(e,t,n){var r=vi(e,t).concat([n]);return bt.set(e,t,r.join(" ")),!0},yi=function(e,t,n){var r=P(vi(e,t),function(e){return e!==n});return 0<r.length?bt.set(e,t,r.join(" ")):bt.remove(e,t),!1},xi=function(e){return bi(e,"class")},Ci=function(e,t){return wi(e,"class",t)},Ri=function(e,t){return yi(e,"class",t)},Si=xi,Ti=Ci,Ni=Ri,Di=function(e,t){return E(xi(e),t)?Ri(e,t):Ci(e,t)},Ei=function(e){return e.dom().classList!==undefined},Oi=function(e,t){return Ei(e)&&e.dom().classList.contains(t)},Ai={add:function(e,t){Ei(e)?e.dom().classList.add(t):Ti(e,t)},remove:function(e,t){var n;Ei(e)?e.dom().classList.remove(t):Ni(e,t),0===(Ei(n=e)?n.dom().classList:Si(n)).length&&bt.remove(n,"class")},toggle:function(e,t){return Ei(e)?e.dom().classList.toggle(t):Di(e,t)},toggler:function(e,t){var n,r,o,i,u,a,c=Ei(e),l=e.dom().classList;return n=function(){c?l.remove(t):Ni(e,t)},r=function(){c?l.add(t):Ti(e,t)},o=Oi(e,t),i=o||!1,{on:u=function(){r(),i=!0},off:a=function(){n(),i=!1},toggle:function(){(i?a:u)()},isOn:function(){return i}}},has:Oi},ki=pi.resolve("resizer-bar"),Pi=pi.resolve("resizer-rows"),Ii=pi.resolve("resizer-cols"),Bi=function(e){var t=St.descendants(e.parent(),"."+ki);k(t,an.remove)},Mi=function(n,e,r){var o=n.origin();k(e,function(e,t){e.each(function(e){var t=r(o,e);Ai.add(t,ki),rn.append(n.parent(),t)})})},Wi=function(e,t,n,r,o,i){var u,a,c,l,f=fo(t),s=0<n.length?o.positions(n,t):[];u=e,a=s,c=f,l=Hr(t),Mi(u,a,function(e,t){var n=gi(t.row(),c.left()-e.left(),t.y()-e.top(),l,7);return Ai.add(n,Pi),n});var d,m,g,h,p=0<r.length?i.positions(r,t):[];d=e,m=p,g=f,h=Fr(t),Mi(d,m,function(e,t){var n=mi(t.col(),t.x()-e.left(),g.top()-e.top(),7,h);return Ai.add(n,Ii),n})},_i=function(e,t){var n=St.descendants(e.parent(),"."+ki);k(n,t)},Li={refresh:function(e,t,n,r){Bi(e);var o=Ht(t),i=Yt.generate(o),u=di(i),a=si(i);Wi(e,t,u,a,n,r)},hide:function(e){_i(e,function(e){en.set(e,"display","none")})},show:function(e){_i(e,function(e){en.set(e,"display","block")})},destroy:Bi,isRowBar:function(e){return Ai.has(e,Pi)},isColBar:function(e){return Ai.has(e,Ii)}},qi=function(e,r){return A(e,function(e){var t,n=(t=e.details(),Jo(t,function(e){return ot.parent(e.element()).map(function(e){var t=ot.parent(e).isNone();return ae.elementnew(e,t)})}).getOrThunk(function(){return ae.elementnew(r.row(),!0)}));return ae.rowdatanew(n.element(),e.details(),e.section(),n.isNew())})},Fi=function(e,t){var n=ni(e,$e.eq);return qi(n,t)},ji=function(e,t){var n=q(A(e.all(),function(e){return e.cells()}));return M(n,function(e){return $e.eq(t,e.element())})},zi=function(a,c,l,f,s){return function(n,r,e,o,i){var t=Ht(r),u=Yt.generate(t);return c(u,e).map(function(e){var t=ri(u,o,!1),n=a(t,e,$e.eq,s(o)),r=Fi(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return S.none()},function(e){var t=ii(r,e.grid());return l(r,e.grid(),i),f(r),Li.refresh(n,r,Co.height,i),S.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},Hi=Fi,Ui=function(t,e){return zt.cell(e.element()).bind(function(e){return ji(t,e)})},Vi=function(t,e){var n=A(e.selection(),function(e){return zt.cell(e).bind(function(e){return ji(t,e)})}),r=Ko(n);return 0<r.length?S.some(r):S.none()},Gi=function(t,n){return zt.cell(n.element()).bind(function(e){return ji(t,e).map(function(e){return Xo(e,{generators:n.generators,clipboard:n.clipboard})})})},Yi=function(t,e){var n=A(e.selection(),function(e){return zt.cell(e).bind(function(e){return ji(t,e)})}),r=Ko(n);return 0<r.length?S.some(Xo({cells:r},{generators:e.generators,clipboard:e.clipboard})):S.none()},Xi=function(e,t){return t.mergable()},Ki=function(e,t){return t.unmergable()},Ji=function(n){return{is:function(e){return n===e},isValue:l,isError:c,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return Ji(n)},orThunk:function(e){return Ji(n)},fold:function(e,t){return t(n)},map:function(e){return Ji(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return S.some(n)}}},$i=function(n){return{is:c,isValue:c,isError:l,getOr:u,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return $i(n)},each:y,bind:function(e){return $i(n)},exists:c,forall:l,toOption:S.none}},Qi={value:Ji,error:$i},Zi=function(e,t){return A(e,function(){return ae.elementnew(t.cell(),!0)})},eu=function(t,e,n){return t.concat(ai(e,function(e){return Zo.setCells(t[t.length-1],Zi(t[t.length-1].cells(),n))}))},tu=function(e,t,n){return A(e,function(e){return Zo.setCells(e,e.cells().concat(Zi(ci(0,t),n)))})},nu=function(e,t,n){if(e.row()>=t.length||e.column()>Zo.cellLength(t[0]))return Qi.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=Zo.cellLength(n[0]),u=n.length;return Qi.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},ru=function(e,t){var n=Zo.cellLength(e[0]),r=Zo.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},ou=function(e,t,n){var r=t.colDelta()<0?tu:u;return(t.rowDelta()<0?eu:u)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},iu=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)Zo.mutateCell(e[o],i,ae.elementnew(r(),!1));return e},uu=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<Zo.cellLength(e[0]);u++){var a=n(Zo.getCellElement(e[i],u),t);!0===a&&!1===o?Zo.mutateCell(e[i],u,ae.elementnew(r(),!0)):!0===a&&(o=!1)}return e},au=function(i,u,a,c){if(0<u&&u<i.length){var e=i[u-1].cells(),t=(n=a,B(e,function(e,t){return O(e,function(e){return n(e.element(),t.element())})?e:e.concat([t])},[]));k(t,function(e){for(var t=S.none(),n=u;n<i.length;n++)for(var r=0;r<Zo.cellLength(i[0]);r++){var o=i[n].cells()[r];a(o.element(),e.element())&&(t.isNone()&&(t=S.some(c())),t.each(function(e){Zo.mutateCell(i[n],r,ae.elementnew(e,!0))}))}})}var n;return i},cu=function(n,r,o,i,u){return nu(n,r,o).map(function(e){var t=ou(r,e,i);return function(e,t,n,r,o){for(var i,u,a,c,l,f,s,d=e.row(),m=e.column(),g=d+n.length,h=m+Zo.cellLength(n[0]),p=d;p<g;p++)for(var v=m;v<h;v++){i=t,u=p,a=v,c=o,f=l=void 0,l=Zo.getCell(i[u],a),f=R(c,l.element()),s=i[u],1<i.length&&1<Zo.cellLength(s)&&(0<a&&f(Zo.getCellElement(s,a-1))||a<s.length-1&&f(Zo.getCellElement(s,a+1))||0<u&&f(Zo.getCellElement(i[u-1],a))||u<i.length-1&&f(Zo.getCellElement(i[u+1],a)))&&uu(t,Zo.getCellElement(t[p],v),o,r.cell);var b=Zo.getCellElement(n[p-d],v-m),w=r.replace(b);Zo.mutateCell(t[p],v,ae.elementnew(w,!0))}return t}(n,t,o,i,u)})},lu=function(e,t,n,r,o){au(t,e,o,r.cell);var i=ru(n,t),u=ou(n,i,r),a=ru(t,u),c=ou(t,a,r);return c.slice(0,e).concat(u).concat(c.slice(e,c.length))},fu=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),a=Zo.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(Zo.getCellElement(n[r-1],t),Zo.getCellElement(n[r],t))?Zo.getCell(n[r],t):ae.elementnew(i(e.element(),o),!0)});return t.concat([a]).concat(u)},su=function(e,n,r,o,i){return A(e,function(e){var t=0<n&&n<Zo.cellLength(e)&&o(Zo.getCellElement(e,n-1),Zo.getCellElement(e,n))?Zo.getCell(e,n):ae.elementnew(i(Zo.getCellElement(e,r),o),!0);return Zo.addCell(e,n,t)})},du=function(e,r,o,i,u){var a=o+1;return A(e,function(e,t){var n=t===r?ae.elementnew(u(Zo.getCellElement(e,o),i),!0):Zo.getCell(e,o);return Zo.addCell(e,a,n)})},mu=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),a=e.slice(i),c=Zo.mapCells(e[t],function(e,t){return t===n?ae.elementnew(o(e.element(),r),!0):e});return u.concat([c]).concat(a)},gu=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},hu=function(e,n,r){var t=A(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return ae.rowcells(t,e.section())});return P(t,function(e){return 0<e.cells().length})},pu=function(e,n,r,o){return A(e,function(e){return Zo.mapCells(e,function(e){return t=e,O(n,function(e){return r(t.element(),e.element())})?ae.elementnew(o(e.element(),r),!0):e;var t})})},vu=function(e,t,n,r){return Zo.getCellElement(e[t],n)!==undefined&&0<t&&r(Zo.getCellElement(e[t-1],n),Zo.getCellElement(e[t],n))},bu=function(e,t,n){return 0<t&&n(Zo.getCellElement(e,t-1),Zo.getCellElement(e,t))},wu=function(n,r,o,e){var t=F(n,function(e,t){return vu(n,t,r,o)||bu(e,r,o)?[]:[Zo.getCell(e,r)]});return pu(n,t,o,e)},yu=function(n,r,o,e){var i=n[r],t=F(i.cells(),function(e,t){return vu(n,r,t,o)||bu(i,t,o)?[]:[e]});return pu(n,t,o,e)},xu=function(e){return{fold:e}},Cu=function(){return xu(function(e,t,n,r,o){return e()})},Ru=function(i){return xu(function(e,t,n,r,o){return t(i)})},Su=function(i,u){return xu(function(e,t,n,r,o){return n(i,u)})},Tu=function(i,u,a){return xu(function(e,t,n,r,o){return r(i,u,a)})},Nu=function(i,u){return xu(function(e,t,n,r,o){return o(i,u)})},Du=function(e,t,i,u){var n,r,a=e.slice(0),o=(r=t,0===(n=e).length?Cu():1===n.length?Ru(0):0===r?Su(0,1):r===n.length-1?Nu(r-1,r):0<r&&r<n.length-1?Tu(r-1,r,r+1):Cu()),c=function(e){return A(e,C(0))},l=C(c(a)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),a[t]-i);return c(a.slice(0,e)).concat([i,n-a[t]]).concat(c(a.slice(t+1)))}var r=Math.max(u.minCellWidth(),a[e]+i),o=a[e]-r;return c(a.slice(0,e)).concat([r-a[e],o]).concat(c(a.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(a[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return c(a.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),a[t]+i);return c(a.slice(0,t)).concat([n-a[t]])})},Eu=function(e,t){return bt.has(e,t)&&1<parseInt(bt.get(e,t),10)},Ou={hasColspan:function(e){return Eu(e,"colspan")},hasRowspan:function(e){return Eu(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(en.get(e,t),10)}},Au=function(e,t,n){return en.getRaw(e,t).fold(function(){return n(e)+"px"},function(e){return e})},ku=function(e){return Au(e,"width",no.getPixelWidth)},Pu=function(e){return Au(e,"height",no.getHeight)},Iu=function(e,t,n,r,o){var i=si(e),u=A(i,function(e){return e.map(t.edge)});return A(i,function(e,t){return e.filter(m(Ou.hasColspan)).fold(function(){var e=li(u,t);return r(e)},function(e){return n(e,o)})})},Bu=function(e){return e.map(function(e){return e+"px"}).getOr("")},Mu=function(e,t,n,r){var o=di(e),i=A(o,function(e){return e.map(t.edge)});return A(o,function(e,t){return e.filter(m(Ou.hasRowspan)).fold(function(){var e=li(i,t);return r(e)},function(e){return n(e)})})},Wu={getRawWidths:function(e,t){return Iu(e,t,ku,Bu)},getPixelWidths:function(e,t,n){return Iu(e,t,no.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Iu(e,t,no.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Mu(e,t,no.getHeight,function(e){return e.getOrThunk(Ou.minHeight)})},getRawHeights:function(e,t){return Mu(e,t,Pu,Bu)}},_u=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},Lu=function(e,n){var t=Yt.justCells(e);return A(t,function(e){var t=_u(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},qu=function(e,n){var t=Yt.justCells(e);return A(t,function(e){var t=_u(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},Fu=function(e,n){return A(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},ju=function(e){var t=parseInt(e,10),n=u;return{width:C(t),pixelWidth:C(t),getWidths:Wu.getPixelWidths,getCellDelta:n,singleColumnWidth:function(e,t){return[Math.max(Ou.minWidth(),e+t)-e]},minCellWidth:Ou.minWidth,setElementWidth:no.setPixelWidth,setTableWidth:function(e,t,n){var r=I(t,function(e,t){return e+t},0);no.setPixelWidth(e,r)}}},zu=function(e,t){if(no.percentageBasedSizeRegex().test(t)){var n=no.percentageBasedSizeRegex().exec(t);return o=n[1],i=e,u=parseFloat(o),a=zr(i),{width:C(u),pixelWidth:C(a),getWidths:Wu.getPercentageWidths,getCellDelta:function(e){return e/a*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Ou.minWidth()/a*100},setElementWidth:no.setPercentageWidth,setTableWidth:function(e,t,n){var r=u+n;no.setPercentageWidth(e,r)}}}if(no.pixelBasedSizeRegex().test(t)){var r=no.pixelBasedSizeRegex().exec(t);return ju(r[1])}var o,i,u,a,c=zr(e);return ju(c)},Hu=function(t){return no.getRawWidth(t).fold(function(){var e=zr(t);return ju(e)},function(e){return zu(t,e)})},Uu=function(e){return Yt.generate(e)},Vu=function(e){var t=Ht(e);return Uu(t)},Gu=function(e,t,n,r){var o=Hu(e),i=o.getCellDelta(t),u=Vu(e),a=o.getWidths(u,r,o),c=Du(a,n,i,o),l=A(c,function(e,t){return e+a[t]}),f=Lu(u,l);k(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},Yu=function(e,n,r,t){var o=Vu(e),i=Wu.getPixelHeights(o,t),u=A(i,function(e,t){return r===t?Math.max(n+e,Ou.minHeight()):e}),a=qu(o,u),c=Fu(o,u);k(c,function(e){no.setHeight(e.element(),e.height())}),k(a,function(e){no.setHeight(e.element(),e.height())});var l=I(u,function(e,t){return e+t},0);no.setHeight(e,l)},Xu=function(e,t,n){var r=Hu(e),o=Uu(t),i=r.getWidths(o,n,r),u=Lu(o,i);k(u,function(e){r.setElementWidth(e.element(),e.width())});var a=I(i,function(e,t){return t+e},0);0<u.length&&r.setElementWidth(e,a)},Ku=function(e){0===zt.cells(e).length&&an.remove(e)},Ju=X("grid","cursor"),$u=function(e,t,n){return Qu(e,t,n).orThunk(function(){return Qu(e,0,0)})},Qu=function(e,t,n){return S.from(e[t]).bind(function(e){return S.from(e.cells()[n]).bind(function(e){return S.from(e.element())})})},Zu=function(e,t,n){return Ju(e,Qu(e,t,n))},ea=function(e){return B(e,function(e,t){return O(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},ta=function(e){return B(e,function(e,t){return O(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},na=function(e,t,n){var r=Ut(e,n),o=Yt.generate(r);return ri(o,t,!0)},ra=Xu,oa={insertRowBefore:zi(function(e,t,n,r){var o=t.row(),i=t.row(),u=fu(e,i,o,n,r.getOrInit);return Zu(u,i,t.column())},Ui,y,y,Io),insertRowsBefore:zi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=ea(t),a=B(u,function(e,t){return fu(e,i,o,n,r.getOrInit)},e);return Zu(a,i,t[0].column())},Vi,y,y,Io),insertRowAfter:zi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=fu(e,i,o,n,r.getOrInit);return Zu(u,i,t.column())},Ui,y,y,Io),insertRowsAfter:zi(function(e,t,n,r){var o=ea(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=B(o,function(e,t){return fu(e,u,i,n,r.getOrInit)},e);return Zu(a,u,t[0].column())},Vi,y,y,Io),insertColumnBefore:zi(function(e,t,n,r){var o=t.column(),i=t.column(),u=su(e,i,o,n,r.getOrInit);return Zu(u,t.row(),i)},Ui,ra,y,Io),insertColumnsBefore:zi(function(e,t,n,r){var o=ta(t),i=o[0].column(),u=o[0].column(),a=B(o,function(e,t){return su(e,u,i,n,r.getOrInit)},e);return Zu(a,t[0].row(),u)},Vi,ra,y,Io),insertColumnAfter:zi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=su(e,i,o,n,r.getOrInit);return Zu(u,t.row(),i)},Ui,ra,y,Io),insertColumnsAfter:zi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ta(t),a=B(u,function(e,t){return su(e,i,o,n,r.getOrInit)},e);return Zu(a,t[0].row(),i)},Vi,ra,y,Io),splitCellIntoColumns:zi(function(e,t,n,r){var o=du(e,t.row(),t.column(),n,r.getOrInit);return Zu(o,t.row(),t.column())},Ui,ra,y,Io),splitCellIntoRows:zi(function(e,t,n,r){var o=mu(e,t.row(),t.column(),n,r.getOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Io),eraseColumns:zi(function(e,t,n,r){var o=ta(t),i=hu(e,o[0].column(),o[o.length-1].column()),u=$u(i,t[0].row(),t[0].column());return Ju(i,u)},Vi,ra,Ku,Io),eraseRows:zi(function(e,t,n,r){var o=ea(t),i=gu(e,o[0].row(),o[o.length-1].row()),u=$u(i,t[0].row(),t[0].column());return Ju(i,u)},Vi,y,Ku,Io),makeColumnHeader:zi(function(e,t,n,r){var o=wu(e,t.column(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo("row","th")),unmakeColumnHeader:zi(function(e,t,n,r){var o=wu(e,t.column(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo(null,"td")),makeRowHeader:zi(function(e,t,n,r){var o=yu(e,t.row(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo("col","th")),unmakeRowHeader:zi(function(e,t,n,r){var o=yu(e,t.row(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo(null,"td")),mergeCells:zi(function(e,t,n,r){var o=t.cells();Go(o);var i=iu(e,t.bounds(),n,C(o[0]));return Ju(i,S.from(o[0]))},Xi,y,y,Mo),unmergeCells:zi(function(e,t,n,r){var o=I(t,function(e,t){return uu(e,t,n,r.combine(t))},e);return Ju(o,S.from(t[0]))},Ki,ra,y,Mo),pasteCells:zi(function(e,n,t,r){var o,i,u,a,c=(o=n.clipboard(),i=n.generators(),u=Ht(o),a=Yt.generate(u),ri(a,i,!0)),l=ae.address(n.row(),n.column());return cu(l,e,c,n.generators(),t).fold(function(){return Ju(e,S.some(n.element()))},function(e){var t=$u(e,n.row(),n.column());return Ju(e,t)})},Gi,ra,y,Io),pasteRowsBefore:zi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=na(t.clipboard(),t.generators(),o),a=lu(i,e,u,t.generators(),n),c=$u(a,t.cells[0].row(),t.cells[0].column());return Ju(a,c)},Yi,y,y,Io),pasteRowsAfter:zi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=na(t.clipboard(),t.generators(),o),a=lu(i,e,u,t.generators(),n),c=$u(a,t.cells[0].row(),t.cells[0].column());return Ju(a,c)},Yi,y,y,Io)},ia=function(e){return le.fromDom(e.getBody())},ua=function(e){return e.getBoundingClientRect().width},aa=function(e){return e.getBoundingClientRect().height},ca=function(t){return function(e){return $e.eq(e,ia(t))}},la=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},fa=function(e){var t=St.descendants(e,"td[data-mce-style],th[data-mce-style]");bt.remove(e,"data-mce-style"),k(t,function(e){bt.remove(e,"data-mce-style")})},sa=function(e){return"rtl"===en.get(e,"direction")?"rtl":"ltr"},da={onDirection:function(t,n){return function(e){return"rtl"===sa(e)?n:t}},getDirection:sa},ma={isRtl:C(!1)},ga={isRtl:C(!0)},ha={directionAt:function(e){return"rtl"===da.getDirection(e)?ga:ma}},pa=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],va={"border-collapse":"collapse",width:"100%"},ba={border:"1"},wa=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},ya=function(e){return e.getParam("table_row_advtab",!0,"boolean")},xa=function(e){return e.getParam("table_advtab",!0,"boolean")},Ca=function(e){return e.getParam("table_style_by_css",!1,"boolean")},Ra=function(e){return e.getParam("table_cell_class_list",[],"array")},Sa=function(e){return e.getParam("table_row_class_list",[],"array")},Ta=function(e){return e.getParam("table_class_list",[],"array")},Na=function(e){return!1===e.getParam("table_responsive_width")},Da=function(e,t){return e.fire("newrow",{node:t})},Ea=function(e,t){return e.fire("newcell",{node:t})},Oa=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Aa=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},ka=function(f,e){var t,n=function(e){return"table"===mt.name(ia(e))},s=(t=f.getParam("table_clone_elements"),v(t)?S.some(t.split(/[ ,]/)):Array.isArray(t)?S.some(t):S.none()),r=function(u,a,c,l){return function(e,t){fa(e);var n=l(),r=le.fromDom(f.getDoc()),o=So(ha.directionAt),i=En(c,r,s);return a(e)?u(n,e,t,i,o).bind(function(e){return k(e.newRows(),function(e){Da(f,e.dom())}),k(e.newCells(),function(e){Ea(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):S.none()}};return{deleteRow:r(oa.eraseRows,function(e){var t=No(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(oa.eraseColumns,function(e){var t=No(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(oa.insertRowsBefore,l,y,e),insertRowsAfter:r(oa.insertRowsAfter,l,y,e),insertColumnsBefore:r(oa.insertColumnsBefore,l,ro,e),insertColumnsAfter:r(oa.insertColumnsAfter,l,ro,e),mergeCells:r(oa.mergeCells,l,y,e),unmergeCells:r(oa.unmergeCells,l,y,e),pasteRowsBefore:r(oa.pasteRowsBefore,l,y,e),pasteRowsAfter:r(oa.pasteRowsAfter,l,y,e),pasteCells:r(oa.pasteCells,l,y,e)}},Pa=function(e,t,r){var n=Ht(e),o=Yt.generate(n);return Vi(o,t).map(function(e){var t=ri(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=Hi(t,r);return ui(n)})},Ia=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ba=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},Ma=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},Wa=function(t,n){Ia.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},_a=function(t,n){Ia.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},La=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},qa=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?la(o.width):"",i.height=o.height?la(o.height):"",r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(i))))},Fa=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);r.find("#borderStyle").value(i["border-style"]||""),r.find("#borderColor").value(i["border-color"]||""),r.find("#backgroundColor").value(i["background-color"]||""),r.find("#width").value(i.width||""),r.find("#height").value(i.height||"")},ja={createStyleForm:function(n){var e=function(){var e=n.getParam("color_picker_callback");if(e)return function(t){return e.call(n,function(e){t.control.value(e).fire("change")},t.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:R(qa,n)},items:[{label:"Style",name:"style",type:"textbox",onchange:R(Fa,n)},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:R(qa,n),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}},buildListItems:function(e,r,t){var o=function(e,n){return n=n||[],Ia.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},updateStyleField:qa,extractAdvancedStyles:function(e,t){var n=e.parseStyle(e.getAttrib(t,"style")),r={};return n["border-style"]&&(r.borderStyle=n["border-style"]),n["border-color"]&&(r.borderColor=n["border-color"]),n["background-color"]&&(r.backgroundColor=n["background-color"]),r.style=e.serializeStyle(n),r},updateAdvancedFields:Fa,syncAdvancedStyleFields:function(e,t){t.control.rootControl.find("#style")[0].getEl().isEqualNode(document.activeElement)?Fa(e,t):qa(e,t)}},za=function(r,o,e){var i,u=r.dom;function a(e,t,n){(1===o.length||n)&&u.setAttrib(e,t,n)}function c(e,t,n){(1===o.length||n)&&u.setStyle(e,t,n)}wa(r)&&ja.syncAdvancedStyleFields(r,e),i=e.control.rootControl.toJSON(),r.undoManager.transact(function(){Ia.each(o,function(e){var t,n;a(e,"scope",i.scope),1===o.length?a(e,"style",i.style):(t=e,n=i.style,delete t.dataset.mceStyle,t.style.cssText+=";"+n),a(e,"class",i["class"]),c(e,"width",la(i.width)),c(e,"height",la(i.height)),i.type&&e.nodeName.toLowerCase()!==i.type&&(e=u.rename(e,i.type)),1===o.length&&(Wa(r,e),_a(r,e)),i.align&&Ba(r,e,i.align),i.valign&&Ma(r,e,i.valign)}),r.focus()})},Ha=function(t){var e,n,r,o=[];if(o=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!o.length&&e&&o.push(e),e=e||o[0]){var i,u,a,c;1<o.length?n={width:"",height:"",scope:"","class":"",align:"",valign:"",style:"",type:e.nodeName.toLowerCase()}:(u=e,a=(i=t).dom,c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class"),type:u.nodeName.toLowerCase(),style:"",align:"",valign:""},Ia.each("left center right".split(" "),function(e){i.formatter.matchNode(u,"align"+e)&&(c.align=e)}),Ia.each("top middle bottom".split(" "),function(e){i.formatter.matchNode(u,"valign"+e)&&(c.valign=e)}),wa(i)&&Ia.extend(c,ja.extractAdvancedStyles(a,u)),n=c),0<Ra(t).length&&(r={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Ra(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[e.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};wa(t)?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:l},ja.createStyleForm(t)],onsubmit:R(za,t,o)}):t.windowManager.open({title:"Cell properties",data:n,body:l,onsubmit:R(za,t,o)})}};function Ua(f,s,d,e){var m=f.dom;function g(e,t,n){(1===s.length||n)&&m.setAttrib(e,t,n)}ya(f)&&ja.syncAdvancedStyleFields(f,e);var h=e.control.rootControl.toJSON();f.undoManager.transact(function(){Ia.each(s,function(e){var t,n,r,o,i,u,a,c,l;g(e,"scope",h.scope),g(e,"style",h.style),g(e,"class",h["class"]),t=e,n="height",r=la(h.height),(1===s.length||r)&&m.setStyle(t,n,r),h.type!==e.parentNode.nodeName.toLowerCase()&&(o=f.dom,i=e,u=h.type,a=o.getParent(i,"table"),c=i.parentNode,(l=o.select(u,a)[0])||(l=o.create(u),a.firstChild?"CAPTION"===a.firstChild.nodeName?o.insertAfter(l,a.firstChild):a.insertBefore(l,a.firstChild):a.appendChild(l)),l.appendChild(i),c.hasChildNodes()||o.remove(c)),h.align!==d.align&&(Wa(f,e),Ba(f,e,h.align))}),f.focus()})}var Va=function(t){var e,n,r,o,i,u,a,c,l,f,s=t.dom,d=[];e=s.getParent(t.selection.getStart(),"table"),n=s.getParent(t.selection.getStart(),"td,th"),Ia.each(e.rows,function(t){Ia.each(t.cells,function(e){if(s.getAttrib(e,"data-mce-selected")||e===n)return d.push(t),!1})}),(r=d[0])&&(1<d.length?i={height:"",scope:"",style:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=t).dom,f={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class"),align:"",style:"",type:c.parentNode.nodeName.toLowerCase()},Ia.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),ya(a)&&Ia.extend(f,ja.extractAdvancedStyles(l,c)),i=f),0<Sa(t).length&&(o={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Sa(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},ya(t)?t.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},ja.createStyleForm(t)],onsubmit:R(Ua,t,d,i)}):t.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:R(Ua,t,d,i)}))},Ga=tinymce.util.Tools.resolve("tinymce.Env"),Ya={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Xa=function(e,t,n,r,o){void 0===o&&(o=Ya);var i=le.fromTag("table");en.setAll(i,o.styles),bt.setAll(i,o.attributes);var u=le.fromTag("tbody");rn.append(i,u);for(var a=[],c=0;c<e;c++){for(var l=le.fromTag("tr"),f=0;f<t;f++){var s=c<n||f<r?le.fromTag("th"):le.fromTag("td");f<r&&bt.set(s,"scope","row"),c<n&&bt.set(s,"scope","col"),rn.append(s,le.fromTag("br")),o.percentages&&en.set(s,"width",100/t+"%"),rn.append(l,s)}a.push(l)}return on.append(u,a),i},Ka=function(e){return e.dom().innerHTML},Ja=function(e){var t=le.fromTag("div"),n=le.fromDom(e.dom().cloneNode(!0));return rn.append(t,n),Ka(t)},$a=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},Qa=function(o,e,t){var n,r,i=o.getParam("table_default_styles",va,"object"),u={styles:i,attributes:(r=o,r.getParam("table_default_attributes",ba,"object")),percentages:(n=i.width,v(n)&&-1!==n.indexOf("%")&&!Na(o))},a=Xa(t,e,0,0,u);bt.set(a,"data-mce-id","__mce");var c=Ja(a);return o.insertContent(c),Wt.descendant(ia(o),'table[data-mce-id="__mce"]').map(function(e){var t,n,r;return Na(o)&&en.set(e,"width",en.get(e,"width")),bt.remove(e,"data-mce-id"),t=o,k(St.descendants(e,"tr"),function(e){Da(t,e.dom()),k(St.descendants(e,"th,td"),function(e){Ea(t,e.dom())})}),n=o,r=e,Wt.descendant(r,"td,th").each(R($a,n)),e.dom()}).getOr(null)};function Za(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)Za(e,t.children[o],n,r)}var ec=function(e,t,n){var r,o,i=e.dom;xa(e)&&ja.syncAdvancedStyleFields(e,n),!1===(o=n.control.rootControl.toJSON())["class"]&&delete o["class"],e.undoManager.transact(function(){t||(t=Qa(e,o.cols||1,o.rows||1)),function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=la(n.height),o.getAttrib(t,"width")&&!Ca(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=la(n.width),Ca(e)?(u["border-width"]=la(n.border),u["border-spacing"]=la(n.cellspacing),Ia.extend(i,{"data-mce-border-color":n.borderColor,"data-mce-cell-padding":n.cellpadding,"data-mce-border":n.border})):Ia.extend(i,{border:n.border,cellpadding:n.cellpadding,cellspacing:n.cellspacing}),Ca(e)&&t.children)for(var a=0;a<t.children.length;a++)Za(o,t.children[a],{"border-width":la(n.border),"border-color":n.borderColor,padding:la(n.cellpadding)});n.style?Ia.extend(u,o.parseStyle(n.style)):u=Ia.extend({},o.parseStyle(o.getAttrib(t,"style")),u),i.style=o.serializeStyle(u),o.setAttribs(t,i)}(e,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=Ga.ie?"\xa0":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),Wa(e,t),o.align&&Ba(e,t,o.align),e.focus(),e.addVisual()})},tc=function(t,e){var n,r,o,i,u,a,c,l,f,s,d=t.dom,m={};!0===e?(n=d.getParent(t.selection.getStart(),"table"))&&(c=n,l=(a=t).dom,f={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||La(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||La(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},Ia.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),xa(a)&&Ia.extend(f,ja.extractAdvancedStyles(l,c)),m=f):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),0<Ta(t).length&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Ta(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(s=t,s.getParam("table_appearance_options",!0,"boolean")?[r,o,{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)}])},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},xa(t)?t.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},ja.createStyleForm(t)],onsubmit:R(ec,t,n)}):t.windowManager.open({title:"Table properties",data:m,body:u,onsubmit:R(ec,t,n)})},nc=Ia.each,rc=function(a,t,c,l,n){var r=ca(a),f=function(){return le.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"))},s=function(e){return zt.table(e,r)},d=function(e){return{width:ua(e.dom()),height:ua(e.dom())}},o=function(t){var n=f();s(n).each(function(i){var e=Mr.forMenu(l,i,n),u=d(i);t(i,e).each(function(e){var t,n,r,o;t=a,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(Oa(t,r.dom(),n.width,n.height),Aa(t,r.dom(),o.width,o.height)),a.selection.setRng(e),a.focus(),c.clear(i),fa(i)})})},i=function(e){var o=f();return s(o).bind(function(e){var t=le.fromDom(a.getDoc()),n=Mr.forMenu(l,e,o),r=En(y,t,S.none());return Pa(e,n,r)})},u=function(u){n.get().each(function(e){var o=A(e,function(e){return gn(e)}),i=f();s(i).bind(function(t){var e=le.fromDom(a.getDoc()),n=On(e),r=Mr.pasteRows(l,t,i,o,n);u(t,r).each(function(e){a.selection.setRng(e),a.focus(),c.clear(t)})})})};nc({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){n.set(i()),o(t.deleteRow)},mceTableCopyRow:function(e){n.set(i())},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){var e=le.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"));zt.table(e,r).filter(m(r)).each(function(e){var t=le.fromText("");rn.after(e,t),an.remove(e);var n=a.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),a.selection.setRng(n)})}},function(e,t){a.addCommand(t,e)}),nc({mceInsertTable:R(tc,a),mceTableProps:R(tc,a,!0),mceTableRowProps:R(Va,a),mceTableCellProps:R(Ha,a)},function(n,e){a.addCommand(e,function(e,t){n(t)})})},oc=function(e){var t=S.from(e.dom().documentElement).map(le.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(ao(0,0))}},ic=function(e,t){return{parent:C(t),view:C(e),origin:C(ao(0,0))}};function uc(e){var n=X.apply(null,e),r=[];return{bind:function(e){if(e===undefined)throw"Event bind error: undefined handler";r.push(e)},unbind:function(t){r=P(r,function(e){return e!==t})},trigger:function(){var t=n.apply(null,arguments);k(r,function(e){e(t)})}}}var ac={create:function(e){return{registry:G(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:G(e,function(e){return e.trigger})}}},cc={mode:Ao(["compare","extract","mutate","sink"]),sink:Ao(["element","start","stop","destroy"]),api:Ao(["forceDrop","drop","move","delayDrop"])},lc={resolve:hi("ephox-dragster").resolve},fc=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,a,c=le.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=c,n=e.clientX,r=e.clientY,o=l,i=f,u=s,a=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(a)});g(d)}}},sc=function(e,t,n,r,o){var i=fc(n,r);return e.dom().addEventListener(t,i,o),{unbind:R(dc,e,t,i,o)}},dc=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},mc=function(e,t,n,r){return sc(e,t,n,r,!1)},gc=function(e,t,n,r){return sc(e,t,n,r,!0)},hc=C(!0),pc={bind:function(e,t,n){return mc(e,t,hc,n)},capture:function(e,t,n){return gc(e,t,hc,n)}},vc=cc.mode({compare:function(e,t){return ao(t.left()-e.left(),t.top()-e.top())},extract:function(e){return S.some(ao(e.x(),e.y()))},sink:function(e,t){var n,r,o,i=(n=t,r=Xo({layerClass:lc.resolve("blocker")},n),o=le.fromTag("div"),bt.set(o,"role","presentation"),en.setAll(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ai.add(o,lc.resolve("blocker")),Ai.add(o,r.layerClass),{element:function(){return o},destroy:function(){an.remove(o)}}),u=pc.bind(i.element(),"mousedown",e.forceDrop),a=pc.bind(i.element(),"mouseup",e.drop),c=pc.bind(i.element(),"mousemove",e.move),l=pc.bind(i.element(),"mouseout",e.delayDrop);return cc.sink({element:i.element,start:function(e){rn.append(e,i.element())},stop:function(){an.remove(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function bc(){var i=S.none(),u=ac.create({move:uc(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=S.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=S.none()},events:u.registry}}function wc(){var e={onEvent:function(e,t){},reset:y},t=bc(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var yc=function(t,n,e){var r,o,i,u=!1,a=ac.create({start:uc([]),stop:uc([])}),c=wc(),l=function(){d.stop(),c.isOn()&&(c.off(),a.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&clearTimeout(i),i=setTimeout(function(){r.apply(null,e),i=null},o)}});c.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);if(u)return t.apply(null,e)}},d=n.sink(cc.api({forceDrop:l,drop:s(l),move:s(function(e,t){f.cancel(),c.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),c.on(),a.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:a.registry}},xc={transform:function(e,t){var n=t!==undefined?t:{},r=n.mode!==undefined?n.mode:vc;return yc(e,r,t)}};function Cc(){var n,r=ac.create({drag:uc(["xDelta","yDelta","target"])}),o=S.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=ac.create({drag:uc(["xDelta","yDelta"])})).registry};return e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){o=S.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}}var Rc={any:function(e){return Wt.first(e).isSome()},ancestor:function(e,t,n){return Wt.ancestor(e,t,n).isSome()},sibling:function(e,t){return Wt.sibling(e,t).isSome()},child:function(e,t){return Wt.child(e,t).isSome()},descendant:function(e,t){return Wt.descendant(e,t).isSome()},closest:function(e,t,n){return Wt.closest(e,t,n).isSome()}},Sc=pi.resolve("resizer-bar-dragging");function Tc(e,n){var r=Co.height,t=function(o,t,i){var n=Cc(),r=xc.transform(n,{}),u=S.none(),e=function(e,t){return S.from(bt.get(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Ou.getInt(n.target(),"top");en.set(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Ou.getInt(n.target(),"left");en.set(n.target(),"left",t+n.xDelta()+"px")})});var a=function(e,t){return Ou.getInt(e,t)-parseInt(bt.get(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=a(r,"top");bt.remove(r,"data-initial-top"),d.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=a(r,"left");bt.remove(r,"data-initial-left"),d.trigger.adjustWidth(n,t,parseInt(e,10))}),Li.refresh(o,n,i,t)})})});var c=function(e,t){d.trigger.startAdjust(),n.assign(e),bt.set(e,"data-initial-"+t,parseInt(en.get(e,t),10)),Ai.add(e,Sc),en.set(e,"opacity","0.2"),r.go(o.parent())},l=pc.bind(o.parent(),"mousedown",function(e){Li.isRowBar(e.target())&&c(e.target(),"top"),Li.isColBar(e.target())&&c(e.target(),"left")}),f=function(e){return $e.eq(e,o.view())},s=pc.bind(o.view(),"mouseover",function(e){"table"===mt.name(e.target())||Rc.closest(e.target(),"table",f)?(u="table"===mt.name(e.target())?S.some(e.target()):Wt.ancestor(e.target(),"table",f)).each(function(e){Li.refresh(o,e,i,t)}):xt.inBody(e.target())&&Li.destroy(o)}),d=ac.create({adjustHeight:uc(["table","delta","row"]),adjustWidth:uc(["table","delta","column"]),startAdjust:uc([])});return{destroy:function(){l.unbind(),s.unbind(),r.destroy(),Li.destroy(o)},refresh:function(e){Li.refresh(o,e,i,t)},on:r.on,off:r.off,hideBars:R(Li.hide,o),showBars:R(Li.show,o),events:d.registry}}(e,n,r),o=ac.create({beforeResize:uc(["table"]),afterResize:uc(["table"]),startDrag:uc([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());Yu(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());Gu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}var Nc=function(e,t){return e.inline?ic(ia(e),(n=le.fromTag("div"),en.setAll(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),rn.append(xt.body(),n),n)):oc(le.fromDom(e.getDoc()));var n},Dc=function(e,t){e.inline&&an.remove(t.parent())},Ec=function(u){var a,c,o=S.none(),i=S.none(),l=S.none(),f=/(\d+(\.\d+)?)%/,s=function(e){return"TABLE"===e.nodeName};return u.on("init",function(){var e,t=So(ha.directionAt),n=Nc(u);if(l=S.some(n),("table"===(e=u.getParam("object_resizing",!0))||e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=Tc(n,t);r.on(),r.events.startDrag.bind(function(e){o=S.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();Oa(u,t,ua(t),aa(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();fa(t),o.each(function(e){u.selection.setRng(e),u.focus()}),Aa(u,n,ua(n),aa(n)),u.undoManager.add()}),i=S.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n=e.target;s(n)&&(a=e.width,t=n,c=u.dom.getStyle(t,"width")||u.dom.getAttrib(t,"width"))}),u.on("ObjectResized",function(e){var t=e.target;if(s(t)){var n=t;if(f.test(c)){var r=parseFloat(f.exec(c)[1]),o=e.width*r/a;u.dom.setStyle(n,"width",o+"%")}else{var i=[];Ia.each(n.rows,function(e){Ia.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),Ia.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(oc(le.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),l.each(function(e){Dc(u,e)})}}},Oc=function(e){return{fold:e}},Ac=function(o){return Oc(function(e,t,n,r){return e(o)})},kc=function(o){return Oc(function(e,t,n,r){return t(o)})},Pc=function(o,i){return Oc(function(e,t,n,r){return n(o,i)})},Ic=function(o){return Oc(function(e,t,n,r){return r(o)})},Bc=function(n,e){return zt.table(n,e).bind(function(e){var t=zt.cells(e);return W(t,function(e){return $e.eq(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},Mc=function(t,e){return Bc(t,e).fold(function(){return Ac(t)},function(e){return e.index()+1<e.all().length?Pc(t,e.all()[e.index()+1]):Ic(t)})},Wc=function(t,e){return Bc(t,e).fold(function(){return Ac()},function(e){return 0<=e.index()-1?Pc(t,e.all()[e.index()-1]):kc(t)})},_c=Nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Lc={before:_c.before,on:_c.on,after:_c.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(u,u,u)}},qc=Nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Fc=X("start","soffset","finish","foffset"),jc={domRange:qc.domRange,relative:qc.relative,exact:qc.exact,exactFromRange:function(e){return qc.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:Fc,getWin:function(e){var t=e.match({domRange:function(e){return le.fromDom(e.startContainer)},relative:function(e,t){return Lc.getStart(e)},exact:function(e,t,n,r){return e}});return ot.defaultView(t)}},zc=function(e,t,n,r){var o=ot.owner(e).dom().createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},Hc=function(e,t,n,r){var o=zc(e,t,n,r),i=$e.eq(e,n)&&t===r;return o.collapsed&&!i},Uc=function(e,t){e.selectNodeContents(t.dom())},Vc=function(e){e.deleteContents()},Gc=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},Yc={create:function(e){return e.document.createRange()},replaceWith:function(e,t){Vc(e),e.insertNode(t.dom())},selectNodeContents:function(e,t){var n=e.document.createRange();return Uc(n,t),n},selectNodeContentsUsing:Uc,relativeToNative:function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},exactToNative:function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},deleteContents:Vc,cloneFragment:function(e){var t=e.cloneContents();return le.fromDom(t)},getFirstRect:function(e){var t=e.getClientRects(),n=0<t.length?t[0]:e.getBoundingClientRect();return 0<n.width||0<n.height?S.some(n).map(Gc):S.none()},getBounds:function(e){var t=e.getBoundingClientRect();return 0<t.width||0<t.height?S.some(t).map(Gc):S.none()},isWithin:function(e,t){return t.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<t.compareBoundaryPoints(e.START_TO_END,e)},toString:function(e){return e.toString()}},Xc=Nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Kc=function(e,t,n){return t(le.fromDom(n.startContainer),n.startOffset,le.fromDom(n.endContainer),n.endOffset)},Jc=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:S.none}},relative:function(e,t){return{ltr:Ce(function(){return Yc.relativeToNative(o,e,t)}),rtl:Ce(function(){return S.some(Yc.relativeToNative(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Ce(function(){return Yc.exactToNative(o,e,t,n,r)}),rtl:Ce(function(){return S.some(Yc.exactToNative(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Xc.rtl(le.fromDom(e.endContainer),e.endOffset,le.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Kc(0,Xc.ltr,r)}):Kc(0,Xc.ltr,r)},$c={ltr:Xc.ltr,rtl:Xc.rtl,diagnose:Jc,asLtrRange:function(i,e){return Jc(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})}},Qc=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Zc=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var a=e(u),c=Math.abs(t-a.left);if(n<=a.bottom){if(n<a.top||i<c)return u-1;i=c}}return 0},el={locate:function(l,f,s,d){var e=l.dom().createRange();e.selectNode(f.dom());var t=e.getClientRects();return Jo(t,function(e){return Qc(e,s,d)?S.some(e):S.none()}).map(function(e){return n=l,t=s,o=d,i=e,u=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},a=vn.get(r=f).length,c=Zc(function(e){return u(e).getBoundingClientRect()},t,o,i.right,a),u(c);var n,r,t,o,i,u,a,c})}},tl=function(t,e,n,r){var o=t.dom().createRange(),i=ot.children(e);return Jo(i,function(e){return o.selectNode(e.dom()),Qc(o.getBoundingClientRect(),n,r)?nl(t,e,n,r):S.none()})},nl=function(e,t,n,r){return(mt.isText(t)?el.locate:tl)(e,t,n,r)},rl=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return nl(e,t,u,a)},ol=function(e,t){return t-e.left<e.right-t},il=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},ul=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=ol(o,n);return(!0===i?Rn.first:Rn.last)(e).map(function(e){return il(t,e,i)})},al=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=ol(r,n);return S.some(il(e,t,o))},cl=function(e,t,n){return(0===ot.children(t).length?al:ul)(e,t,n)},ll=document.caretPositionFromPoint?function(n,e,t){return S.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return S.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),S.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return S.from(e.dom().caretRangeFromPoint(t,n))}:function(n,r,o){return le.fromPoint(n,r,o).bind(function(e){var t=function(){return cl(n,e,r)};return 0===ot.children(e).length?t():function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return rl(e,t,u,a)}(n,e,r,o).orThunk(t)})},fl=function(e,t,n){var r=le.fromDom(e.document);return ll(r,t,n).map(function(e){return jc.range(le.fromDom(e.startContainer),e.startOffset,le.fromDom(e.endContainer),e.endOffset)})},sl=function(e,t){var n=mt.name(e);return"input"===n?Lc.after(e):E(["br","img"],n)?0===t?Lc.before(e):Lc.after(e):Lc.on(e,t)},dl=function(e,t){var n=e.fold(Lc.before,sl,Lc.after),r=t.fold(Lc.before,sl,Lc.after);return jc.relative(n,r)},ml=function(e,t,n,r){var o=sl(e,t),i=sl(n,r);return jc.relative(o,i)},gl=function(e){return e.match({domRange:function(e){var t=le.fromDom(e.startContainer),n=le.fromDom(e.endContainer);return ml(t,e.startOffset,n,e.endOffset)},relative:dl,exact:ml})},hl=dl,pl=ml,vl=function(e,t){S.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},bl=function(e,t,n,r,o){var i=Yc.exactToNative(e,t,n,r,o);vl(e,i)},wl=function(s,e){return $c.diagnose(s,e).match({ltr:function(e,t,n,r){bl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,a,c,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,a=n,c=r,(o=l).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){bl(s,n,r,e,t)}else bl(s,n,r,e,t)}})},yl=function(e){var t=le.fromDom(e.anchorNode),n=le.fromDom(e.focusNode);return Hc(t,e.anchorOffset,n,e.focusOffset)?S.some(jc.range(le.fromDom(e.anchorNode),e.anchorOffset,le.fromDom(e.focusNode),e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return S.some(jc.range(le.fromDom(t.startContainer),t.startOffset,le.fromDom(n.endContainer),n.endOffset))}return S.none()}(e)},xl=function(e){return S.from(e.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(yl)},Cl=function(e,t,n,r,o){var i=pl(t,n,r,o);wl(e,i)},Rl=function(e){return xl(e).map(function(e){return jc.exact(e.start(),e.soffset(),e.finish(),e.foffset())})},Sl=function(e,t,n){var r=hl(t,n);wl(e,r)},Tl=function(e){var o=jc.getWin(e).dom(),t=function(e,t,n,r){return Yc.exactToNative(o,e,t,n,r)},n=gl(e);return $c.diagnose(o,n).match({ltr:t,rtl:t})},Nl=function(e,t){var n=Yc.selectNodeContents(e,t);vl(e,n)},Dl=function(e){e.getSelection().removeAllRanges()},El=function(e,t){var n=$c.asLtrRange(e,t);return Yc.getFirstRect(n)},Ol=function(e,t,n){return fl(e,t,n)},Al=tinymce.util.Tools.resolve("tinymce.util.VK"),kl=function(e,t,n,r){return Ml(e,t,Mc(n),r)},Pl=function(e,t,n,r){return Ml(e,t,Wc(n),r)},Il=function(e,t){var n=jc.exact(t,0,t,0);return Tl(n)},Bl=function(e,t){var n,r=St.descendants(t,"tr");return(n=r,0===n.length?S.none():S.some(n[n.length-1])).bind(function(e){return Wt.descendant(e,"td,th").map(function(e){return Il(0,e)})})},Ml=function(r,e,t,o,n){return t.fold(S.none,S.none,function(e,t){return Rn.first(t).map(function(e){return Il(0,e)})},function(n){return zt.table(n,e).bind(function(e){var t=Mr.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Bl(0,e)})})},Wl=["table","li","dl"],_l=function(t,n,r,o){if(t.keyCode===Al.TAB){var i=ia(n),u=function(e){var t=mt.name(e);return $e.eq(e,i)||E(Wl,t)},e=n.selection.getRng();if(e.collapsed){var a=le.fromDom(e.startContainer);zt.cell(a,u).each(function(e){t.preventDefault(),(t.shiftKey?Pl:kl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},Ll={response:X("selection","kill")},ql=function(t){return function(e){return e===t}},Fl=ql(38),jl=ql(40),zl={ltr:{isBackward:ql(37),isForward:ql(39)},rtl:{isBackward:ql(39),isForward:ql(37)},isUp:Fl,isDown:jl,isNavigation:function(e){return 37<=e&&e<=40}},Hl=function(e,t){var n=$c.asLtrRange(e,t);return{start:C(le.fromDom(n.startContainer)),soffset:C(n.startOffset),finish:C(le.fromDom(n.endContainer)),foffset:C(n.endOffset)}},Ul=function(e,t,n,r){return{start:C(Lc.on(e,t)),finish:C(Lc.on(n,r))}},Vl=(Xe.detect().browser.isSafari(),function(e){var t=e!==undefined?e.dom():document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return ao(n,r)}),Gl=Vl,Yl=function(e,t,n){(n!==undefined?n.dom():document).defaultView.scrollBy(e,t)};function Xl(i){return{elementFromPoint:function(e,t){return le.fromPoint(le.fromDom(i.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=jc.exact(e,t,n,r);return El(i,o).map(function(e){return G(e,a)})},getSelection:function(){return Rl(i).map(function(e){return Hl(i,e)})},fromSitus:function(e){var t=jc.relative(e.start(),e.finish());return Hl(i,t)},situsFromPoint:function(e,t){return Ol(i,e,t).map(function(e){return{start:C(Lc.on(e.start(),e.soffset())),finish:C(Lc.on(e.finish(),e.foffset()))}})},clearSelection:function(){Dl(i)},setSelection:function(e){Cl(i,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,t){Sl(i,e,t)},selectContents:function(e){Nl(i,e)},getInnerHeight:function(){return i.innerHeight},getScrollY:function(){return Gl(le.fromDom(i.document)).top()},scrollBy:function(e,t){Yl(e,t,le.fromDom(i.document))}}}var Kl=function(n,e,r,t,o){return $e.eq(r,t)?S.none():pr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),S.some(Ll.response(S.some(Ul(r,0,r,yn(r))),!0))):S.none()})},Jl={sync:function(n,r,e,t,o,i,u){return $e.eq(e,o)&&t===i?S.none():Wt.closest(e,"td,th",r).bind(function(t){return Wt.closest(o,"td,th",r).bind(function(e){return Kl(n,r,t,e,u)})})},detect:Kl,update:function(e,t,n,r,o){return br(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},$l=ee(["left","top","right","bottom"],[]),Ql={nu:$l,moveUp:function(e,t){return $l({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return $l({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return $l({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Zl=function(e){return Ql.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},ef=function(e,t){return S.some(e.getRect(t))},tf=function(e,t,n){return mt.isElement(t)?ef(e,t).map(Zl):mt.isText(t)?(r=e,o=t,i=n,0<=i&&i<yn(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):S.none()).map(Zl):S.none();var r,o,i},nf=function(e,t){return mt.isElement(t)?ef(e,t).map(Zl):mt.isText(t)?e.getRangedRect(t,0,t,yn(t)).map(Zl):S.none()},rf=X("item","mode"),of=function(e,t,n,r){var o=r!==undefined?r:uf;return e.property().parent(t).map(function(e){return rf(e,o)})},uf=function(e,t,n,r){var o=r!==undefined?r:af;return n.sibling(e,t).map(function(e){return rf(e,o)})},af=function(e,t,n,r){var o=r!==undefined?r:af,i=e.property().children(t);return n.first(i).map(function(e){return rf(e,o)})},cf=[{current:of,next:uf,fallback:S.none()},{current:uf,next:af,fallback:S.some(of)},{current:af,next:af,fallback:S.some(uf)}],lf=function(t,n,r,o,e){return e=e!==undefined?e:cf,M(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return lf(t,n,e,o)})})})},ff={backtrack:of,sidestep:uf,advance:af,go:lf},sf={left:function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?S.some(e[e.length-1]):S.none()}}},right:function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?S.some(e[0]):S.none()}}}},df=function(t,e,n,r,o,i){return ff.go(t,e,r,o).bind(function(e){return i(e.item())?S.none():n(e.item())?S.some(e.item()):df(t,e.item(),n,e.mode(),o,i)})},mf=function(e,t,n,r){return df(e,t,n,ff.sidestep,sf.left(),r)},gf=function(e,t,n,r){return df(e,t,n,ff.sidestep,sf.right(),r)},hf=function(e,t){return 0===e.property().children(t).length},pf=function(e,t,n,r){return mf(e,t,n,r)},vf=function(e,t,n,r){return gf(e,t,n,r)},bf={before:function(e,t,n){return pf(e,t,R(hf,e),n)},after:function(e,t,n){return vf(e,t,R(hf,e),n)},seekLeft:pf,seekRight:vf,walkers:function(){return{left:sf.left,right:sf.right}},walk:function(e,t,n,r,o){return ff.go(e,t,n,r,o)},backtrack:ff.backtrack,sidestep:ff.sidestep,advance:ff.advance},wf=Pn(),yf={gather:function(e,t,n){return bf.gather(wf,e,t,n)},before:function(e,t){return bf.before(wf,e,t)},after:function(e,t){return bf.after(wf,e,t)},seekLeft:function(e,t,n){return bf.seekLeft(wf,e,t,n)},seekRight:function(e,t,n){return bf.seekRight(wf,e,t,n)},walkers:function(){return bf.walkers()},walk:function(e,t,n,r){return bf.walk(wf,e,t,n,r)}},xf=Nr([{none:[]},{retry:["caret"]}]),Cf=function(t,e,r){return Bt.closest(e,Ho).fold(C(!1),function(e){return nf(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})})},Rf={point:Ql.getTop,adjuster:function(e,t,n,r,o){var i=Ql.moveUp(o,5);return Math.abs(n.top()-r.top())<1?xf.retry(i):n.bottom()<o.top()?xf.retry(i):n.bottom()===o.top()?xf.retry(Ql.moveUp(o,1)):Cf(e,t,o)?xf.retry(Ql.translate(i,5,0)):xf.none()},move:Ql.moveUp,gather:yf.before},Sf={point:Ql.getBottom,adjuster:function(e,t,n,r,o){var i=Ql.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?xf.retry(i):n.top()>o.bottom()?xf.retry(i):n.top()===o.bottom()?xf.retry(Ql.moveDown(o,1)):Cf(e,t,o)?xf.retry(Ql.translate(i,5,0)):xf.none()},move:Ql.moveDown,gather:yf.after},Tf=function(n,r,o,i,u){return 0===u?S.some(i):(c=n,l=i.left(),f=r.point(i),c.elementFromPoint(l,f).filter(function(e){return"table"===mt.name(e)}).isSome()?(t=i,a=u-1,Tf(n,e=r,o,e.move(t,5),a)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(S.none,function(t,e){return nf(n,t,e).bind(function(e){return r.adjuster(n,t,e,o,i).fold(S.none,function(e){return Tf(n,r,o,e,u-1)})}).orThunk(function(){return S.some(i)})},S.none)}));var e,t,a,c,l,f},Nf=function(t,n,e){var r,o,i,u=t.move(e,5),a=Tf(n,t,e,u,100).getOr(u);return(r=t,o=a,i=n,r.point(o)>i.getInnerHeight()?S.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return n.situsFromPoint(a.left(),t.point(a))},function(e){return n.scrollBy(0,e),n.situsFromPoint(a.left(),t.point(a)-e)})},Df={tryUp:R(Nf,Rf),tryDown:R(Nf,Sf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},Ef=Nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Of=function(e){return Wt.closest(e,"tr")},Af={verify:function(a,e,t,n,r,c,o){return Wt.closest(n,"td,th",o).bind(function(u){return Wt.closest(e,"td,th",o).map(function(i){return $e.eq(u,i)?$e.eq(n,u)&&yn(u)===r?c(i):Ef.none("in same cell"):Qn.sharedOne(Of,[u,i]).fold(function(){return t=i,n=u,r=(e=a).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Ef.success():c(i);var e,t,n,r,o},function(e){return c(i)})})}).getOr(Ef.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)},adt:Ef},kf={point:X("element","offset"),delta:X("element","deltaOffset"),range:X("element","start","finish"),points:X("begin","end"),text:X("element","text")},Pf=(X("ancestor","descendants","element","index"),X("parent","children","element","index")),If=function(e,t){return W(e,R($e.eq,t))},Bf=function(r){return ot.parent(r).bind(function(t){var n=ot.children(t);return If(n,r).map(function(e){return Pf(t,n,r,e)})})},Mf=function(e){return"br"===mt.name(e)},Wf=function(e,t,n){return t(e,n).bind(function(e){return mt.isText(e)&&0===vn.get(e).trim().length?Wf(e,t,n):S.some(e)})},_f=function(t,e,n,r){return(o=e,i=n,ot.child(o,i).filter(Mf).orThunk(function(){return ot.child(o,i-1).filter(Mf)})).bind(function(e){return r.traverse(e).fold(function(){return Wf(e,r.gather,t).map(r.relative)},function(e){return Bf(e).map(function(e){return Lc.on(e.parent(),e.index())})})});var o,i},Lf=function(e,t,n,r){var o,i,u;return(Mf(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return Wf(i,u.gather,o)}).map(u.relative)):_f(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},qf=function(e){return Af.cata(e,function(e){return S.none()},function(){return S.none()},function(e){return S.some(kf.point(e,0))},function(e){return S.some(kf.point(e,yn(e)))})},Ff=Xe.detect(),jf=function(r,o,i,u,a,c){return 0===c?S.none():Uf(r,o,i,u,a).bind(function(e){var t=r.fromSitus(e),n=Af.verify(r,i,u,t.finish(),t.foffset(),a.failure,o);return Af.cata(n,function(){return S.none()},function(){return S.some(e)},function(e){return $e.eq(i,e)&&0===u?zf(r,i,u,Ql.moveUp,a):jf(r,o,e,0,a,c-1)},function(e){return $e.eq(i,e)&&u===yn(e)?zf(r,i,u,Ql.moveDown,a):jf(r,o,e,yn(e),a,c-1)})})},zf=function(t,e,n,r,o){return tf(t,e,n).bind(function(e){return Hf(t,o,r(e,Df.getJumpSize()))})},Hf=function(e,t,n){return Ff.browser.isChrome()||Ff.browser.isSafari()||Ff.browser.isFirefox()||Ff.browser.isEdge()?t.otherRetry(e,n):Ff.browser.isIE()?t.ieRetry(e,n):S.none()},Uf=function(t,e,n,r,o){return tf(t,n,r).bind(function(e){return Hf(t,o,e)})},Vf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return Lf(i,r.finish(),r.foffset(),u).fold(function(){return S.some(kf.point(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Af.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return qf(n)})})).bind(function(e){return jf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},Gf=function(e,t,n){return Bt.ancestor(e,t,n).isSome()},Yf=Xe.detect(),Xf=function(r,o,i,e,u){return Wt.closest(e,"td,th",o).bind(function(n){return Wt.closest(n,"table",o).bind(function(e){return t=e,Gf(u,function(e){return ot.parent(e).exists(function(e){return $e.eq(e,t)})})?Vf(r,o,i).bind(function(t){return Wt.closest(t.finish(),"td,th",o).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):S.none();var t})})},Kf=function(e,t,n,r,o,i){return Yf.browser.isIE()?S.none():i(r,t).orThunk(function(){return Xf(e,t,n,r,o).map(function(e){var t=e.range();return Ll.response(S.some(Ul(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Jf=function(e,t,n,r,o,i,u){return Xf(e,n,r,o,i).bind(function(e){return Jl.detect(t,n,e.start(),e.finish(),u)})},$f=function(e,r){return Wt.closest(e,"tr",r).bind(function(n){return Wt.closest(n,"table",r).bind(function(e){var t=St.descendants(e,"tr");return $e.eq(n,t[0])?yf.seekLeft(e,function(e){return Rn.last(e).isSome()},r).map(function(e){var t=yn(e);return Ll.response(S.some(Ul(e,t,e,t)),!0)}):S.none()})})},Qf=function(e,r){return Wt.closest(e,"tr",r).bind(function(n){return Wt.closest(n,"table",r).bind(function(e){var t=St.descendants(e,"tr");return $e.eq(n,t[t.length-1])?yf.seekRight(e,function(e){return Rn.first(e).isSome()},r).map(function(e){return Ll.response(S.some(Ul(e,0,e,0)),!0)}):S.none()})})},Zf=function(e,t){return Wt.closest(e,"td,th",t)},es={down:{traverse:ot.nextSibling,gather:yf.after,relative:Lc.before,otherRetry:Df.tryDown,ieRetry:Df.ieTryDown,failure:Af.adt.failedDown},up:{traverse:ot.prevSibling,gather:yf.before,relative:Lc.before,otherRetry:Df.tryUp,ieRetry:Df.ieTryUp,failure:Af.adt.failedUp}},ts=X("rows","cols"),ns={mouse:function(e,t,n,r){var o,i,u,a,c,l,f=Xl(e),s=(o=f,i=t,u=n,a=r,c=S.none(),l=function(){c=S.none()},{mousedown:function(e){a.clear(i),c=Zf(e.target(),u)},mouseover:function(e){c.each(function(r){a.clear(i),Zf(e.target(),u).each(function(n){pr(r,n,u).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!$e.eq(r,n))&&(a.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){c.each(l)}});return{mousedown:s.mousedown,mouseover:s.mouseover,mouseup:s.mouseup}},keyboard:function(e,c,l,f){var s=Xl(e),d=function(){return f.clear(c),S.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw().which,a=!0===e.raw().shiftKey;return vr(c,f.selectedSelector()).fold(function(){return zl.isDown(u)&&a?R(Jf,s,c,l,es.down,r,t,f.selectRange):zl.isUp(u)&&a?R(Jf,s,c,l,es.up,r,t,f.selectRange):zl.isDown(u)?R(Kf,s,l,es.down,r,t,Qf):zl.isUp(u)?R(Kf,s,l,es.up,r,t,$f):S.none},function(t){var e=function(e){return function(){return Jo(e,function(e){return Jl.update(e.rows(),e.cols(),c,t,f)}).fold(function(){return wr(c,f.firstSelectedSelector(),f.lastSelectedSelector()).map(function(e){var t=zl.isDown(u)||i.isForward(u)?Lc.after:Lc.before;return s.setRelativeSelection(Lc.on(e.first(),0),t(e.table())),f.clear(c),Ll.response(S.none(),!0)})},function(e){return S.some(Ll.response(S.none(),!0))})}};return zl.isDown(u)&&a?e([ts(1,0)]):zl.isUp(u)&&a?e([ts(-1,0)]):i.isBackward(u)&&a?e([ts(0,-1),ts(-1,0)]):i.isForward(u)&&a?e([ts(0,1),ts(1,0)]):zl.isNavigation(u)&&!1===a?d:S.none})()},keyup:function(t,n,r,o,i){return vr(c,f.selectedSelector()).fold(function(){var e=t.raw().which;return 0==(!0===t.raw().shiftKey)?S.none():zl.isNavigation(e)?Jl.sync(c,l,n,r,o,i,f.selectRange):S.none()},S.none)}}}},rs=function(t,e){k(e,function(e){Ai.remove(t,e)})},os=function(t){return function(e){Ai.add(e,t)}},is=function(t){return function(e){rs(e,t)}},us={byClass:function(o){var i=os(o.selected()),n=is([o.selected(),o.lastSelected(),o.firstSelected()]),u=function(e){var t=St.descendants(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Ai.add(n,o.firstSelected()),Ai.add(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){bt.remove(e,o.selected()),bt.remove(e,o.firstSelected()),bt.remove(e,o.lastSelected())},i=function(e){bt.set(e,o.selected(),"1")},u=function(e){var t=St.descendants(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),bt.set(n,o.firstSelected(),"1"),bt.set(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},as=function(e){return!1===Ai.has(le.fromDom(e.target),"ephox-snooker-resizer-bar")};function cs(h,p){var v=ee(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=S.none(),w=us.byAttr(Tr);return h.on("init",function(e){var r=h.getWin(),o=ia(h),t=ca(h),n=ns.mouse(r,o,t,w),a=ns.keyboard(r,o,t,w),c=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=jc.relative(e.start(),e.finish()),n=$c.asLtrRange(r,t);h.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&zl.isNavigation(t.raw().which)){var n=h.selection.getRng(),r=le.fromDom(n.startContainer),o=le.fromDom(n.endContainer);a.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){c(t,e)})}},u=function(e){var t=f(e);p().each(function(e){e.hideBars()});var n=h.selection.getRng(),r=le.fromDom(h.selection.getStart()),o=le.fromDom(n.startContainer),i=le.fromDom(n.endContainer),u=ha.directionAt(r).isRtl()?zl.rtl:zl.ltr;a.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){c(t,e)}),p().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=le.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&as(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!as(e)||n.mouseover(f(e))},g=function(e){s(e)&&as(e)&&n.mouseup(f(e))};h.on("mousedown",d),h.on("mouseover",m),h.on("mouseup",g),h.on("keyup",i),h.on("keydown",u),h.on("nodechange",function(){var e=h.selection,t=le.fromDom(e.getStart()),n=le.fromDom(e.getEnd());Qn.sharedOne(zt.table,[t,n]).fold(function(){w.clear(o)},y)}),b=S.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var ls=Ia.each,fs=function(t){var n=[];function e(e){return function(){t.execCommand(e)}}ls("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?n.push({text:"-"}):n.push(t.menuItems[e])}),t.addButton("table",{type:"menubutton",title:"Table",menu:n}),t.addButton("tableprops",{title:"Table properties",onclick:e("mceTableProps"),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},ss=function(t){var e,n=""===(e=t.getParam("table_toolbar",pa))||!1===e?[]:v(e)?e.split(/[ ,]/):b(e)?e:[];0<n.length&&t.addContextToolbar(function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n.join(" "))},ds=function(o,n){var r=S.none(),i=[],u=[],a=[],c=[],l=function(e){e.disabled(!0)},f=function(e){e.disabled(!1)},e=function(){var t=this;i.push(t),r.fold(function(){l(t)},function(e){f(t)})},t=function(){var t=this;u.push(t),r.fold(function(){l(t)},function(e){f(t)})};o.on("init",function(){o.on("nodechange",function(e){var t=S.from(o.dom.getParent(o.selection.getStart(),"th,td"));(r=t.bind(function(e){var t=le.fromDom(e);return zt.table(t).map(function(e){return Mr.forMenu(n,e,t)})})).fold(function(){k(i,l),k(u,l),k(a,l),k(c,l)},function(t){k(i,f),k(u,f),k(a,function(e){e.disabled(t.mergable().isNone())}),k(c,function(e){e.disabled(t.unmergable().isNone())})})})});var s=function(e,t,n,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],f=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(n+1),f&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(f?t<=o:o<=t)&&i<=n,e.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===o.getParam("table_grid",!0,"boolean")?{text:"Table",icon:"table",context:"table",onclick:m("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),o.execCommand("mceInsertTable"))},onshow:function(){s(o,0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:function(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){e+="<tr>";for(var n=0;n<10;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t,n,r=e.target;"A"===r.tagName.toUpperCase()&&(t=parseInt(r.getAttribute("data-mce-x"),10),n=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(t=9-t),t===this.lastX&&n===this.lastY||(s(o,t,n,e.control),this.lastX=t,this.lastY=n))},onclick:function(e){var t=this;"A"===e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),o.undoManager.transact(function(){Qa(o,t.lastX+1,t.lastY+1)}),o.addVisual())}}]};function m(e){return function(){o.execCommand(e)}}var g={text:"Table properties",context:"table",onPostRender:e,onclick:m("mceTableProps")},h={text:"Delete table",context:"table",onPostRender:e,cmd:"mceTableDelete"},p={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:t},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:t},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:t},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:t},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:t},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:t},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:t},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:t}]},v={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:t},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:t},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:t}]},b={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:t},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:function(){var t=this;a.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.mergable().isNone())})}},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:function(){var t=this;c.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.unmergable().isNone())})}}]};o.addMenuItem("inserttable",d),o.addMenuItem("tableprops",g),o.addMenuItem("deletetable",h),o.addMenuItem("row",p),o.addMenuItem("column",v),o.addMenuItem("cell",b)},ms=function(n,r){return{insertTable:function(e,t){return Qa(n,e,t)},setClipboardRows:function(e){return t=r,n=A(e,le.fromDom),void t.set(S.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return A(e,function(e){return e.dom()})})}}};i.add("table",function(t){var n,r=Ec(t),e=cs(t,r.lazyResize),o=ka(t,r.lazyWire),i=(n=t,{get:function(){var e=ia(n);return yr(e,Tr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Er.none():Er.single(n.selection)},function(e){return Er.multiple(e)})}}),u=Do(S.none());return rc(t,o,e,i,u),Wr(t,i,o,e),ds(t,i),fs(t),ss(t),t.on("PreInit",function(){t.serializer.addTempAttr(Tr.firstSelected()),t.serializer.addTempAttr(Tr.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){_l(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),ms(t,u)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),s=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==f.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=y.explode(d(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):m.get(e[0]):":next"===e[1]?u(1):m.get(e[1]))){var t=c.get(o.id||o.name);o.id&&t?t.focus():a.setTimeout(function(){s.webkit||window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(t){return/INPUT|TEXTAREA|BUTTON/.test(t.tagName)&&c.get(n.id)&&-1!==t.tabIndex&&function e(t){return"BODY"===t.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&e(t.parentNode)}(t)}if(o=m.select(":input:enabled,*[tabindex]:not(iframe)"),y.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&m.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),s.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();!function(){"use strict";var u=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return u(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!t.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},s=function(e,t){return{clipboard:e,quirks:t}},f=function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},d=function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},l=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},n=function(e,t){return e.fire("paste",{ieFake:t})},m={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("paste_retain_style_properties")},getWordValidElements:function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},r=function(e,t,n){var r,a,i;"text"===t.pasteFormat.get()?(t.pasteFormat.set("html"),l(e,!1)):(t.pasteFormat.set("text"),l(e,!0),i=e,!1===n.get()&&m.shouldPlainTextInform(i)&&(a="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=e).notificationManager.open({text:r.translate(a),type:"info"}),n.set(!0))),e.focus()},c=function(e,n,t){e.addCommand("mceTogglePlainTextPaste",function(){r(e,n,t)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&n.pasteHtml(t.content,t.internal),t.text&&n.pasteText(t.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),b=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=tinymce.util.Tools.resolve("tinymce.util.VK"),e="x-tinymce/html",i="\x3c!-- "+e+" --\x3e",p=function(e){return i+e},g=function(e){return e.replace(i,"")},y=function(e){return-1!==e.indexOf(i)},x=function(){return e},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(e){return e.replace(/\r?\n/g,"<br>")},_=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),i="</"+t+">",o=b.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===o.length?o[0]:b.map(o,function(e){return a+e+i}).join("")},D=function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},T=function(e,t,n){return t?_(e,t,n):w(e)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),R=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Serializer");function E(t,e){return b.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}var S={filter:E,innerText:function(t){var n=R(),r=C({},n),a="",i=n.getShortEndedElements(),o=b.makeMap("script noscript style textarea video audio iframe object"," "),s=n.getBlockElements();return t=E(t,[/<!\[[^\]]+\]>/g]),function e(t){var n=t.name,r=t;if("br"!==n)if(i[n]&&(a+=" "),o[n])a+=" ";else{if(3===t.type&&(a+=t.value),!t.shortEnded&&(t=t.firstChild))for(;e(t),t=t.next;);s[n]&&r.next&&(a+="\n","p"===n&&(a+="\n"))}else a+="\n"}(r.parse(t)),a},trimHtml:function(e){return e=E(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function I(t){var n,e;return e=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],t=t.replace(/^[\u00a0 ]+/,""),b.each(e,function(e){if(e.test(t))return!(n=!0)}),n}function M(e){var i,o,s=1;function n(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=n(e),e=e.next;);return t}function l(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!l(e,t))return!1}while(e=e.next);return!0}function t(t,n,r){var a=t._listLevel||s;a!==s&&(a<s?i&&(i=i.parent.parent):(o=i,i=null)),i&&i.name===n?i.append(t):(o=o||i,i=new k(n,1),1<r&&i.attr("start",""+r),t.wrap(i)),t.name="li",s<a&&o&&o.lastChild.append(i),s=a,function e(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;e(t),t=t.next;);}(t),l(t,/^\u00a0+/),l(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),l(t,/^\u00a0+/)}for(var r=[],a=e.firstChild;null!=a;)if(r.push(a),null!==(a=a.walk()))for(;void 0!==a&&a.parent!==e;)a=a.walk();for(var u=0;u<r.length;u++)if("p"===(e=r[u]).name&&e.firstChild){var c=n(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){t(e,"ul");continue}if(I(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),t(e,"ol",d);continue}if(e._listLevel){t(e,"ul",1);continue}i=null}else o=i,i=null}function O(n,r,a,i){var o,s={},e=n.dom.parseStyle(i);return b.each(e,function(e,t){switch(t){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(i))&&(a._listLevel=parseInt(o[1],10)),/Ignore/i.test(e)&&a.firstChild&&(a._listIgnore=!0,a.firstChild._listIgnore=!0);break;case"horiz-align":t="text-align";break;case"vert-align":t="vertical-align";break;case"font-color":case"mso-foreground":t="color";break;case"mso-background":case"mso-highlight":t="background";break;case"font-weight":case"font-style":return void("normal"!==e&&(s[t]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void a.remove()}0!==t.indexOf("mso-comment")?0!==t.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[t])&&(s[t]=e):a.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],a.wrap(new k("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],a.wrap(new k("i",1))),(s=n.dom.serializeStyle(s,a.name))||null}var A={preProcess:function(e,t){return m.shouldUseDefaultFilters(e)?function(r,e){var t,a;(t=m.getRetainStyleProps(r))&&(a=b.makeMap(t.split(/[, ]/))),e=S.filter(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return 0<t.length?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=R({valid_elements:n,valid_children:"-li[p]"});b.each(i.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var o=C({},i);o.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)(t=e[n]).attr("style",O(r,a,t,t.attr("style"))),"span"===t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),o.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),o.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),o.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)if(n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var s=o.parse(e);return m.shouldConvertWordFakeLists(r)&&M(s),e=F({validate:r.settings.validate},i).serialize(s)}(e,t):t},isWordContent:function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}},H=function(e,t){return{content:e,cancelled:t}},B=function(e,t,n,r){var a,i,o,s,l,u,c=f(e,t,n,r);return e.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(a=e,i=c.content,o=n,s=r,l=a.dom.create("div",{style:"display:none"},i),u=d(a,l,o,s),H(u.node.innerHTML,u.isDefaultPrevented())):H(c.content,c.isDefaultPrevented())},L=function(e,t,n){var r=A.isWordContent(t),a=r?A.preProcess(e,t):t;return B(e,a,n,r)},$=function(e,t){return e.insertContent(t,{merge:m.shouldMergeFormats(e),paste:!0}),!0},j=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},W=function(e){return j(e)&&/.(gif|jpe?g|png)$/.test(e)},N=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!j(t)||(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),0));var r,a,i},V=function(e,t,n){return!!W(t)&&(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.insertContent('<img src="'+a+'">')}),!0);var r,a,i},z=function(e,t){var n,r;!1===m.isSmartPasteEnabled(e)?$(e,t):(n=e,r=t,b.each([N,V,$],function(e){return!0!==e(n,r,$)}))},K=function(e,t,n){var r=n||y(t),a=L(e,g(t),r);!1===a.cancelled&&z(e,a.content)},U=function(e,t){t=e.dom.encode(t).replace(/\r\n/g,"\n"),t=T(t,e.settings.forced_root_block,e.settings.forced_root_block_attrs),K(e,t,!1)},G=function(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var a=e.types[r];try{t[a]=e.getData(a)}catch(i){t[a]=""}}}return t},X=function(e,t){return t in e&&0<e[t].length},q=function(e){return X(e,"text/html")||X(e,"text/plain")},Y=S.createIdGenerator("mceclip"),Z=function(e,t,n,r){t&&(e.selection.setRng(t),t=null);var a,i,o,s,l,u,c,f=n.result,d=-1!==(i=(a=f).indexOf(","))?a.substr(i+1):null,m=Y(),p=e.settings.images_reuse_filename&&r.name?(o=e,s=r.name,(l=s.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(l[1]):null):m,g=new Image;if(g.src=f,u=e.settings,c=g,!u.images_dataimg_filter||u.images_dataimg_filter(c)){var v,h=e.editorUpload.blobCache,b=void 0;(v=h.findFirst(function(e){return e.base64()===d}))?b=v:(b=h.create(m,r,d,p),h.add(b)),K(e,'<img src="'+b.blobUri()+'">',!1)}else K(e,'<img src="'+f+'">',!1)},J=function(o,s,l){var e="paste"===s.type?s.clipboardData:s.dataTransfer;function t(e){var t,n,r,a=!1;if(e)for(t=0;t<e.length;t++)if(n=e[t],/^image\/(jpeg|png|gif|bmp)$/.test(n.type)){var i=n.getAsFile?n.getAsFile():n;(r=new window.FileReader).onload=Z.bind(null,o,l,r,i),r.readAsDataURL(i),s.preventDefault(),a=!0}return a}if(o.settings.paste_data_images&&e)return t(e.items)||t(e.files)},Q=function(e){return a.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},ee=function(c,f,d){var m,p=0;function g(e,t,n,r){var a,i;X(e,"text/html")?a=e["text/html"]:(a=f.getHtml(),r=r||y(a),f.isDefaultContent(a)&&(n=!0)),a=S.trimHtml(a),f.remove(),i=!1===r&&D(a),a.length&&!i||(n=!0),n&&(a=X(e,"text/plain")&&i?e["text/plain"]:S.innerText(a)),f.isDefaultContent(a)?t||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?U(c,a):K(c,a,r)}c.on("keydown",function(e){function t(e){Q(e)&&!e.isDefaultPrevented()&&f.remove()}if(Q(e)&&!e.isDefaultPrevented()){if((m=e.shiftKey&&86===e.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),p=(new Date).getTime(),v.ie&&m)return e.preventDefault(),void n(c,!0);f.remove(),f.create(),c.once("keyup",t),c.once("paste",function(){c.off("keyup",t)})}}),c.on("paste",function(e){var t,n,r,a=(new Date).getTime(),i=(t=c,n=G(e.clipboardData||t.getDoc().dataTransfer),S.isMsEdge()?b.extend(n,{"text/html":""}):n),o=(new Date).getTime()-a,s=(new Date).getTime()-p-o<1e3,l="text"===d.get()||m,u=X(i,x());m=!1,e.isDefaultPrevented()||(r=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():q(i)||!J(c,e,f.getLastRng()||c.selection.getRng())?(s||e.preventDefault(),!v.ie||s&&!e.ieFake||X(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(e){e.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),X(i,"text/html")?(e.preventDefault(),u||(u=y(i["text/html"])),g(i,s,l,u)):h.setEditorTimeout(c,function(){g(i,s,l,u)},0)):f.remove()})},te=function(e){return v.ie&&e.inline?document.body:e.getBody()},ne=function(t,e,n){var r;te(r=t)!==r.getBody()&&t.dom.bind(e,"paste keyup",function(e){ie(t,n)||t.fire("paste")})},re=function(e){return e.dom.get("mcepastebin")},ae=function(e,t){return t===e},ie=function(e,t){var n,r=re(e);return(n=r)&&"mcepastebin"===n.id&&ae(t,r.innerHTML)},oe=function(o){var s=u(null),l="%MCEPASTEBIN%";return{create:function(){return t=s,n=l,a=(e=o).dom,i=e.getBody(),t.set(e.selection.getRng()),r=e.dom.add(te(e),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(v.ie||v.gecko)&&a.setStyle(r,"left","rtl"===a.getStyle(i,"direction",!0)?65535:-65535),a.bind(r,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),ne(e,r,n),r.focus(),void e.selection.select(r,!0);var e,t,n,r,a,i},remove:function(){return function(e,t){if(re(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(o,s)},getEl:function(){return re(o)},getHtml:function(){return function(n){var t,e,r,a,i,o=function(e,t){e.appendChild(t),n.dom.remove(t,!0)};for(e=b.grep(te(n).childNodes,function(e){return"mcepastebin"===e.id}),t=e.shift(),b.each(e,function(e){o(t,e)}),r=(a=n.dom.select("div[id=mcepastebin]",t)).length-1;0<=r;r--)i=n.dom.create("div"),t.insertBefore(i,a[r]),o(i,a[r]);return t?t.innerHTML:""}(o)},getLastRng:function(){return s.get()},isDefault:function(){return ie(o,l)},isDefaultContent:function(e){return ae(l,e)}}},se=function(n,e){var t=oe(n);return n.on("preInit",function(){return ee(o=n,t,e),void o.parser.addNodeFilter("img",function(e,t,n){var r,a=function(e){e.attr("data-mce-object")||s===v.transparentSrc||e.remove()};if(!o.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=e.length;i--;)(s=e[i].attributes.map.src)&&(0===s.indexOf("webkit-fake-url")?a(e[i]):o.settings.allow_html_data_urls||0!==s.indexOf("data:")||a(e[i]))});var o,s}),{pasteFormat:e,pasteHtml:function(e,t){return K(n,e,t)},pasteText:function(e){return U(n,e)},pasteImageData:function(e,t){return J(n,e,t)},getDataTransferItems:G,hasHtmlOrText:q,hasContentType:X}},le=function(){},ue=function(e,t,n){if(r=e,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===S.isMsEdge())return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(x(),t),!0}catch(a){return!1}var r},ce=function(e,t,n,r){ue(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},fe=function(s){return function(e,t){var n=p(e),r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var i=s.selection.getRng();a.focus();var o=s.dom.createRng();o.selectNodeContents(a),s.selection.setRng(o),setTimeout(function(){s.selection.setRng(i),r.parentNode.removeChild(r),t()},0)}},de=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},me=function(e){var t,n;e.on("cut",(t=e,function(e){!1===t.selection.isCollapsed()&&ce(e,de(t),fe(t),function(){setTimeout(function(){t.execCommand("Delete")},0)})})),e.on("copy",(n=e,function(e){!1===n.selection.isCollapsed()&&ce(e,de(n),fe(n),le)}))},pe=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ge=function(e,t){return pe.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},ve=function(e,t){e.focus(),e.selection.setRng(t)},he=function(o,s,l){m.shouldBlockDrop(o)&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),m.shouldPasteDataImages(o)||o.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0<t.files.length&&e.preventDefault()}),o.on("drop",function(e){var t,n;if(n=ge(o,e),!e.isDefaultPrevented()&&!l.get()){t=s.getDataTransferItems(e.dataTransfer);var r,a=s.hasContentType(t,x());if((s.hasHtmlOrText(t)&&(!(r=t["text/plain"])||0!==r.indexOf("file://"))||!s.pasteImageData(e,n))&&n&&m.shouldFilterDrop(o)){var i=t["mce-internal"]||t["text/html"]||t["text/plain"];i&&(e.preventDefault(),h.setEditorTimeout(o,function(){o.undoManager.transact(function(){t["mce-internal"]&&o.execCommand("Delete"),ve(o,n),i=S.trimHtml(i),t["text/html"]?s.pasteHtml(i,a):s.pasteText(i)})}))}}}),o.on("dragstart",function(e){l.set(!0)}),o.on("dragover dragend",function(e){m.shouldPasteDataImages(o)&&!1===l.get()&&(e.preventDefault(),ve(o,ge(o,e))),"dragend"===e.type&&l.set(!1)})},be=function(e){var t=e.plugins.paste,n=m.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=m.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})};function ye(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function xe(e,t){if(!A.isWordContent(t))return t;var n=[];b.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return t=S.filter(t,[[r,"$1"]]),t=S.filter(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Pe(e,t,n,r){if(r||n)return t;var u,a=m.getWebkitStyles(e);if(!1===m.shouldRemoveWebKitStyles(e)||"all"===a)return t;if(a&&(u=a.split(/[, ]/)),u){var c=e.dom,f=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=c.parseStyle(c.decode(n)),i={};if("none"===u)return t+r;for(var o=0;o<u.length;o++){var s=a[u[o]],l=c.getStyle(f,u[o],!0);/color/.test(u[o])&&(s=c.toHex(s),l=c.toHex(l)),l!==s&&(i[u[o]]=s)}return(i=c.serializeStyle(i,"span"))?t+' style="'+i+'"'+r:t+r})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function we(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var _e=function(e){var t,n;v.webkit&&ye(e,Pe),v.ie&&(ye(e,xe),n=we,(t=e).on("PastePostProcess",function(e){n(t,e.node)}))},De=function(e,t,n){var r=n.control;r.active("text"===t.pasteFormat.get()),e.on("PastePlainTextToggle",function(e){r.active(e.state)})},Te=function(e,t){var n=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var o=new Array(arguments.length-1),n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var a=o.concat(n);return i.apply(null,a)}}(De,e,t);e.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:t.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};t.add("paste",function(e){if(!1===o(e)){var t=u(!1),n=u(!1),r=u(m.isPasteAsTextEnabled(e)?"text":"html"),a=se(e,r),i=_e(e);return Te(e,a),c(e,a,t),be(e),me(e),he(e,a,n),s(a,i)}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(e){return e&&"BR"===e.nodeName},r=function(e){return e&&3===e.nodeType},h=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},i=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},a=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},C=o,s=function(e){return e.parentNode.firstChild===e},c=function(e){return e.parentNode.lastChild===e},y=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},f=function(e,t){return e&&e.nodeName in t},u=function(e,t){return!!o(t)&&!(!e.isBlock(t.nextSibling)||o(t.previousSibling))},m=function(e,t,n){var o=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&o},g=function(e,t){return e.isChildOf(t,e.getRoot())},N=function(e,t){var n=d.getNode(e,t);return i(e)&&r(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:{container:e,offset:t}},L=function(e){var t=e.cloneRange(),n=N(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var o=N(e.endContainer,e.endOffset);return t.setEnd(o.container,o.offset),t},S=t.DOM,b=function(r){var i={},e=function(e){var t,n,o;n=r[e?"startContainer":"endContainer"],o=r[e?"startOffset":"endOffset"],1===n.nodeType&&(t=S.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(o=Math.min(o,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[o]):S.insertAfter(t,n.childNodes[o])):n.appendChild(t),n=t,o=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=o};return e(!0),r.collapsed||e(),i},D=function(r){function e(e){var t,n,o;t=o=r[e?"startContainer":"endContainer"],n=r[e?"startOffset":"endOffset"],t&&(1===t.nodeType&&(n=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(t),t=t.parentNode,S.remove(o),!t.hasChildNodes()&&S.isBlock(t)&&t.appendChild(S.create("br"))),r[e?"startContainer":"endContainer"]=t,r[e?"startOffset":"endOffset"]=n)}e(!0),e();var t=S.createRng();return t.setStart(r.startContainer,r.startOffset),r.endContainer&&t.setEnd(r.endContainer,r.endOffset),L(t)},k=t.DOM,T=function(e,t){var n,o=t.parentNode;"LI"===o.nodeName&&o.firstChild===t&&((n=o.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),m(e,o)&&k.remove(o)):k.setStyle(o,"listStyleType","none")),h(o)&&(n=o.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},I=function(t,e){v.each(v.grep(t.select("ol,ul",e)),function(e){T(t,e)})},B=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),R=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",O(e,t))},O=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0<n.length?n[0]:e.getBody()},E={getParentList:R,getSelectedSubLists:function(e){var t,n,o,r=R(e),i=e.selection.getSelectedBlocks();return o=i,(n=r)&&1===o.length&&o[0]===n?(t=r,v.grep(t.querySelectorAll("ol,ul,dl"),function(e){return h(e)})):v.grep(i,function(e){return h(e)&&r!==e})},getSelectedListItems:function(e){var n,t,o,r=e.selection.getSelectedBlocks();return v.grep((n=e,t=r,o=v.map(t,function(e){var t=n.dom.getParent(e,"li,dd,dt",O(n,e));return t||e}),B.unique(o)),function(e){return i(e)})},getClosestListRootElm:O},A=tinymce.util.Tools.resolve("tinymce.Env"),P=t.DOM,x=function(e,t,n){var o,r,i,a=P.createFragment(),s=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&((r=P.create(n)).tagName===e.settings.forced_root_block&&P.setAttribs(r,e.settings.forced_root_block_attrs),f(t.firstChild,s)||a.appendChild(r)),t)for(;o=t.firstChild;){var d=o.nodeName;i||"SPAN"===d&&"bookmark"===o.getAttribute("data-mce-type")||(i=!0),f(o,s)?(a.appendChild(o),r=null):n?(r||(r=P.create(n),a.appendChild(r)),r.appendChild(o)):a.appendChild(o)}return e.settings.forced_root_block?i||A.ie&&!(10<A.ie)||r.appendChild(P.create("br",{"data-mce-bogus":"1"})):a.appendChild(P.create("br")),a},_=t.DOM,M=function(e,t,n,o){var r,i,a,s,d;for(a=_.select('span[data-mce-type="bookmark"]',t),o=o||x(e,n),(r=_.createRng()).setStartAfter(n),r.setEndAfter(t),s=(i=r.extractContents()).firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&e.dom.isEmpty(s)){_.remove(s);break}e.dom.isEmpty(i)||_.insertAfter(i,t),_.insertAfter(o,t),m(e.dom,n.parentNode)&&(d=n.parentNode,v.each(a,function(e){d.parentNode.insertBefore(e,n.parentNode)}),_.remove(d)),_.remove(n),m(e.dom,t)&&_.remove(t)},U=t.DOM,H=function(e,t){m(e,t)&&U.remove(t)},$=function(e,t){var n,o,r=t.parentNode;return r?(n=r.parentNode,r===e.getBody()||("DD"===t.nodeName?U.rename(t,"DT"):s(t)&&c(t)?"LI"===n.nodeName?(U.insertAfter(t,n),H(e.dom,n),U.remove(r)):h(n)?U.remove(r,!0):(n.insertBefore(x(e,t),r),U.remove(r)):s(t)?"LI"===n.nodeName?(U.insertAfter(t,n),t.appendChild(r),H(e.dom,n)):h(n)?n.insertBefore(t,r):(n.insertBefore(x(e,t),r),U.remove(t)):c(t)?"LI"===n.nodeName?U.insertAfter(t,n):h(n)?U.insertAfter(t,r):(U.insertAfter(x(e,t),r),U.remove(t)):("LI"===n.nodeName?(r=n,o=x(e,t,"LI")):o=h(n)?x(e,t,"LI"):x(e,t),M(e,r,t,o),I(e.dom,r.parentNode)))):H(e.dom,t),!0},w=$,K=function(e){var t=E.getSelectedListItems(e);if(t.length){var n=b(e.selection.getRng()),o=void 0,r=void 0,i=E.getClosestListRootElm(e,e.selection.getStart(!0));for(o=t.length;o--;)for(var a=t[o].parentNode;a&&a!==i;){for(r=t.length;r--;)if(t[r]===a){t.splice(o,1);break}a=a.parentNode}for(o=0;o<t.length&&($(e,t[o])||0!==o);o++);return e.selection.setRng(D(n)),e.nodeChanged(),!0}},Q=function(n,e){v.each(e,function(e,t){n.setAttribute(t,e)})},W=function(e,t,n){var o,r,i,a,s,d,l;o=e,r=t,a=(i=n)["list-style-type"]?i["list-style-type"]:null,o.setStyle(r,"list-style-type",a),s=e,Q(d=t,(l=n)["list-attributes"]),v.each(s.select("li",d),function(e){Q(e,l["list-item-attributes"])})},j=function(e,t,n,o){var r,i;for(r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===r.nodeType&&(r=r.childNodes[Math.min(i,r.childNodes.length-1)]||r),!n&&C(r.nextSibling)&&(r=r.nextSibling);r.parentNode!==o;){if(y(e,r))return r;if(/^(TD|TH)$/.test(r.parentNode.nodeName))return r;r=r.parentNode}return r},q=function(c,f,u){void 0===u&&(u={});var e,t=c.selection.getRng(!0),m="LI",n=E.getClosestListRootElm(c,c.selection.getStart(!0)),g=c.dom;"false"!==g.getContentEditable(c.selection.getNode())&&("DL"===(f=f.toUpperCase())&&(m="DT"),e=b(t),v.each(function(n,e,o){for(var r,i=[],a=n.dom,t=j(n,e,!0,o),s=j(n,e,!1,o),d=[],l=t;l&&(d.push(l),l!==s);l=l.nextSibling);return v.each(d,function(e){if(y(n,e))return i.push(e),void(r=null);if(a.isBlock(e)||C(e))return C(e)&&a.remove(e),void(r=null);var t=e.nextSibling;p.isBookmarkNode(e)&&(y(n,t)||!t&&e.parentNode===o)?r=null:(r||(r=a.create("p"),e.parentNode.insertBefore(r,e),i.push(r)),r.appendChild(e))}),i}(c,t,n),function(e){var t,n,o,r,i,a,s,d,l;(n=e.previousSibling)&&h(n)&&n.nodeName===f&&(o=n,r=u,i=g.getStyle(o,"list-style-type"),a=r?r["list-style-type"]:"",i===(a=null===a?"":a))?(t=n,e=g.rename(e,m),n.appendChild(e)):(t=g.create(f),e.parentNode.insertBefore(t,e),t.appendChild(e),e=g.rename(e,m)),s=g,d=e,l=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(l,function(e){var t;return s.setStyle(d,((t={})[e]="",t))}),W(g,t,u),z(c.dom,t)}),c.selection.setRng(D(e)))},F=function(o){var e=b(o.selection.getRng(!0)),r=E.getClosestListRootElm(o,o.selection.getStart(!0)),t=E.getSelectedListItems(o),n=v.grep(t,function(e){return o.dom.isEmpty(e)});t=v.grep(t,function(e){return!o.dom.isEmpty(e)}),v.each(n,function(e){m(o.dom,e)&&w(o,e)}),v.each(t,function(e){var t,n;if(e.parentNode!==o.getBody()){for(t=e;t&&t!==r;t=t.parentNode)h(t)&&(n=t);M(o,n,e),I(o.dom,n.parentNode)}}),o.selection.setRng(D(e))},V=function(e,t,n){return d=n,(s=t)&&d&&h(s)&&s.nodeName===d.nodeName&&(i=t,a=n,(r=e).getStyle(i,"list-style-type",!0)===r.getStyle(a,"list-style-type",!0))&&(o=n,t.className===o.className);var o,r,i,a,s,d},z=function(e,t){var n,o;if(n=t.nextSibling,V(e,t,n)){for(;o=n.firstChild;)t.appendChild(o);e.remove(n)}if(n=t.previousSibling,V(e,t,n)){for(;o=n.lastChild;)t.insertBefore(o,t.firstChild);e.remove(n)}},G=function(t,e,n,o,r){if(e.nodeName!==o||J(r)){var i=b(t.selection.getRng(!0));v.each([e].concat(n),function(e){!function(e,t,n,o){if(t.nodeName!==n){var r=e.rename(t,n);W(e,r,o)}else W(e,t,o)}(t.dom,e,o,r)}),t.selection.setRng(D(i))}else F(t)},J=function(e){return"list-style-type"in e},X={toggleList:function(e,t,n){var o=E.getParentList(e),r=E.getSelectedSubLists(e);n=n||{},o&&0<r.length?G(e,o,r,t,n):function(e,t,n,o){if(t!==e.getBody())if(t)if(t.nodeName!==n||J(o)){var r=b(e.selection.getRng(!0));W(e.dom,t,o),z(e.dom,e.dom.rename(t,n)),e.selection.setRng(D(r))}else F(e);else q(e,n,o)}(e,o,t,n)},removeList:F,mergeWithAdjacentLists:z},Y=function(e,t,n,o){var r,i,a=t.startContainer,s=t.startOffset;if(3===a.nodeType&&(n?s<a.data.length:0<s))return a;for(r=e.schema.getNonEmptyElements(),1===a.nodeType&&(a=d.getNode(a,s)),i=new l(a,o),n&&u(e.dom,a)&&i.next();a=i[n?"next":"prev2"]();){if("LI"===a.nodeName&&!a.hasChildNodes())return a;if(r[a.nodeName])return a;if(3===a.nodeType&&0<a.data.length)return a}},Z=function(e,t){var n=t.childNodes;return 1===n.length&&!h(n[0])&&e.isBlock(n[0])},ee=function(e,t,n){var o,r,i,a;if(r=Z(e,n)?n.firstChild:n,Z(i=e,a=t)&&i.remove(a.firstChild,!0),!m(e,t,!0))for(;o=t.firstChild;)r.appendChild(o)},te=function(e,t,n){var o,r,i=t.parentNode;g(e,t)&&g(e,n)&&(h(n.lastChild)&&(r=n.lastChild),i===n.lastChild&&C(i.previousSibling)&&e.remove(i.previousSibling),(o=n.lastChild)&&C(o)&&t.hasChildNodes()&&e.remove(o),m(e,n,!0)&&e.$(n).empty(),ee(e,t,n),r&&n.appendChild(r),e.remove(t),m(e,i)&&i!==e.getRoot()&&e.remove(i))},ne=function(e,t,n,o){var r,i,a,s=e.dom;if(s.isEmpty(o))i=n,a=o,(r=e).dom.$(a).empty(),te(r.dom,i,a),r.selection.setCursorLocation(a);else{var d=b(t);te(s,n,o),e.selection.setRng(D(d))}},oe=function(e,t){var n,o,r,i=e.dom,a=e.selection,s=a.getStart(),d=E.getClosestListRootElm(e,s),l=i.getParent(a.getStart(),"LI",d);if(l){if((n=l.parentNode)===e.getBody()&&m(i,n))return!0;if(o=L(a.getRng(!0)),(r=i.getParent(Y(e,o,t,d),"LI",d))&&r!==l)return t?ne(e,o,r,l):function(e,t,n,o){var r=b(t);te(e.dom,n,o);var i=D(r);e.selection.setRng(i)}(e,o,l,r),!0;if(!r&&!t)return X.removeList(e),!0}return!1},re=function(e,t){return oe(e,t)||function(r,i){var a=r.dom,e=r.selection.getStart(),s=E.getClosestListRootElm(r,e),d=a.getParent(e,a.isBlock,s);if(d&&a.isEmpty(d)){var t=L(r.selection.getRng(!0)),l=a.getParent(Y(r,t,i,s),"LI",s);if(l)return r.undoManager.transact(function(){var e,t,n,o;t=d,n=s,o=(e=a).getParent(t.parentNode,e.isBlock,n),e.remove(t),o&&e.isEmpty(o)&&e.remove(o),X.mergeWithAdjacentLists(a,l.parentNode),r.selection.select(l,!0),r.selection.collapse(i)}),!0}return!1}(e,t)},ie=function(e,t){return e.selection.isCollapsed()?re(e,t):(o=(n=e).selection.getStart(),r=E.getClosestListRootElm(n,o),!!(n.dom.getParent(o,"LI,DT,DD",r)||0<E.getSelectedListItems(n).length)&&(n.undoManager.transact(function(){n.execCommand("Delete"),I(n.dom,n.getBody())}),!0));var n,o,r},ae=function(t){t.on("keydown",function(e){e.keyCode===n.BACKSPACE?ie(t,!1)&&e.preventDefault():e.keyCode===n.DELETE&&ie(t,!0)&&e.preventDefault()})},se=ie,de=function(t){return{backspaceDelete:function(e){se(t,e)}}},le=t.DOM,ce=function(e,t){var n;if(h(e)){for(;n=e.firstChild;)t.appendChild(n);le.remove(e)}},fe=function(e){var t,n,o,r,i=E.getSelectedListItems(e);if(i.length){for(var a=b(e.selection.getRng(!0)),s=0;s<i.length&&(t=i[s],r=o=n=void 0,("DT"===t.nodeName?(le.rename(t,"DD"),1):(n=t.previousSibling)&&h(n)?(n.appendChild(t),1):n&&"LI"===n.nodeName&&h(n.lastChild)?(n.lastChild.appendChild(t),ce(t.lastChild,n.lastChild),1):(n=t.nextSibling)&&h(n)?(n.insertBefore(t,n.firstChild),1):(n=t.previousSibling)&&"LI"===n.nodeName&&(o=le.create(t.parentNode.nodeName),(r=le.getStyle(t.parentNode,"listStyleType"))&&le.setStyle(o,"listStyleType",r),n.appendChild(o),o.appendChild(t),ce(t.lastChild,o),1))||0!==s);s++);return e.selection.setRng(D(a)),e.nodeChanged(),!0}},ue=function(t,n){return function(){var e=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===n}},me=function(o){o.on("BeforeExecCommand",function(e){var t,n=e.command.toLowerCase();if("indent"===n?fe(o)&&(t=!0):"outdent"===n&&K(o)&&(t=!0),t)return o.fire("ExecCommand",{command:e.command}),e.preventDefault(),!0}),o.addCommand("InsertUnorderedList",function(e,t){X.toggleList(o,"UL",t)}),o.addCommand("InsertOrderedList",function(e,t){X.toggleList(o,"OL",t)}),o.addCommand("InsertDefinitionList",function(e,t){X.toggleList(o,"DL",t)}),o.addQueryStateHandler("InsertUnorderedList",ue(o,"UL")),o.addQueryStateHandler("InsertOrderedList",ue(o,"OL")),o.addQueryStateHandler("InsertDefinitionList",ue(o,"DL"))},ge=function(e){return e.getParam("lists_indent_on_tab",!0)},pe=function(e){var t;ge(e)&&(t=e).on("keydown",function(e){e.keyCode!==n.TAB||n.metaKeyPressed(e)||t.dom.getParent(t.selection.getStart(),"LI,DT,DD")&&(e.preventDefault(),e.shiftKey?K(t):fe(t))}),ae(e)},ve=function(t,i){return function(e){var r=e.control;t.on("NodeChange",function(e){var t=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e.parents,a),n=-1!==t?e.parents.slice(0,t):e.parents,o=v.grep(n,h);r.active(0<o.length&&o[0].nodeName===i)})}},he=function(e){var t,n,o,r;n="advlist",o=(t=e).settings.plugins?t.settings.plugins:"",-1===v.inArray(o.split(/[ ,]/),n)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ve(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ve(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:(r=e,function(e){var n=e.control;r.on("nodechange",function(){var e=E.getSelectedListItems(r),t=0<e.length&&s(e[0]);n.disabled(t)})})})};e.add("lists",function(e){return pe(e),he(e),me(e),de(e)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),e=function(t){return t.target_list},o=function(t){return t.rel_list},i=function(t){return t.link_class_list},p=function(t){return"boolean"==typeof t.link_assume_external_targets&&t.link_assume_external_targets},a=function(t){return"boolean"==typeof t.link_context_toolbar&&t.link_context_toolbar},r=function(t){return t.link_list},k=function(t){return"string"==typeof t.default_link_target},y=function(t){return t.default_link_target},b=e,_=function(t,e){t.settings.target_list=e},w=function(t){return!1!==e(t)},T=o,C=function(t){return o(t)!==undefined},M=i,O=function(t){return i(t)!==undefined},R=function(t){return!1!==t.link_title},N=function(t){return"boolean"==typeof t.allow_unsafe_link_target&&t.allow_unsafe_link_target},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=tinymce.util.Tools.resolve("tinymce.Env"),c=function(t){if(!u.ie||10<u.ie){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r=e,a=n,document.body.appendChild(r),r.dispatchEvent(a),document.body.removeChild(r)}else{var o=window.open("","_blank");if(o){o.opener=null;var i=o.document;i.open(),i.write('<meta http-equiv="refresh" content="0; url='+l.DOM.encode(t)+'">'),i.close()}}var r,a},A=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e){var n,o,i=["noopener"],r=t?t.split(/\s+/):[],a=function(t){return t.filter(function(t){return-1===A.inArray(i,t)})};return(r=e?(n=a(n=r)).length?n.concat(i):i:a(r)).length?(o=r,A.trim(o.sort().join(" "))):null},f=function(t,e){return e=e||t.selection.getNode(),m(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},d=function(t){return t&&"A"===t.nodeName&&t.href},m=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},v=function(t,e){var n,o;(o=t.dom.select("img",e)[0])&&(n=t.dom.getParents(o,"a[href]",e)[0])&&(n.parentNode.insertBefore(o,n),t.dom.remove(n))},g=function(t,e,n){var o,i;(i=t.dom.select("img",e)[0])&&(o=t.dom.create("a",n),i.parentNode.insertBefore(o,i),o.appendChild(i))},L=function(i,r){return function(o){i.undoManager.transact(function(){var t=i.selection.getNode(),e=f(i,t),n={href:o.href,target:o.target?o.target:null,rel:o.rel?o.rel:null,"class":o["class"]?o["class"]:null,title:o.title?o.title:null};C(i.settings)||!1!==N(i.settings)||(n.rel=s(n.rel,"_blank"===n.target)),o.href===r.href&&(r.attach(),r={}),e?(i.focus(),o.hasOwnProperty("text")&&("innerText"in e?e.innerText=o.text:e.textContent=o.text),i.dom.setAttribs(e,n),i.selection.select(e),i.undoManager.add()):m(t)?g(i,t,n):o.hasOwnProperty("text")?i.insertContent(i.dom.createHTML("a",n,i.dom.encode(o.text))):i.execCommand("mceInsertLink",!1,n)})}},P=function(e){return function(){e.undoManager.transact(function(){var t=e.selection.getNode();m(t)?v(e,t):e.execCommand("unlink")})}},h=d,x=function(t){return 0<A.grep(t,d).length},E=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},S=f,I=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return n.replace(/\uFEFF/g,"")},K=s,U=tinymce.util.Tools.resolve("tinymce.util.Delay"),D=tinymce.util.Tools.resolve("tinymce.util.XHR"),B={},F=function(t,o,e){var i=function(t,n){return n=n||[],A.each(t,function(t){var e={text:t.text||t.title};t.menu?e.menu=i(t.menu):(e.value=t.value,o&&o(e)),n.push(e)}),n};return i(t,e||[])},q=function(e,t,n){var o=e.selection.getRng();U.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),n(t)})})},V=function(a,t){var e,l,o,u,n,i,r,c,s,f,d,m={},v=a.selection,g=a.dom,h=function(t){var e=o.find("#text");(!e.value()||t.lastControl&&e.value()===t.lastControl.text())&&e.value(t.control.text()),o.find("#href").value(t.control.value())},x=function(){l||!u||m.text||this.parent().parent().find("#text")[0].value(this.value())};u=E(v.getContent()),e=S(a),m.text=l=I(a.selection,e),m.href=e?g.getAttrib(e,"href"):"",e?m.target=g.getAttrib(e,"target"):k(a.settings)&&(m.target=y(a.settings)),(d=g.getAttrib(e,"rel"))&&(m.rel=d),(d=g.getAttrib(e,"class"))&&(m["class"]=d),(d=g.getAttrib(e,"title"))&&(m.title=d),u&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){m.text=this.value()}}),t&&(i={type:"listbox",label:"Link list",values:F(t,function(t){t.value=a.convertURL(t.value||t.url,"href")},[{text:"None",value:""}]),onselect:h,value:a.convertURL(m.href,"href"),onPostRender:function(){i=this}}),w(a.settings)&&(b(a.settings)===undefined&&_(a,[{text:"None",value:""},{text:"New window",value:"_blank"}]),c={name:"target",type:"listbox",label:"Target",values:F(b(a.settings))}),C(a.settings)&&(r={name:"rel",type:"listbox",label:"Rel",values:F(T(a.settings),function(t){!1===N(a.settings)&&(t.value=K(t.value,"_blank"===m.target))})}),O(a.settings)&&(s={name:"class",type:"listbox",label:"Class",values:F(M(a.settings),function(t){t.value&&(t.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[t.value]})})})}),R(a.settings)&&(f={name:"title",type:"textbox",label:"Title",value:m.title}),o=a.windowManager.open({title:"Insert link",data:m,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(t){var e=t.meta||{};i&&i.value(a.convertURL(this.value(),"href")),A.each(t.meta,function(t,e){var n=o.find("#"+e);"text"===e?0===l.length&&(n.value(t),m.text=t):n.value(t)}),e.attach&&(B={href:this.value(),attach:e.attach}),e.text||x.call(this)},onkeyup:x,onpaste:x,onbeforecall:function(t){t.meta=o.toJSON()}},n,f,function(n){var o=[];if(A.each(a.dom.select("a:not([href])"),function(t){var e=t.name||t.id;e&&o.push({text:e,value:"#"+e,selected:-1!==n.indexOf("#"+e)})}),o.length)return o.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:o,onselect:h}}(m.href),i,r,c,s],onSubmit:function(t){var e=p(a.settings),n=L(a,B),o=P(a),i=A.extend({},m,t.data),r=i.href;r?(u&&i.text!==l||delete i.text,0<r.indexOf("@")&&-1===r.indexOf("//")&&-1===r.indexOf("mailto:")?q(a,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(i.href="mailto:"+r),n(i)}):!0===e&&!/^\w+:/i.test(r)||!1===e&&/^\s*www[\.|\d\.]/i.test(r)?q(a,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(i.href="http://"+r),n(i)}):n(i)):o()}})},z=function(t){var e,n,o;n=V,"string"==typeof(o=r((e=t).settings))?D.send({url:o,success:function(t){n(e,JSON.parse(t))}}):"function"==typeof o?o(function(t){n(e,t)}):n(e,o)},H=function(t,e){return t.dom.getParent(e,"a[href]")},J=function(t){return H(t,t.selection.getStart())},$=function(t,e){if(e){var n=(i=e).getAttribute("data-mce-href")||i.getAttribute("href");if(/^#/.test(n)){var o=t.$(n);o.length&&t.selection.scrollIntoView(o[0],!0)}else c(e.href)}var i},j=function(t){return function(){z(t)}},G=function(t){return function(){$(t,J(t))}},X=function(r){return function(t){var e,n,o,i;return!!(a(r.settings)&&(!(i=r.plugins.contextmenu)||!i.isContextMenuVisible())&&h(t)&&3===(o=(n=(e=r.selection).getRng()).startContainer).nodeType&&e.isCollapsed()&&0<n.startOffset&&n.startOffset<o.data.length)}},Q=function(o){o.on("click",function(t){var e=H(o,t.target);e&&n.metaKeyPressed(t)&&(t.preventDefault(),$(o,e))}),o.on("keydown",function(t){var e,n=J(o);n&&13===t.keyCode&&!0===(e=t).altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey&&(t.preventDefault(),$(o,n))})},W=function(n){return function(){var e=this;n.on("nodechange",function(t){e.active(!n.readonly&&!!S(n,t.element))})}},Y=function(n){return function(){var e=this,t=function(t){x(t.parents)?e.show():e.hide()};x(n.dom.getParents(n.selection.getStart()))||e.hide(),n.on("nodechange",t),e.on("remove",function(){n.off("nodechange",t)})}},Z=function(t){t.addCommand("mceLink",j(t))},tt=function(t){t.addShortcut("Meta+K","",j(t))},et=function(t){t.addButton("link",{active:!1,icon:"link",tooltip:"Insert/edit link",onclick:j(t),onpostrender:W(t)}),t.addButton("unlink",{active:!1,icon:"unlink",tooltip:"Remove link",onclick:P(t),onpostrender:W(t)}),t.addContextToolbar&&t.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:G(t)})},nt=function(t){t.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:G(t),onPostRender:Y(t),prependToContext:!0}),t.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:j(t),stateSelector:"a[href]",context:"insert",prependToContext:!0}),t.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onclick:P(t),stateSelector:"a[href]"})},ot=function(t){t.addContextToolbar&&t.addContextToolbar(X(t),"openlink | link unlink")};t.add("link",function(t){et(t),nt(t),ot(t),Q(t),Z(t),tt(t)})}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}();!function(){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=function(e,n){e.fire("FullscreenStateChanged",{state:n})},g=n.DOM,r=function(e,n){var t,r,l,i,o,c,s=document.body,u=document.documentElement,d=n.get(),a=function(){var e,n,t,i;g.setStyle(l,"height",(t=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-l.clientHeight))},h=function(){g.unbind(window,"resize",a)};if(t=(r=e.getContainer()).style,i=(l=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),g.removeClass(s,"mce-fullscreen"),g.removeClass(u,"mce-fullscreen"),g.removeClass(r,"mce-fullscreen"),o=d.scrollPos,window.scrollTo(o.x,o.y),g.unbind(window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),m(e,!1);else{var f={scrollPos:(c=g.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:h};i.width=i.height="100%",t.width=t.height="",g.addClass(s,"mce-fullscreen"),g.addClass(u,"mce-fullscreen"),g.addClass(r,"mce-fullscreen"),g.bind(window,"resize",a),e.on("remove",h),a(),n.set(f),m(e,!0)}},l=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},o=function(t){return function(e){var n=e.control;t.on("FullscreenStateChanged",function(e){n.active(e.state)})}},c=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:o(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:o(e)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(l(e,n),c(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),t(n)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t,e){var i,n=t.dom,o=t.selection.getSelectedBlocks();o.length&&(i=n.getAttrib(o[0],"dir"),c.each(o,function(t){n.getParent(t.parentNode,'*[dir="'+e+'"]',n.getRoot())||n.setAttrib(t,"dir",i!==e?e:null)}),t.nodeChanged())},i=function(t){t.addCommand("mceDirectionLTR",function(){e(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){e(t,"rtl")})},n=function(e){var i=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){i.push(t+"[dir="+e+"]")}),i.join(",")},o=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})};t.add("directionality",function(t){i(t),o(t)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){return e.fire("insertCustomChar",{chr:t})},l=function(e,t){var a=i(e,t).chr;e.execCommand("mceInsertContent",!1,a)},a=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.settings.charmap},n=function(e){return e.settings.charmap_append},o=a.isArray,c=function(e){return o(e)?[].concat((t=e,a.grep(t,function(e){return o(e)&&2===e.length}))):"function"==typeof e?e():[];var t},s=function(e){return function(e,t){var a=r(e);a&&(t=c(a));var i=n(e);return i?[].concat(t).concat(c(i)):t}(e,[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["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","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]])},t=function(t){return{getCharMap:function(){return s(t)},insertChar:function(e){l(t,e)}}},u=function(e){var t,a,i,r=Math.min(e.length,25),n=Math.ceil(e.length/r);for(t='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>',i=0;i<n;i++){for(t+="<tr>",a=0;a<r;a++){var o=i*r+a;if(o<e.length){var l=e[o],c=parseInt(l[0],10),s=l?String.fromCharCode(c):"&nbsp;";t+='<td title="'+l[1]+'"><div tabindex="-1" title="'+l[1]+'" role="button" data-chr="'+c+'">'+s+"</div></td>"}else t+="<td />"}t+="</tr>"}return t+="</tbody></table>"},d=function(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}},m=function(n){var o,e={type:"container",html:u(s(n)),onclick:function(e){var t=e.target;if(/^(TD|DIV)$/.test(t.nodeName)){var a=d(t).firstChild;if(a&&a.hasAttribute("data-chr")){var i=a.getAttribute("data-chr"),r=parseInt(i,10);isNaN(r)||l(n,String.fromCharCode(r)),e.ctrlKey||o.close()}}},onmouseover:function(e){var t=d(e.target);t&&t.firstChild?(o.find("#preview").text(t.firstChild.firstChild.data),o.find("#previewTitle").text(t.title)):(o.find("#preview").text(" "),o.find("#previewTitle").text(" "))}};o=n.windowManager.open({title:"Special character",spacing:10,padding:10,items:[e,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){o.close()}}]})},g=function(e){e.addCommand("mceShowCharmap",function(){m(e)})},p=function(e){e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};e.add("charmap",function(e){return g(e),p(e),t(e)})}();!function(){"use strict";var i=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return i(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},v=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},o=function(t){return t.getParam("autoresize_overflow_padding",1)},a=function(t){return t.getParam("autoresize_bottom_margin",50)},n=function(t){return t.getParam("autoresize_on_init",!0)},u=function(t,e,n,i,o){r.setEditorTimeout(t,function(){_(t,e),n--?u(t,e,n,i,o):o&&o()},i)},S=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},_=function(t,e){var n,i,o,r,a,u,s,l,g,c,f,d=t.dom;if(i=t.getDoc())if((m=t).plugins.fullscreen&&m.plugins.fullscreen.isFullscreen())S(t,!0);else{var m;o=i.body,r=h(t),u=d.getStyle(o,"margin-top",!0),s=d.getStyle(o,"margin-bottom",!0),l=d.getStyle(o,"padding-top",!0),g=d.getStyle(o,"padding-bottom",!0),c=d.getStyle(o,"border-top-width",!0),f=d.getStyle(o,"border-bottom-width",!0),a=o.offsetHeight+parseInt(u,10)+parseInt(s,10)+parseInt(l,10)+parseInt(g,10)+parseInt(c,10)+parseInt(f,10),(isNaN(a)||a<=0)&&(a=y.ie?o.scrollHeight:y.webkit&&0===o.clientHeight?0:o.offsetHeight),a>h(t)&&(r=a);var p=v(t);p&&p<a?(r=p,S(t,!0)):S(t,!1),r!==e.get()&&(n=r-e.get(),d.setStyle(t.iframeElement,"height",r+"px"),e.set(r),y.webkit&&n<0&&_(t,e))}},s={setup:function(i,e){i.on("init",function(){var t,e,n=i.dom;t=o(i),e=a(i),!1!==t&&n.setStyles(i.getBody(),{paddingLeft:t,paddingRight:t}),!1!==e&&n.setStyles(i.getBody(),{paddingBottom:e})}),i.on("nodechange setcontent keyup FullscreenStateChanged",function(t){_(i,e)}),n(i)&&i.on("init",function(){u(i,e,20,100,function(){u(i,e,5,1e3)})})},resize:_},l=function(t,e){t.addCommand("mceAutoResize",function(){s.resize(t,e)})};t.add("autoresize",function(t){if(!t.inline){var e=i(0);l(t,e),s.setup(t,e)}})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();!function(){"use strict";var e,t,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.EditorManager"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},f=function(e){return e.getParam("toolbar_items_size")},m=function(e){return e.getParam("menu")},g=function(e){return!1===e.settings.skin},p=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),b=tinymce.util.Tools.resolve("tinymce.ui.Factory"),y=tinymce.util.Tools.resolve("tinymce.util.I18n"),s=function(e){return e.fire("SkinLoaded")},x=function(e){return e.fire("ResizeEditor")},_=function(e){return e.fire("BeforeRenderUI")},a=function(t,n){return function(){var e=t.find(n)[0];e&&e.focus(!0)}},C=function(e,t){e.shortcuts.add("Alt+F9","",a(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",a(t,"toolbar")),e.shortcuts.add("Alt+F11","",a(t,"elementpath")),t.on("cancel",function(){e.focus()})},R=tinymce.util.Tools.resolve("tinymce.geom.Rect"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},k=function(e){return function(){return e}},l=k(!1),T=k(!0),H=l,S=T,M=function(){return N},N=(i={fold:function(e,t){return e()},is:H,isSome:H,isNone:S,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:M,ap:M,each:function(){},bind:M,flatten:M,exists:H,forall:S,filter:M,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:k("none()")},Object.freeze&&Object.freeze(i),i),P=function(n){var e=function(){return n},t=function(){return r},i=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:S,isNone:H,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return P(e(n))},ap:function(e){return e.fold(M,function(e){return P(e(n))})},each:function(e){e(n)},bind:i,flatten:e,exists:i,forall:i,filter:function(e){return e(n)?r:N},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(H,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},D={some:P,none:M,from:function(e){return null===e||e===undefined?N:P(e)}},W=function(e){return e?e.getRoot().uiContainer:null},O={getUiContainerDelta:function(e){var t=W(e);if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var n=v.DOM.getPos(t),i=t.scrollLeft-n.x,r=t.scrollTop-n.y;return D.some({x:i,y:r})}return D.none()},setUiContainer:function(e,t){var n=v.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:W,inheritUiContainer:function(e,t){return t.uiContainer=W(e)}},A=function(i,e,r){var o,s=[];if(e)return w.each(e.split(/[ ,]/),function(t){var e,n=function(){var e=i.selection;t.settings.stateSelector&&e.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&e.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?o=null:(o||(o={type:"buttongroup",items:[]},s.push(o)),i.buttons[t]&&(e=t,"function"==typeof(t=i.buttons[e])&&(t=t()),t.type=t.type||"button",t.size=r,t=b.create(t),o.items.push(t),i.initialized?n():i.on("init",n)))}),{type:"toolbar",layout:"flow",items:s}},B=A,L=function(n,i){var e,t,r=[];if(w.each(!1===(t=(e=n).getParam("toolbar"))?[]:w.isArray(t)?w.grep(t,function(e){return 0<e.length}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return 0<n.length?n:o}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(e){var t;(t=e)&&r.push(A(n,t,i))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},I=v.DOM,z=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},F=function(e,t){e.moveTo(t.left,t.top)},U=function(e,t,n,i,r,o){return o=z({x:t,y:n,w:o.w,h:o.h}),e&&(o=e({elementRect:z(i),contentAreaRect:z(r),panelRect:o})),o},V=function(x){var i,o=function(){return x.contextToolbars||[]},n=function(e,t){var n,i,r,o,s,a,l,u=x.getParam("inline_toolbar_position_handler");if(!x.removed){if(!e||!e.toolbar.panel)return c=x,void w.each(c.contextToolbars,function(e){e.panel&&e.panel.hide()});var c,d,f,h,m;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=e.toolbar.panel,t&&s.show(),d=e.element,f=I.getPos(x.getContentAreaContainer()),h=x.dom.getRect(d),"BODY"===(m=x.dom.getRoot()).nodeName&&(h.x-=m.ownerDocument.documentElement.scrollLeft||m.scrollLeft,h.y-=m.ownerDocument.documentElement.scrollTop||m.scrollTop),h.x+=f.x,h.y+=f.y,r=h,i=I.getRect(s.getEl()),o=I.getRect(x.getContentAreaContainer()||x.getBody());var g,p,v,b=O.getUiContainerDelta(s).getOr({x:0,y:0});if(r.x+=b.x,r.y+=b.y,i.x+=b.x,i.y+=b.y,o.x+=b.x,o.y+=b.y,"inline"!==I.getStyle(e.element,"display",!0)){var y=e.element.getBoundingClientRect();r.w=y.width,r.h=y.height}x.inline||(o.w=x.getDoc().documentElement.offsetWidth),x.selection.controlSelection.isResizable(e.element)&&r.w<25&&(r=R.inflate(r,0,8)),n=R.findBestRelativePosition(i,r,o,l),r=R.clamp(r,o),n?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):(o.h+=i.h,(r=R.intersect(o,r))?(n=R.findBestRelativePosition(i,r,o,["bc-tc","bl-tl","br-tr"]))?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):F(s,U(u,r.x,r.y,r,o,i)):s.hide()),g=s,v=function(e,t){return e===t},p=(p=n)?p.substr(0,2):"",w.each({t:"down",b:"up"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(0,1)))}),w.each({l:"left",r:"right"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(1,1)))})}},r=function(e){return function(){u.requestAnimationFrame(function(){x.selection&&n(a(x.selection.getNode()),e)})}},t=function(e){var t;if(e.toolbar.panel)return e.toolbar.panel.show(),void n(e);t=b.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:B(x,e.toolbar.items),oncancel:function(){x.focus()}}),O.setUiContainer(x,t),function(e){if(!i){var t=r(!0),n=O.getUiContainer(e);i=x.selection.getScrollContainer()||x.getWin(),I.bind(i,"scroll",t),I.bind(n,"scroll",t),x.on("remove",function(){I.unbind(i,"scroll",t),I.unbind(n,"scroll",t)})}}(t),(e.toolbar.panel=t).renderTo().reflow(),n(e)},s=function(){w.each(o(),function(e){e.panel&&e.panel.hide()})},a=function(e){var t,n,i,r=o();for(t=(i=x.$(e).parents().add(e)).length-1;0<=t;t--)for(n=r.length-1;0<=n;n--)if(r[n].predicate(i[t]))return{toolbar:r[n],element:i[t]};return null};x.on("click keyup setContent ObjectResized",function(e){("setcontent"!==e.type||e.selection)&&u.setEditorTimeout(x,function(){var e;(e=a(x.selection.getNode()))?(s(),t(e)):s()})}),x.on("blur hide contextmenu",s),x.on("ObjectResizeStart",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.hide()}),x.on("ResizeEditor ResizeWindow",r(!0)),x.on("nodeChange",r(!1)),x.on("remove",function(){w.each(o(),function(e){e.panel&&e.panel.remove()}),x.contextToolbars={}}),x.shortcuts.add("ctrl+shift+e > ctrl+shift+p","",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},Y=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},$=Y("function"),X=Y("number"),q=(r=Array.prototype.indexOf)===undefined?function(e,t){return ee(e,t)}:function(e,t){return r.call(e,t)},j=function(e,t){return Q(e,t).isSome()},J=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r,e)}return i},G=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n,e)},K=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i,e)&&n.push(o)}return n},Z=function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n,e))return D.some(r)}return D.none()},Q=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n,e))return D.some(n);return D.none()},ee=function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return n;return-1},te=Array.prototype.push,ne=(Array.prototype.slice,$(Array.from)&&Array.from,{file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}}),ie=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},re=function(e){return e&&"|"===e.item.text},oe=function(n,e,t,i){var r,o,s,a,l,u,c;return e?(o=e[i],a=!0):o=ne[i],o&&(r={text:o.title},s=[],w.each((o.items||"").split(/[ ,]/),function(e){var t=ie(e,n[e]);t&&s.push(t)}),a||w.each(n,function(e,t){var n;e.context!==i||(n=t,Q(s,function(e){return e.name===n}).isSome())||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ie(t,e)):s.push(ie(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),r.menu=J((l=t,u=K(s,function(e){return!1===l.hasOwnProperty(e.name)}),c=K(u,function(e,t,n){return!re(e)||!re(n[t-1])}),K(c,function(e,t,n){return!re(e)||0<t&&t<n.length-1})),function(e){return e.item}),!r.menu.length)?null:r},se=function(e){for(var t,n=[],i=function(e){var t,n=[],i=m(e);if(i)for(t in i)n.push(t);else for(t in ne)n.push(t);return n}(e),r=w.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=c(e),s="string"==typeof o?o.split(/[ ,]/):i,a=0;a<s.length;a++){var l=s[a],u=oe(e.menuItems,m(e),r,l);u&&n.push(u)}return n},ae=v.DOM,le=function(e){return{width:e.clientWidth,height:e.clientHeight}},ue=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=le(i),s=le(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),ae.setStyle(i,"width",t+(o.width-s.width)),ae.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),ae.setStyle(r,"height",n),x(e)},ce=ue,de=function(e,t,n){var i=e.getContentAreaContainer();ue(e,i.clientWidth+t,i.clientHeight+n)},fe=tinymce.util.Tools.resolve("tinymce.Env"),he=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},me=function(c,d,f){return function(e){var t,n,i,r,o,s=e.control,a=s.parents().filter("panel")[0],l=a.find("#"+d)[0],u=(t=f,n=d,w.grep(t,function(e){return e.name===n})[0]);i=d,r=a,o=f,w.each(o,function(e){var t=r.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==i&&(he(e,t,"onhide"),t.visible(!1))}),s.parent().items().each(function(e){e.active(!1)}),l&&l.visible()?(he(u,l,"onhide"),l.hide(),s.active(!1)):(l?l.show():(l=b.create({type:"container",name:d,layout:"stack",classes:"sidebar-panel",html:""}),a.prepend(l),he(u,l,"onrender")),he(u,l,"onshow"),s.active(!0)),x(c)}},ge=function(e){return!(fe.ie&&!(11<=fe.ie)||!e.sidebars)&&0<e.sidebars.length},pe=function(n){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:w.map(n.sidebars,function(e){var t=e.settings;return{type:"button",icon:t.icon,image:t.image,tooltip:t.tooltip,onclick:me(n,e.name,n.sidebars)}})}]}},ve=function(e){var t=function(){e._skinLoaded=!0,s(e)};return function(){e.initialized?t():e.on("init",t)}},be=v.DOM,ye=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},xe=function(t,e,n){var i,r,o,s,a;if(!1===g(t)&&n.skinUiCss?be.styleSheetLoader.load(n.skinUiCss,ve(t)):ve(t)(),i=e.panel=b.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===d(t)?null:{type:"menubar",border:"0 0 1 0",items:se(t)},L(t,f(t))]},ge(t)?(s=t,{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[ye("0"),pe(s)]}):ye("1 0 0 0")]}),O.setUiContainer(t,i),"none"!==p(t)&&(r={type:"resizehandle",direction:p(t),onResizeStart:function(){var e=t.getContentAreaContainer().firstChild;o={width:e.clientWidth,height:e.clientHeight}},onResize:function(e){"both"===p(t)?ce(t,o.width+e.deltaX,o.height+e.deltaY):ce(t,null,o.height+e.deltaY)}}),t.getParam("statusbar",!0,"boolean")){var l=y.translate(["Powered by {0}",'<a href="https://www.tinymce.com/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},r,u]})}return _(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&be.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),C(t,i),V(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},we=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),_e=0,Ce={id:function(){return"mceu_"+_e++},create:function(e,t,n){var i=document.createElement(e);return v.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return v.DOM.createFragment(e)},getWindowSize:function(){return v.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return v.DOM.getPos(e,t||Ce.getContainer())},getContainer:function(){return fe.container?fe.container:document.body},getViewPort:function(e){return v.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return v.DOM.addClass(e,t)},removeClass:function(e,t){return v.DOM.removeClass(e,t)},hasClass:function(e,t){return v.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return v.DOM.toggleClass(e,t,n)},css:function(e,t,n){return v.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return v.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return v.DOM.bind(e,t,n,i)},off:function(e,t,n){return v.DOM.unbind(e,t,n)},fire:function(e,t,n){return v.DOM.fire(e,t,n)},innerHtml:function(e,t){v.DOM.setHTML(e,t)}},Re=function(e){return"static"===Ce.getRuntimeStyle(e,"position")},Ee=function(e){return e.state.get("fixed")};function ke(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=Te(),o=(r=Ce.getPos(t,O.getUiContainer(e))).x,s=r.y,Ee(e)&&Re(document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=Ce.getSize(i)).width,l=f.height,u=(f=Ce.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Te=function(){var e=window,t=Math.max(e.pageXOffset,document.body.scrollLeft,document.documentElement.scrollLeft),n=Math.max(e.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop);return{x:t,y:n,w:t+(e.innerWidth||document.documentElement.clientWidth),h:n+(e.innerHeight||document.documentElement.clientHeight)}},He=function(e){var t,n=O.getUiContainer(e);return n&&!Ee(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:Te()},Se={testMoveRel:function(e,t){for(var n=He(this),i=0;i<t.length;i++){var r=ke(this,e,t[i]);if(Ee(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w&&r.y>n.y&&r.y+r.h<n.h)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=ke(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:t<e+n&&(e=t-n)<0?0:e}if(n.settings.constrainToViewport){var r=He(this),o=n.layoutRect();e=i(e,r.w,o.w),t=i(t,r.h,o.h)}var s=O.getUiContainer(n);return s&&Re(s)&&!Ee(n)&&(e-=s.scrollLeft,t-=s.scrollTop),s&&(e+=1,t+=1),n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},Me=tinymce.util.Tools.resolve("tinymce.util.Class"),Ne=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Pe=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},De=function(i,e){function t(e){var t=parseFloat(function(e){var t=i.ownerDocument.defaultView;if(t){var n=t.getComputedStyle(i,null);return n?(e=e.replace(/[A-Z]/g,function(e){return"-"+e}),n.getPropertyValue(e)):null}return i.currentStyle[e]}(e));return isNaN(t)?0:t}return{top:t(e+"TopWidth"),right:t(e+"RightWidth"),bottom:t(e+"BottomWidth"),left:t(e+"LeftWidth")}};function We(){}function Oe(e){this.cls=[],this.cls._map={},this.onchange=e||We,this.prefix=""}w.extend(Oe.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Oe.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)0<t&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Ae,Be,Le,Ie=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,ze=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Fe=/^\s*|\s*$/g,Ue=Me.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Ie.exec(e.replace(Fe,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.indexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(ze.exec(""),(i=ze.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r<o.length;r++)">"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,u=[],i=this._selectors;function c(e,t,n){var i,r,o,s,a,l=t[n];for(i=0,r=e.length;i<r;i++){for(a=e[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===t.length-1?u.push(a):a.items&&c(a.items(),t,n+1);else if(l.direct)return;a.items&&c(a.items(),t,n)}}if(e.items){for(t=0,n=i.length;t<n;t++)c(e.items(),i[t],0);1<n&&(u=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return Ae||(Ae=Ue.Collection),new Ae(u)}}),Ve=Array.prototype.push,Ye=Array.prototype.slice;Le={length:0,init:function(e){e&&this.add(e)},add:function(e){return w.isArray(e)?Ve.apply(this,e):e instanceof Be?this.add(e.toArray()):Ve.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)delete n[t];return n},filter:function(t){var e,n,i,r,o=[];for("string"==typeof t?(t=new Ue(t),r=function(e){return t.match(e)}):r=t,e=0,n=this.length;e<n;e++)r(i=this[e])&&o.push(i);return new Be(o)},slice:function(){return new Be(Ye.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return w.each(this,e),this},toArray:function(){return w.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Be(w.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(t,n){var e;return n!==undefined?(this.each(function(e){e[t]&&e[t](n)}),this):(e=this[0])&&e[t]?e[t]():void 0},exec:function(t){var n=w.toArray(arguments).slice(1);return this.each(function(e){e[t]&&e[t].apply(e,n)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(t){return this.each(function(e){e.classes.add(t)})},removeClass:function(t){return this.each(function(e){e.classes.remove(t)})}},w.each("fire on off show hide append prepend before after reflow".split(" "),function(n){Le[n]=function(){var t=w.toArray(arguments);return this.each(function(e){n in e&&e[n].apply(e,t)}),this}}),w.each("text name disabled active selected checked visible parent value data".split(" "),function(t){Le[t]=function(e){return this.prop(t,e)}}),Be=Me.extend(Le);var $e=Ue.Collection=Be,Xe=function(e){this.create=e.create};Xe.create=function(r,o){return new Xe({create:function(t,n){var i,e=function(e){t.set(n,e.value)};return t.on("change:"+n,function(e){r.set(o,e.value)}),r.on("change:"+o,e),(i=t._bindings)||(i=t._bindings=[],t.on("destroy",function(){for(var e=i.length;e--;)i[e]()})),i.push(function(){r.off("change:"+o,e)}),r.get(o)}})};var qe=tinymce.util.Tools.resolve("tinymce.util.Observable");function je(e){return 0<e.nodeType}var Je,Ge,Ke=Me.extend({Mixins:[qe],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof Xe&&(e[t]=n.create(this,t));this.data=e},set:function(t,n){var i,r,o=this.data[t];if(n instanceof Xe&&(n=n.create(this,t)),"object"==typeof t){for(i in t)this.set(i,t[i]);return this}return function e(t,n){var i,r;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(w.isArray(n)){if(t.length!==n.length)return!1;for(i=t.length;i--;)if(!e(t[i],n[i]))return!1}if(je(t)||je(n))return t===n;for(i in r={},n){if(!e(t[i],n[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&!e(t[i],n[i]))return!1;return!0}(o,n)||(this.data[t]=n,r={target:this,name:t,value:n,oldValue:o},this.fire("change:"+t,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return Xe.create(this,e)},destroy:function(){this.fire("destroy")}}),Ze={},Qe={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;Ze[t._id]||(Ze[t._id]=t),Je||(Je=!0,u.requestAnimationFrame(function(){var e,t;for(e in Je=!1,Ze)(t=Ze[e]).state.get("rendered")&&t.reflow();Ze={}},document.body))}},remove:function(e){Ze[e._id]&&delete Ze[e._id]}},et="onmousewheel"in document,tt=!1,nt=0,it={Statics:{classPrefix:"mce-"},isRtl:function(){return Ge.rtl},classPrefix:"mce-",init:function(t){var e,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=t=w.extend({},i.Defaults,t),i._id=t.id||"mceu_"+nt++,i._aria={role:t.role},i._elmCache={},i.$=we,i.state=new Ke({visible:!0,active:!1,disabled:!1,value:""}),i.data=new Ke(t.data),i.classes=new Oe(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(e=t.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&e!==n&&r(n),r(e)),w.each("title text name visible disabled active value".split(" "),function(e){e in t&&i[e](t[e])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=t,i.borderBox=Pe(t.border),i.paddingBox=Pe(t.padding),i.marginBox=Pe(t.margin),t.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var e=O.getUiContainer(this);return e||Ce.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||De(f,"border"),c.paddingBox=c.paddingBox||De(f,"padding"),c.marginBox=c.marginBox||De(f,"margin"),u=Ce.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=Ge.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,Ce.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return rt(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return rt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=rt(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return rt(this).has(e)},parents:function(e){var t,n=new $e;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new $e(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=we("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return Ge.translate?Ge.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&we(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return we(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return we(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=we(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}ot(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),Qe.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){Qe.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function rt(n){return n._eventDispatcher||(n._eventDispatcher=new Ne({scope:n,toggleEvent:function(e,t){t&&Ne.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&ot(n))}})),n._eventDispatcher}function ot(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}function u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(t=i.length-1;s<=t;t--)(o=i[t]).fire("mouseleave",{target:o.getEl()})}for(t=s;t<n.length;t++)(r=n[t]).fire("mouseenter",{target:r.getEl()})}}function c(e){e.preventDefault(),"mousewheel"===e.type?(e.deltaY=-.025*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-.025*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=a.fire("wheel",e)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),e=0,t=n.length;!l&&e<t;e++)l=n[e]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,t=e,e=0;e<t;e++)n[e]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||tt?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(we(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(we(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):et?we(a.getEl()).on("mousewheel",c):we(a.getEl()).on("DOMMouseScroll",c)}}}w.each("text title visible disabled active value".split(" "),function(t){it[t]=function(e){return 0===arguments.length?this.state.get(t):(void 0!==e&&this.state.set(t,e),this)}});var st=Ge=Me.extend(it),at=function(e){return!!e.getAttribute("data-mce-tabstop")};function lt(e){var o,r,n=e.root;function i(e){return e&&1===e.nodeType}try{o=document.activeElement}catch(t){o=document.body}function s(e){return i(e=e||o)?e.getAttribute("role"):null}function a(e){for(var t,n=e||o;n=n.parentNode;)if(t=s(n))return t}function l(e){var t=o;if(i(t))return t.getAttribute("aria-"+e)}function u(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function c(t){var r=[];return function e(t){if(1===t.nodeType&&"none"!==t.style.display&&!t.disabled){var n;(u(n=t)&&!n.hidden||at(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(t);for(var i=0;i<t.childNodes.length;i++)e(t.childNodes[i])}}(t||n.getEl()),r}function d(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var i=0;i<n.length&&!(t=n[i]).settings.ariaRoot;i++);return t}function f(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r<t.length;r++)t[r]===o&&(n=r);n+=e,i.lastAriaIndex=f(n,t)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var e=s(),t=a();"tablist"===t?h(1,c(o.parentNode)):"menuitem"===e&&"menu"===t&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var e=s(),t=a();"menuitem"===e&&"menubar"===t?y():"button"===e&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:o,aria:e})}return r=n.getParentCtrl(o),n.on("keydown",function(e){function t(e,t){u(o)||at(o)||"slider"!==s(o)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,m);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===a()){var t=c(r.getEl("body"))[0];t&&t.focus()}else h(e.shiftKey?-1:1)}(e),e.preventDefault()}}),n.on("focusin",function(e){o=e.target,r=e.control}),{focusFirst:function(e){var t=d(e),n=c(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?f(t.lastAriaIndex,n):f(0,n)}}}var ut={},ct=st.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new $e,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new Oe(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=b.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=ut[e]=ut[e]||new Ue(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}0<=r&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return w.isArray(e)||(e=[e]),w.each(e,function(e){e&&(e instanceof st||("string"==typeof e&&(e={type:e}),t=w.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=b.create(t)),i.push(e))}),i},renderNew:function(){var i=this;return i.items().each(function(e,t){var n;e.parent(i),e.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&t<=n.childNodes.length-1?we(n.childNodes[t]).before(e.renderHtml()):we(n).append(e.renderHtml()),e.postRender(),Qe.add(e))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),0<=t&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var i={};return this.find("*").each(function(e){var t=e.name(),n=e.value();t&&void 0!==n&&(i[t]=n)}),i},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=lt({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(Qe.remove(this),this.visible()){for(st.repaintControls=[],st.repaintControls.map={},this.recalc(),e=st.repaintControls.length;e--;)st.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),st.repaintControls=[]}return this}});function dt(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function ft(e,h){var m,g,t,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||e);t=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=(t=x,u=Math.max,n=t.documentElement,i=t.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});dt(e),e.preventDefault(),g=e.button,c=w,b=e.screenX,y=e.screenY,d=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=we("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),we(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(dt(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){dt(e),we(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){we(w).off()},we(w).on("mousedown touchstart",t)}var ht,mt,gt,pt,vt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),we(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void we(a).css("display","none");we(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+v,d[h]=u,we(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,we(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;we(p.getEl()).append('<div id="'+e+'" class="'+t+"scrollbar "+t+"scrollbar-"+s+'"><div id="'+e+'t" class="'+t+'scrollbar-thumb"></div></div>'),p.draghelper=new ft(e+"t",{start:function(){d=p.getEl("body")["scroll"+a],we("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){we("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),we(p.getEl("body")).on("scroll",n)),n())}},bt=ct.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[vt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),yt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=Ce.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},xt=[],wt=[];function _t(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function Ct(){ht||(ht=function(e){2!==e.button&&function(e){for(var t=xt.length;t--;){var n=xt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(_t(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},we(document).on("click touchstart",ht))}function Rt(r){var e=Ce.getViewPort().y;function t(e,t){for(var n,i=0;i<xt.length;i++)if(xt[i]!==r)for(n=xt[i].parent();n&&(n=n.parent());)n===r&&xt[i].fixed(e).moveBy(0,t).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>e&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY<e&&(r.fixed(!0).layoutRect({y:0}).repaint(),t(!0,e-r._autoFixY))))}function Et(e,t){var n,i,r=kt.zIndex||65535;if(e)wt.push(t);else for(n=wt.length;n--;)wt[n]===t&&wt.splice(n,1);if(wt.length)for(n=0;n<wt.length;n++)wt[n].modal&&(r++,i=wt[n]),wt[n].getEl().style.zIndex=r,wt[n].zIndex=r,r++;var o=we("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?we(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),pt=!1),kt.currentZIndex=r}var kt=bt.extend({Mixins:[Se,yt],init:function(e){var i=this;i._super(e),(i._eventsRoot=i).classes.add("floatpanel"),e.autohide&&(Ct(),function(){if(!gt){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;gt=function(){document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,kt.hideAll())},we(window).on("resize",gt)}}(),xt.push(i)),e.autofix&&(mt||(mt=function(){var e;for(e=xt.length;e--;)Rt(xt[e])},we(window).on("scroll",mt)),i.on("move",function(){Rt(this)})),i.on("postrender show",function(e){if(e.control===i){var t,n=i.classPrefix;i.modal&&!pt&&((t=we("#"+n+"modal-block",i.getContainerElm()))[0]||(t=we('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),we(i.getEl()).addClass(n+"in")}),pt=!0),Et(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=Ce.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=xt.length;e--&&xt[e]!==this;);return-1===e&&xt.push(this),t},hide:function(){return Tt(this),Et(!1,this),this._super()},hideAll:function(){kt.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Et(!1,this)),this},remove:function(){Tt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Tt(e){var t;for(t=xt.length;t--;)xt[t]===e&&xt.splice(t,1);for(t=wt.length;t--;)wt[t]===e&&wt.splice(t,1)}kt.hideAll=function(){for(var e=xt.length;e--;){var t=xt[e];t&&t.settings.autohide&&(t.hide(),xt.splice(e,1))}};var Ht=function(e,t){return!(!e||t.settings.ui_container)},St=function(s,e,t){var a,n,l=v.DOM,i=s.getParam("fixed_toolbar_container");i&&(n=l.select(i)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),kt.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){a?a.visible()||o():(a=e.panel=b.create({type:n?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:Ht(n,s),fixed:Ht(n,s),border:1,items:[!1===d(s)?null:{type:"menubar",border:"0 0 1 0",items:se(s)},L(s,f(s))]}),O.setUiContainer(s,a),_(s),n?a.renderTo(n).reflow():a.renderTo().reflow(),C(s,a),o(),V(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===g(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===g(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,ve(s)):ve(s)(),{}};function Mt(i,r){var o,s,a=this,l=st.classPrefix;a.show=function(e,t){function n(){o&&(we(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;return u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var Nt=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Mt(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Pt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):h.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),Nt(e,t),e.getParam("inline",!1,"boolean")?St(e,t,n):xe(e,t,n)},Dt=st.extend({Mixins:[Se],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Wt=st.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==Wt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Dt({type:"tooltip"}),O.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Ot=Wt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),At=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Bt=st.extend({Mixins:[Se],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0<e.timeout)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Ot),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progressBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),At(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,At(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){At(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Lt(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),Ce.getSize(n).width)}),r=new Bt(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){G(e,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=s(o);e.moveRel(t,"tc-tc"),G(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(e)},getArgs:function(e){return e.args}}}var It=[],zt="";function Ft(e){var t,n=we("meta[name=viewport]")[0];!1!==fe.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==zt&&(zt=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":zt))}function Ut(e,t){(function(){for(var e=0;e<It.length;e++)if(It[e]._fullscreen)return!0;return!1})()&&!1===t&&we([document.documentElement,document.body]).removeClass(e+"fullscreen")}var Vt=kt.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),e.buttons&&(n.statusbar=new bt({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(e){var t=n.classPrefix+"close";(Ce.hasClass(e.target,t)||Ce.hasClass(e.target.parentNode,t))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(e){e.control===n&&kt.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(Ce.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=Ce.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=Ce.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var n,t,i=this,r=document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(we(window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=Ce.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=Ce.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Pe("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,we([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=Ce.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Pe(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,we([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new ft(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),It.push(n),Ft(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),Ut(t.classPrefix,!1),e=It.length;e--;)It[e]===t&&It.splice(e,1);Ft(0<It.length)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!fe.desktop){var n={w:window.innerWidth,h:window.innerHeight};u.setInterval(function(){var e=window.innerWidth,t=window.innerHeight;n.w===e&&n.h===t||(n={w:e,h:t},we(window).trigger("resize"))},100)}we(window).on("resize",function(){var e,t,n=Ce.getWindowSize();for(e=0;e<It.length;e++)t=It[e].layoutRect(),It[e].moveTo(It[e].settings.x||Math.max(0,n.w/2-t.w/2),It[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Yt=Vt.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,i=e.callback||function(){};function n(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),i(t)}}}switch(e.buttons){case Yt.OK_CANCEL:t=[n("Ok",!0,!0),n("Cancel",!1)];break;case Yt.YES_NO:case Yt.YES_NO_CANCEL:t=[n("Yes",1,!0),n("No",0)],e.buttons===Yt.YES_NO_CANCEL&&t.push(n("Cancel",-1));break;default:t=[n("Ok",!0,!0)]}return new Vt({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,Yt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=Yt.OK_CANCEL,Yt.msgBox(e)}}}),$t=function(n){return{renderUI:function(e){return Pt(n,this,e)},resizeTo:function(e,t){return ce(n,e,t)},resizeBy:function(e,t){return de(n,e,t)},getNotificationManagerImpl:function(){return Lt(n)},getWindowManagerImpl:function(){return{open:function(n,e,t){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new Vt(n)).on("close",function(){t(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(e){var t=e.name();t in n.data&&e.value(n.data[t])})}),i.features=n||{},i.params=e||{},i=i.renderTo(document.body).reflow()},alert:function(e,t,n){var i;return(i=Yt.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=Yt.confirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},Xt=Me.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=w.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),qt=Xt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),jt=Wt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Jt=jt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,t=Ce.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),we(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),we(t).on("click",function(e){e.stopPropagation()}),we(n.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),n.getEl().appendChild(t)},remove:function(){we(this.getEl("button")).off(),we(this.getEl("input")).off(),this._super()}}),Gt=ct.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),Kt=Wt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on("change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),Zt=tinymce.util.Tools.resolve("tinymce.util.VK"),Qt=Wt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t=e.target,n=r.getEl();if(we.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0<arguments.length&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return 0<arguments.length&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=b.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show"),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(Ce.getRuntimeStyle(a,"padding-right"),10)-parseInt(Ce.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-Ce.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(t=n.layoutRect().h-2+"px"),we(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var t=this;return we(this.getEl("inp")).on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)}),t._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,i){var r=this;if(0!==e.length){r.menu?r.menu.items().remove():r.menu=b.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),w.each(e,function(e){var t,n;r.menu.add({text:e.title,url:e.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){r.fire("selectitem",{title:n,value:t})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(e){e.control.parent()===r.menu&&(e.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var t=r.layoutRect().w;r.menu.layoutRect({w:t,minW:0,maxW:t}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(e){r.getEl("inp").value!==e.value&&(r.getEl("inp").value=e.value)}),r.state.on("change:disabled",function(e){r.getEl("inp").disabled=e.value}),r.state.on("change:statusLevel",function(e){var t=r.getEl("status"),n=r.classPrefix,i=e.value;Ce.css(t,"display","none"===i?"none":""),Ce.toggleClass(t,n+"i-checkmark","ok"===i),Ce.toggleClass(t,n+"i-warning","warn"===i),Ce.toggleClass(t,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),Ce.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(e){r.menu&&r.menu.visible()&&(e.stopPropagation(),r.hideMenu())});var n=function(e,t){t&&0<t.items().length&&t.items().eq(e)[0].focus()};return r.on("keydown",function(e){var t=e.keyCode;"INPUT"===e.target.nodeName&&(t===Zt.DOWN?(e.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):t===Zt.UP&&(e.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){we(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),en=Qt.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.state.get("rendered")&&t.repaintColor(e.value)}),t._super()}}),tn=jt.extend({showPanel:function(){var t=this,e=t.settings;if(t.classes.add("opened"),t.panel)t.panel.show();else{var n=e.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,t.panel=new kt(n).on("hide",function(){t.classes.remove("opened")}).on("cancel",function(e){e.stopPropagation(),t.focus(),t.hidePanel()}).parent(t).renderTo(t.getContainerElm()),t.panel.fire("show"),t.panel.reflow()}var i=t.panel.testMoveRel(t.getEl(),e.popoverAlign||(t.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));t.panel.classes.toggle("start","l"===i.substr(-1)),t.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);t.panel.classes.toggle("bottom",!r),t.panel.classes.toggle("top",r),t.panel.moveRel(t.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var t=this;return t.aria("haspopup",!0),t.on("click",function(e){e.control===t&&(t.panel&&t.panel.visible()?t.hidePanel():(t.showPanel(),t.panel.focus(!!e.aria)))}),t._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),nn=v.DOM,rn=tn.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.aria.key||e.control!==t||nn.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t.settings.onclick,t._super()}}),on=tinymce.util.Tools.resolve("tinymce.util.Color"),sn=Wt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(e,t){var n,i,r=Ce.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function c(e,t){var n=(360-e.h)/360;Ce.css(r,{top:100*n+"%"}),t||Ce.css(s,{left:e.s+"%",top:100-e.v+"%"}),o.style.background=on({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){var t;t=u(o,e),n.s=100*t.x,n.v=100*(1-t.y),c(n),a.fire("change")}function t(e){var t;t=u(i,e),(n=l.toHsv()).h=360*(1-t.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new ft(a._id+"-sv",{start:e,drag:e}),a._hdraghelper=new ft(a._id+"-h",{start:t,drag:t}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=on()),this._color},renderHtml:function(){var e,t=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var e,t,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(i=s.split(",")).length-1;e<t;e++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/t+"%;"+n+i[e]+",endColorstr="+i[e+1]+");-ms-"+n+i[e]+",endColorstr="+i[e+1]+')"></div>';return r}()+'<div id="'+t+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),an=Wt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=Ce.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&Ce.css(t,"height",n.height+"px"),n.width&&Ce.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=function(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),ln=Wt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(0<t?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),un=ln.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.selection.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),cn=ct.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),dn=ct.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new cn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i<n?n:i,r.push(t)}),t=n.settings.labelGap||0,e=r.length;e--;)r[e].settings.minWidth=i+t}n._super(),n.on("show",e),e()}}),fn=dn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),hn=0,mn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},gn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return mn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return mn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return mn(n)},fromDom:mn,fromPoint:function(e,t,n){var i=e.dom();return D.from(i.elementFromPoint(t,n)).map(mn)}},pn=function(n){var i,r=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r||(r=!0,i=n.apply(null,e)),i}},vn={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},bn=function(e){return e.dom().nodeType},yn=function(t){return function(e){return bn(e)===t}},xn=(yn(vn.ELEMENT),yn(vn.TEXT),yn(vn.DOCUMENT),pn(function(){return xn(gn.fromDom(document))}),function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return gn.fromDom(t)}),wn=("undefined"!=typeof window?window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return Cn(i(1),i(2))}),_n=function(){return Cn(0,0)},Cn=function(e,t){return{major:e,minor:t}},Rn={nu:Cn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?_n():wn(e,n)},unknown:_n},En="Firefox",kn=function(e,t){return function(){return t===e}},Tn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:kn("Edge",t),isChrome:kn("Chrome",t),isIE:kn("IE",t),isOpera:kn("Opera",t),isFirefox:kn(En,t),isSafari:kn("Safari",t)}},Hn={unknown:function(){return Tn({current:undefined,version:Rn.unknown()})},nu:Tn,edge:k("Edge"),chrome:k("Chrome"),ie:k("IE"),opera:k("Opera"),firefox:k(En),safari:k("Safari")},Sn="Windows",Mn="Android",Nn="Solaris",Pn="FreeBSD",Dn=function(e,t){return function(){return t===e}},Wn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Dn(Sn,t),isiOS:Dn("iOS",t),isAndroid:Dn(Mn,t),isOSX:Dn("OSX",t),isLinux:Dn("Linux",t),isSolaris:Dn(Nn,t),isFreeBSD:Dn(Pn,t)}},On={unknown:function(){return Wn({current:undefined,version:Rn.unknown()})},nu:Wn,windows:k(Sn),ios:k("iOS"),android:k(Mn),linux:k("Linux"),osx:k("OSX"),solaris:k(Nn),freebsd:k(Pn)},An=function(e,t){var n=String(t).toLowerCase();return Z(e,function(e){return e.search(n)})},Bn=function(e,n){return An(e,n).map(function(e){var t=Rn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ln=function(e,n){return An(e,n).map(function(e){var t=Rn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},In=function(e,t){return-1!==e.indexOf(t)},zn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Fn=function(t){return function(e){return In(e,t)}},Un=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return In(e,"edge/")&&In(e,"chrome")&&In(e,"safari")&&In(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,zn],search:function(e){return In(e,"chrome")&&!In(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return In(e,"msie")||In(e,"trident")}},{name:"Opera",versionRegexes:[zn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Fn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Fn("firefox")},{name:"Safari",versionRegexes:[zn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(In(e,"safari")||In(e,"mobile/"))&&In(e,"applewebkit")}}],Vn=[{name:"Windows",search:Fn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return In(e,"iphone")||In(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Fn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Fn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Fn("linux"),versionRegexes:[]},{name:"Solaris",search:Fn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Fn("freebsd"),versionRegexes:[]}],Yn={browsers:k(Un),oses:k(Vn)},$n=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=Yn.browsers(),h=Yn.oses(),m=Bn(f,e).fold(Hn.unknown,Hn.nu),g=Ln(h,e).fold(On.unknown,On.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:k(r),isiPhone:k(o),isTablet:k(l),isPhone:k(c),isTouch:k(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:k(d)})}},Xn=pn(function(){var e=navigator.userAgent;return $n(e)}),qn=vn.ELEMENT,jn=vn.DOCUMENT,Jn=function(e){return e.nodeType!==qn&&e.nodeType!==jn||0===e.childElementCount},Gn={all:function(e,t){var n=t===undefined?document:t.dom();return Jn(n)?[]:J(n.querySelectorAll(e),gn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==qn)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Jn(n)?D.none():D.from(n.querySelector(e)).map(gn.fromDom)}},Kn=(Xn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(e,t){return Gn.all(t,e)}),Zn=w.trim,Qn=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},ei=Qn("true"),ti=Qn("false"),ni=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},ii=function(e){return e.innerText||e.textContent},ri=function(e){return e.id?e.id:(t="h",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++hn+String(n));var t,n},oi=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&ai(e);var t},si=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},ai=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return ei(e)}return!1}(e)&&!ti(e)},li=function(e){return si(e)&&ai(e)},ui=function(e){var t,n=ri(e);return ni("header",ii(e),"#"+n,si(t=e)?parseInt(t.nodeName.substr(1),10):0,function(){e.id=n})},ci=function(e){var t=e.id||e.name,n=ii(e);return ni("anchor",n||"#"+t,"#"+t,0,E)},di=function(e){var t,n;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,J(Kn(gn.fromDom(n),t),function(e){return e.dom()})},fi=function(e){return 0<Zn(e.title).length},hi=function(e){var t,n=di(e);return K((t=n,J(K(t,li),ui)).concat(J(K(n,oi),ci)),fi)},mi={},gi=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},pi=function(e,t){return{title:e,value:{title:e,url:t,attach:E}}},vi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},bi=function(e,i,r,t){var n,o,s,a,l,u,c={title:"-"},d=function(e){var t=e.hasOwnProperty(r)?e[r]:[],n=K(t,function(e){return t=e,!j(i,function(e){return e.url===t});var t});return w.map(n,function(e){return{title:e,value:{title:e,url:e,attach:E}}})},f=function(t){var e,n=K(i,function(e){return e.type===t});return e=n,w.map(e,gi)};return!1===t.typeahead_urls?[]:"file"===r?(n=[xi(e,d(mi)),xi(e,f("header")),xi(e,(a=f("anchor"),l=vi(t,"anchor_top","#top"),u=vi(t,"anchor_bottom","#bottom"),null!==l&&a.unshift(pi("<top>",l)),null!==u&&a.push(pi("<bottom>",u)),a))],o=function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(c,t)},s=[],G(n,function(e){s=o(s,e)}),s):xi(e,d(mi))},yi=function(e,t){var n,i,r,o=mi[t];/^https?/.test(e)&&(o?(n=o,i=e,r=q(n,i),-1===r?D.none():D.some(r)).isNone()&&(mi[t]=o.slice(0,5).concat(e)):mi[t]=[e])},xi=function(e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},wi=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},_i=Qt.extend({Statics:{clearHistory:function(){mi={}}},init:function(e){var t,n,i,r,o,s,a,l,u=this,c=window.tinymce?window.tinymce.activeEditor:h.activeEditor,d=c.settings,f=e.filetype;e.spellcheck=!1,(i=d.file_picker_types||d.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[f]||(!(n=d.file_picker_callback)||i&&!i[f]?!(n=d.file_browser_callback)||i&&!i[f]||(t=function(){n(u.getEl("inp").id,u.value(),f,window)}):t=function(){var e=u.fire("beforecall").meta;e=w.extend({filetype:f},e),n.call(c,function(e,t){u.value(e).fire("change",{meta:t})},u.value(),e)}),t&&(e.icon="browse",e.onaction=t),u._super(e),u.classes.add("filepicker"),r=u,o=d,s=c.getBody(),a=f,l=function(e){var t=hi(s),n=bi(e,t,a,o);r.showAutoComplete(n,e)},r.on("autocomplete",function(){l(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===a?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&l("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(e){e.isDefaultPrevented()||yi(r.value(),a)})}),wi(u,d,f)}}),Ci=qt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),Ri=qt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,S,M,N,P,D,W,O,A,B,L=[],I=Math.max,z=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(R="y",_="h",C="minH",E="maxH",T="innerH",k="top",H="deltaH",S="contentH",W="left",P="w",M="x",N="innerW",D="minW",O="right",A="deltaW",B="contentW"):(R="x",_="w",C="minW",E="maxW",T="innerW",k="left",H="deltaW",S="contentW",W="top",P="h",M="y",N="innerH",D="minH",O="bottom",A="deltaH",B="contentH"),d=r[T]-o[k]-o[k],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),d-=t<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[E]&&L.push(h),m.flex=g),d-=m[C],w<(p=o[W]+m[D]+o[O])&&(w=p);if((y={})[C]=d<0?r[C]-d+r[H]:r[T]-d+r[H],y[D]=w+r[A],y[S]=r[T]-d,y[B]=w,y.minW=z(y.minW,r.maxW),y.minH=z(y.minH,r.maxH),y.minW=I(y.minW,r.startMinWidth),y.minH=I(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=L.length;t<n;t++)(v=(m=(h=L[t]).layoutRect())[E])<(p=m[C]+m.flex*b)?(d-=m[E]-m[C],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[k],y={},0===c&&("end"===l?x=d+o[k]:"center"===l?(x=Math.round(r[T]/2-(r[T]-d)/2)+o[k])<0&&(x=o[k]):"justify"===l&&(x=o[k],u=Math.floor(d/(i.length-1)))),y[M]=o[W],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[C],"center"===a?y[M]=Math.round(r[N]/2-m[P]/2):"stretch"===a?(y[P]=I(m[D]||0,r[N]-o[W]-o[O]),y[M]=o[W]):"end"===a&&(y[M]=r[N]-m[P]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[R]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),Ei=Xt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}}),ki=function(e,t){return Gn.one(t,e)},Ti=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},Hi=function(e,t,n){var i=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,i):e.on("init",function(){e.formatter.formatChanged(t,i)})},Si=function(e,n){return function(t){Hi(e,n,function(e){t.control.active(e)})}},Mi=function(i){var t=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",e=[{text:"Left",icon:"alignleft",onclick:Ti(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:Ti(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:Ti(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:Ti(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:e}),i.addButton("align",{type:"menubutton",icon:r,menu:e,onShowMenu:function(e){var n=e.control.menu;w.each(t,function(t,e){n.items().eq(e).each(function(e){return e.active(i.formatter.match(t))})})},onPostRender:function(e){var n=e.control;w.each(t,function(t,e){Hi(i,t,function(e){n.icon(r),e&&n.icon(t)})})}}),w.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Si(i,t)})})},Ni=function(e){return e?e.split(",")[0]:""},Pi=function(l,u){return function(){var a=this;a.state.set("value",null),l.on("init nodeChange",function(e){var t,n,i,r,o=l.queryCommandValue("FontName"),s=(t=u,r=(n=o)?n.toLowerCase():"",w.each(t,function(e){e.value.toLowerCase()===r&&(i=e.value)}),w.each(t,function(e){i||Ni(e.value).toLowerCase()!==Ni(r).toLowerCase()||(i=e.value)}),i);a.value(s||null),!s&&o&&a.text(Ni(o))})}},Di=function(n){n.addButton("fontselect",function(){var e,t=(e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(n.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),w.map(e,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Pi(n,t),onselect:function(e){e.control.settings.value&&n.execCommand("FontName",!1,e.control.settings.value)}}})},Wi=function(e){Di(e)},Oi=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r},Ai=function(e,t,n){var i;return w.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},Bi=function(n){n.addButton("fontsizeselect",function(){var e,s,a,t=(e=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",w.map(e.split(" "),function(e){var t=e,n=e,i=e.split("=");return 1<i.length&&(t=i[0],n=i[1]),{text:t,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:(s=n,a=t,function(){var o=this;s.on("init nodeChange",function(e){var t,n,i,r;if(t=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=Oi(t,i),r=Ai(a,n,t);o.value(r||null),r||o.text(n)})}),onclick:function(e){e.control.settings.value&&n.execCommand("FontSize",!1,e.control.settings.value)}}})},Li=function(e){Bi(e)},Ii=function(n,e){var i=e.length;return w.each(e,function(e){e.menu&&(e.hidden=0===Ii(n,e.menu));var t=e.format;t&&(e.hidden=!n.formatter.canApply(t)),e.hidden&&i--}),i},zi=function(n,e){var i=e.items().length;return e.items().each(function(e){e.menu&&e.visible(0<zi(n,e.menu)),!e.menu&&e.settings.menu&&e.visible(0<Ii(n,e.settings.menu));var t=e.settings.format;t&&e.visible(n.formatter.canApply(t)),e.visible()||i--}),i},Fi=function(e){var i,r,o,t,s,n,a,l,u=(r=0,o=[],t=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(e){var i=[];if(e)return w.each(e,function(e){var t={text:e.title,icon:e.icon};if(e.items)t.menu=s(e.items);else{var n=e.format||"custom"+r++;e.format||(e.name=n,o.push(e)),t.format=n,t.cmd=e.cmd}i.push(t)}),i},(i=e).on("init",function(){w.each(o,function(e){i.formatter.register(e.name,e)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(t.concat(i.settings.style_formats)):s(t):s(i.settings.style_formats||t),onPostRender:function(e){i.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var e,t;(e=n.settings.format)&&(n.disabled(!i.formatter.canApply(e)),n.active(i.formatter.match(e))),(t=n.settings.cmd)&&n.active(i.queryCommandState(t))})},onclick:function(){this.settings.format&&Ti(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,e.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=e).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&zi(a,this.menu)}})},Ui=function(n,e){return function(){var r,o,s,t=[];return w.each(e,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return n.formatter.getCssText(e[1])}})}),{type:"listbox",text:e[0][0],values:t,fixedWidth:!0,onselect:function(e){if(e.control){var t=e.control.value();Ti(n,t)()}},onPostRender:(r=n,o=t,function(){var t=this;r.on("nodeChange",function(e){var n=r.formatter,i=null;w.each(e.parents,function(t){if(w.each(o,function(e){if(s?n.matchNode(t,s,{value:e.value})&&(i=e.value):n.matchNode(t,e.value)&&(i=e.value),i)return!1}),i)return!1}),t.value(i)})})}}},Vi=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,w.map(n,function(e){return{text:e[0],onclick:Ti(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",Ui(e,i))},Yi=function(t,e){var n,i;if("string"==typeof e)i=e.split(" ");else if(w.isArray(e))return function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);te.apply(t,e[n])}return t}(w.map(e,function(e){return Yi(t,e)}));return n=w.grep(i,function(e){return"|"===e||e in t.menuItems}),w.map(n,function(e){return"|"===e?{text:"-"}:t.menuItems[e]})},$i=function(e){return e&&"-"===e.text},Xi=function(e){var t=K(e,function(e,t,n){return!$i(e)||!$i(n[t-1])});return K(t,function(e,t,n){return!$i(e)||0<t&&t<n.length-1})},qi=function(e){var t,n,i,r,o=e.settings.insert_button_items;return Xi(o?Yi(e,o):(t=e,n="insert",i=[{text:"-"}],r=w.grep(t.menuItems,function(e){return e.context===n}),w.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},ji=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(qi(t)),this.menu.renderNew()}})},Ji=function(e){var n,i,r;n=e,w.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){n.addButton(t,{active:!1,tooltip:e,onPostRender:Si(n,t),onclick:Ti(n,t)})}),i=e,w.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){i.addButton(t,{tooltip:e[0],cmd:e[1]})}),r=e,w.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){r.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Si(r,t)})})},Gi=function(e){var n;Ji(e),n=e,w.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,t){n.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:Ti(n,"code")})},Ki=function(n,i){return function(){var e=this,t=function(){var e="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[e]()};e.disabled(!t()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){e.disabled(n.readonly||!t())})}},Zi=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Ki(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Ki(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:Ki(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:Ki(n,"redo"),cmd:"redo"})},Qi=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var t=this;n.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},er={setup:function(e){var t;e.rtl&&(st.rtl=!0),e.on("mousedown",function(){kt.hideAll()}),(t=e).settings.ui_container&&(fe.container=ki(gn.fromDom(document.body),t.settings.ui_container).fold(k(null),function(e){return e.dom()})),Wt.tooltips=!fe.iOS,st.translate=function(e){return h.translate(e)},Vi(e),Mi(e),Gi(e),Zi(e),Li(e),Wi(e),Fi(e),Qi(e),ji(e)}},tr=qt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,S=[],M=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,H="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)S.push(0);for(f=0;f<n;f++)M.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)R=(u=c.layoutRect()).minW,E=u.minH,S[d]=R>S[d]?R:S[d],M[f]=E>M[f]?E:M[f];for(k=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=S[d]+(0<d?b:0),k-=(0<d?b:0)+S[d];for(T=o.innerH-p.top-p.bottom,f=C=0;f<n;f++)C+=M[f]+(0<f?y:0),T-=(0<f?y:0)+M[f];if(_+=p.left+p.right,C+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=C+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var N;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===t.packV?0:0<T?Math.floor(T/n):0;var P=0,D=t.flexWidths;if(D)for(d=0;d<D.length;d++)P+=D[d];else P=i;var W=k/P;for(d=0;d<i;d++)S[d]+=D?D[d]*W:W;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=M[f]+N,d=0;d<i&&(c=r[H?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(S[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}}),nr=Wt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),ir=Wt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),rr=Wt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(Ce.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,Ce.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),or=ct.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),sr=or.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),ar=jt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=b.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof sr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof ar&&n.parent()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),lr=kt.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==fe.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Mt(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),ur=ar.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&&("undefined"!=typeof i.value&&function e(t){for(var n=0;n<t.length;n++){if(r=t[n].selected||i.value===t[n].value)return o=o||t[n].text,s.state.set("value",t[n].value),!0;if(t[n].menu&&e(t[n].menu))return!0}}(t),!r&&0<t.length&&(o=t[0].text,s.state.set("value",t[0].value)),s.state.set("menu",t)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(e){var t=e.control;n&&(e.lastControl=n),i.multiple?t.active(!t.active()):s.value(e.control.value()),n=t})},value:function(t){return 0===arguments.length?this.state.get("value"):(void 0===t||(this.settings.values?0<w.grep(this.settings.values,function(e){return e.value===t}).length?this.state.set("value",t):null===t&&this.state.set("value",null):this.state.set("value",t)),this)},bindStates:function(){var i=this;return i.on("show",function(e){var t,n;t=e.control,n=i.value(),t instanceof lr&&t.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}),i.state.on("change:value",function(t){var n=function e(t,n){var i;if(t)for(var r=0;r<t.length;r++){if(t[r].value===n)return t[r];if(t[r].menu&&(i=e(t[r].menu,n)))return i}}(i.state.get("menu"),t.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),cr=Wt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var t,n=this,e=n.settings,i=n.parent();if(i.items().each(function(e){e!==n&&e.hideMenu()}),e.menu){(t=n.menu)?t.show():((t=e.menu).length?t={type:"menu",items:t}:t.type=t.type||"menu",i.settings.itemDefaults&&(t.itemDefaults=i.settings.itemDefaults),(t=n.menu=b.create(t).parent(n).renderTo()).reflow(),t.on("cancel",function(e){e.stopPropagation(),n.focus(),t.hide()}),t.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),t.on("hide",function(e){e.control===t&&n.classes.remove("selected")}),t.submenu=!0),t._parentMenu=i,t.classes.add("menu-sub");var r=t.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);t.moveRel(n.getEl(),r),r="menu-sub-"+(t.rel=r),t.classes.remove(t._lastRel).add(r),t._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=fe.mac?{alt:"&#x2325;",ctrl:"&#x2318;",shift:"&#x21E7;",meta:"&#x2318;"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),dr=Kt.extend({Defaults:{classes:"radio",role:"radio"}}),fr=Wt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new ft(this._id,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function hr(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var mr=Wt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=hr(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=hr(e.value)}),t._super()}});function gr(e,t,n){return e<t&&(e=t),n<e&&(e=n),e}function pr(e,t,n){e.setAttribute("aria-"+t,n)}function vr(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-Ce.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",pr(s,"valuenow",t),pr(s,"valuetext",""+e.settings.previewFilter(t)),pr(s,"valuemin",e._minValue),pr(s,"valuemax",e._maxValue)}var br=Wt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=X(e.minValue)?e.minValue:0,t._maxValue=X(e.maxValue)?e.maxValue:100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=gr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new ft(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-Ce.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=gr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),vr(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){vr(t,e.value)}),t._super()}}),yr=Wt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),xr=ar.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,we(e).css({width:i.w-Ce.getSize(t).width,height:i.h-2}),we(t).css({height:i.h-2}),this},activeMenu:function(e){we(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._super()}}),wr=Ei.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),_r=bt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),we(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),we(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+e._id+'" aria-selected="false" tabIndex="-1">'+i.encode(e.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+e.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=Ce.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=Ce.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),Cr=Wt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline"):(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=Ce.create(i.multiline?"textarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),Rr=function(){return{Selector:Ue,Collection:$e,ReflowQueue:Qe,Control:st,Factory:b,KeyboardNavigation:lt,Container:ct,DragHelper:ft,Scrollable:vt,Panel:bt,Movable:Se,Resizable:yt,FloatPanel:kt,Window:Vt,MessageBox:Yt,Tooltip:Dt,Widget:Wt,Progress:Ot,Notification:Bt,Layout:Xt,AbsoluteLayout:qt,Button:jt,ButtonGroup:Gt,Checkbox:Kt,ComboBox:Qt,ColorBox:en,PanelButton:tn,ColorButton:rn,ColorPicker:sn,Path:ln,ElementPath:un,FormItem:cn,Form:dn,FieldSet:fn,FilePicker:_i,FitLayout:Ci,FlexLayout:Ri,FlowLayout:Ei,FormatControls:er,GridLayout:tr,Iframe:nr,InfoBox:ir,Label:rr,Toolbar:or,MenuBar:sr,MenuButton:ar,MenuItem:cr,Throbber:Mt,Menu:lr,ListBox:ur,Radio:dr,ResizeHandle:fr,SelectBox:mr,Slider:br,Spacer:yr,SplitButton:xr,StackLayout:wr,TabPanel:_r,TextBox:Cr,DropZone:an,BrowseButton:Jt}},Er=function(n){n.ui?w.each(Rr(),function(e,t){n.ui[t]=e}):n.ui=Rr()};w.each(Rr(),function(e,t){b.add(t,e)}),Er(window.tinymce?window.tinymce:{}),o.add("modern",function(e){return er.setup(e),$t(e)})}();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.2.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2019-08-13 00:00:00.000000000 Z
16
+ date: 2019-03-29 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -21,14 +21,14 @@ dependencies:
21
21
  requirements:
22
22
  - - "~>"
23
23
  - !ruby/object:Gem::Version
24
- version: 0.9.0
24
+ version: 0.10.0
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
29
  - - "~>"
30
30
  - !ruby/object:Gem::Version
31
- version: 0.9.0
31
+ version: 0.10.0
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: acts_as_list
34
34
  requirement: !ruby/object:Gem::Requirement
@@ -253,22 +253,16 @@ dependencies:
253
253
  name: ransack
254
254
  requirement: !ruby/object:Gem::Requirement
255
255
  requirements:
256
- - - ">="
257
- - !ruby/object:Gem::Version
258
- version: '1.8'
259
- - - "<"
256
+ - - "~>"
260
257
  - !ruby/object:Gem::Version
261
- version: '3.0'
258
+ version: '2.0'
262
259
  type: :runtime
263
260
  prerelease: false
264
261
  version_requirements: !ruby/object:Gem::Requirement
265
262
  requirements:
266
- - - ">="
267
- - !ruby/object:Gem::Version
268
- version: '1.8'
269
- - - "<"
263
+ - - "~>"
270
264
  - !ruby/object:Gem::Version
271
- version: '3.0'
265
+ version: '2.0'
272
266
  - !ruby/object:Gem::Dependency
273
267
  name: request_store
274
268
  requirement: !ruby/object:Gem::Requirement
@@ -345,7 +339,7 @@ dependencies:
345
339
  - - ">="
346
340
  - !ruby/object:Gem::Version
347
341
  version: '2.5'
348
- description: Alchemy is a powerful, userfriendly and flexible Rails 4 CMS.
342
+ description: Alchemy is a powerful, userfriendly and flexible Rails 5 CMS.
349
343
  email:
350
344
  - alchemy@magiclabs.de
351
345
  executables: []
@@ -393,6 +387,7 @@ files:
393
387
  - app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee
394
388
  - app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee
395
389
  - app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee
390
+ - app/assets/javascripts/alchemy/alchemy.fixed_elements.js
396
391
  - app/assets/javascripts/alchemy/alchemy.growler.js.coffee
397
392
  - app/assets/javascripts/alchemy/alchemy.gui.js.coffee
398
393
  - app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee
@@ -433,7 +428,9 @@ files:
433
428
  - app/assets/stylesheets/alchemy/dialogs.scss
434
429
  - app/assets/stylesheets/alchemy/elements.scss
435
430
  - app/assets/stylesheets/alchemy/errors.scss
431
+ - app/assets/stylesheets/alchemy/filter_field.scss
436
432
  - app/assets/stylesheets/alchemy/flash.scss
433
+ - app/assets/stylesheets/alchemy/flatpickr.scss
437
434
  - app/assets/stylesheets/alchemy/fonts.scss
438
435
  - app/assets/stylesheets/alchemy/form_fields.scss
439
436
  - app/assets/stylesheets/alchemy/forms.scss
@@ -442,7 +439,6 @@ files:
442
439
  - app/assets/stylesheets/alchemy/icons.scss
443
440
  - app/assets/stylesheets/alchemy/image_library.scss
444
441
  - app/assets/stylesheets/alchemy/jquery-ui.scss
445
- - app/assets/stylesheets/alchemy/jquery.datetimepicker.scss
446
442
  - app/assets/stylesheets/alchemy/lists.scss
447
443
  - app/assets/stylesheets/alchemy/menubar.scss
448
444
  - app/assets/stylesheets/alchemy/navigation.scss
@@ -501,6 +497,7 @@ files:
501
497
  - app/controllers/alchemy/elements_controller.rb
502
498
  - app/controllers/alchemy/messages_controller.rb
503
499
  - app/controllers/alchemy/pages_controller.rb
500
+ - app/controllers/concerns/alchemy/admin/archive_overlay.rb
504
501
  - app/controllers/concerns/alchemy/admin/uploader_responses.rb
505
502
  - app/controllers/concerns/alchemy/legacy_page_redirects.rb
506
503
  - app/controllers/concerns/alchemy/locale_redirects.rb
@@ -526,7 +523,6 @@ files:
526
523
  - app/mailers/alchemy/messages_mailer.rb
527
524
  - app/models/alchemy/attachment.rb
528
525
  - app/models/alchemy/base_record.rb
529
- - app/models/alchemy/cell.rb
530
526
  - app/models/alchemy/content.rb
531
527
  - app/models/alchemy/content/factory.rb
532
528
  - app/models/alchemy/element.rb
@@ -552,7 +548,6 @@ files:
552
548
  - app/models/alchemy/message.rb
553
549
  - app/models/alchemy/page.rb
554
550
  - app/models/alchemy/page/fixed_attributes.rb
555
- - app/models/alchemy/page/page_cells.rb
556
551
  - app/models/alchemy/page/page_elements.rb
557
552
  - app/models/alchemy/page/page_naming.rb
558
553
  - app/models/alchemy/page/page_natures.rb
@@ -568,7 +563,6 @@ files:
568
563
  - app/models/concerns/alchemy/content_touching.rb
569
564
  - app/serializers/alchemy/attachment_serializer.rb
570
565
  - app/serializers/alchemy/base_serializer.rb
571
- - app/serializers/alchemy/cell_serializer.rb
572
566
  - app/serializers/alchemy/content_serializer.rb
573
567
  - app/serializers/alchemy/element_serializer.rb
574
568
  - app/serializers/alchemy/essence_boolean_serializer.rb
@@ -606,8 +600,6 @@ files:
606
600
  - app/views/alchemy/admin/clipboard/remove.js.erb
607
601
  - app/views/alchemy/admin/contents/_missing.html.erb
608
602
  - app/views/alchemy/admin/contents/create.js.erb
609
- - app/views/alchemy/admin/contents/new.html.erb
610
- - app/views/alchemy/admin/contents/order.js.erb
611
603
  - app/views/alchemy/admin/dashboard/_locked_pages.html.erb
612
604
  - app/views/alchemy/admin/dashboard/_recent_pages.html.erb
613
605
  - app/views/alchemy/admin/dashboard/_sites.html.erb
@@ -615,13 +607,11 @@ files:
615
607
  - app/views/alchemy/admin/dashboard/help.html.erb
616
608
  - app/views/alchemy/admin/dashboard/index.html.erb
617
609
  - app/views/alchemy/admin/dashboard/info.html.erb
618
- - app/views/alchemy/admin/elements/_add_picture.html.erb
619
610
  - app/views/alchemy/admin/elements/_element.html.erb
620
611
  - app/views/alchemy/admin/elements/_element_footer.html.erb
621
612
  - app/views/alchemy/admin/elements/_element_header.html.erb
622
613
  - app/views/alchemy/admin/elements/_element_toolbar.html.erb
623
614
  - app/views/alchemy/admin/elements/_new_element_form.html.erb
624
- - app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb
625
615
  - app/views/alchemy/admin/elements/create.js.erb
626
616
  - app/views/alchemy/admin/elements/fold.js.erb
627
617
  - app/views/alchemy/admin/elements/index.html.erb
@@ -792,7 +782,6 @@ files:
792
782
  - app/views/layouts/alchemy/sitemap.xml.erb
793
783
  - bin/rails
794
784
  - bin/rspec
795
- - bin/spring
796
785
  - config/alchemy/config.yml
797
786
  - config/alchemy/modules.yml
798
787
  - config/brakeman.ignore
@@ -806,6 +795,7 @@ files:
806
795
  - config/spring.rb
807
796
  - db/migrate/20180226123013_alchemy_four_point_zero.rb
808
797
  - db/migrate/20180227224537_migrate_tags_to_gutentag.rb
798
+ - db/migrate/20180519204655_add_fixed_to_alchemy_elements.rb
809
799
  - lib/alchemy/ability_helper.rb
810
800
  - lib/alchemy/admin/locale.rb
811
801
  - lib/alchemy/auth_accessors.rb
@@ -814,6 +804,7 @@ files:
814
804
  - lib/alchemy/configuration_methods.rb
815
805
  - lib/alchemy/controller_actions.rb
816
806
  - lib/alchemy/deprecation.rb
807
+ - lib/alchemy/elements_finder.rb
817
808
  - lib/alchemy/engine.rb
818
809
  - lib/alchemy/errors.rb
819
810
  - lib/alchemy/essence.rb
@@ -845,7 +836,6 @@ files:
845
836
  - lib/alchemy/test_support/essence_shared_examples.rb
846
837
  - lib/alchemy/test_support/factories.rb
847
838
  - lib/alchemy/test_support/factories/attachment_factory.rb
848
- - lib/alchemy/test_support/factories/cell_factory.rb
849
839
  - lib/alchemy/test_support/factories/content_factory.rb
850
840
  - lib/alchemy/test_support/factories/dummy_user_factory.rb
851
841
  - lib/alchemy/test_support/factories/element_factory.rb
@@ -863,7 +853,12 @@ files:
863
853
  - lib/alchemy/tinymce.rb
864
854
  - lib/alchemy/upgrader.rb
865
855
  - lib/alchemy/upgrader/four_point_one.rb
856
+ - lib/alchemy/upgrader/four_point_two.rb
857
+ - lib/alchemy/upgrader/tasks/cells_migration.rb
858
+ - lib/alchemy/upgrader/tasks/cells_upgrader.rb
866
859
  - lib/alchemy/upgrader/tasks/harden_acts_as_taggable_on_migrations.rb
860
+ - lib/alchemy/upgrader/tasks/picture_gallery_migration.rb
861
+ - lib/alchemy/upgrader/tasks/picture_gallery_upgrader.rb
867
862
  - lib/alchemy/userstamp.rb
868
863
  - lib/alchemy/version.rb
869
864
  - lib/alchemy_cms.rb
@@ -923,13 +918,12 @@ files:
923
918
  - vendor/assets/fonts/fa-solid-900.woff2
924
919
  - vendor/assets/images/Jcrop.gif
925
920
  - vendor/assets/javascripts/clipboard.min.js
926
- - vendor/assets/javascripts/date-formatter.js
927
921
  - vendor/assets/javascripts/fileupload/jquery.fileupload-process.js
928
922
  - vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js
929
923
  - vendor/assets/javascripts/fileupload/jquery.fileupload.js
930
924
  - vendor/assets/javascripts/fileupload/jquery.iframe-transport.js
925
+ - vendor/assets/javascripts/flatpickr/flatpickr.min.js
931
926
  - vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js
932
- - vendor/assets/javascripts/jquery_plugins/jquery.datetimepicker.full.min.js
933
927
  - vendor/assets/javascripts/jquery_plugins/jquery.scrollTo.min.js
934
928
  - vendor/assets/javascripts/jquery_plugins/jquery.ui.nestedSortable.js
935
929
  - vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js
@@ -986,16 +980,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
986
980
  requirements:
987
981
  - - ">="
988
982
  - !ruby/object:Gem::Version
989
- version: 2.2.2
983
+ version: 2.3.0
990
984
  required_rubygems_version: !ruby/object:Gem::Requirement
991
985
  requirements:
992
- - - ">="
986
+ - - ">"
993
987
  - !ruby/object:Gem::Version
994
- version: '0'
988
+ version: 1.3.1
995
989
  requirements:
996
990
  - ImageMagick (libmagick), v6.6 or greater.
997
991
  rubygems_version: 3.0.3
998
992
  signing_key:
999
993
  specification_version: 4
1000
- summary: A powerful, userfriendly and flexible CMS for Rails 4
994
+ summary: A powerful, userfriendly and flexible CMS for Rails 5
1001
995
  test_files: []