Version Description
- Crop Constraints are visually available: green is good and red means there will be upscaling
- In the options panel change the size of the cropping image
- Bug fix: 3.6 compatibility
- Added thumbnail metadata to table
Download this release
Release Info
Developer | sewpafly |
Plugin | Post Thumbnail Editor |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.1.0
- README.txt +10 -4
- html/pte.php +23 -4
- i18n/post-thumbnail-editor.pot +95 -66
- js-build/main.js +1 -1
- js-build/main.js.gz +0 -0
- js/controllers/CropCtrl.coffee +16 -2
- js/jcrop-api.coffee +22 -2
- js/main.js +1 -1
- js/snippets/admin.coffee +12 -9
- php/functions.php +9 -4
- php/log.php +1 -1
- php/options.php +107 -74
- php/overwrite_imgedit_preview.php +64 -0
- post-thumbnail-editor.php +199 -195
README.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Post Thumbnail Editor ===
|
2 |
Contributors: sewpafly
|
3 |
Donate link: https://www.wepay.com/donate/34543
|
4 |
-
Tags: post-thumbnail, post thumbnail, featured image, featured, editor, image, awesome
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 3.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2
|
9 |
|
@@ -63,6 +63,12 @@ Using a version with [json_encode](http://www.php.net/manual/en/function.json-en
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 2.0.1 =
|
67 |
* IE fix with the jcrop api
|
68 |
* Now go into the view mode after cropping
|
@@ -120,5 +126,5 @@ Using a version with [json_encode](http://www.php.net/manual/en/function.json-en
|
|
120 |
|
121 |
== Upgrade Notice ==
|
122 |
|
123 |
-
= 2.0
|
124 |
-
Several new features and bug fixes since 2.0.
|
1 |
=== Post Thumbnail Editor ===
|
2 |
Contributors: sewpafly
|
3 |
Donate link: https://www.wepay.com/donate/34543
|
4 |
+
Tags: post-thumbnail, post thumbnail, featured image, featured, editor, image, awesome, crop
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 3.6
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2
|
9 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 2.1.0 =
|
67 |
+
* Crop Constraints are visually available: green is good and red means there will be upscaling
|
68 |
+
* In the options panel change the size of the cropping image
|
69 |
+
* Bug fix: 3.6 compatibility
|
70 |
+
* Added thumbnail metadata to table
|
71 |
+
|
72 |
= 2.0.1 =
|
73 |
* IE fix with the jcrop api
|
74 |
* Now go into the view mode after cropping
|
126 |
|
127 |
== Upgrade Notice ==
|
128 |
|
129 |
+
= 2.1.0 =
|
130 |
+
Several new features and bug fixes since 2.0.1
|
html/pte.php
CHANGED
@@ -11,9 +11,19 @@ $options = pte_get_options();
|
|
11 |
<base href="/wp-admin/"/>
|
12 |
-->
|
13 |
<script type="text/javascript" charset="utf-8">
|
14 |
-
var post_id = <?php echo $post->ID; ?>
|
15 |
-
, post_width = <?php echo $meta['width']; ?>
|
16 |
-
, post_height = <?php echo $meta['height']; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
</script>
|
18 |
|
19 |
<link rel="stylesheet" href="<?php ep() ?>apps/font-awesome/css/font-awesome.css"/>
|
@@ -72,6 +82,9 @@ $options = pte_get_options();
|
|
72 |
#pte-thumbnail-table td input {
|
73 |
margin: 1px 0 0;
|
74 |
}
|
|
|
|
|
|
|
75 |
|
76 |
#aspect-ratio-selector {
|
77 |
margin-top: 20px;
|
@@ -190,7 +203,7 @@ $options = pte_get_options();
|
|
190 |
<div id="pte-image" ng-controller="CropCtrl">
|
191 |
<img id="pte-preview" src="<?php
|
192 |
echo admin_url('admin-ajax.php');
|
193 |
-
?>?action=
|
194 |
echo $nonce;
|
195 |
?>&postid=<?php
|
196 |
echo $post->ID;
|
@@ -244,6 +257,9 @@ $options = pte_get_options();
|
|
244 |
<input type="checkbox" ng-model="tableSelector" ng-change="toggleAll()"/>
|
245 |
</th>
|
246 |
<th><?php _e( "Thumbnails" ); ?></th>
|
|
|
|
|
|
|
247 |
<th class="center">
|
248 |
<span class="pte-thumbnails-menu">
|
249 |
<i ng-show="anyProposed()"
|
@@ -277,6 +293,9 @@ $options = pte_get_options();
|
|
277 |
|
278 |
</td>
|
279 |
<td>{{ thumbnail.name }}</td>
|
|
|
|
|
|
|
280 |
<td class="center pte-thumbnail-options">
|
281 |
<span class="pte-thumbnail-menu">
|
282 |
<i ng-show="thumbnail.proposed"
|
11 |
<base href="/wp-admin/"/>
|
12 |
-->
|
13 |
<script type="text/javascript" charset="utf-8">
|
14 |
+
var post_id = <?php echo $post->ID; ?>
|
15 |
+
, post_width = <?php echo $meta['width']; ?>
|
16 |
+
, post_height = <?php echo $meta['height']; ?>
|
17 |
+
, pteI18n = <?php echo json_encode(
|
18 |
+
array( 'no_t_selected' => __( 'No thumbnails selected', PTE_DOMAIN )
|
19 |
+
, 'no_c_selected' => __( 'No crop selected', PTE_DOMAIN )
|
20 |
+
, 'crop_problems' => __( 'Cropping will likely result in skewed imagery', PTE_DOMAIN )
|
21 |
+
, 'save_crop_problem' => __( 'There was a problem saving the crop...', PTE_DOMAIN )
|
22 |
+
, 'cropSave' => __( 'Crop and Save', PTE_DOMAIN )
|
23 |
+
, 'crop' => __( 'Crop', PTE_DOMAIN )
|
24 |
+
));
|
25 |
+
?>;
|
26 |
+
|
27 |
</script>
|
28 |
|
29 |
<link rel="stylesheet" href="<?php ep() ?>apps/font-awesome/css/font-awesome.css"/>
|
82 |
#pte-thumbnail-table td input {
|
83 |
margin: 1px 0 0;
|
84 |
}
|
85 |
+
.align-right {
|
86 |
+
text-align: right !important;
|
87 |
+
}
|
88 |
|
89 |
#aspect-ratio-selector {
|
90 |
margin-top: 20px;
|
203 |
<div id="pte-image" ng-controller="CropCtrl">
|
204 |
<img id="pte-preview" src="<?php
|
205 |
echo admin_url('admin-ajax.php');
|
206 |
+
?>?action=pte_imgedit_preview&_ajax_nonce=<?php
|
207 |
echo $nonce;
|
208 |
?>&postid=<?php
|
209 |
echo $post->ID;
|
257 |
<input type="checkbox" ng-model="tableSelector" ng-change="toggleAll()"/>
|
258 |
</th>
|
259 |
<th><?php _e( "Thumbnails" ); ?></th>
|
260 |
+
<th class="align-right"><?php _e( "W" ); ?></th>
|
261 |
+
<th class="align-right"><?php _e( "H" ); ?></th>
|
262 |
+
<th><?php _e( "C" ); ?></th>
|
263 |
<th class="center">
|
264 |
<span class="pte-thumbnails-menu">
|
265 |
<i ng-show="anyProposed()"
|
293 |
|
294 |
</td>
|
295 |
<td>{{ thumbnail.name }}</td>
|
296 |
+
<td class="align-right">{{ thumbnail.width }}</td>
|
297 |
+
<td class="align-right">{{ thumbnail.height }}</td>
|
298 |
+
<td>{{ thumbnail.crop }}</td>
|
299 |
<td class="center pte-thumbnail-options">
|
300 |
<span class="pte-thumbnail-menu">
|
301 |
<i ng-show="thumbnail.proposed"
|
i18n/post-thumbnail-editor.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Post Thumbnail Editor package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Post Thumbnail Editor 2.0.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-thumbnail-editor\n"
|
7 |
-
"POT-Creation-Date: 2013-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -12,91 +12,124 @@ msgstr ""
|
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
#: html/pte.php:168 php/options.php:66 post-thumbnail-editor.php:122
|
18 |
-
#: post-thumbnail-editor.php:225 post-thumbnail-editor.php:226
|
19 |
-
#: post-thumbnail-editor.php:234 post-thumbnail-editor.php:235
|
20 |
-
msgid "Post Thumbnail Editor"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: html/pte.php:
|
24 |
-
msgid "crop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: html/pte.php:
|
28 |
msgid "Crop"
|
29 |
msgstr ""
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
msgid "View"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: html/pte.php:
|
36 |
msgid "Options"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: html/pte.php:
|
40 |
msgid "Aspect Ratio"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: html/pte.php:
|
44 |
msgid "width/height"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: html/pte.php:
|
48 |
msgid "Crop and save"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: html/pte.php:
|
52 |
msgid "Thumbnails"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: html/pte.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
msgid "Save all"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: html/pte.php:
|
60 |
msgid "Reset all"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: html/pte.php:
|
64 |
msgid "View all/modified"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: html/pte.php:
|
68 |
msgid "Save"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: html/pte.php:
|
72 |
msgid "Reset"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: html/pte.php:
|
76 |
msgid "Compare/View"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: html/pte.php:
|
80 |
msgid "These thumbnails have an aspect ratio set:"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: html/pte.php:
|
84 |
msgid "Original"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: html/pte.php:
|
88 |
msgid "No image has been generated yet for image: "
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: html/pte.php:
|
92 |
msgid "Proposed"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: php/functions.php:
|
96 |
msgid "Invalid meta data for POST #%d: %s"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: php/functions.php:
|
100 |
msgid "Please contact support"
|
101 |
msgstr ""
|
102 |
|
@@ -124,100 +157,96 @@ msgstr ""
|
|
124 |
msgid "Debug"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: php/options.php:
|
128 |
-
msgid "Crop
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: php/options.php:
|
132 |
msgid "Reset to defaults"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: php/options.php:
|
136 |
msgid "Site Options"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: php/options.php:
|
140 |
msgid "JPEG Compression"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: php/options.php:
|
144 |
msgid "Cache Buster"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: php/options.php:
|
148 |
msgid "Save Changes"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: php/options.php:
|
152 |
msgid ""
|
153 |
"Only users with the 'manage_options' capability may make changes to these "
|
154 |
"settings."
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: php/options.php:
|
158 |
msgid "JPEG Compression needs to be set from 0 to 100."
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: php/options.php:
|
|
|
|
|
|
|
|
|
162 |
msgid "Enable debugging"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: php/options.php:
|
166 |
msgid "WP_DEBUG is currently set to true and will override this setting."
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: php/options.php:
|
170 |
msgid "I know what I'm doing, bypass the image verification."
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: php/options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
msgid "Reset User Options"
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: php/options.php:
|
178 |
msgid "Post Thumbnail"
|
179 |
msgstr ""
|
180 |
|
181 |
-
#: php/options.php:
|
182 |
msgid "Hidden"
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: php/options.php:
|
186 |
msgid "Set the compression level for resizing jpeg images (0 to 100)."
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: php/options.php:
|
190 |
msgid "No entry defaults to using the 'jpeg_quality' filter or 90"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: php/options.php:
|
194 |
msgid "Append timestamp to filename. Useful for solving caching problems."
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: php/options.php:
|
198 |
msgid "These site-wide settings can only be changed by an administrator"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: post-thumbnail-editor.php:
|
202 |
msgid "Edit Thumbnails"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: post-thumbnail-editor.php:294
|
206 |
-
msgid "No thumbnails selected"
|
207 |
-
msgstr ""
|
208 |
-
|
209 |
-
#: post-thumbnail-editor.php:295
|
210 |
-
msgid "No crop selected"
|
211 |
-
msgstr ""
|
212 |
-
|
213 |
-
#: post-thumbnail-editor.php:296
|
214 |
-
msgid "Cropping will likely result in skewed imagery"
|
215 |
-
msgstr ""
|
216 |
-
|
217 |
-
#: post-thumbnail-editor.php:297
|
218 |
-
msgid "There was a problem saving the crop..."
|
219 |
-
msgstr ""
|
220 |
-
|
221 |
#. Plugin URI of the plugin/theme
|
222 |
msgid "http://wordpress.org/extend/plugins/post-thumbnail-editor/"
|
223 |
msgstr ""
|
@@ -231,5 +260,5 @@ msgid "sewpafly"
|
|
231 |
msgstr ""
|
232 |
|
233 |
#. Author URI of the plugin/theme
|
234 |
-
msgid "http://sewpafly.github.
|
235 |
msgstr ""
|
2 |
# This file is distributed under the same license as the Post Thumbnail Editor package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Post Thumbnail Editor 2.0.2-beta\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-thumbnail-editor\n"
|
7 |
+
"POT-Creation-Date: 2013-04-26 19:43:47+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#: html/pte.php:18
|
16 |
+
msgid "No thumbnails selected"
|
|
|
|
|
|
|
|
|
17 |
msgstr ""
|
18 |
|
19 |
+
#: html/pte.php:19
|
20 |
+
msgid "No crop selected"
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: html/pte.php:20
|
24 |
+
msgid "Cropping will likely result in skewed imagery"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: html/pte.php:21
|
28 |
+
msgid "There was a problem saving the crop..."
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: html/pte.php:22 php/options.php:22
|
32 |
+
msgid "Crop and Save"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: html/pte.php:23 html/pte.php:186
|
36 |
msgid "Crop"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#. #-#-#-#-# post-thumbnail-editor.pot (Post Thumbnail Editor 2.0.2-beta) #-#-#-#-#
|
40 |
+
#. Plugin Name of the plugin/theme
|
41 |
+
#: html/pte.php:181 php/options.php:72 post-thumbnail-editor.php:143
|
42 |
+
#: post-thumbnail-editor.php:187 post-thumbnail-editor.php:271
|
43 |
+
#: post-thumbnail-editor.php:272 post-thumbnail-editor.php:278
|
44 |
+
#: post-thumbnail-editor.php:279 post-thumbnail-editor.php:316
|
45 |
+
msgid "Post Thumbnail Editor"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
#: html/pte.php:182
|
49 |
+
msgid "crop and resize"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: html/pte.php:187
|
53 |
msgid "View"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: html/pte.php:216
|
57 |
msgid "Options"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: html/pte.php:231
|
61 |
msgid "Aspect Ratio"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: html/pte.php:234
|
65 |
msgid "width/height"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: html/pte.php:240
|
69 |
msgid "Crop and save"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: html/pte.php:259 php/options.php:49 post-thumbnail-editor.php:239
|
73 |
msgid "Thumbnails"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: html/pte.php:260
|
77 |
+
msgid "W"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: html/pte.php:261
|
81 |
+
msgid "H"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: html/pte.php:262
|
85 |
+
msgid "C"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: html/pte.php:268
|
89 |
msgid "Save all"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: html/pte.php:273
|
93 |
msgid "Reset all"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: html/pte.php:277
|
97 |
msgid "View all/modified"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: html/pte.php:303
|
101 |
msgid "Save"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: html/pte.php:306
|
105 |
msgid "Reset"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: html/pte.php:309
|
109 |
msgid "Compare/View"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: html/pte.php:316
|
113 |
msgid "These thumbnails have an aspect ratio set:"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: html/pte.php:341
|
117 |
msgid "Original"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: html/pte.php:348
|
121 |
msgid "No image has been generated yet for image: "
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: html/pte.php:355
|
125 |
msgid "Proposed"
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: php/functions.php:244
|
129 |
msgid "Invalid meta data for POST #%d: %s"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: php/functions.php:249
|
133 |
msgid "Please contact support"
|
134 |
msgstr ""
|
135 |
|
157 |
msgid "Debug"
|
158 |
msgstr ""
|
159 |
|
160 |
+
#: php/options.php:28
|
161 |
+
msgid "Crop Picture Size"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: php/options.php:34
|
165 |
msgid "Reset to defaults"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: php/options.php:45
|
169 |
msgid "Site Options"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: php/options.php:54
|
173 |
msgid "JPEG Compression"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: php/options.php:59
|
177 |
msgid "Cache Buster"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: php/options.php:80
|
181 |
msgid "Save Changes"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: php/options.php:94
|
185 |
msgid ""
|
186 |
"Only users with the 'manage_options' capability may make changes to these "
|
187 |
"settings."
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: php/options.php:120
|
191 |
msgid "JPEG Compression needs to be set from 0 to 100."
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: php/options.php:145
|
195 |
+
msgid "Crop Size must be between 0 and 10000."
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: php/options.php:163
|
199 |
msgid "Enable debugging"
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: php/options.php:166
|
203 |
msgid "WP_DEBUG is currently set to true and will override this setting."
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: php/options.php:181
|
207 |
msgid "I know what I'm doing, bypass the image verification."
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: php/options.php:194
|
211 |
+
msgid "Set the max size for the crop image."
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: php/options.php:195
|
215 |
+
msgid "No entry defaults to 600"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: php/options.php:204
|
219 |
msgid "Reset User Options"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: php/options.php:230
|
223 |
msgid "Post Thumbnail"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: php/options.php:231
|
227 |
msgid "Hidden"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: php/options.php:259
|
231 |
msgid "Set the compression level for resizing jpeg images (0 to 100)."
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: php/options.php:260
|
235 |
msgid "No entry defaults to using the 'jpeg_quality' filter or 90"
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: php/options.php:272
|
239 |
msgid "Append timestamp to filename. Useful for solving caching problems."
|
240 |
msgstr ""
|
241 |
|
242 |
+
#: php/options.php:283
|
243 |
msgid "These site-wide settings can only be changed by an administrator"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: post-thumbnail-editor.php:238
|
247 |
msgid "Edit Thumbnails"
|
248 |
msgstr ""
|
249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
#. Plugin URI of the plugin/theme
|
251 |
msgid "http://wordpress.org/extend/plugins/post-thumbnail-editor/"
|
252 |
msgstr ""
|
260 |
msgstr ""
|
261 |
|
262 |
#. Author URI of the plugin/theme
|
263 |
+
msgid "http://sewpafly.github.io/post-thumbnail-editor"
|
264 |
msgstr ""
|
js-build/main.js
CHANGED
@@ -17,4 +17,4 @@
|
|
17 |
* see: http://github.com/requirejs/domReady for details
|
18 |
*/
|
19 |
|
20 |
-
define("cs",{load:function(e){throw new Error("Dynamic load not allowed: "+e)}}),function(){define("cs!jquery",[],function(){return jQuery?jQuery.noConflict():{}})}.call(this),function(e,t,n){function r(e,t,n){var i;if(e)if(E(e))for(i in e)i!="prototype"&&i!="length"&&i!="name"&&e.hasOwnProperty(i)&&t.call(n,e[i],i);else if(e.forEach&&e.forEach!==r)e.forEach(t,n);else if(!e||typeof e.length!="number"?0:typeof e.hasOwnProperty!="function"&&typeof e.constructor!="function"||e instanceof K||Ln&&e instanceof Ln||Mn.call(e)!=="[object Object]"||typeof e.callee=="function")for(i=0;i<e.length;i++)t.call(n,e[i],i);else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i);return e}function i(e){var t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push(n);return t.sort()}function s(e,t,n){for(var r=i(e),s=0;s<r.length;s++)t.call(n,e[r[s]],r[s]);return r}function o(e){return function(t,n){e(n,t)}}function u(){for(var e=Hn.length,t;e;){e--,t=Hn[e].charCodeAt(0);if(t==57)return Hn[e]="A",Hn.join("");if(t!=90)return Hn[e]=String.fromCharCode(t+1),Hn.join("");Hn[e]="0"}return Hn.unshift("0"),Hn.join("")}function a(e){return r(arguments,function(t){t!==e&&r(t,function(t,n){e[n]=t})}),e}function f(e){return parseInt(e,10)}function l(e,t){return a(new(a(function(){},{prototype:e})),t)}function c(){}function h(e){return e}function p(e){return function(){return e}}function d(e){return typeof e=="undefined"}function v(e){return typeof e!="undefined"}function m(e){return e!=null&&typeof e=="object"}function g(e){return typeof e=="string"}function y(e){return typeof e=="number"}function b(e){return Mn.apply(e)=="[object Date]"}function w(e){return Mn.apply(e)=="[object Array]"}function E(e){return typeof e=="function"}function S(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function x(e){return g(e)?e.replace(/^\s*/,"").replace(/\s*$/,""):e}function T(e){return e&&(e.nodeName||e.bind&&e.find)}function N(e,t,n){var i=[];return r(e,function(e,r,s){i.push(t.call(n,e,r,s))}),i}function C(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1}function k(e,t){var n=C(e,t);return n>=0&&e.splice(n,1),t}function L(e,t){if(S(e)||e&&e.$evalAsync&&e.$watch)throw Error("Can't copy Window or Scope");if(t){if(e===t)throw Error("Can't copy equivalent objects or arrays");if(w(e))for(var n=t.length=0;n<e.length;n++)t.push(L(e[n]));else for(n in r(t,function(e,n){delete t[n]}),e)t[n]=L(e[n])}else(t=e)&&(w(e)?t=L(e,[]):b(e)?t=new Date(e.getTime()):m(e)&&(t=L(e,{})));return t}function A(e,t){var t=t||{},n;for(n in e)e.hasOwnProperty(n)&&n.substr(0,2)!=="$$"&&(t[n]=e[n]);return t}function O(e,t){if(e===t)return!0;if(e===null||t===null)return!1;if(e!==e&&t!==t)return!0;var r=typeof e,i;if(r==typeof t&&r=="object"){if(!w(e)){if(b(e))return b(t)&&e.getTime()==t.getTime();if(e&&e.$evalAsync&&e.$watch||t&&t.$evalAsync&&t.$watch||S(e)||S(t))return!1;r={};for(i in e)if(i.charAt(0)!=="$"&&!E(e[i])){if(!O(e[i],t[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&i.charAt(0)!=="$"&&t[i]!==n&&!E(t[i]))return!1;return!0}if((r=e.length)==t.length){for(i=0;i<r;i++)if(!O(e[i],t[i]))return!1;return!0}}return!1}function M(e,t){var n=arguments.length>2?An.call(arguments,2):[];return!E(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,n.concat(An.call(arguments,0))):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function _(e,r){var i=r;return/^\$+/.test(e)?i=n:S(r)?i="$WINDOW":r&&t===r?i="$DOCUMENT":r&&r.$evalAsync&&r.$watch&&(i="$SCOPE"),i}function D(e,t){return JSON.stringify(e,_,t?" ":null)}function P(e){return g(e)?JSON.parse(e):e}function H(e){return e&&e.length!==0?(e=Tn(""+e),e=e!="f"&&e!="0"&&e!="false"&&e!="no"&&e!="n"&&e!="[]"):e=!1,e}function B(e){e=kn(e).clone();try{e.html("")}catch(t){}var n=kn("<div>").append(e).html();try{return e[0].nodeType===3?Tn(n):n.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(e,t){return"<"+Tn(t)})}catch(r){return Tn(n)}}function j(e){var t={},n,i;return r((e||"").split("&"),function(e){e&&(n=e.split("="),i=decodeURIComponent(n[0]),t[i]=v(n[1])?decodeURIComponent(n[1]):!0)}),t}function F(e){var t=[];return r(e,function(e,n){t.push(q(n,!0)+(e===!0?"":"="+q(e,!0)))}),t.length?t.join("&"):""}function I(e){return q(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function q(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(t?null:/%20/g,"+")}function R(e,n){function i(e){e&&s.push(e)}var s=[e],o,u,a=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;r(a,function(n){a[n]=!0,i(t.getElementById(n)),n=n.replace(":","\\:"),e.querySelectorAll&&(r(e.querySelectorAll("."+n),i),r(e.querySelectorAll("."+n+"\\:"),i),r(e.querySelectorAll("["+n+"]"),i))}),r(s,function(e){if(!o){var t=f.exec(" "+e.className+" ");t?(o=e,u=(t[2]||"").replace(/\s+/g,",")):r(e.attributes,function(t){!o&&a[t.name]&&(o=e,u=t.value)})}}),o&&n(o,u?[u]:[])}function U(e,t){e=kn(e),t=t||[],t.unshift(["$provide",function(t){t.value("$rootElement",e)}]),t.unshift("ng");var n=dt(t);return n.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,r){e.$apply(function(){t.data("$injector",r),n(t)(e)})}]),n}function z(e,t){return t=t||"_",e.replace(Bn,function(e,n){return(n?t:"")+e.toLowerCase()})}function W(e,t,n){if(!e)throw Error("Argument '"+(t||"?")+"' is "+(n||"required"));return e}function X(e,t,n){return n&&w(e)&&(e=e[e.length-1]),W(E(e),t,"not a function, got "+(e&&typeof e=="object"?e.constructor.name||"Object":typeof e)),e}function V(e){function t(e,t,n){return e[t]||(e[t]=n())}return t(t(e,"angular",Object),"module",function(){var e={};return function(n,r,i){return r&&e.hasOwnProperty(n)&&(e[n]=null),t(e,n,function(){function e(e,n,r){return function(){return t[r||"push"]([e,n,arguments]),u}}if(!r)throw Error("No module: "+n);var t=[],s=[],o=e("$injector","invoke"),u={_invokeQueue:t,_runBlocks:s,requires:r,name:n,provider:e("$provide","provider"),factory:e("$provide","factory"),service:e("$provide","service"),value:e("$provide","value"),constant:e("$provide","constant","unshift"),filter:e("$filterProvider","register"),controller:e("$controllerProvider","register"),directive:e("$compileProvider","directive"),config:o,run:function(e){return s.push(e),this}};return i&&o(i),u})}})}function $(e){return e.replace(zn,function(e,t,n,r){return r?n.toUpperCase():n}).replace(Wn,"Moz$1")}function J(e,t){function n(){var e;for(var n=[this],i=t,s,o,u,a,f,l;n.length;){s=n.shift(),o=0;for(u=s.length;o<u;o++){a=kn(s[o]),i?a.triggerHandler("$destroy"):i=!i,f=0;for(e=(l=a.children()).length,a=e;f<a;f++)n.push(Ln(l[f]))}}return r.apply(this,arguments)}var r=Ln.fn[e],r=r.$original||r;n.$original=r,Ln.fn[e]=n}function K(e){if(e instanceof K)return e;if(!(this instanceof K)){if(g(e)&&e.charAt(0)!="<")throw Error("selectors not implemented");return new K(e)}if(g(e)){var n=t.createElement("div");n.innerHTML="<div> </div>"+e,n.removeChild(n.firstChild),st(this,n.childNodes),this.remove()}else st(this,e)}function Q(e){return e.cloneNode(!0)}function G(e){Z(e);for(var t=0,e=e.childNodes||[];t<e.length;t++)G(e[t])}function Y(e,t,n){var i=et(e,"events");et(e,"handle")&&(d(t)?r(i,function(t,n){Un(e,n,t),delete i[n]}):d(n)?(Un(e,t,i[t]),delete i[t]):k(i[t],n))}function Z(e){var t=e[In],r=Fn[t];r&&(r.handle&&(r.events.$destroy&&r.handle({},"$destroy"),Y(e)),delete Fn[t],e[In]=n)}function et(e,t,n){var r=e[In],r=Fn[r||-1];if(!v(n))return r&&r[t];r||(e[In]=r=++qn,r=Fn[r]={}),r[t]=n}function tt(e,t,n){var r=et(e,"data"),i=v(n),s=!i&&v(t),o=s&&!m(t);!r&&!o&&et(e,"data",r={});if(i)r[t]=n;else{if(!s)return r;if(o)return r&&r[t];a(r,t)}}function nt(e,t){return(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1}function rt(e,t){t&&r(t.split(" "),function(t){e.className=x((" "+e.className+" ").replace(/[\n\t]/g," ").replace(" "+x(t)+" "," "))})}function it(e,t){t&&r(t.split(" "),function(t){nt(e,t)||(e.className=x(e.className+" "+x(t)))})}function st(e,t){if(t)for(var t=!t.nodeName&&v(t.length)&&!S(t)?t:[t],n=0;n<t.length;n++)e.push(t[n])}function ot(e,t){return ut(e,"$"+(t||"ngController")+"Controller")}function ut(e,t,n){e=kn(e);for(e[0].nodeType==9&&(e=e.find("html"));e.length;){if(n=e.data(t))return n;e=e.parent()}}function at(e,t){var n=Vn[t.toLowerCase()];return n&&$n[e.nodeName]&&n}function ft(e,n){var i=function(i,s){i.preventDefault||(i.preventDefault=function(){i.returnValue=!1}),i.stopPropagation||(i.stopPropagation=function(){i.cancelBubble=!0}),i.target||(i.target=i.srcElement||t);if(d(i.defaultPrevented)){var o=i.preventDefault;i.preventDefault=function(){i.defaultPrevented=!0,o.call(i)},i.defaultPrevented=!1}i.isDefaultPrevented=function(){return i.defaultPrevented},r(n[s||i.type],function(t){t.call(e,i)}),Cn<=8?(i.preventDefault=null,i.stopPropagation=null,i.isDefaultPrevented=null):(delete i.preventDefault,delete i.stopPropagation,delete i.isDefaultPrevented)};return i.elem=e,i}function lt(e){var t=typeof e,r;return t=="object"&&e!==null?typeof (r=e.$$hashKey)=="function"?r=e.$$hashKey():r===n&&(r=e.$$hashKey=u()):r=e,t+":"+r}function ct(e){r(e,this.put,this)}function ht(){}function pt(e){var t,n;return typeof e=="function"?(t=e.$inject)||(t=[],n=e.toString().replace(Gn,""),n=n.match(Jn),r(n[1].split(Kn),function(e){e.replace(Qn,function(e,n,r){t.push(r)})}),e.$inject=t):w(e)?(n=e.length-1,X(e[n],"fn"),t=e.slice(0,n)):X(e,"fn",!0),t}function dt(e){function t(e){return function(t,n){if(!m(t))return e(t,n);r(t,o(e))}}function n(e,t){if(E(t)||w(t))t=v.instantiate(t);if(!t.$get)throw Error("Provider "+e+" must define $get factory method.");return d[e+f]=t}function i(e,t){return n(e,{$get:t})}function s(e){var t=[];return r(e,function(e){if(!h.get(e))if(h.put(e,!0),g(e)){var n=Dn(e);t=t.concat(s(n.requires)).concat(n._runBlocks);try{for(var r=n._invokeQueue,n=0,i=r.length;n<i;n++){var o=r[n],u=o[0]=="$injector"?v:v.get(o[0]);u[o[1]].apply(u,o[2])}}catch(a){throw a.message&&(a.message+=" from "+e),a}}else if(E(e))try{t.push(v.invoke(e))}catch(f){throw f.message&&(f.message+=" from "+e),f}else if(w(e))try{t.push(v.invoke(e))}catch(l){throw l.message&&(l.message+=" from "+String(e[e.length-1])),l}else X(e,"module")}),t}function u(e,t){function n(n){if(typeof n!="string")throw Error("Service name expected");if(e.hasOwnProperty(n)){if(e[n]===a)throw Error("Circular dependency: "+l.join(" <- "));return e[n]}try{return l.unshift(n),e[n]=a,e[n]=t(n)}finally{l.shift()}}function r(e,t,r){var i=[],s=pt(e),o,u,a;u=0;for(o=s.length;u<o;u++)a=s[u],i.push(r&&r.hasOwnProperty(a)?r[a]:n(a));e.$inject||(e=e[o]);switch(t?-1:i.length){case 0:return e();case 1:return e(i[0]);case 2:return e(i[0],i[1]);case 3:return e(i[0],i[1],i[2]);case 4:return e(i[0],i[1],i[2],i[3]);case 5:return e(i[0],i[1],i[2],i[3],i[4]);case 6:return e(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6]);case 8:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);case 9:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8]);case 10:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9]);default:return e.apply(t,i)}}return{invoke:r,instantiate:function(e,t){var n=function(){},i;return n.prototype=(w(e)?e[e.length-1]:e).prototype,n=new n,i=r(e,n,t),m(i)?i:n},get:n,annotate:pt}}var a={},f="Provider",l=[],h=new ct,d={$provide:{provider:t(n),factory:t(i),service:t(function(e,t){return i(e,["$injector",function(e){return e.instantiate(t)}])}),value:t(function(e,t){return i(e,p(t))}),constant:t(function(e,t){d[e]=t,y[e]=t}),decorator:function(e,t){var n=v.get(e+f),r=n.$get;n.$get=function(){var e=b.invoke(r,n);return b.invoke(t,null,{$delegate:e})}}}},v=u(d,function(){throw Error("Unknown provider: "+l.join(" <- "))}),y={},b=y.$injector=u(y,function(e){return e=v.get(e+f),b.invoke(e.$get,e)});return r(s(e),function(e){b.invoke(e||c)}),b}function vt(){var e=!0;this.disableAutoScrolling=function(){e=!1},this.$get=["$window","$location","$rootScope",function(t,n,i){function s(e){var t=null;return r(e,function(e){!t&&Tn(e.nodeName)==="a"&&(t=e)}),t}function o(){var e=n.hash(),r;e?(r=u.getElementById(e))?r.scrollIntoView():(r=s(u.getElementsByName(e)))?r.scrollIntoView():e==="top"&&t.scrollTo(0,0):t.scrollTo(0,0)}var u=t.document;return e&&i.$watch(function(){return n.hash()},function(){i.$evalAsync(o)}),o}]}function mt(e,t,i,s){function o(e){try{e.apply(null,An.call(arguments,1))}finally{if(b--,b===0)for(;w.length;)try{w.pop()()}catch(t){i.error(t)}}}function u(e,t){(function n(){r(E,function(e){e()}),S=t(n,e)})()}function a(){x!=f.url()&&(x=f.url(),r(N,function(e){e(f.url())}))}var f=this,l=t[0],h=e.location,p=e.history,v=e.setTimeout,m=e.clearTimeout,y={};f.isMock=!1;var b=0,w=[];f.$$completeOutstandingRequest=o,f.$$incOutstandingRequestCount=function(){b++},f.notifyWhenNoOutstandingRequests=function(e){r(E,function(e){e()}),b===0?e():w.push(e)};var E=[],S;f.addPollFn=function(e){return d(S)&&u(100,v),E.push(e),e};var x=h.href,T=t.find("base");f.url=function(e,t){if(!e)return h.href.replace(/%27/g,"'");if(x!=e)return x=e,s.history?t?p.replaceState(null,"",e):(p.pushState(null,"",e),T.attr("href",T.attr("href"))):t?h.replace(e):h.href=e,f};var N=[],C=!1;f.onUrlChange=function(t){return C||(s.history&&kn(e).bind("popstate",a),s.hashchange?kn(e).bind("hashchange",a):f.addPollFn(a),C=!0),N.push(t),t},f.baseHref=function(){var e=T.attr("href");return e?e.replace(/^https?\:\/\/[^\/]*/,""):""};var k={},L="",A=f.baseHref();f.cookies=function(e,t){var r,s,o,u;if(!e){if(l.cookie!==L){L=l.cookie,r=L.split("; "),k={};for(o=0;o<r.length;o++)s=r[o],u=s.indexOf("="),u>0&&(k[unescape(s.substring(0,u))]=unescape(s.substring(u+1)))}return k}t===n?l.cookie=escape(e)+"=;path="+A+";expires=Thu, 01 Jan 1970 00:00:00 GMT":g(t)&&(r=(l.cookie=escape(e)+"="+escape(t)+";path="+A).length+1,r>4096&&i.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+r+" > 4096 bytes)!"))},f.defer=function(e,t){var n;return b++,n=v(function(){delete y[n],o(e)},t||0),y[n]=!0,n},f.defer.cancel=function(e){return y[e]?(delete y[e],m(e),o(c),!0):!1}}function gt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,r){return new mt(e,r,t,n)}]}function yt(){this.$get=function(){function e(e,n){function r(e){e!=c&&(h?h==e&&(h=e.n):h=e,i(e.n,e.p),i(e,c),c=e,c.n=null)}function i(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in t)throw Error("cacheId "+e+" taken");var s=0,o=a({},n,{id:e}),u={},f=n&&n.capacity||Number.MAX_VALUE,l={},c=null,h=null;return t[e]={put:function(e,t){var n=l[e]||(l[e]={key:e});r(n),d(t)||(e in u||s++,u[e]=t,s>f&&this.remove(h.key))},get:function(e){var t=l[e];if(t)return r(t),u[e]},remove:function(e){var t=l[e];t&&(t==c&&(c=t.p),t==h&&(h=t.n),i(t.n,t.p),delete l[e],delete u[e],s--)},removeAll:function(){u={},s=0,l={},c=h=null},destroy:function(){l=o=u=null,delete t[e]},info:function(){return a({},o,{size:s})}}}var t={};return e.info=function(){var e={};return r(t,function(t,n){e[n]=t.info()}),e},e.get=function(e){return t[e]},e}}function bt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function wt(e){var i={},s="Directive",u=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,f=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,l="Template must have exactly one root element. was: ",c=/^\s*(https?|ftp|mailto):/;this.directive=function d(t,n){return g(t)?(W(n,"directive"),i.hasOwnProperty(t)||(i[t]=[],e.factory(t+s,["$injector","$exceptionHandler",function(e,n){var s=[];return r(i[t],function(r){try{var i=e.invoke(r);E(i)?i={compile:p(i)}:!i.compile&&i.link&&(i.compile=p(i.link)),i.priority=i.priority||0,i.name=i.name||t,i.require=i.require||i.controller&&i.name,i.restrict=i.restrict||"A",s.push(i)}catch(o){n(o)}}),s}])),i[t].push(n)):r(t,o(d)),this},this.urlSanitizationWhitelist=function(e){return v(e)?(c=e,this):c},this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(e,o,d,v,y,b,S,T,N){function C(e,t,n){e instanceof kn||(e=kn(e)),r(e,function(t,n){t.nodeType==3&&t.nodeValue.match(/\S+/)&&(e[n]=kn(t).wrap("<span></span>").parent()[0])});var i=L(e,t,e,n);return function(t,n){W(t,"scope");for(var r=n?Xn.clone.call(e):e,s=0,o=r.length;s<o;s++){var u=r[s];(u.nodeType==1||u.nodeType==9)&&r.eq(s).data("$scope",t)}return k(r,"ng-scope"),n&&n(r,t),i&&i(t,r,r),r}}function k(e,t){try{e.addClass(t)}catch(n){}}function L(e,t,r,i){function s(e,r,i,s){var u,a,f,l,c,h,p,d=[];c=0;for(h=r.length;c<h;c++)d.push(r[c]);p=c=0;for(h=o.length;c<h;p++)a=d[p],r=o[c++],u=o[c++],r?(r.scope?(f=e.$new(m(r.scope)),kn(a).data("$scope",f)):f=e,(l=r.transclude)||!s&&t?r(u,f,a,i,function(t){return function(n){var r=e.$new();return r.$$transcluded=!0,t(r,n).bind("$destroy",M(r,r.$destroy))}}(l||t)):r(u,f,a,n,s)):u&&u(e,a.childNodes,n,s)}for(var o=[],u,a,f,l=0;l<e.length;l++)a=new U,u=O(e[l],[],a,i),a=(u=u.length?_(u,e[l],a,t,r):null)&&u.terminal||!e[l].childNodes.length?null:L(e[l].childNodes,u?u.transclude:t),o.push(u),o.push(a),f=f||u||a;return f?s:null}function O(e,t,n,r){var i=n.$attr,s;switch(e.nodeType){case 1:D(t,Et(Pn(e).toLowerCase()),"E",r);var o,a,l;s=e.attributes;for(var c=0,h=s&&s.length;c<h;c++)if(o=s[c],o.specified)a=o.name,l=Et(a.toLowerCase()),i[l]=a,n[l]=o=x(Cn&&a=="href"?decodeURIComponent(e.getAttribute(a,2)):o.value),at(e,l)&&(n[l]=!0),q(e,t,o,l),D(t,l,"A",r);e=e.className;if(g(e)&&e!=="")for(;s=f.exec(e);)l=Et(s[2]),D(t,l,"C",r)&&(n[l]=x(s[3])),e=e.substr(s.index+s[0].length);break;case 3:I(t,e.nodeValue);break;case 8:try{if(s=u.exec(e.nodeValue))l=Et(s[1]),D(t,l,"M",r)&&(n[l]=x(s[2]))}catch(p){}}return t.sort(j),t}function _(e,i,s,o,u){function a(e,t){e&&(e.require=M.require,p.push(e)),t&&(t.require=M.require,v.push(t))}function f(e,t){var n,i="data",s=!1;if(g(e)){for(;(n=e.charAt(0))=="^"||n=="?";)e=e.substr(1),n=="^"&&(i="inheritedData"),s=s||n=="?";n=t[i]("$"+e+"Controller");if(!n&&!s)throw Error("No controller: "+e)}else w(e)&&(n=[],r(e,function(e){n.push(f(e,t))}));return n}function c(e,t,o,u,a){var l,c,h,m,g;l=i===o?s:A(s,new U(kn(o),s.$attr)),c=l.$$element;if(T){var y=/^\s*([@=&])\s*(\w*)\s*$/,w=t.$parent||t;r(T.scope,function(e,n){var r=e.match(y)||[],i=r[2]||n,r=r[1],s,o,u;t.$$isolateBindings[n]=r+i;switch(r){case"@":l.$observe(i,function(e){t[n]=e}),l.$$observers[i].$$scope=w;break;case"=":o=b(l[i]),u=o.assign||function(){throw s=t[n]=o(w),Error(Yn+l[i]+" (directive: "+T.name+")")},s=t[n]=o(w),t.$watch(function(){var e=o(w);return e!==t[n]&&(e!==s?s=t[n]=e:u(w,e=s=t[n])),e});break;case"&":o=b(l[i]),t[n]=function(e){return o(w,e)};break;default:throw Error("Invalid isolate scope definition for directive "+T.name+": "+e)}})}q&&r(q,function(e){var n={$scope:t,$element:c,$attrs:l,$transclude:a};g=e.controller,g=="@"&&(g=l[e.name]),c.data("$"+e.name+"Controller",S(g,n))}),u=0;for(h=p.length;u<h;u++)try{m=p[u],m(t,c,l,m.require&&f(m.require,c))}catch(E){d(E,B(c))}e&&e(t,o.childNodes,n,a),u=0;for(h=v.length;u<h;u++)try{m=v[u],m(t,c,l,m.require&&f(m.require,c))}catch(x){d(x,B(c))}}for(var h=-Number.MAX_VALUE,p=[],v=[],y=null,T=null,N=null,L=s.$$element=kn(i),M,_,D,j,I=o,q,z,W,X=0,V=e.length;X<V;X++){M=e[X],D=n;if(h>M.priority)break;if(W=M.scope)F("isolated scope",T,M,L),m(W)&&(k(L,"ng-isolate-scope"),T=M),k(L,"ng-scope"),y=y||M;_=M.name;if(W=M.controller)q=q||{},F("'"+_+"' controller",q[_],M,L),q[_]=M;if(W=M.transclude)F("transclusion",j,M,L),j=M,h=M.priority,W=="element"?(D=kn(i),L=s.$$element=kn(t.createComment(" "+_+": "+s[_]+" ")),i=L[0],R(u,kn(D[0]),i),I=C(D,o,h)):(D=kn(Q(i)).contents(),L.html(""),I=C(D,o));if(W=M.template)if(F("template",N,M,L),N=M,W=J(W),M.replace){D=kn("<div>"+x(W)+"</div>").contents(),i=D[0];if(D.length!=1||i.nodeType!==1)throw Error(l+W);R(u,L,i),_={$attr:{}},e=e.concat(O(i,e.splice(X+1,e.length-(X+1)),_)),P(s,_),V=e.length}else L.html(W);if(M.templateUrl)F("template",N,M,L),N=M,c=H(e.splice(X,e.length-X),c,L,s,u,M.replace,I),V=e.length;else if(M.compile)try{z=M.compile(L,s,I),E(z)?a(null,z):z&&a(z.pre,z.post)}catch($){d($,B(L))}M.terminal&&(c.terminal=!0,h=Math.max(h,M.priority))}return c.scope=y&&y.scope,c.transclude=j&&I,c}function D(t,r,o,u){var a=!1;if(i.hasOwnProperty(r))for(var f,r=e.get(r+s),l=0,c=r.length;l<c;l++)try{if(f=r[l],(u===n||u>f.priority)&&f.restrict.indexOf(o)!=-1)t.push(f),a=!0}catch(h){d(h)}return a}function P(e,t){var n=t.$attr,i=e.$attr,s=e.$$element;r(e,function(r,i){i.charAt(0)!="$"&&(t[i]&&(r+=(i==="style"?";":" ")+t[i]),e.$set(i,r,!0,n[i]))}),r(t,function(t,r){r=="class"?(k(s,t),e["class"]=(e["class"]?e["class"]+" ":"")+t):r=="style"?s.attr("style",s.attr("style")+";"+t):r.charAt(0)!="$"&&!e.hasOwnProperty(r)&&(e[r]=t,i[r]=n[r])})}function H(e,t,n,r,i,s,o){var u=[],f,c,h=n[0],p=e.shift(),d=a({},p,{controller:null,templateUrl:null,transclude:null,scope:null});return n.html(""),v.get(p.templateUrl,{cache:y}).success(function(a){var p,v,a=J(a);if(s){v=kn("<div>"+x(a)+"</div>").contents(),p=v[0];if(v.length!=1||p.nodeType!==1)throw Error(l+a);a={$attr:{}},R(i,n,p),O(p,e,a),P(r,a)}else p=h,n.html(a);e.unshift(d),f=_(e,p,r,o);for(c=L(n.contents(),o);u.length;){var m=u.pop(),a=u.pop();v=u.pop();var g=u.pop(),y=p;v!==h&&(y=Q(p),R(a,kn(v),y)),f(function(){t(c,g,y,i,m)},g,y,i,m)}u=null}).error(function(e,t,n,r){throw Error("Failed to load template: "+r.url)}),function(e,n,r,i,s){u?(u.push(n),u.push(r),u.push(i),u.push(s)):f(function(){t(c,n,r,i,s)},n,r,i,s)}}function j(e,t){return t.priority-e.priority}function F(e,t,n,r){if(t)throw Error("Multiple directives ["+t.name+", "+n.name+"] asking for "+e+" on: "+B(r))}function I(e,t){var n=o(t,!0);n&&e.push({priority:0,compile:p(function(e,t){var r=t.parent(),i=r.data("$binding")||[];i.push(n),k(r.data("$binding",i),"ng-binding"),e.$watch(n,function(e){t[0].nodeValue=e})})})}function q(e,t,r,i){var s=o(r,!0);s&&t.push({priority:100,compile:p(function(e,t,r){t=r.$$observers||(r.$$observers={}),i==="class"&&(s=o(r[i],!0)),r[i]=n,(t[i]||(t[i]=[])).$$inter=!0,(r.$$observers&&r.$$observers[i].$$scope||e).$watch(s,function(e){r.$set(i,e)})})})}function R(e,t,n){var r=t[0],i=r.parentNode,s,o;if(e){s=0;for(o=e.length;s<o;s++)if(e[s]==r){e[s]=n;break}}i&&i.replaceChild(n,r),n[kn.expando]=r[kn.expando],t[0]=n}var U=function(e,t){this.$$element=e,this.$attr=t||{}};U.prototype={$normalize:Et,$set:function(e,t,i,s){var o=at(this.$$element[0],e),u=this.$$observers;o&&(this.$$element.prop(e,t),s=o),this[e]=t,s?this.$attr[e]=s:(s=this.$attr[e])||(this.$attr[e]=s=z(e,"-")),Pn(this.$$element[0])==="A"&&e==="href"&&(X.setAttribute("href",t),o=X.href,o.match(c)||(this[e]=t="unsafe:"+o)),i!==!1&&(t===null||t===n?this.$$element.removeAttr(s):this.$$element.attr(s,t)),u&&r(u[e],function(e){try{e(t)}catch(n){d(n)}})},$observe:function(e,t){var n=this,r=n.$$observers||(n.$$observers={}),i=r[e]||(r[e]=[]);return i.push(t),T.$evalAsync(function(){i.$$inter||t(n[e])}),t}};var X=N[0].createElement("a"),V=o.startSymbol(),$=o.endSymbol(),J=V=="{{"||$=="}}"?h:function(e){return e.replace(/\{\{/g,V).replace(/}}/g,$)};return C}]}function Et(e){return $(e.replace(Zn,""))}function St(){var e={};this.register=function(t,n){m(t)?a(e,t):e[t]=n},this.$get=["$injector","$window",function(t,n){return function(r,i){if(g(r)){var s=r,r=e.hasOwnProperty(s)?e[s]:Rt(i.$scope,s,!0)||Rt(n,s,!0);X(r,s,!0)}return t.instantiate(r,i)}}]}function xt(){this.$get=["$window",function(e){return kn(e.document)}]}function Tt(){this.$get=["$log",function(e){return function(t,n){e.error.apply(e,arguments)}}]}function Nt(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse",function(r){function i(i,u){for(var a,f,l=0,c=[],h=i.length,p=!1,d=[];l<h;)(a=i.indexOf(e,l))!=-1&&(f=i.indexOf(t,a+s))!=-1?(l!=a&&c.push(i.substring(l,a)),c.push(l=r(p=i.substring(a+s,f))),l.exp=p,l=f+o,p=!0):(l!=h&&c.push(i.substring(l)),l=h);(h=c.length)||(c.push(""),h=1);if(!u||p)return d.length=h,l=function(e){for(var t=0,r=h,i;t<r;t++)typeof (i=c[t])=="function"&&(i=i(e),i==null||i==n?i="":typeof i!="string"&&(i=D(i))),d[t]=i;return d.join("")},l.exp=i,l.parts=c,l}var s=e.length,o=t.length;return i.startSymbol=function(){return e},i.endSymbol=function(){return t},i}]}function Ct(e){for(var e=e.split("/"),t=e.length;t--;)e[t]=I(e[t]);return e.join("/")}function kt(e,t){var n=er.exec(e),n={protocol:n[1],host:n[3],port:f(n[5])||rr[n[1]]||null,path:n[6]||"/",search:n[8],hash:n[10]};return t&&(t.$$protocol=n.protocol,t.$$host=n.host,t.$$port=n.port),n}function Lt(e,t,n){return e+"://"+t+(n==rr[e]?"":":"+n)}function At(e,t,n){var r=kt(e);return decodeURIComponent(r.path)!=t||d(r.hash)||r.hash.indexOf(n)!==0?e:Lt(r.protocol,r.host,r.port)+t.substr(0,t.lastIndexOf("/"))+r.hash.substr(n.length)}function Ot(e,t,n){var r=kt(e);if(decodeURIComponent(r.path)==t)return e;var i=r.search&&"?"+r.search||"",s=r.hash&&"#"+r.hash||"",o=t.substr(0,t.lastIndexOf("/")),u=r.path.substr(o.length);if(r.path.indexOf(o)!==0)throw Error('Invalid url "'+e+'", missing path prefix "'+o+'" !');return Lt(r.protocol,r.host,r.port)+t+"#"+n+u+i+s}function Mt(e,t,n){t=t||"",this.$$parse=function(e){var n=kt(e,this);if(n.path.indexOf(t)!==0)throw Error('Invalid url "'+e+'", missing path prefix "'+t+'" !');this.$$path=decodeURIComponent(n.path.substr(t.length)),this.$$search=j(n.search),this.$$hash=n.hash&&decodeURIComponent(n.hash)||"",this.$$compose()},this.$$compose=function(){var e=F(this.$$search),n=this.$$hash?"#"+I(this.$$hash):"";this.$$url=Ct(this.$$path)+(e?"?"+e:"")+n,this.$$absUrl=Lt(this.$$protocol,this.$$host,this.$$port)+t+this.$$url},this.$$rewriteAppUrl=function(e){if(e.indexOf(n)==0)return e},this.$$parse(e)}function _t(e,t,n){var r;this.$$parse=function(e){var n=kt(e,this);if(n.hash&&n.hash.indexOf(t)!==0)throw Error('Invalid url "'+e+'", missing hash prefix "'+t+'" !');r=n.path+(n.search?"?"+n.search:""),n=nr.exec((n.hash||"").substr(t.length)),this.$$path=n[1]?(n[1].charAt(0)=="/"?"":"/")+decodeURIComponent(n[1]):"",this.$$search=j(n[3]),this.$$hash=n[5]&&decodeURIComponent(n[5])||"",this.$$compose()},this.$$compose=function(){var e=F(this.$$search),n=this.$$hash?"#"+I(this.$$hash):"";this.$$url=Ct(this.$$path)+(e?"?"+e:"")+n,this.$$absUrl=Lt(this.$$protocol,this.$$host,this.$$port)+r+(this.$$url?"#"+t+this.$$url:"")},this.$$rewriteAppUrl=function(e){if(e.indexOf(n)==0)return e},this.$$parse(e)}function Dt(e,t,n,r){_t.apply(this,arguments),this.$$rewriteAppUrl=function(e){if(e.indexOf(n)==0)return n+r+"#"+t+e.substr(n.length)}}function Pt(e){return function(){return this[e]}}function Ht(e,t){return function(n){return d(n)?this[e]:(this[e]=t(n),this.$$compose(),this)}}function Bt(){var t="",n=!1;this.hashPrefix=function(e){return v(e)?(t=e,this):t},this.html5Mode=function(e){return v(e)?(n=e,this):n},this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(r,i,s,o){function u(e){r.$broadcast("$locationChangeSuccess",a.absUrl(),e)}var a,f,l,c=i.url(),h=kt(c);n?(f=i.baseHref()||"/",l=f.substr(0,f.lastIndexOf("/")),h=Lt(h.protocol,h.host,h.port)+l+"/",a=s.history?new Mt(At(c,f,t),l,h):new Dt(Ot(c,f,t),t,h,f.substr(l.length+1))):(h=Lt(h.protocol,h.host,h.port)+(h.path||"")+(h.search?"?"+h.search:"")+"#"+t+"/",a=new _t(c,t,h)),o.bind("click",function(t){if(!t.ctrlKey&&!t.metaKey&&t.which!=2){for(var n=kn(t.target);Tn(n[0].nodeName)!=="a";)if(n[0]===o[0]||!(n=n.parent())[0])return;var i=n.prop("href"),s=a.$$rewriteAppUrl(i);i&&!n.attr("target")&&s&&(a.$$parse(s),r.$apply(),t.preventDefault(),e.angular["ff-684208-preventDefault"]=!0)}}),a.absUrl()!=c&&i.url(a.absUrl(),!0),i.onUrlChange(function(e){a.absUrl()!=e&&(r.$evalAsync(function(){var t=a.absUrl();a.$$parse(e),u(t)}),r.$$phase||r.$digest())});var p=0;return r.$watch(function(){var e=i.url(),t=a.$$replace;if(!p||e!=a.absUrl())p++,r.$evalAsync(function(){r.$broadcast("$locationChangeStart",a.absUrl(),e).defaultPrevented?a.$$parse(e):(i.url(a.absUrl(),t),u(e))});return a.$$replace=!1,p}),a}]}function jt(){this.$get=["$window",function(e){function t(e){return e instanceof Error&&(e.stack?e=e.message&&e.stack.indexOf(e.message)===-1?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function n(n){var i=e.console||{},s=i[n]||i.log||c;return s.apply?function(){var e=[];return r(arguments,function(n){e.push(t(n))}),s.apply(i,e)}:function(e,t){s(e,t)}}return{log:n("log"),warn:n("warn"),info:n("info"),error:n("error")}}]}function Ft(e,t){function n(e){return e.indexOf(y)!=-1}function r(){return m+1<e.length?e.charAt(m+1):!1}function i(e){return"0"<=e&&e<="9"}function s(e){return e==" "||e=="\r"||e==" "||e=="\n"||e==""||e==" "}function o(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"||"_"==e||e=="$"}function u(e){return e=="-"||e=="+"||i(e)}function f(t,n,r){throw r=r||m,Error("Lexer Error: "+t+" at column"+(v(n)?"s "+n+"-"+m+" ["+e.substring(n,r)+"]":" "+r)+" in expression ["+e+"].")}function l(){for(var t="",n=m;m<e.length;){var s=Tn(e.charAt(m));if(s=="."||i(s))t+=s;else{var o=r();if(s=="e"&&u(o))t+=s;else if(u(s)&&o&&i(o)&&t.charAt(t.length-1)=="e")t+=s;else{if(!u(s)||!!o&&!!i(o)||t.charAt(t.length-1)!="e")break;f("Invalid exponent")}}m++}t*=1,p.push({index:n,text:t,json:!0,fn:function(){return t}})}function c(){for(var n="",r=m,u,f,l;m<e.length;){var c=e.charAt(m);if(c!="."&&!o(c)&&!i(c))break;c=="."&&(u=m),n+=c,m++}if(u)for(f=m;f<e.length;){c=e.charAt(f);if(c=="("){l=n.substr(u-r+1),n=n.substr(0,u-r),m=f;break}if(!s(c))break;f++}r={index:r,text:n};if(ir.hasOwnProperty(n))r.fn=r.json=ir[n];else{var h=zt(n,t);r.fn=a(function(e,t){return h(e,t)},{assign:function(e,t){return qt(e,n,t)}})}p.push(r),l&&(p.push({index:u,text:".",json:!1}),p.push({index:u+1,text:l,json:!1}))}function h(t){var n=m;m++;for(var r="",i=t,s=!1;m<e.length;){var o=e.charAt(m);i+=o;if(s)o=="u"?(o=e.substring(m+1,m+5),o.match(/[\da-f]{4}/i)||f("Invalid unicode escape [\\u"+o+"]"),m+=4,r+=String.fromCharCode(parseInt(o,16))):(s=sr[o],r+=s?s:o),s=!1;else if(o=="\\")s=!0;else{if(o==t){m++,p.push({index:n,text:i,string:r,json:!0,fn:function(){return r}});return}r+=o}m++}f("Unterminated quote",n)}for(var p=[],d,m=0,g=[],y,b=":";m<e.length;){y=e.charAt(m);if(n("\"'"))h(y);else if(i(y)||n(".")&&i(r()))l();else if(o(y)){if(c(),"{,".indexOf(b)!=-1&&g[0]=="{"&&(d=p[p.length-1]))d.json=d.text.indexOf(".")==-1}else if(n("(){}[].,;:"))p.push({index:m,text:y,json:":[,".indexOf(b)!=-1&&n("{[")||n("}]:,")}),n("{[")&&g.unshift(y),n("}]")&&g.shift(),m++;else{if(s(y)){m++;continue}var w=y+r(),E=ir[y],S=ir[w];S?(p.push({index:m,text:w,fn:S}),m+=2):E?(p.push({index:m,text:y,fn:E,json:"[,:".indexOf(b)!=-1&&n("+-")}),m+=1):f("Unexpected next character ",m,m+1)}b=y}return p}function It(e,t,r,i){function s(t,n){throw Error("Syntax Error: Token '"+n.text+"' "+t+" at column "+(n.index+1)+" of the expression ["+e+"] starting at ["+e.substring(n.index)+"].")}function o(){if(L.length===0)throw Error("Unexpected end of expression: "+e);return L[0]}function u(e,t,n,r){if(L.length>0){var i=L[0],s=i.text;if(s==e||s==t||s==n||s==r||!e&&!t&&!n&&!r)return i}return!1}function f(e,n,r,i){return(e=u(e,n,r,i))?(t&&!e.json&&s("is not valid json",e),L.shift(),e):!1}function l(e){f(e)||s("is unexpected, expecting ["+e+"]",u())}function h(e,t){return function(n,r){return e(n,r,t)}}function d(e,t,n){return function(r,i){return t(r,i,e,n)}}function v(){for(var e=[];;)if(L.length>0&&!u("}",")",";","]")&&e.push(D()),!f(";"))return e.length==1?e[0]:function(t,n){for(var r,i=0;i<e.length;i++){var s=e[i];s&&(r=s(t,n))}return r}}function m(){for(var e=f(),t=r(e.text),n=[];;){if(!(e=f(":"))){var i=function(e,r,i){for(var i=[i],s=0;s<n.length;s++)i.push(n[s](e,r));return t.apply(e,i)};return function(){return i}}n.push(A())}}function g(){for(var e=y(),t;;){if(!(t=f("||")))return e;e=d(e,t.fn,y())}}function y(){var e=b(),t;if(t=f("&&"))e=d(e,t.fn,y());return e}function b(){var e=w(),t;if(t=f("==","!="))e=d(e,t.fn,b());return e}function w(){var e;e=E();for(var t;t=f("+","-");)e=d(e,t.fn,E());if(t=f("<",">","<=",">="))e=d(e,t.fn,w());return e}function E(){for(var e=S(),t;t=f("*","/","%");)e=d(e,t.fn,S());return e}function S(){var e;return f("+")?x():(e=f("-"))?d(C,e.fn,S()):(e=f("!"))?h(e.fn,S()):x()}function x(){var e;if(f("("))e=D(),l(")");else if(f("["))e=T();else if(f("{"))e=N();else{var t=f();(e=t.fn)||s("not a primary expression",t)}for(var n;t=f("(","[",".");)t.text==="("?(e=O(e,n),n=null):t.text==="["?(n=e,e=_(e)):t.text==="."?(n=e,e=M(e)):s("IMPOSSIBLE");return e}function T(){var e=[];if(o().text!="]")do e.push(A());while(f(","));return l("]"),function(t,n){for(var r=[],i=0;i<e.length;i++)r.push(e[i](t,n));return r}}function N(){var e=[];if(o().text!="}")do{var t=f(),t=t.string||t.text;l(":");var n=A();e.push({key:t,value:n})}while(f(","));return l("}"),function(t,n){for(var r={},i=0;i<e.length;i++){var s=e[i],o=s.value(t,n);r[s.key]=o}return r}}var C=p(0),k,L=Ft(e,i),A=function(){var t=g(),n,r;return(r=f("="))?(t.assign||s("implies assignment but ["+e.substring(0,r.index)+"] can not be assigned to",r),n=g(),function(e,r){return t.assign(e,n(e,r),r)}):t},O=function(e,t){var n=[];if(o().text!=")")do n.push(A());while(f(","));return l(")"),function(r,i){for(var s=[],o=t?t(r,i):r,u=0;u<n.length;u++)s.push(n[u](r,i));return u=e(r,i)||c,u.apply?u.apply(o,s):u(s[0],s[1],s[2],s[3],s[4])}},M=function(e){var t=f().text,n=zt(t,i);return a(function(t,r){return n(e(t,r),r)},{assign:function(n,r,i){return qt(e(n,i),t,r)}})},_=function(e){var t=A();return l("]"),a(function(r,i){var s=e(r,i),o=t(r,i),u;return s?((s=s[o])&&s.then&&(u=s,"$$v"in s||(u.$$v=n,u.then(function(e){u.$$v=e})),s=s.$$v),s):n},{assign:function(n,r,i){return e(n,i)[t(n,i)]=r}})},D=function(){for(var e=A(),t;;){if(!(t=f("|")))return e;e=d(e,t.fn,m())}};return t?(A=g,O=M=_=D=function(){s("is not valid json",{text:e,index:0})},k=x()):k=v(),L.length!==0&&s("is an unexpected token",L[0]),k}function qt(e,t,n){for(var t=t.split("."),r=0;t.length>1;r++){var i=t.shift(),s=e[i];s||(s={},e[i]=s),e=s}return e[t.shift()]=n}function Rt(e,t,n){if(!t)return e;for(var t=t.split("."),r,i=e,s=t.length,o=0;o<s;o++)r=t[o],e&&(e=(i=e)[r]);return!n&&E(e)?M(i,e):e}function Ut(e,t,r,i,s){return function(o,u){var a=u&&u.hasOwnProperty(e)?u:o,f;return a===null||a===n?a:((a=a[e])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!t||a===null||a===n?a:((a=a[t])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!r||a===null||a===n?a:((a=a[r])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!i||a===null||a===n?a:((a=a[i])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!s||a===null||a===n?a:((a=a[s])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),a)))))}}function zt(e,t){if(or.hasOwnProperty(e))return or[e];var i=e.split("."),s=i.length,o;if(t)o=s<6?Ut(i[0],i[1],i[2],i[3],i[4]):function(e,t){var r=0,o;do o=Ut(i[r++],i[r++],i[r++],i[r++],i[r++])(e,t),t=n,e=o;while(r<s);return o};else{var u="var l, fn, p;\n";r(i,function(e,t){u+="if(s === null || s === undefined) return s;\nl=s;\ns="+(t?"s":'((k&&k.hasOwnProperty("'+e+'"))?k:s)')+'["'+e+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'}),u+="return s;",o=Function("s","k",u),o.toString=function(){return u}}return or[e]=o}function Wt(){var e={};this.$get=["$filter","$sniffer",function(t,n){return function(r){switch(typeof r){case"string":return e.hasOwnProperty(r)?e[r]:e[r]=It(r,!1,t,n.csp);case"function":return r;default:return c}}}]}function Xt(){this.$get=["$rootScope","$exceptionHandler",function(e,t){return Vt(function(t){e.$evalAsync(t)},t)}]}function Vt(e,t){function i(e){return e}function s(e){return a(e)}var o=function(){var r=[],f,l;return l={resolve:function(t){if(r){var i=r;r=n,f=u(t),i.length&&e(function(){for(var e,t=0,n=i.length;t<n;t++)e=i[t],f.then(e[0],e[1])})}},reject:function(e){l.resolve(a(e))},promise:{then:function(e,n){var u=o(),a=function(n){try{u.resolve((e||i)(n))}catch(r){t(r),u.reject(r)}},l=function(e){try{u.resolve((n||s)(e))}catch(r){t(r),u.reject(r)}};return r?r.push([a,l]):f.then(a,l),u.promise}}}},u=function(t){return t&&t.then?t:{then:function(n){var r=o();return e(function(){r.resolve(n(t))}),r.promise}}},a=function(t){return{then:function(n,r){var i=o();return e(function(){i.resolve((r||s)(t))}),i.promise}}};return{defer:o,reject:a,when:function(n,r,f){var l=o(),c,h=function(e){try{return(r||i)(e)}catch(n){return t(n),a(n)}},p=function(e){try{return(f||s)(e)}catch(n){return t(n),a(n)}};return e(function(){u(n).then(function(e){c||(c=!0,l.resolve(u(e).then(h,p)))},function(e){c||(c=!0,l.resolve(p(e)))})}),l.promise},all:function(e){var t=o(),n=e.length,i=[];return n?r(e,function(e,r){u(e).then(function(e){r in i||(i[r]=e,--n||t.resolve(i))},function(e){r in i||t.reject(e)})}):t.resolve(i),t.promise}}}function $t(){var e={};this.when=function(t,n){e[t]=a({reloadOnSearch:!0},n);if(t){var r=t[t.length-1]=="/"?t.substr(0,t.length-1):t+"/";e[r]={redirectTo:t}}return this},this.otherwise=function(e){return this.when(null,e),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(t,n,i,s,o,u,f){function c(e,t){for(var t="^"+t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"$",n="",i=[],s={},o=/:(\w+)/g,u,a=0;(u=o.exec(t))!==null;)n+=t.slice(a,u.index),n+="([^\\/]*)",i.push(u[1]),a=o.lastIndex;n+=t.substr(a);var f=e.match(RegExp(n));return f&&r(i,function(e,t){s[e]=f[t+1]}),f?s:null}function h(){var e=p(),a=y.current;if(e&&a&&e.$route===a.$route&&O(e.pathParams,a.pathParams)&&!e.reloadOnSearch&&!m)a.params=e.params,L(a.params,i),t.$broadcast("$routeUpdate",a);else if(e||a)m=!1,t.$broadcast("$routeChangeStart",e,a),(y.current=e)&&e.redirectTo&&(g(e.redirectTo)?n.path(d(e.redirectTo,e.params)).search(e.params).replace():n.url(e.redirectTo(e.pathParams,n.path(),n.search())).replace()),s.when(e).then(function(){if(e){var t=[],n=[],i;return r(e.resolve||{},function(e,r){t.push(r),n.push(g(e)?o.get(e):o.invoke(e))}),v(i=e.template)||v(i=e.templateUrl)&&(i=u.get(i,{cache:f}).then(function(e){return e.data})),v(i)&&(t.push("$template"),n.push(i)),s.all(n).then(function(e){var n={};return r(e,function(e,r){n[t[r]]=e}),n})}}).then(function(n){e==y.current&&(e&&(e.locals=n,L(e.params,i)),t.$broadcast("$routeChangeSuccess",e,a))},function(n){e==y.current&&t.$broadcast("$routeChangeError",e,a,n)})}function p(){var t,i;return r(e,function(e,r){!i&&(t=c(n.path(),r))&&(i=l(e,{params:a({},n.search(),t),pathParams:t}),i.$route=e)}),i||e[null]&&l(e[null],{params:{},pathParams:{}})}function d(e,t){var n=[];return r((e||"").split(":"),function(e,r){if(r==0)n.push(e);else{var i=e.match(/(\w+)(.*)/),s=i[1];n.push(t[s]),n.push(i[2]||""),delete t[s]}}),n.join("")}var m=!1,y={routes:e,reload:function(){m=!0,t.$evalAsync(h)}};return t.$on("$locationChangeSuccess",h),y}]}function Jt(){this.$get=p({})}function Kt(){var e=10;this.digestTtl=function(t){return arguments.length&&(e=t),e},this.$get=["$injector","$exceptionHandler","$parse",function(t,n,r){function i(){this.$id=u(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this["this"]=this.$root=this,this.$$destroyed=!1,this.$$asyncQueue=[],this.$$listeners={},this.$$isolateBindings={}}function s(e){if(f.$$phase)throw Error(f.$$phase+" already in progress");f.$$phase=e}function o(e,t){var n=r(e);return X(n,t),n}function a(){}i.prototype={$new:function(e){if(E(e))throw Error("API-CHANGE: Use $controller to instantiate controllers.");return e?(e=new i,e.$root=this.$root):(e=function(){},e.prototype=this,e=new e,e.$id=u()),e["this"]=e,e.$$listeners={},e.$parent=this,e.$$asyncQueue=[],e.$$watchers=e.$$nextSibling=e.$$childHead=e.$$childTail=null,e.$$prevSibling=this.$$childTail,this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=e:this.$$childHead=this.$$childTail=e,e},$watch:function(e,t,n){var r=o(e,"watch"),i=this.$$watchers,s={fn:t,last:a,get:r,exp:e,eq:!!n};if(!E(t)){var u=o(t||c,"listener");s.fn=function(e,t,n){u(n)}}return i||(i=this.$$watchers=[]),i.unshift(s),function(){k(i,s)}},$digest:function(){var t,r,i,o,u,l,c,h=e,p,d=[],v,m;s("$digest");do{c=!1,p=this;do{for(u=p.$$asyncQueue;u.length;)try{p.$eval(u.shift())}catch(g){n(g)}if(o=p.$$watchers)for(l=o.length;l--;)try{if(t=o[l],(r=t.get(p))!==(i=t.last)&&!(t.eq?O(r,i):typeof r=="number"&&typeof i=="number"&&isNaN(r)&&isNaN(i)))c=!0,t.last=t.eq?L(r):r,t.fn(r,i===a?r:i,p),h<5&&(v=4-h,d[v]||(d[v]=[]),m=E(t.exp)?"fn: "+(t.exp.name||t.exp.toString()):t.exp,m+="; newVal: "+D(r)+"; oldVal: "+D(i),d[v].push(m))}catch(y){n(y)}if(!(o=p.$$childHead||p!==this&&p.$$nextSibling))for(;p!==this&&!(o=p.$$nextSibling);)p=p.$parent}while(p=o);if(c&&!(h--))throw f.$$phase=null,Error(e+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+D(d))}while(c||u.length);f.$$phase=null},$destroy:function(){if(f!=this&&!this.$$destroyed){var e=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,e.$$childHead==this&&(e.$$childHead=this.$$nextSibling),e.$$childTail==this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(e,t){return r(e)(this,t)},$evalAsync:function(e){this.$$asyncQueue.push(e)},$apply:function(e){try{return s("$apply"),this.$eval(e)}catch(t){n(t)}finally{f.$$phase=null;try{f.$digest()}catch(r){throw n(r),r}}},$on:function(e,t){var n=this.$$listeners[e];return n||(this.$$listeners[e]=n=[]),n.push(t),function(){n[C(n,t)]=null}},$emit:function(e,t){var r=[],i,s=this,o=!1,u={name:e,targetScope:s,stopPropagation:function(){o=!0},preventDefault:function(){u.defaultPrevented=!0},defaultPrevented:!1},a=[u].concat(An.call(arguments,1)),f,l;do{i=s.$$listeners[e]||r,u.currentScope=s,f=0;for(l=i.length;f<l;f++)if(i[f])try{if(i[f].apply(null,a),o)return u}catch(c){n(c)}else i.splice(f,1),f--,l--;s=s.$parent}while(s);return u},$broadcast:function(e,t){var r=this,i=this,s={name:e,targetScope:this,preventDefault:function(){s.defaultPrevented=!0},defaultPrevented:!1},o=[s].concat(An.call(arguments,1)),u,a;do{r=i,s.currentScope=r,i=r.$$listeners[e]||[],u=0;for(a=i.length;u<a;u++)if(i[u])try{i[u].apply(null,o)}catch(f){n(f)}else i.splice(u,1),u--,a--;if(!(i=r.$$childHead||r!==this&&r.$$nextSibling))for(;r!==this&&!(i=r.$$nextSibling);)r=r.$parent}while(r=i);return s}};var f=new i;return f}]}function Qt(){this.$get=["$window",function(e){var t={},n=f((/android (\d+)/.exec(Tn(e.navigator.userAgent))||[])[1]);return{history:!(!e.history||!e.history.pushState||n<4),hashchange:"onhashchange"in e&&(!e.document.documentMode||e.document.documentMode>7),hasEvent:function(n){if(n=="input"&&Cn==9)return!1;if(d(t[n])){var r=e.document.createElement("div");t[n]="on"+n in r}return t[n]},csp:!1}}]}function Gt(){this.$get=p(e)}function Yt(e){var t={},n,i,s;return e?(r(e.split("\n"),function(e){s=e.indexOf(":"),n=Tn(x(e.substr(0,s))),i=x(e.substr(s+1)),n&&(t[n]?t[n]+=", "+i:t[n]=i)}),t):t}function Zt(e){var t=m(e)?e:n;return function(n){return t||(t=Yt(e)),n?t[Tn(n)]||null:t}}function en(e,t,n){return E(n)?n(e,t):(r(n,function(n){e=n(e,t)}),e)}function tn(){var e=/^\s*(\[|\{[^\{])/,t=/[\}\]]\s*$/,i=/^\)\]\}',?\n/,o=this.defaults={transformResponse:[function(n){return g(n)&&(n=n.replace(i,""),e.test(n)&&t.test(n)&&(n=P(n,!0))),n}],transformRequest:[function(e){return m(e)&&Mn.apply(e)!=="[object File]"?D(e):e}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},u=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(e,t,i,f,l,c){function h(e){function n(e){var t=a({},e,{data:en(e.data,e.headers,s)});return 200<=e.status&&e.status<300?t:l.reject(t)}e.method=Nn(e.method);var i=e.transformRequest||o.transformRequest,s=e.transformResponse||o.transformResponse,u=o.headers,u=a({"X-XSRF-TOKEN":t.cookies()["XSRF-TOKEN"]},u.common,u[Tn(e.method)],e.headers),i=en(e.data,Zt(u),i),f;return d(e.data)&&delete u["Content-Type"],f=p(e,i,u),f=f.then(n,n),r(b,function(e){f=e(f)}),f.success=function(t){return f.then(function(n){t(n.data,n.status,n.headers,e)}),f},f.error=function(t){return f.then(null,function(n){t(n.data,n.status,n.headers,e)}),f},f}function p(t,n,r){function i(e,t,n){c&&(200<=e&&e<300?c.put(d,[e,t,Yt(n)]):c.remove(d)),s(t,e,n),f.$apply()}function s(e,n,r){n=Math.max(n,0),(200<=n&&n<300?u.resolve:u.reject)({data:e,status:n,headers:Zt(r),config:t})}function o(){var e=C(h.pendingRequests,t);e!==-1&&h.pendingRequests.splice(e,1)}var u=l.defer(),a=u.promise,c,p,d=v(t.url,t.params);h.pendingRequests.push(t),a.then(o,o),t.cache&&t.method=="GET"&&(c=m(t.cache)?t.cache:y);if(c)if(p=c.get(d)){if(p.then)return p.then(o,o),p;w(p)?s(p[1],p[0],L(p[2])):s(p,200,{})}else c.put(d,a);return p||e(t.method,d,n,i,r,t.timeout,t.withCredentials),a}function v(e,t){if(!t)return e;var r=[];return s(t,function(e,t){e==null||e==n||(m(e)&&(e=D(e)),r.push(encodeURIComponent(t)+"="+encodeURIComponent(e)))}),e+(e.indexOf("?")==-1?"?":"&")+r.join("&")}var y=i("$http"),b=[];return r(u,function(e){b.push(g(e)?c.get(e):c.invoke(e))}),h.pendingRequests=[],function(e){r(arguments,function(e){h[e]=function(t,n){return h(a(n||{},{method:e,url:t}))}})}("get","delete","head","jsonp"),function(e){r(arguments,function(e){h[e]=function(t,n,r){return h(a(r||{},{method:e,url:t,data:n}))}})}("post","put"),h.defaults=o,h}]}function nn(){this.$get=["$browser","$window","$document",function(e,t,n){return rn(e,ur,e.defer,t.angular.callbacks,n[0],t.location.protocol.replace(":",""))}]}function rn(e,t,n,i,s,o){function u(e,t){var n=s.createElement("script"),r=function(){s.body.removeChild(n),t&&t()};n.type="text/javascript",n.src=e,Cn?n.onreadystatechange=function(){/loaded|complete/.test(n.readyState)&&r()}:n.onload=n.onerror=r,s.body.appendChild(n)}return function(s,a,f,l,h,p,d){function v(t,n,r,i){n=(a.match(er)||["",o])[1]=="file"?r?200:404:n,t(n==1223?204:n,r,i),e.$$completeOutstandingRequest(c)}e.$$incOutstandingRequestCount(),a=a||e.url();if(Tn(s)=="jsonp"){var m="_"+(i.counter++).toString(36);i[m]=function(e){i[m].data=e},u(a.replace("JSON_CALLBACK","angular.callbacks."+m),function(){i[m].data?v(l,200,i[m].data):v(l,-2),delete i[m]})}else{var g=new t;g.open(s,a,!0),r(h,function(e,t){e&&g.setRequestHeader(t,e)});var y;g.onreadystatechange=function(){if(g.readyState==4){var e=g.getAllResponseHeaders(),t=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];e||(e="",r(t,function(t){var n=g.getResponseHeader(t);n&&(e+=t+": "+n+"\n")})),v(l,y||g.status,g.responseText,e)}},d&&(g.withCredentials=!0),g.send(f||""),p>0&&n(function(){y=-1,g.abort()},p)}}}function sn(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(e){return e===1?"one":"other"}}}}function on(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(e,t,n,r){function i(i,o,u){var a=n.defer(),f=a.promise,l=v(u)&&!u,o=t.defer(function(){try{a.resolve(i())}catch(t){a.reject(t),r(t)}l||e.$apply()},o),u=function(){delete s[f.$$timeoutId]};return f.$$timeoutId=o,s[o]=a,f.then(u,u),f}var s={};return i.cancel=function(e){return e&&e.$$timeoutId in s?(s[e.$$timeoutId].reject("canceled"),t.defer.cancel(e.$$timeoutId)):!1},i}]}function un(e){function t(t,r){return e.factory(t+n,r)}var n="Filter";this.register=t,this.$get=["$injector",function(e){return function(t){return e.get(t+n)}}],t("currency",fn),t("date",vn),t("filter",an),t("json",mn),t("limitTo",gn),t("lowercase",hr),t("number",ln),t("orderBy",yn),t("uppercase",pr)}function an(){return function(e,t){if(!w(e))return e;var n=[];n.check=function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0};var r=function(e,t){if(t.charAt(0)==="!")return!r(e,t.substr(1));switch(typeof e){case"boolean":case"number":case"string":return(""+e).toLowerCase().indexOf(t)>-1;case"object":for(var n in e)if(n.charAt(0)!=="$"&&r(e[n],t))return!0;return!1;case"array":for(n=0;n<e.length;n++)if(r(e[n],t))return!0;return!1;default:return!1}};switch(typeof t){case"boolean":case"number":case"string":t={$:t};case"object":for(var i in t)i=="$"?function(){var e=(""+t[i]).toLowerCase();e&&n.push(function(t){return r(t,e)})}():function(){var e=i,s=(""+t[i]).toLowerCase();s&&n.push(function(t){return r(Rt(t,e),s)})}();break;case"function":n.push(t);break;default:return e}for(var s=[],o=0;o<e.length;o++){var u=e[o];n.check(u)&&s.push(u)}return s}}function fn(e){var t=e.NUMBER_FORMATS;return function(e,n){return d(n)&&(n=t.CURRENCY_SYM),cn(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,2).replace(/\u00A4/g,n)}}function ln(e){var t=e.NUMBER_FORMATS;return function(e,n){return cn(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,n)}}function cn(e,t,n,r,i){if(isNaN(e)||!isFinite(e))return"";var s=e<0,e=Math.abs(e),o=e+"",u="",a=[],f=!1;if(o.indexOf("e")!==-1){var l=o.match(/([\d\.]+)e(-?)(\d+)/);l&&l[2]=="-"&&l[3]>i+1?o="0":(u=o,f=!0)}if(!f){o=(o.split(ar)[1]||"").length,d(i)&&(i=Math.min(Math.max(t.minFrac,o),t.maxFrac));var o=Math.pow(10,i),e=Math.round(e*o)/o,e=(""+e).split(ar),o=e[0],e=e[1]||"",f=0,l=t.lgSize,c=t.gSize;if(o.length>=l+c)for(var f=o.length-l,h=0;h<f;h++)(f-h)%c===0&&h!==0&&(u+=n),u+=o.charAt(h);for(h=f;h<o.length;h++)(o.length-h)%l===0&&h!==0&&(u+=n),u+=o.charAt(h);for(;e.length<i;)e+="0";i&&i!=="0"&&(u+=r+e.substr(0,i))}return a.push(s?t.negPre:t.posPre),a.push(u),a.push(s?t.negSuf:t.posSuf),a.join("")}function hn(e,t,n){var r="";e<0&&(r="-",e=-e);for(e=""+e;e.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),r+e}function pn(e,t,n,r){return function(i){i=i["get"+e]();if(n>0||i>-n)i+=n;return i===0&&n==-12&&(i=12),hn(i,t,r)}}function dn(e,t){return function(n,r){var i=n["get"+e](),s=Nn(t?"SHORT"+e:e);return r[s][i]}}function vn(e){function t(e){var t;if(t=e.match(n)){var e=new Date(0),r=0,i=0;t[9]&&(r=f(t[9]+t[10]),i=f(t[9]+t[11])),e.setUTCFullYear(f(t[1]),f(t[2])-1,f(t[3])),e.setUTCHours(f(t[4]||0)-r,f(t[5]||0)-i,f(t[6]||0),f(t[7]||0))}return e}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,i){var s="",o=[],u,a,i=i||"mediumDate",i=e.DATETIME_FORMATS[i]||i;g(n)&&(n=cr.test(n)?f(n):t(n)),y(n)&&(n=new Date(n));if(!b(n))return n;for(;i;)(a=lr.exec(i))?(o=o.concat(An.call(a,1)),i=o.pop()):(o.push(i),i=null);return r(o,function(t){u=fr[t],s+=u?u(n,e.DATETIME_FORMATS):t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),s}}function mn(){return function(e){return D(e,!0)}}function gn(){return function(e,t){if(e instanceof Array){var t=f(t),n=[],r,i;if(!!e&&e instanceof Array){t>e.length?t=e.length:t<-e.length&&(t=-e.length),t>0?(r=0,i=t):(r=e.length+t,i=e.length);for(;r<i;r++)n.push(e[r]);return n}return n}return e}}function yn(e){return function(t,n,r){function i(e,t){return H(t)?function(t,n){return e(n,t)}:e}if(!w(t))return t;if(!n)return t;for(var n=w(n)?n:[n],n=N(n,function(t){var n=!1,r=t||h;if(g(t)){if(t.charAt(0)=="+"||t.charAt(0)=="-")n=t.charAt(0)=="-",t=t.substring(1);r=e(t)}return i(function(e,t){var n;n=r(e);var i=r(t),s=typeof n,o=typeof i;return s==o?(s=="string"&&(n=n.toLowerCase()),s=="string"&&(i=i.toLowerCase()),n=n===i?0:n<i?-1:1):n=s<o?-1:1,n},n)}),s=[],o=0;o<t.length;o++)s.push(t[o]);return s.sort(i(function(e,t){for(var r=0;r<n.length;r++){var i=n[r](e,t);if(i!==0)return i}return 0},r))}}function bn(e){return E(e)&&(e={link:e}),e.restrict=e.restrict||"AC",p(e)}function wn(e,t){function n(t,n){n=n?"-"+z(n,"-"):"",e.removeClass((t?Nr:Tr)+n).addClass((t?Tr:Nr)+n)}var i=this,s=e.parent().controller("form")||mr,o=0,u=i.$error={};i.$name=t.name,i.$dirty=!1,i.$pristine=!0,i.$valid=!0,i.$invalid=!1,s.$addControl(i),e.addClass(Cr),n(!0),i.$addControl=function(e){e.$name&&!i.hasOwnProperty(e.$name)&&(i[e.$name]=e)},i.$removeControl=function(e){e.$name&&i[e.$name]===e&&delete i[e.$name],r(u,function(t,n){i.$setValidity(n,!0,e)})},i.$setValidity=function(e,t,r){var a=u[e];if(t)a&&(k(a,r),!a.length)&&(o--,o||(n(t),i.$valid=!0,i.$invalid=!1),u[e]=!1,n(!0,e),s.$setValidity(e,!0,i));else{o||n(t);if(a){if(C(a,r)!=-1)return}else u[e]=a=[],o++,n(!1,e),s.$setValidity(e,!1,i);a.push(r),i.$valid=!1,i.$invalid=!0}},i.$setDirty=function(){e.removeClass(Cr).addClass(kr),i.$dirty=!0,i.$pristine=!1,s.$setDirty()}}function En(e){return d(e)||e===""||e===null||e!==e}function Sn(e,t,r,i,s,o){var u=function(){var n=x(t.val());i.$viewValue!==n&&e.$apply(function(){i.$setViewValue(n)})};if(s.hasEvent("input"))t.bind("input",u);else{var a;t.bind("keydown",function(e){e=e.keyCode,e===91||15<e&&e<19||37<=e&&e<=40||a||(a=o.defer(function(){u(),a=null}))}),t.bind("change",u)}i.$render=function(){t.val(En(i.$viewValue)?"":i.$viewValue)};var l=r.ngPattern,c=function(e,t){return En(t)||e.test(t)?(i.$setValidity("pattern",!0),t):(i.$setValidity("pattern",!1),n)};l&&(l.match(/^\/(.*)\/$/)?(l=RegExp(l.substr(1,l.length-2)),s=function(e){return c(l,e)}):s=function(t){var n=e.$eval(l);if(!n||!n.test)throw Error("Expected "+l+" to be a RegExp but was "+n);return c(n,t)},i.$formatters.push(s),i.$parsers.push(s));if(r.ngMinlength){var h=f(r.ngMinlength),s=function(e){return!En(e)&&e.length<h?(i.$setValidity("minlength",!1),n):(i.$setValidity("minlength",!0),e)};i.$parsers.push(s),i.$formatters.push(s)}if(r.ngMaxlength){var p=f(r.ngMaxlength),r=function(e){return!En(e)&&e.length>p?(i.$setValidity("maxlength",!1),n):(i.$setValidity("maxlength",!0),e)};i.$parsers.push(r),i.$formatters.push(r)}}function xn(e,t){return e="ngClass"+e,bn(function(r,i,s){function o(e){if(t===!0||r.$index%2===t)f&&e!==f&&u(f),a(e);f=e}function u(e){m(e)&&!w(e)&&(e=N(e,function(e,t){if(e)return t})),i.removeClass(w(e)?e.join(" "):e)}function a(e){m(e)&&!w(e)&&(e=N(e,function(e,t){if(e)return t})),e&&i.addClass(w(e)?e.join(" "):e)}var f=n;r.$watch(s[e],o,!0),s.$observe("class",function(){var t=r.$eval(s[e]);o(t,t)}),e!=="ngClass"&&r.$watch("$index",function(n,i){var o=n%2;o!==i%2&&(o==t?a(r.$eval(s[e])):u(r.$eval(s[e])))})})}var Tn=function(e){return g(e)?e.toLowerCase():e},Nn=function(e){return g(e)?e.toUpperCase():e},Cn=f((/msie (\d+)/.exec(Tn(navigator.userAgent))||[])[1]),kn,Ln,An=[].slice,On=[].push,Mn=Object.prototype.toString,_n=e.angular||(e.angular={}),Dn,Pn,Hn=["0","0","0"];c.$inject=[],h.$inject=[],Pn=Cn<9?function(e){return e=e.nodeName?e:e[0],e.scopeName&&e.scopeName!="HTML"?Nn(e.scopeName+":"+e.nodeName):e.nodeName}:function(e){return e.nodeName?e.nodeName:e[0].nodeName};var Bn=/[A-Z]/g,jn={full:"1.0.5",major:1,minor:0,dot:5,codeName:"flatulent-propulsion"},Fn=K.cache={},In=K.expando="ng-"+(new Date).getTime(),qn=1,Rn=e.document.addEventListener?function(e,t,n){e.addEventListener(t,n,!1)}:function(e,t,n){e.attachEvent("on"+t,n)},Un=e.document.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent("on"+t,n)},zn=/([\:\-\_]+(.))/g,Wn=/^moz([A-Z])/,Xn=K.prototype={ready:function(t){function n(){r||(r=!0,t())}var r=!1;this.bind("DOMContentLoaded",n),K(e).bind("load",n)},toString:function(){var e=[];return r(this,function(t){e.push(""+t)}),"["+e.join(", ")+"]"},eq:function(e){return e>=0?kn(this[e]):kn(this[this.length+e])},length:0,push:On,sort:[].sort,splice:[].splice},Vn={};r("multiple,selected,checked,disabled,readOnly,required".split(","),function(e){Vn[Tn(e)]=e});var $n={};r("input,select,option,textarea,button,form".split(","),function(e){$n[Nn(e)]=!0}),r({data:tt,inheritedData:ut,scope:function(e){return ut(e,"$scope")},controller:ot,injector:function(e){return ut(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:nt,css:function(e,t,r){t=$(t);if(!v(r)){var i;return Cn<=8&&(i=e.currentStyle&&e.currentStyle[t],i===""&&(i="auto")),i=i||e.style[t],Cn<=8&&(i=i===""?n:i),i}e.style[t]=r},attr:function(e,t,r){var i=Tn(t);if(Vn[i]){if(!v(r))return e[t]||(e.attributes.getNamedItem(t)||c).specified?i:n;r?(e[t]=!0,e.setAttribute(t,i)):(e[t]=!1,e.removeAttribute(i))}else if(v(r))e.setAttribute(t,r);else if(e.getAttribute)return e=e.getAttribute(t,2),e===null?n:e},prop:function(e,t,n){if(!v(n))return e[t];e[t]=n},text:a(Cn<9?function(e,t){if(e.nodeType==1){if(d(t))return e.innerText;e.innerText=t}else{if(d(t))return e.nodeValue;e.nodeValue=t}}:function(e,t){if(d(t))return e.textContent;e.textContent=t},{$dv:""}),val:function(e,t){if(d(t))return e.value;e.value=t},html:function(e,t){if(d(t))return e.innerHTML;for(var n=0,r=e.childNodes;n<r.length;n++)G(r[n]);e.innerHTML=t}},function(e,t){K.prototype[t]=function(t,r){var i,s;if((e.length==2&&e!==nt&&e!==ot?t:r)!==n){for(i=0;i<this.length;i++)e(this[i],t,r);return this}if(m(t)){for(i=0;i<this.length;i++)if(e===tt)e(this[i],t);else for(s in t)e(this[i],s,t[s]);return this}return this.length?e(this[0],t,r):e.$dv}}),r({removeData:Z,dealoc:G,bind:function li(e,t,n){var i=et(e,"events"),s=et(e,"handle");i||et(e,"events",i={}),s||et(e,"handle",s=ft(e,i)),r(t.split(" "),function(t){var r=i[t];if(!r){if(t=="mouseenter"||t=="mouseleave"){var o=0;i.mouseenter=[],i.mouseleave=[],li(e,"mouseover",function(e){o++,o==1&&s(e,"mouseenter")}),li(e,"mouseout",function(e){o--,o==0&&s(e,"mouseleave")})}else Rn(e,t,s),i[t]=[];r=i[t]}r.push(n)})},unbind:Y,replaceWith:function(e,t){var n,i=e.parentNode;G(e),r(new K(t),function(t){n?i.insertBefore(t,n.nextSibling):i.replaceChild(t,e),n=t})},children:function(e){var t=[];return r(e.childNodes,function(e){e.nodeType===1&&t.push(e)}),t},contents:function(e){return e.childNodes||[]},append:function(e,t){r(new K(t),function(t){e.nodeType===1&&e.appendChild(t)})},prepend:function(e,t){if(e.nodeType===1){var n=e.firstChild;r(new K(t),function(t){n?e.insertBefore(t,n):(e.appendChild(t),n=t)})}},wrap:function(e,t){var t=kn(t)[0],n=e.parentNode;n&&n.replaceChild(t,e),t.appendChild(e)},remove:function(e){G(e);var t=e.parentNode;t&&t.removeChild(e)},after:function(e,t){var n=e,i=e.parentNode;r(new K(t),function(e){i.insertBefore(e,n.nextSibling),n=e})},addClass:it,removeClass:rt,toggleClass:function(e,t,n){d(n)&&(n=!nt(e,t)),(n?it:rt)(e,t)},parent:function(e){return(e=e.parentNode)&&e.nodeType!==11?e:null},next:function(e){if(e.nextElementSibling)return e.nextElementSibling;for(e=e.nextSibling;e!=null&&e.nodeType!==1;)e=e.nextSibling;return e},find:function(e,t){return e.getElementsByTagName(t)},clone:Q,triggerHandler:function(e,t){var n=(et(e,"events")||{})[t];r(n,function(t){t.call(e,null)})}},function(e,t){K.prototype[t]=function(t,r){for(var i,s=0;s<this.length;s++)i==n?(i=e(this[s],t,r),i!==n&&(i=kn(i))):st(i,e(this[s],t,r));return i==n?this:i}}),ct.prototype={put:function(e,t){this[lt(e)]=t},get:function(e){return this[lt(e)]},remove:function(e){var t=this[e=lt(e)];return delete this[e],t}},ht.prototype={push:function(e,t){var n=this[e=lt(e)];n?n.push(t):this[e]=[t]},shift:function(e){var t=this[e=lt(e)];if(t)return t.length==1?(delete this[e],t[0]):t.shift()},peek:function(e){if(e=this[lt(e)])return e[0]}};var Jn=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,Kn=/,/,Qn=/^\s*(_?)(\S+?)\1\s*$/,Gn=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Yn="Non-assignable model expression: ";wt.$inject=["$provide"];var Zn=/^(x[\:\-_]|data[\:\-_])/i,er=/^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,tr=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,nr=tr,rr={http:80,https:443,ftp:21};Mt.prototype={$$replace:!1,absUrl:Pt("$$absUrl"),url:function(e,t){if(d(e))return this.$$url;var n=tr.exec(e);return n[1]&&this.path(decodeURIComponent(n[1])),(n[2]||n[1])&&this.search(n[3]||""),this.hash(n[5]||"",t),this},protocol:Pt("$$protocol"),host:Pt("$$host"),port:Pt("$$port"),path:Ht("$$path",function(e){return e.charAt(0)=="/"?e:"/"+e}),search:function(e,t){return d(e)?this.$$search:(v(t)?t===null?delete this.$$search[e]:this.$$search[e]=t:this.$$search=g(e)?j(e):e,this.$$compose(),this)},hash:Ht("$$hash",h),replace:function(){return this.$$replace=!0,this}},_t.prototype=l(Mt.prototype),Dt.prototype=l(_t.prototype);var ir={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},"undefined":c,"+":function(e,t,r,i){return r=r(e,t),i=i(e,t),v(r)?v(i)?r+i:r:v(i)?i:n},"-":function(e,t,n,r){return n=n(e,t),r=r(e,t),(v(n)?n:0)-(v(r)?r:0)},"*":function(e,t,n,r){return n(e,t)*r(e,t)},"/":function(e,t,n,r){return n(e,t)/r(e,t)},"%":function(e,t,n,r){return n(e,t)%r(e,t)},"^":function(e,t,n,r){return n(e,t)^r(e,t)},"=":c,"==":function(e,t,n,r){return n(e,t)==r(e,t)},"!=":function(e,t,n,r){return n(e,t)!=r(e,t)},"<":function(e,t,n,r){return n(e,t)<r(e,t)},">":function(e,t,n,r){return n(e,t)>r(e,t)},"<=":function(e,t,n,r){return n(e,t)<=r(e,t)},">=":function(e,t,n,r){return n(e,t)>=r(e,t)},"&&":function(e,t,n,r){return n(e,t)&&r(e,t)},"||":function(e,t,n,r){return n(e,t)||r(e,t)},"&":function(e,t,n,r){return n(e,t)&r(e,t)},"|":function(e,t,n,r){return r(e,t)(e,t,n(e,t))},"!":function(e,t,n){return!n(e,t)}},sr={n:"\n",f:"\f",r:"\r",t:" ",v:"","'":"'",'"':'"'},or={},ur=e.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(n){}throw Error("This browser does not support XMLHttpRequest.")};un.$inject=["$provide"],fn.$inject=["$locale"],ln.$inject=["$locale"];var ar=".",fr={yyyy:pn("FullYear",4),yy:pn("FullYear",2,0,!0),y:pn("FullYear",1),MMMM:dn("Month"),MMM:dn("Month",!0),MM:pn("Month",2,1),M:pn("Month",1,1),dd:pn("Date",2),d:pn("Date",1),HH:pn("Hours",2),H:pn("Hours",1),hh:pn("Hours",2,-12),h:pn("Hours",1,-12),mm:pn("Minutes",2),m:pn("Minutes",1),ss:pn("Seconds",2),s:pn("Seconds",1),EEEE:dn("Day"),EEE:dn("Day",!0),a:function(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]},Z:function(e){var e=-1*e.getTimezoneOffset(),t=e>=0?"+":"";return t+=hn(e/60,2)+hn(Math.abs(e%60),2),t}},lr=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,cr=/^\d+$/;vn.$inject=["$locale"];var hr=p(Tn),pr=p(Nn);yn.$inject=["$parse"];var dr=p({restrict:"E",compile:function(e,n){return Cn<=8&&(!n.href&&!n.name&&n.$set("href",""),e.append(t.createComment("IE fix"))),function(e,t){t.bind("click",function(e){t.attr("href")||e.preventDefault()})}}}),vr={};r(Vn,function(e,t){var n=Et("ng-"+t);vr[n]=function(){return{priority:100,compile:function(){return function(e,r,i){e.$watch(i[n],function(e){i.$set(t,!!e)})}}}}}),r(["src","href"],function(e){var t=Et("ng-"+e);vr[t]=function(){return{priority:99,link:function(n,r,i){i.$observe(t,function(t){t&&(i.$set(e,t),Cn&&r.prop(e,i[e]))})}}}});var mr={$addControl:c,$removeControl:c,$setValidity:c,$setDirty:c};wn.$inject=["$element","$attrs","$scope"];var On=function(e){return["$timeout",function(t){var r={name:"form",restrict:"E",controller:wn,compile:function(){return{pre:function(e,r,i,s){if(!i.action){var o=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1};Rn(r[0],"submit",o),r.bind("$destroy",function(){t(function(){Un(r[0],"submit",o)},0,!1)})}var u=r.parent().controller("form"),f=i.name||i.ngForm;f&&(e[f]=s),u&&r.bind("$destroy",function(){u.$removeControl(s),f&&(e[f]=n),a(s,mr)})}}}};return e?a(L(r),{restrict:"EAC"}):r}]},gr=On(),yr=On(!0),br=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,wr=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,Er=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Sr={text:Sn,number:function(e,t,r,i,s,o){Sn(e,t,r,i,s,o),i.$parsers.push(function(e){var t=En(e);return t||Er.test(e)?(i.$setValidity("number",!0),e===""?null:t?e:parseFloat(e)):(i.$setValidity("number",!1),n)}),i.$formatters.push(function(e){return En(e)?"":""+e});if(r.min){var u=parseFloat(r.min),e=function(e){return!En(e)&&e<u?(i.$setValidity("min",!1),n):(i.$setValidity("min",!0),e)};i.$parsers.push(e),i.$formatters.push(e)}if(r.max){var a=parseFloat(r.max),r=function(e){return!En(e)&&e>a?(i.$setValidity("max",!1),n):(i.$setValidity("max",!0),e)};i.$parsers.push(r),i.$formatters.push(r)}i.$formatters.push(function(e){return En(e)||y(e)?(i.$setValidity("number",!0),e):(i.$setValidity("number",!1),n)})},url:function(e,t,r,i,s,o){Sn(e,t,r,i,s,o),e=function(e){return En(e)||br.test(e)?(i.$setValidity("url",!0),e):(i.$setValidity("url",!1),n)},i.$formatters.push(e),i.$parsers.push(e)},email:function(e,t,r,i,s,o){Sn(e,t,r,i,s,o),e=function(e){return En(e)||wr.test(e)?(i.$setValidity("email",!0),e):(i.$setValidity("email",!1),n)},i.$formatters.push(e),i.$parsers.push(e)},radio:function(e,t,n,r){d(n.name)&&t.attr("name",u()),t.bind("click",function(){t[0].checked&&e.$apply(function(){r.$setViewValue(n.value)})}),r.$render=function(){t[0].checked=n.value==r.$viewValue},n.$observe("value",r.$render)},checkbox:function(e,t,n,r){var i=n.ngTrueValue,s=n.ngFalseValue;g(i)||(i=!0),g(s)||(s=!1),t.bind("click",function(){e.$apply(function(){r.$setViewValue(t[0].checked)})}),r.$render=function(){t[0].checked=r.$viewValue},r.$formatters.push(function(e){return e===i}),r.$parsers.push(function(e){return e?i:s})},hidden:c,button:c,submit:c,reset:c},xr=["$browser","$sniffer",function(e,t){return{restrict:"E",require:"?ngModel",link:function(n,r,i,s){s&&(Sr[Tn(i.type)]||Sr.text)(n,r,i,s,t,e)}}}],Tr="ng-valid",Nr="ng-invalid",Cr="ng-pristine",kr="ng-dirty",Lr=["$scope","$exceptionHandler","$attrs","$element","$parse",function(e,t,n,i,s){function o(e,t){t=t?"-"+z(t,"-"):"",i.removeClass((e?Nr:Tr)+t).addClass((e?Tr:Nr)+t)}this.$modelValue=this.$viewValue=Number.NaN,this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$name=n.name;var u=s(n.ngModel),a=u.assign;if(!a)throw Error(Yn+n.ngModel+" ("+B(i)+")");this.$render=c;var f=i.inheritedData("$formController")||mr,l=0,h=this.$error={};i.addClass(Cr),o(!0),this.$setValidity=function(e,t){if(h[e]!==!t){if(t){if(h[e]&&l--,!l)o(!0),this.$valid=!0,this.$invalid=!1}else o(!1),this.$invalid=!0,this.$valid=!1,l++;h[e]=!t,o(t,e),f.$setValidity(e,t,this)}},this.$setViewValue=function(n){this.$viewValue=n,this.$pristine&&(this.$dirty=!0,this.$pristine=!1,i.removeClass(Cr).addClass(kr),f.$setDirty()),r(this.$parsers,function(e){n=e(n)}),this.$modelValue!==n&&(this.$modelValue=n,a(e,n),r(this.$viewChangeListeners,function(e){try{e()}catch(n){t(n)}}))};var p=this;e.$watch(function(){var t=u(e);if(p.$modelValue!==t){var n=p.$formatters,r=n.length;for(p.$modelValue=t;r--;)t=n[r](t);p.$viewValue!==t&&(p.$viewValue=t,p.$render())}})}],Ar=function(){return{require:["ngModel","^?form"],controller:Lr,link:function(e,t,n,r){var i=r[0],s=r[1]||mr;s.$addControl(i),t.bind("$destroy",function(){s.$removeControl(i)})}}},Or=p({require:"ngModel",link:function(e,t,n,r){r.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),Mr=function(){return{require:"?ngModel",link:function(e,t,n,r){if(r){n.required=!0;var i=function(e){if(!n.required||!En(e)&&e!==!1)return r.$setValidity("required",!0),e;r.$setValidity("required",!1)};r.$formatters.push(i),r.$parsers.unshift(i),n.$observe("required",function(){i(r.$viewValue)})}}}},_r=function(){return{require:"ngModel",link:function(e,t,i,s){var o=(e=/\/(.*)\//.exec(i.ngList))&&RegExp(e[1])||i.ngList||",";s.$parsers.push(function(e){var t=[];return e&&r(e.split(o),function(e){e&&t.push(x(e))}),t}),s.$formatters.push(function(e){return w(e)?e.join(", "):n})}}},Dr=/^(true|false|\d+)$/,Pr=function(){return{priority:100,compile:function(e,t){return Dr.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(e){n.$set("value",e,!1)})}}}},Hr=bn(function(e,t,r){t.addClass("ng-binding").data("$binding",r.ngBind),e.$watch(r.ngBind,function(e){t.text(e==n?"":e)})}),Br=["$interpolate",function(e){return function(t,n,r){t=e(n.attr(r.$attr.ngBindTemplate)),n.addClass("ng-binding").data("$binding",t),r.$observe("ngBindTemplate",function(e){n.text(e)})}}],jr=[function(){return function(e,t,n){t.addClass("ng-binding").data("$binding",n.ngBindHtmlUnsafe),e.$watch(n.ngBindHtmlUnsafe,function(e){t.html(e||"")})}}],Fr=xn("",!0),Ir=xn("Odd",0),qr=xn("Even",1),Rr=bn({compile:function(e,t){t.$set("ngCloak",n),e.removeClass("ng-cloak")}}),Ur=[function(){return{scope:!0,controller:"@"}}],zr=["$sniffer",function(e){return{priority:1e3,compile:function(){e.csp=!0}}}],Wr={};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(e){var t=Et("ng-"+e);Wr[t]=["$parse",function(n){return function(r,i,s){var o=n(s[t]);i.bind(Tn(e),function(e){r.$apply(function(){o(r,{$event:e})})})}}]});var Xr=bn(function(e,t,n){t.bind("submit",function(){e.$apply(n.ngSubmit)})}),Vr=["$http","$templateCache","$anchorScroll","$compile",function(e,t,n,r){return{restrict:"ECA",terminal:!0,compile:function(i,s){var o=s.ngInclude||s.src,u=s.onload||"",a=s.autoscroll;return function(i,s){var f=0,l,c=function(){l&&(l.$destroy(),l=null),s.html("")};i.$watch(o,function(o){var h=++f;o?e.get(o,{cache:t}).success(function(e){h===f&&(l&&l.$destroy(),l=i.$new(),s.html(e),r(s.contents())(l),v(a)&&(!a||i.$eval(a))&&n(),l.$emit("$includeContentLoaded"),i.$eval(u))}).error(function(){h===f&&c()}):c()})}}}}],$r=bn({compile:function(){return{pre:function(e,t,n){e.$eval(n.ngInit)}}}}),Jr=bn({terminal:!0,priority:1e3}),Kr=["$locale","$interpolate",function(e,t){var n=/{}/g;return{restrict:"EA",link:function(i,s,o){var u=o.count,a=s.attr(o.$attr.when),f=o.offset||0,l=i.$eval(a),c={},h=t.startSymbol(),p=t.endSymbol();r(l,function(e,r){c[r]=t(e.replace(n,h+u+"-"+f+p))}),i.$watch(function(){var t=parseFloat(i.$eval(u));return isNaN(t)?"":(l[t]||(t=e.pluralCat(t-f)),c[t](i,s,!0))},function(e){s.text(e)})}}}],Qr=bn({transclude:"element",priority:1e3,terminal:!0,compile:function(e,t,n){return function(e,t,r){var i=r.ngRepeat,r=i.match(/^\s*(.+)\s+in\s+(.*)\s*$/),s,o,u;if(!r)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+i+"'.");i=r[1],s=r[2],r=i.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!r)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+i+"'.");o=r[3]||r[1],u=r[2];var a=new ht;e.$watch(function(e){var r,i,f=e.$eval(s),l=t,c=new ht,h,p,d,v,m,g;if(w(f))m=f||[];else{m=[];for(d in f)f.hasOwnProperty(d)&&d.charAt(0)!="$"&&m.push(d);m.sort()}h=m.length,r=0;for(i=m.length;r<i;r++)d=f===m?r:m[r],v=f[d],(g=a.shift(v))?(p=g.scope,c.push(v,g),r!==g.index&&(g.index=r,l.after(g.element)),l=g.element):p=e.$new(),p[o]=v,u&&(p[u]=d),p.$index=r,p.$first=r===0,p.$last=r===h-1,p.$middle=!p.$first&&!p.$last,g||n(p,function(e){l.after(e),g={scope:p,element:l=e,index:r},c.push(v,g)});for(d in a)if(a.hasOwnProperty(d))for(m=a[d];m.length;)v=m.pop(),v.element.remove(),v.scope.$destroy();a=c})}}}),Gr=bn(function(e,t,n){e.$watch(n.ngShow,function(e){t.css("display",H(e)?"":"none")})}),Yr=bn(function(e,t,n){e.$watch(n.ngHide,function(e){t.css("display",H(e)?"none":"")})}),Zr=bn(function(e,t,n){e.$watch(n.ngStyle,function(e,n){n&&e!==n&&r(n,function(e,n){t.css(n,"")}),e&&t.css(e)},!0)}),ei=p({restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(e,t,n,r){var i,s,o;e.$watch(n.ngSwitch||n.on,function(u){s&&(o.$destroy(),s.remove(),s=o=null);if(i=r.cases["!"+u]||r.cases["?"])e.$eval(n.change),o=e.$new(),i(o,function(e){s=e,t.append(e)})})}}),ti=bn({transclude:"element",priority:500,require:"^ngSwitch",compile:function(e,t,n){return function(e,r,i,s){s.cases["!"+t.ngSwitchWhen]=n}}}),ni=bn({transclude:"element",priority:500,require:"^ngSwitch",compile:function(e,t,n){return function(e,t,r,i){i.cases["?"]=n}}}),ri=bn({controller:["$transclude","$element",function(e,t){e(function(e){t.append(e)})}]}),ii=["$http","$templateCache","$route","$anchorScroll","$compile","$controller",function(e,t,n,r,i,s){return{restrict:"ECA",terminal:!0,link:function(e,t,o){function u(){var o=n.current&&n.current.locals,u=o&&o.$template;if(u){t.html(u),a&&(a.$destroy(),a=null);var u=i(t.contents()),l=n.current;a=l.scope=e.$new(),l.controller&&(o.$scope=a,o=s(l.controller,o),t.children().data("$ngControllerController",o)),u(a),a.$emit("$viewContentLoaded"),a.$eval(f),r()}else t.html(""),a&&(a.$destroy(),a=null)}var a,f=o.onload||"";e.$on("$routeChangeSuccess",u),u()}}}],si=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,n){n.type=="text/ng-template"&&e.put(n.id,t[0].text)}}}],oi=p({terminal:!0}),ui=["$compile","$parse",function(e,s){var o=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,u={$setViewValue:c};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(e,t,n){var r=this,i={},s=u,o;r.databound=n.ngModel,r.init=function(e,t,n){s=e,o=n},r.addOption=function(t){i[t]=!0,s.$viewValue==t&&(e.val(t),o.parent()&&o.remove())},r.removeOption=function(e){this.hasOption(e)&&(delete i[e],s.$viewValue==e&&this.renderUnknownOption(e))},r.renderUnknownOption=function(t){t="? "+lt(t)+" ?",o.val(t),e.prepend(o),e.val(t),o.prop("selected",!0)},r.hasOption=function(e){return i.hasOwnProperty(e)},t.$on("$destroy",function(){r.renderUnknownOption=c})}],link:function(u,a,f,l){function c(e,t,n,r){n.$render=function(){var e=n.$viewValue;r.hasOption(e)?(T.parent()&&T.remove(),t.val(e),e===""&&E.prop("selected",!0)):d(e)&&E?t.val(""):r.renderUnknownOption(e)},t.bind("change",function(){e.$apply(function(){T.parent()&&T.remove(),n.$setViewValue(t.val())})})}function h(e,t,n){var i;n.$render=function(){var e=new ct(n.$viewValue);r(t.find("option"),function(t){t.selected=v(e.get(t.value))})},e.$watch(function(){O(i,n.$viewValue)||(i=L(n.$viewValue),n.$render())}),t.bind("change",function(){e.$apply(function(){var e=[];r(t.find("option"),function(t){t.selected&&e.push(t.value)}),n.$setViewValue(e)})})}function p(t,r,u){function a(){var e={"":[]},s=[""],o,a,f,g,b;f=u.$modelValue,g=v(t)||[];var E=h?i(g):g,T,N,C;N={},b=!1;var k,L;if(y)b=new ct(f);else if(f===null||w)e[""].push({selected:f===null,id:"",label:""}),b=!0;for(C=0;T=E.length,C<T;C++)N[c]=g[h?N[h]=E[C]:C],o=p(t,N)||"",(a=e[o])||(a=e[o]=[],s.push(o)),y?o=b.remove(d(t,N))!=n:(o=f===d(t,N),b=b||o),k=l(t,N),k=k===n?"":k,a.push({id:h?E[C]:C,label:k,selected:o});!y&&!b&&e[""].unshift({id:"?",label:"",selected:!0}),N=0;for(E=s.length;N<E;N++){o=s[N],a=e[o],m.length<=N?(f={element:x.clone().attr("label",o),label:a.label},g=[f],m.push(g),r.append(f.element)):(g=m[N],f=g[0],f.label!=o)&&f.element.attr("label",f.label=o),k=null,C=0;for(T=a.length;C<T;C++)(o=a[C],b=g[C+1])?(k=b.element,b.label!==o.label&&k.text(b.label=o.label),b.id!==o.id&&k.val(b.id=o.id),b.element.selected!==o.selected&&k.prop("selected",b.selected=o.selected)):(o.id===""&&w?L=w:(L=S.clone()).val(o.id).attr("selected",o.selected).text(o.label),g.push({element:L,label:o.label,id:o.id,selected:o.selected}),k?k.after(L):f.element.append(L),k=L);for(C++;g.length>C;)g.pop().element.remove()}for(;m.length>N;)m.pop()[0].element.remove()}var f;if(!(f=b.match(o)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+b+"'.");var l=s(f[2]||f[1]),c=f[4]||f[6],h=f[5],p=s(f[3]||""),d=s(f[2]?f[1]:c),v=s(f[7]),m=[[{element:r,label:""}]];w&&(e(w)(t),w.removeClass("ng-scope"),w.remove()),r.html(""),r.bind("change",function(){t.$apply(function(){var e,i=v(t)||[],s={},o,a,f,l,p,g;if(y){a=[],l=0;for(g=m.length;l<g;l++){e=m[l],f=1;for(p=e.length;f<p;f++)(o=e[f].element)[0].selected&&(o=o.val(),h&&(s[h]=o),s[c]=i[o],a.push(d(t,s)))}}else o=r.val(),o=="?"?a=n:o==""?a=null:(s[c]=i[o],h&&(s[h]=o),a=d(t,s));u.$setViewValue(a)})}),u.$render=a,t.$watch(a)}if(l[1]){for(var m=l[0],g=l[1],y=f.multiple,b=f.ngOptions,w=!1,E,S=kn(t.createElement("option")),x=kn(t.createElement("optgroup")),T=S.clone(),l=0,N=a.children(),C=N.length;l<C;l++)if(N[l].value==""){E=w=N.eq(l);break}m.init(g,w,T);if(y&&(f.required||f.ngRequired)){var k=function(e){return g.$setValidity("required",!f.required||e&&e.length),e};g.$parsers.push(k),g.$formatters.unshift(k),f.$observe("required",function(){k(g.$viewValue)})}b?p(u,a,g):y?h(u,a,g):c(u,a,g,m)}}}}],ai=["$interpolate",function(e){var t={addOption:c,removeOption:c};return{restrict:"E",priority:100,compile:function(n,r){if(d(r.value)){var i=e(n.text(),!0);i||r.$set("value",n.text())}return function(e,n,r){var s=n.parent(),o=s.data("$selectController")||s.parent().data("$selectController");o&&o.databound?n.prop("selected",!1):o=t,i?e.$watch(i,function(e,t){r.$set("value",e),e!==t&&o.removeOption(t),o.addOption(e)}):o.addOption(r.value),n.bind("$destroy",function(){o.removeOption(r.value)})}}}}],fi=p({restrict:"E",terminal:!0});(Ln=e.jQuery)?(kn=Ln,a(Ln.fn,{scope:Xn.scope,controller:Xn.controller,injector:Xn.injector,inheritedData:Xn.inheritedData}),J("remove",!0),J("empty"),J("html")):kn=K,_n.element=kn,function(t){a(t,{bootstrap:U,copy:L,extend:a,equals:O,element:kn,forEach:r,injector:dt,noop:c,bind:M,toJson:D,fromJson:P,identity:h,isUndefined:d,isDefined:v,isString:g,isFunction:E,isObject:m,isNumber:y,isElement:T,isArray:w,version:jn,isDate:b,lowercase:Tn,uppercase:Nn,callbacks:{counter:0}}),Dn=V(e);try{Dn("ngLocale")}catch(n){Dn("ngLocale",[]).provider("$locale",sn)}Dn("ng",["ngLocale"],["$provide",function(e){e.provider("$compile",wt).directive({a:dr,input:xr,textarea:xr,form:gr,script:si,select:ui,style:fi,option:ai,ngBind:Hr,ngBindHtmlUnsafe:jr,ngBindTemplate:Br,ngClass:Fr,ngClassEven:qr,ngClassOdd:Ir,ngCsp:zr,ngCloak:Rr,ngController:Ur,ngForm:yr,ngHide:Yr,ngInclude:Vr,ngInit:$r,ngNonBindable:Jr,ngPluralize:Kr,ngRepeat:Qr,ngShow:Gr,ngSubmit:Xr,ngStyle:Zr,ngSwitch:ei,ngSwitchWhen:ti,ngSwitchDefault:ni,ngOptions:oi,ngView:ii,ngTransclude:ri,ngModel:Ar,ngList:_r,ngChange:Or,required:Mr,ngRequired:Mr,ngValue:Pr}).directive(vr).directive(Wr),e.provider({$anchorScroll:vt,$browser:gt,$cacheFactory:yt,$controller:St,$document:xt,$exceptionHandler:Tt,$filter:un,$interpolate:Nt,$http:tn,$httpBackend:nn,$location:Bt,$log:jt,$parse:Wt,$route:$t,$routeParams:Jt,$rootScope:Kt,$q:Xt,$sniffer:Qt,$templateCache:bt,$timeout:on,$window:Gt})}])}(_n),kn(t).ready(function(){R(t,U)})}(window,document),angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>'),define("angular",function(e){return function(){var t,n;return t||e.angular}}(this)),function(e,t,n){t.module("ngResource",["ng"]).factory("$resource",["$http","$parse",function(e,r){function i(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(t?null:/%20/g,"+")}function s(e,t){this.template=e+="#",this.defaults=t||{};var n=this.urlParams={};f(e.split(/\W/),function(t){t&&RegExp("(^|[^\\\\]):"+t+"\\W").test(e)&&(n[t]=!0)}),this.template=e.replace(/\\:/g,":")}function o(i,m,g){function b(e,t){var n={},t=l({},m,t);return f(t,function(t,i){var s;t.charAt&&t.charAt(0)=="@"?(s=t.substr(1),s=r(s)(e)):s=t,n[i]=s}),n}function E(e){c(e||{},this)}var S=new s(i),g=l({},u,g);return f(g,function(r,i){r.method=t.uppercase(r.method);var s=r.method=="POST"||r.method=="PUT"||r.method=="PATCH";E[i]=function(t,n,i,o){var u={},d,m=a,g=null;switch(arguments.length){case 4:g=o,m=i;case 3:case 2:if(!h(n)){u=t,d=n,m=i;break}if(h(t)){m=t,g=n;break}m=n,g=i;case 1:h(t)?m=t:s?d=t:u=t;break;case 0:break;default:throw"Expected between 0-4 arguments [params, data, success, error], got "+arguments.length+" arguments."}var y=this instanceof E?this:r.isArray?[]:new E(d);return e({method:r.method,url:S.url(l({},b(d,r.params||{}),u)),data:d}).then(function(e){var t=e.data;t&&(r.isArray?(y.length=0,f(t,function(e){y.push(new E(e))})):c(t,y)),(m||a)(y,e.headers)},g),y},E.prototype["$"+i]=function(e,t,r){var o=b(this),u=a,f;switch(arguments.length){case 3:o=e,u=t,f=r;break;case 2:case 1:h(e)?(u=e,f=t):(o=e,u=t||a);case 0:break;default:throw"Expected between 1-3 arguments [params, success, error], got "+arguments.length+" arguments."}E[i].call(this,o,s?this:n,u,f)}}),E.bind=function(e){return o(i,l({},m,e),g)},E}var u={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},a=t.noop,f=t.forEach,l=t.extend,c=t.copy,h=t.isFunction;return s.prototype={url:function(e){var n=this,r=this.template,s,o,e=e||{};f(this.urlParams,function(u,a){s=e.hasOwnProperty(a)?e[a]:n.defaults[a],t.isDefined(s)&&s!==null?(o=i(s,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),r=r.replace(RegExp(":"+a+"(\\W)","g"),o+"$1")):r=r.replace(RegExp("(/?):"+a+"(\\W)","g"),function(e,t,n){return n.charAt(0)=="/"?n:t+n})});var r=r.replace(/\/?#$/,""),u=[];return f(e,function(e,t){n.urlParams[t]||u.push(i(t)+"="+i(e))}),u.sort(),r=r.replace(/\/*$/,""),r+(u.length?"?"+u.join("&"):"")}},o}])}(window,window.angular),define("angular-resource",["angular"],function(e){return function(){var t,n;return t||e.angular}}(this)),function(){define("cs!apps/urlCacheBreaker",["angular"],function(e){var t;return t=e.module("UrlCacheBreaker",[]),t.filter("randomizeUrl",function(){var t,n;return t=function(){return Math.floor(Math.random()*1000001).toString(16)},n={},function(r){var i,s,o,u,a,f,l;if(r==null)return r;if(e.isObject(r)&&r.reset){if(((f=r.urls)!=null?f.length:void 0)>0){l=r.urls;for(u=0,a=l.length;u<a;u++)s=l[u],n[s]=t()}else n={};return}return r in n||(n[r]=t()),i=n[r],o="?",(r!=null?r.indexOf("?"):void 0)>=0&&(o="&"),r+o+i}}),t})}.call(this),function(){define("cs!apps/pteApp",["angular","angular-resource","cs!apps/urlCacheBreaker"],function(e){var t;return t=e.module("pte",["ngResource","UrlCacheBreaker"]),t})}.call(this),function(){define("cs!settings",[],function(){var e,t;return e=function(e){if(!window[e])throw"PTE_EXCEPTION: Invalid window var: "+e;return window[e]},t={width:e("post_width"),height:e("post_height"),id:e("post_id"),ajaxurl:e("ajaxurl"),i18n:e("pteI18n")}})}.call(this),function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};define("cs!controllers/PteCtrl",["angular","cs!apps/pteApp","cs!settings","cs!jquery"],function(t,n,r,i){return n.controller("PteCtrl",["$scope","$resource","$log","$filter",function(n,s,o,u){var a,f,l,c,h;n.page={crop:!0,view:!1},n.changePage=function(e){var t,r,i,s;n.viewFilterValue=!1,i=n.page,s=[];for(t in i)r=i[t],t===e?s.push(n.page[t]=!0):s.push(n.page[t]=!1);return s},n.pageClass=function(e){if(n.page[e])return"nav-tab-active"},n.thumbnailResource=s(r.ajaxurl,{action:"pte_ajax","pte-action":"get-thumbnail-info"}),n.updateSelected=function(){return n.$broadcast("thumbnail_selected")},n.viewFilterValue=!1,n.view=function(e){typeof event!="undefined"&&event!==null&&typeof event.stopPropagation=="function"&&event.stopPropagation(),n.changePage("view"),n.viewFilterValue=e},n.viewFilterFunc=function(r){var i;if(n.viewFilterValue===!1)return!0;if(t.isString(n.viewFilterValue))return r.name===n.viewFilterValue?!0:!1;if(t.isArray(n.viewFilterValue))if(i=r.name,e.call(n.viewFilterValue,i)>=0)return!0;return n.viewFilterValue?r.proposed!=null:!0},n.save=function(e){var r,i,s,u,a,f;i={"pte-action":"confirm-images","pte-nonce":h["pte-nonce"],id:c},u=[];if(!e){t.forEach(n.thumbnails,function(e){e.proposed&&u.push(e)});if(u.length<1)return}else u.push(e);for(a=0,f=u.length;a<f;a++)e=u[a],s="pte-confirm["+e.name+"]",i[s]=e.proposed.file;o.log(i),r=n.thumbnailResource.get(i,function(){return n.confirmResults(r)})},n.confirmResults=function(e){var t,r,i,s,o,a,l;if(!e.thumbnails){n.setErrorMessage(n.i18n.save_crop_problem);return}i=[],t=[],a=n.thumbnails;for(s=0,o=a.length;s<o;s++)r=a[s],e.thumbnails[r.name]&&(i.push(r.name),r.current=e.thumbnails[r.name].current,t.push(r.current.url),((l=r.proposed)!=null?l.url:void 0)&&t.push(r.proposed.url),n.trash(r));e.immediate?n.view(i):f(),u("randomizeUrl")({reset:!0,urls:t})},n.trash=function(e){return typeof event!="undefined"&&event!==null&&typeof event.stopPropagation=="function"&&event.stopPropagation(),delete e.proposed,e.showProposed=!1,f()},f=function(){var e,t,r,i;i=n.thumbnails;for(t=0,r=i.length;t<r;t++){e=i[t];if(e.proposed)return}return n.viewFilterValue=!1},n.trashAll=function(){return l(),t.forEach(n.thumbnails,function(e){return n.trash(e)})},l=function(){var e;if((typeof h!=="undefined"&&h!==null?h["pte-delete-nonce"]:void 0)==null)return;e=i.ajax(r.ajaxurl,{async:!1,data:{action:"pte_ajax",id:c,"pte-action":"delete-images","pte-nonce":h["pte-delete-nonce"]}})},i(window).unload(function(e){l()}),n.aspectRatios=[],a=function(e){var t,r,i,s,o;t=e.width/e.height;if(t==null||t===Infinity)return;if(!e.crop||+e.crop<1)return;o=n.aspectRatios;for(i=0,s=o.length;i<s;i++){r=o[i];if(r.size===t){r.thumbnails.push(e.name);return}}n.aspectRatios.push({size:t,thumbnails:[e.name]})},c=r.id,c||o.error("No ID Found"),n.i18n=r.i18n,n.infoMessage=null,n.setInfoMessage=function(e){return n.infoMessage=e},n.errorMessage=null,n.setErrorMessage=function(e){return n.errorMessage=e},h=null,n.setNonces=function(e){return h=e},n.thumbnails=[],n.thumbnailObject=n.thumbnailResource.get({id:c},function(){t.forEach(n.thumbnailObject,function(e,t){e.name=t,this.thumbnails.push(e),a(e)},n),n.updateSelected()}),n.anyProposed=function(){var e,t,r,i;i=n.thumbnails;for(t=0,r=i.length;t<r;t++){e=i[t];if(e.proposed!=null)return!0}return!1}}]),n})}.call(this),function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};define("cs!controllers/TableCtrl",["angular","cs!apps/pteApp"],function(t,n){return n.controller("TableCtrl",["$scope",function(n){n.toggleSelected=function(e){e.selected=!e.selected,n.updateSelected()},n.toggleAll=function(){var e,t,r;r=n.thumbnails;for(e in r)t=r[e],t.selected=n.tableSelector;n.updateSelected()},n.selectAspectRatio=function(r){var i;typeof event!="undefined"&&event!==null&&typeof event.stopPropagation=="function"&&event.stopPropagation(),i=null,t.forEach(n.thumbnails,function(t){var n;if(n=t.name,e.call(r.thumbnails,n)>=0)i==null&&(i=t.selected!=null&&t.selected?!1:!0),t.selected=i}),n.updateSelected()}}]),n})}.call(this),function(e){e.Jcrop=function(t,n){function r(e){return Math.round(e)+"px"}function i(e){return H.baseClass+"-"+e}function s(){return e.fx.step.hasOwnProperty("backgroundColor")}function o(t){var n=e(t).offset();return[n.left,n.top]}function u(e){return[e.pageX-B[0],e.pageY-B[1]]}function f(t){typeof t!="object"&&(t={}),H=e.extend(H,t),e.each(["onChange","onSelect","onRelease","onDblClick"],function(e,t){typeof H[t]!="function"&&(H[t]=function(){})})}function l(e,t,n){B=o(W),mt.setCursor(e==="move"?e:e+"-resize");if(e==="move")return mt.activateHandlers(h(t),g,n);var r=pt.getFixed(),i=p(e),s=pt.getCorner(p(i));pt.setPressed(pt.getCorner(i)),pt.setCurrent(s),mt.activateHandlers(c(e,r),g,n)}function c(e,t){return function(n){if(!H.aspectRatio)switch(e){case"e":n[1]=t.y2;break;case"w":n[1]=t.y2;break;case"n":n[0]=t.x2;break;case"s":n[0]=t.x2}else switch(e){case"e":n[1]=t.y+1;break;case"w":n[1]=t.y+1;break;case"n":n[0]=t.x+1;break;case"s":n[0]=t.x+1}pt.setCurrent(n),vt.update()}}function h(e){var t=e;return gt.watchKeys(),function(e){pt.moveOffset([e[0]-t[0],e[1]-t[1]]),t=e,vt.update()}}function p(e){switch(e){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function d(e){return function(t){return H.disabled?!1:e==="move"&&!H.allowMove?!1:(B=o(W),ft=!0,l(e,u(t)),t.stopPropagation(),t.preventDefault(),!1)}}function v(e,t,n){var r=e.width(),i=e.height();r>t&&t>0&&(r=t,i=t/e.width()*e.height()),i>n&&n>0&&(i=n,r=n/e.height()*e.width()),ot=e.width()/r,ut=e.height()/i,e.width(r).height(i)}function m(e){return{x:e.x*ot,y:e.y*ut,x2:e.x2*ot,y2:e.y2*ut,w:e.w*ot,h:e.h*ut}}function g(e){var t=pt.getFixed();t.w>H.minSelect[0]&&t.h>H.minSelect[1]?(vt.enableHandles(),vt.done()):vt.release(),mt.setCursor(H.allowSelect?"crosshair":"default")}function y(e){if(H.disabled)return!1;if(!H.allowSelect)return!1;ft=!0,B=o(W),vt.disableHandles(),mt.setCursor("crosshair");var t=u(e);return pt.setPressed(t),vt.update(),mt.activateHandlers(b,g,e.type.substring(0,5)==="touch"),gt.watchKeys(),e.stopPropagation(),e.preventDefault(),!1}function b(e){pt.setCurrent(e),vt.update()}function w(){var t=e("<div></div>").addClass(i("tracker"));return F&&t.css({opacity:0,backgroundColor:"white"}),t}function E(e){$.removeClass().addClass(i("holder")).addClass(e)}function S(e,t){function n(){window.setTimeout(b,c)}var r=e[0]/ot,i=e[1]/ut,s=e[2]/ot,o=e[3]/ut;if(lt)return;var u=pt.flipCoords(r,i,s,o),a=pt.getFixed(),f=[a.x,a.y,a.x2,a.y2],l=f,c=H.animationDelay,h=u[0]-f[0],p=u[1]-f[1],d=u[2]-f[2],v=u[3]-f[3],m=0,g=H.swingSpeed;r=l[0],i=l[1],s=l[2],o=l[3],vt.animMode(!0);var y,b=function(){return function(){m+=(100-m)/g,l[0]=Math.round(r+m/100*h),l[1]=Math.round(i+m/100*p),l[2]=Math.round(s+m/100*d),l[3]=Math.round(o+m/100*v),m>=99.8&&(m=100),m<100?(T(l),n()):(vt.done(),vt.animMode(!1),typeof t=="function"&&t.call(yt))}}();n()}function x(e){T([e[0]/ot,e[1]/ut,e[2]/ot,e[3]/ut]),H.onSelect.call(yt,m(pt.getFixed())),vt.enableHandles()}function T(e){pt.setPressed([e[0],e[1]]),pt.setCurrent([e[2],e[3]]),vt.update()}function N(){return m(pt.getFixed())}function C(){return pt.getFixed()}function k(e){f(e),P()}function L(){H.disabled=!0,vt.disableHandles(),vt.setCursor("default"),mt.setCursor("default")}function A(){H.disabled=!1,P()}function O(){vt.done(),mt.activateHandlers(null,null)}function M(){$.remove(),R.show(),R.css("visibility","visible"),e(t).removeData("Jcrop")}function _(e,t){vt.release(),L();var n=new Image;n.onload=function(){var r=n.width,i=n.height,s=H.boxWidth,o=H.boxHeight;W.width(r).height(i),W.attr("src",e),J.attr("src",e),v(W,s,o),X=W.width(),V=W.height(),J.width(X).height(V),Z.width(X+Y*2).height(V+Y*2),$.width(X).height(V),dt.resize(X,V),A(),typeof t=="function"&&t.call(yt)},n.src=e}function D(e,t,n){var r=t||H.bgColor;H.bgFade&&s()&&H.fadeTime&&!n?e.animate({backgroundColor:r},{queue:!1,duration:H.fadeTime}):e.css("backgroundColor",r)}function P(e){H.allowResize?e?vt.enableOnly():vt.enableHandles():vt.disableHandles(),mt.setCursor(H.allowSelect?"crosshair":"default"),vt.setCursor(H.allowMove?"move":"default"),H.hasOwnProperty("trueSize")&&(ot=H.trueSize[0]/X,ut=H.trueSize[1]/V),H.hasOwnProperty("setSelect")&&(x(H.setSelect),vt.done(),delete H.setSelect),dt.refresh(),H.bgColor!=et&&(D(H.shade?dt.getShades():$,H.shade?H.shadeColor||H.bgColor:H.bgColor),et=H.bgColor),tt!=H.bgOpacity&&(tt=H.bgOpacity,H.shade?dt.refresh():vt.setBgOpacity(tt)),nt=H.maxSize[0]||0,rt=H.maxSize[1]||0,it=H.minSize[0]||0,st=H.minSize[1]||0,H.hasOwnProperty("outerImage")&&(W.attr("src",H.outerImage),delete H.outerImage),vt.refresh()}var H=e.extend({},e.Jcrop.defaults),B,j=navigator.userAgent.toLowerCase(),F=/msie/.test(j),I=/msie [1-6]\./.test(j);typeof t!="object"&&(t=e(t)[0]),typeof n!="object"&&(n={}),f(n);var q={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},R=e(t),U=!0;if(t.tagName=="IMG"){if(R[0].width!=0&&R[0].height!=0)R.width(R[0].width),R.height(R[0].height);else{var z=new Image;z.src=R[0].src,R.width(z.width),R.height(z.height)}var W=R.clone().removeAttr("id").css(q).show();W.width(R.width()),W.height(R.height()),R.after(W).hide()}else W=R.css(q).show(),U=!1,H.shade===null&&(H.shade=!0);v(W,H.boxWidth,H.boxHeight);var X=W.width(),V=W.height(),$=e("<div />").width(X).height(V).addClass(i("holder")).css({position:"relative",backgroundColor:H.bgColor}).insertAfter(R).append(W);H.addClass&&$.addClass(H.addClass);var J=e("<div />"),K=e("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),Q=e("<div />").width("100%").height("100%").css("zIndex",320),G=e("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var e=pt.getFixed();H.onDblClick.call(yt,e)}).insertBefore(W).append(K,Q);U&&(J=e("<img />").attr("src",W.attr("src")).css(q).width(X).height(V),K.append(J)),I&&G.css({overflowY:"hidden"});var Y=H.boundary,Z=w().width(X+Y*2).height(V+Y*2).css({position:"absolute",top:r(-Y),left:r(-Y),zIndex:290}).mousedown(y),et=H.bgColor,tt=H.bgOpacity,nt,rt,it,st,ot,ut,at=!0,ft,lt,ct;B=o(W);var ht=function(){function e(){var e={},t=["touchstart","touchmove","touchend"],n=document.createElement("div"),r;try{for(r=0;r<t.length;r++){var i=t[r];i="on"+i;var s=i in n;s||(n.setAttribute(i,"return;"),s=typeof n[i]=="function"),e[t[r]]=s}return e.touchstart&&e.touchend&&e.touchmove}catch(o){return!1}}function t(){return H.touchSupport===!0||H.touchSupport===!1?H.touchSupport:e()}return{createDragger:function(e){return function(t){return H.disabled?!1:e==="move"&&!H.allowMove?!1:(B=o(W),ft=!0,l(e,u(ht.cfilter(t)),!0),t.stopPropagation(),t.preventDefault(),!1)}},newSelection:function(e){return y(ht.cfilter(e))},cfilter:function(e){return e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e},isSupported:e,support:t()}}(),pt=function(){function e(e){e=o(e),h=l=e[0],p=c=e[1]}function t(e){e=o(e),d=e[0]-h,v=e[1]-p,h=e[0],p=e[1]}function n(){return[d,v]}function r(e){var t=e[0],n=e[1];0>l+t&&(t-=t+l),0>c+n&&(n-=n+c),V<p+n&&(n+=V-(p+n)),X<h+t&&(t+=X-(h+t)),l+=t,h+=t,c+=n,p+=n}function i(e){var t=s();switch(e){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function s(){if(!H.aspectRatio)return a();var e=H.aspectRatio,t=H.minSize[0]/ot,n=H.maxSize[0]/ot,r=H.maxSize[1]/ut,i=h-l,s=p-c,o=Math.abs(i),d=Math.abs(s),v=o/d,m,g,y,b;return n===0&&(n=X*10),r===0&&(r=V*10),v<e?(g=p,y=d*e,m=i<0?l-y:y+l,m<0?(m=0,b=Math.abs((m-l)/e),g=s<0?c-b:b+c):m>X&&(m=X,b=Math.abs((m-l)/e),g=s<0?c-b:b+c)):(m=h,b=o/e,g=s<0?c-b:c+b,g<0?(g=0,y=Math.abs((g-c)*e),m=i<0?l-y:y+l):g>V&&(g=V,y=Math.abs(g-c)*e,m=i<0?l-y:y+l)),m>l?(m-l<t?m=l+t:m-l>n&&(m=l+n),g>c?g=c+(m-l)/e:g=c-(m-l)/e):m<l&&(l-m<t?m=l-t:l-m>n&&(m=l-n),g>c?g=c+(l-m)/e:g=c-(l-m)/e),m<0?(l-=m,m=0):m>X&&(l-=m-X,m=X),g<0?(c-=g,g=0):g>V&&(c-=g-V,g=V),f(u(l,c,m,g))}function o(e){return e[0]<0&&(e[0]=0),e[1]<0&&(e[1]=0),e[0]>X&&(e[0]=X),e[1]>V&&(e[1]=V),[Math.round(e[0]),Math.round(e[1])]}function u(e,t,n,r){var i=e,s=n,o=t,u=r;return n<e&&(i=n,s=e),r<t&&(o=r,u=t),[i,o,s,u]}function a(){var e=h-l,t=p-c,n;return nt&&Math.abs(e)>nt&&(h=e>0?l+nt:l-nt),rt&&Math.abs(t)>rt&&(p=t>0?c+rt:c-rt),st/ut&&Math.abs(t)<st/ut&&(p=t>0?c+st/ut:c-st/ut),it/ot&&Math.abs(e)<it/ot&&(h=e>0?l+it/ot:l-it/ot),l<0&&(h-=l,l-=l),c<0&&(p-=c,c-=c),h<0&&(l-=h,h-=h),p<0&&(c-=p,p-=p),h>X&&(n=h-X,l-=n,h-=n),p>V&&(n=p-V,c-=n,p-=n),l>X&&(n=l-V,p-=n,c-=n),c>V&&(n=c-V,p-=n,c-=n),f(u(l,c,h,p))}function f(e){return{x:e[0],y:e[1],x2:e[2],y2:e[3],w:e[2]-e[0],h:e[3]-e[1]}}var l=0,c=0,h=0,p=0,d,v;return{flipCoords:u,setPressed:e,setCurrent:t,getOffset:n,moveOffset:r,getCorner:i,getFixed:s}}(),dt=function(){function t(e,t){v.left.css({height:r(t)}),v.right.css({height:r(t)})}function n(){return i(pt.getFixed())}function i(e){v.top.css({left:r(e.x),width:r(e.w),height:r(e.y)}),v.bottom.css({top:r(e.y2),left:r(e.x),width:r(e.w),height:r(V-e.y2)}),v.right.css({left:r(e.x2),width:r(X-e.x2)}),v.left.css({width:r(e.x)})}function s(){return e("<div />").css({position:"absolute",backgroundColor:H.shadeColor||H.bgColor}).appendTo(d)}function o(){p||(p=!0,d.insertBefore(W),n(),vt.setBgOpacity(1,0,1),J.hide(),u(H.shadeColor||H.bgColor,1),vt.isAwake()?l(H.bgOpacity,1):l(1,1))}function u(e,t){D(h(),e,t)}function f(){p&&(d.remove(),J.show(),p=!1,vt.isAwake()?vt.setBgOpacity(H.bgOpacity,1,1):(vt.setBgOpacity(1,1,1),vt.disableHandles()),D($,0,1))}function l(e,t){p&&(H.bgFade&&!t?d.animate({opacity:1-e},{queue:!1,duration:H.fadeTime}):d.css({opacity:1-e}))}function c(){H.shade?o():f(),vt.isAwake()&&l(H.bgOpacity)}function h(){return d.children()}var p=!1,d=e("<div />").css({position:"absolute",zIndex:240,opacity:0}),v={top:s(),left:s().height(V),right:s().height(V),bottom:s()};return{update:n,updateRaw:i,getShades:h,setBgColor:u,enable:o,disable:f,resize:t,refresh:c,opacity:l}}(),vt=function(){function t(t){var n=e("<div />").css({position:"absolute",opacity:H.borderOpacity}).addClass(i(t));return K.append(n),n}function n(t,n){var r=e("<div />").mousedown(d(t)).css({cursor:t+"-resize",position:"absolute",zIndex:n}).addClass("ord-"+t);return ht.support&&r.bind("touchstart.jcrop",ht.createDragger(t)),Q.append(r),r}function s(e){var t=H.handleSize,r=n(e,L++).css({opacity:H.handleOpacity}).addClass(i("handle"));return t&&r.width(t).height(t),r}function o(e){return n(e,L++).addClass("jcrop-dragbar")}function u(e){var t;for(t=0;t<e.length;t++)M[e[t]]=o(e[t])}function f(e){var n,r;for(r=0;r<e.length;r++){switch(e[r]){case"n":n="hline";break;case"s":n="hline bottom";break;case"e":n="vline right";break;case"w":n="vline"}A[e[r]]=t(n)}}function l(e){var t;for(t=0;t<e.length;t++)O[e[t]]=s(e[t])}function c(e,t){H.shade||J.css({top:r(-t),left:r(-e)}),G.css({top:r(t),left:r(e)})}function h(e,t){G.width(Math.round(e)).height(Math.round(t))}function p(){var e=pt.getFixed();pt.setPressed([e.x,e.y]),pt.setCurrent([e.x2,e.y2]),v()}function v(e){if(k)return g(e)}function g(e){var t=pt.getFixed();h(t.w,t.h),c(t.x,t.y),H.shade&&dt.updateRaw(t),k||b(),e?H.onSelect.call(yt,m(t)):H.onChange.call(yt,m(t))}function y(e,t,n){if(!k&&!t)return;H.bgFade&&!n?W.animate({opacity:e},{queue:!1,duration:H.fadeTime}):W.css("opacity",e)}function b(){G.show(),H.shade?dt.opacity(tt):y(tt,!0),k=!0}function E(){T(),G.hide(),H.shade?dt.opacity(1):y(1),k=!1,H.onRelease.call(yt)}function S(){_&&Q.show()}function x(){_=!0;if(H.allowResize)return Q.show(),!0}function T(){_=!1,Q.hide()}function N(e){e?(lt=!0,T()):(lt=!1,x())}function C(){N(!1),p()}var k,L=370,A={},O={},M={},_=!1;H.dragEdges&&e.isArray(H.createDragbars)&&u(H.createDragbars),e.isArray(H.createHandles)&&l(H.createHandles),H.drawBorders&&e.isArray(H.createBorders)&&f(H.createBorders),e(document).bind("touchstart.jcrop-ios",function(t){e(t.currentTarget).hasClass("jcrop-tracker")&&t.stopPropagation()});var D=w().mousedown(d("move")).css({cursor:"move",position:"absolute",zIndex:360});return ht.support&&D.bind("touchstart.jcrop",ht.createDragger("move")),K.append(D),T(),{updateVisible:v,update:g,release:E,refresh:p,isAwake:function(){return k},setCursor:function(e){D.css("cursor",e)},enableHandles:x,enableOnly:function(){_=!0},showHandles:S,disableHandles:T,animMode:N,setBgOpacity:y,done:C}}(),mt=function(){function t(t){Z.css({zIndex:450}),t?e(document).bind("touchmove.jcrop",o).bind("touchend.jcrop",f):p&&e(document).bind("mousemove.jcrop",r).bind("mouseup.jcrop",i)}function n(){Z.css({zIndex:290}),e(document).unbind(".jcrop")}function r(e){return c(u(e)),!1}function i(e){return e.preventDefault(),e.stopPropagation(),ft&&(ft=!1,h(u(e)),vt.isAwake()&&H.onSelect.call(yt,m(pt.getFixed())),n(),c=function(){},h=function(){}),!1}function s(e,n,r){return ft=!0,c=e,h=n,t(r),!1}function o(e){return c(u(ht.cfilter(e))),!1}function f(e){return i(ht.cfilter(e))}function l(e){Z.css("cursor",e)}var c=function(){},h=function(){},p=H.trackDocument;return p||Z.mousemove(r).mouseup(i).mouseout(i),W.before(Z),{activateHandlers:s,setCursor:l}}(),gt=function(){function t(){H.keySupport&&(s.show(),s.focus())}function n(e){s.hide()}function r(e,t,n){H.allowMove&&(pt.moveOffset([t,n]),vt.updateVisible(!0)),e.preventDefault(),e.stopPropagation()}function i(e){if(e.ctrlKey||e.metaKey)return!0;ct=e.shiftKey?!0:!1;var t=ct?10:1;switch(e.keyCode){case 37:r(e,-t,0);break;case 39:r(e,t,0);break;case 38:r(e,0,-t);break;case 40:r(e,0,t);break;case 27:H.allowSelect&&vt.release();break;case 9:return!0}return!1}var s=e('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),o=e("<div />").css({position:"absolute",overflow:"hidden"}).append(s);return H.keySupport&&(s.keydown(i).blur(n),I||!H.fixedSupport?(s.css({position:"absolute",left:"-20px"}),o.append(s).insertBefore(W)):s.insertBefore(W)),{watchKeys:t}}();ht.support&&Z.bind("touchstart.jcrop",ht.newSelection),Q.hide(),P(!0);var yt={setImage:_,animateTo:S,setSelect:x,setOptions:k,tellSelect:N,tellScaled:C,setClass:E,disable:L,enable:A,cancel:O,release:vt.release,destroy:M,focus:gt.watchKeys,getBounds:function(){return[X*ot,V*ut]},getWidgetSize:function(){return[X,V]},getScaleFactor:function(){return[ot,ut]},getOptions:function(){return H},ui:{holder:$,selection:G}};return F&&$.bind("selectstart",function(){return!1}),R.data("Jcrop",yt),yt},e.fn.Jcrop=function(t,n){var r;return this.each(function(){if(e(this).data("Jcrop")){if(t==="api")return e(this).data("Jcrop");e(this).data("Jcrop").setOptions(t)}else this.tagName=="IMG"?e.Jcrop.Loader(this,function(){e(this).css({display:"block",visibility:"hidden"}),r=e.Jcrop(this,t),e.isFunction(n)&&n.call(r)}):(e(this).css({display:"block",visibility:"hidden"}),r=e.Jcrop(this,t),e.isFunction(n)&&n.call(r))}),this},e.Jcrop.Loader=function(t,n,r){function i(){o.complete?(s.unbind(".jcloader"),e.isFunction(n)&&n.call(o)):window.setTimeout(i,50)}var s=e(t),o=s[0];s.bind("load.jcloader",i).bind("error.jcloader",function(t){s.unbind(".jcloader"),e.isFunction(r)&&r.call(o)}),o.complete&&e.isFunction(n)&&(s.unbind(".jcloader"),n.call(o))},e.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}}(jQuery),define("jcrop",function(){}),define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t+=1)e[t](s)}function a(){var e=o;i&&e.length&&(o=[],u(e))}function f(){i||(i=!0,n&&clearInterval(n),a())}function c(e){return i?e(s):o.push(e),c}var e,t,n,r=typeof window!="undefined"&&window.document,i=!r,s=r?document:null,o=[];if(r){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),t=document.createElement("div");try{e=window.frameElement===null}catch(l){}t.doScroll&&e&&window.external&&(n=setInterval(function(){try{t.doScroll(),f()}catch(e){}},30))}document.readyState==="complete"&&f()}return c.version="2.0.1",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),function(){define("cs!jcrop-api",["cs!jquery","cs!settings","jcrop","domReady!"],function(e,t){var n,r;return r=null,n={bgColor:"transparent",onRelease:function(){var e,t,n,r,i,s,o;o=this.tellSelect(),n=o.x,i=o.y,t=o.w,e=o.h,r=o.x2,s=o.y2;if(n!==0||i!==0||t!==0||e!==0||r!==0||s!==0)this.setSelect([0,0,0,0,0,0]),this.release()},trueSize:[t.width,t.height]},r=e.Jcrop("#pte-preview",n),r.release(),r})}.call(this),function(){define("cs!controllers/CropCtrl",["cs!apps/pteApp","cs!jcrop-api","cs!jquery","cs!settings"],function(e,t,n,r){return e.controller("CropCtrl",["$scope","$log",function(e,i){e.$watch("pteCropSave",function(t,n){var r,s;if(t===n)return;r={"pte-action":"change-options",pte_crop_save:e.pteCropSave?"true":"false"},i.log(r),s=e.thumbnailResource.get(r,function(){return i.log("Updated options")})}),e.$watch("aspectRatio",function(){var n;n=e.aspectRatio||null,t.setOptions({aspectRatio:n})}),e.changeAR=function(){return e.userChanged=!0},e.toggleOptions=function(){e.cropOptions=!e.cropOptions,e.cropOptions||(e.aspectRatio=null,e.userChanged=!1,e.updateSelected())},e.updateSelected=function(){var t,n,i,s,o,u,a,f,l,c,h,p;e.setInfoMessage(null);if(e.userChanged)return;n=null;try{u=!1,t=null,p=e.thumbnails;for(c=0,h=p.length;c<h;c++){a=p[c],i=a.crop,l=a.width,o=a.height,i=+i,l=+l,o=+o,f=l/o,a.selected&&(u=!0),i>0&&(t===null?t=f:t>0&&t!==f&&(t=-1));if(a.selected&&i>0){if(n!==null&&n!==f)throw"PTE_EXCEPTION";n=f}}n===null&&u===!1&&(t!==null&&t>0?n=t:n=r.width/r.height)}catch(d){s=d,e.setInfoMessage(e.i18n.crop_problems),e.aspectRatio=null;return}e.aspectRatio=n},e.submitCrop=function(){var s,o,u,a,f,l,c,h,p,d;if(e.cropInProgress)return;e.cropInProgress=!0,a=n.map(e.thumbnails,function(e,t){return e.selected?e.name:null});if(a.length===0){e.setErrorMessage(e.i18n.no_t_selected),i.error(e.i18n.no_t_selected),e.cropInProgress=!1;return}d=t.tellSelect(),l=d.x,h=d.y,f=d.w,u=d.h,c=d.x2,p=d.y2;if(l===0&&h===0&&f===0&&u===0&&c===0&&p===0){e.setErrorMessage(e.i18n.no_c_selected),i.error(e.i18n.no_c_selected),e.cropInProgress=!1;return}s={"pte-action":"resize-images",id:r.id,"pte-sizes":a,w:f,h:u,x:l,y:h},e.pteCropSave&&(s.save="true"),o=e.thumbnailResource.get(s,function(){e.cropInProgress=!1;if(o!=null?o.immediate:void 0)return e.confirmResults(o);e.setNonces({"pte-nonce":o["pte-nonce"],"pte-delete-nonce":o["pte-delete-nonce"]}),n.each(e.thumbnails,function(e,t){var n;o.thumbnails[t.name]&&(n={url:o.thumbnails[t.name].url,file:o.thumbnails[t.name].file},t.proposed=n,t.showProposed=!0)}),e.view(!0)})},e.cropText=function(){return e.pteCropSave===!0?e.i18n.cropSave:e.i18n.crop},e.$on("thumbnail_selected",function(t){e.updateSelected()}),e.updateSelected()}]),e})}.call(this),function(){define("cs!controllers/ViewCtrl",["cs!apps/pteApp"],function(e){return e.controller("ViewCtrl",["$scope",function(e){e.orderBy=function(e){var t,n,r;return t=((n=e.current)!=null?n.width:void 0)*((r=e.current)!=null?r.height:void 0),t!=null&&t>0?t:e.width*e.height},e.selectThumb=function(t){t.selected=!0,e.changePage("crop"),e.updateSelected()},e.thumbnailClass=function(e){var t;return t=[],e.proposed!=null?t.push("modified"):t.push("original"),e.selected&&t.push("selected"),t}}]),e})}.call(this),function(){define("cs!csmain",["cs!jquery","angular","cs!apps/pteApp","cs!controllers/PteCtrl","cs!controllers/TableCtrl","cs!controllers/CropCtrl","cs!controllers/ViewCtrl"],function(e,t,n){t.bootstrap(e(".wrap"),[n.name])})}.call(this),require({paths:{angular:"../apps/angular/angular.min","angular-resource":"../apps/angular/angular-resource.min",cs:"../apps/requirejs/cs","coffee-script":"../apps/coffee-script",jcrop:"../apps/jcrop/js/jquery.Jcrop.min",domReady:"../apps/requirejs/domReady"},shim:{angular:{exports:"angular"},"angular-resource":{exports:"angular",deps:["angular"]},jcrop:["cs!jquery"]}},["cs!csmain"]),define("main",function(){});
|
17 |
* see: http://github.com/requirejs/domReady for details
|
18 |
*/
|
19 |
|
20 |
+
define("cs",{load:function(e){throw new Error("Dynamic load not allowed: "+e)}}),function(){define("cs!jquery",[],function(){return jQuery?jQuery.noConflict():{}})}.call(this),function(e,t,n){function r(e,t,n){var i;if(e)if(E(e))for(i in e)i!="prototype"&&i!="length"&&i!="name"&&e.hasOwnProperty(i)&&t.call(n,e[i],i);else if(e.forEach&&e.forEach!==r)e.forEach(t,n);else if(!e||typeof e.length!="number"?0:typeof e.hasOwnProperty!="function"&&typeof e.constructor!="function"||e instanceof K||Ln&&e instanceof Ln||Mn.call(e)!=="[object Object]"||typeof e.callee=="function")for(i=0;i<e.length;i++)t.call(n,e[i],i);else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i);return e}function i(e){var t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push(n);return t.sort()}function s(e,t,n){for(var r=i(e),s=0;s<r.length;s++)t.call(n,e[r[s]],r[s]);return r}function o(e){return function(t,n){e(n,t)}}function u(){for(var e=Hn.length,t;e;){e--,t=Hn[e].charCodeAt(0);if(t==57)return Hn[e]="A",Hn.join("");if(t!=90)return Hn[e]=String.fromCharCode(t+1),Hn.join("");Hn[e]="0"}return Hn.unshift("0"),Hn.join("")}function a(e){return r(arguments,function(t){t!==e&&r(t,function(t,n){e[n]=t})}),e}function f(e){return parseInt(e,10)}function l(e,t){return a(new(a(function(){},{prototype:e})),t)}function c(){}function h(e){return e}function p(e){return function(){return e}}function d(e){return typeof e=="undefined"}function v(e){return typeof e!="undefined"}function m(e){return e!=null&&typeof e=="object"}function g(e){return typeof e=="string"}function y(e){return typeof e=="number"}function b(e){return Mn.apply(e)=="[object Date]"}function w(e){return Mn.apply(e)=="[object Array]"}function E(e){return typeof e=="function"}function S(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function x(e){return g(e)?e.replace(/^\s*/,"").replace(/\s*$/,""):e}function T(e){return e&&(e.nodeName||e.bind&&e.find)}function N(e,t,n){var i=[];return r(e,function(e,r,s){i.push(t.call(n,e,r,s))}),i}function C(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1}function k(e,t){var n=C(e,t);return n>=0&&e.splice(n,1),t}function L(e,t){if(S(e)||e&&e.$evalAsync&&e.$watch)throw Error("Can't copy Window or Scope");if(t){if(e===t)throw Error("Can't copy equivalent objects or arrays");if(w(e))for(var n=t.length=0;n<e.length;n++)t.push(L(e[n]));else for(n in r(t,function(e,n){delete t[n]}),e)t[n]=L(e[n])}else(t=e)&&(w(e)?t=L(e,[]):b(e)?t=new Date(e.getTime()):m(e)&&(t=L(e,{})));return t}function A(e,t){var t=t||{},n;for(n in e)e.hasOwnProperty(n)&&n.substr(0,2)!=="$$"&&(t[n]=e[n]);return t}function O(e,t){if(e===t)return!0;if(e===null||t===null)return!1;if(e!==e&&t!==t)return!0;var r=typeof e,i;if(r==typeof t&&r=="object"){if(!w(e)){if(b(e))return b(t)&&e.getTime()==t.getTime();if(e&&e.$evalAsync&&e.$watch||t&&t.$evalAsync&&t.$watch||S(e)||S(t))return!1;r={};for(i in e)if(i.charAt(0)!=="$"&&!E(e[i])){if(!O(e[i],t[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&i.charAt(0)!=="$"&&t[i]!==n&&!E(t[i]))return!1;return!0}if((r=e.length)==t.length){for(i=0;i<r;i++)if(!O(e[i],t[i]))return!1;return!0}}return!1}function M(e,t){var n=arguments.length>2?An.call(arguments,2):[];return!E(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,n.concat(An.call(arguments,0))):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function _(e,r){var i=r;return/^\$+/.test(e)?i=n:S(r)?i="$WINDOW":r&&t===r?i="$DOCUMENT":r&&r.$evalAsync&&r.$watch&&(i="$SCOPE"),i}function D(e,t){return JSON.stringify(e,_,t?" ":null)}function P(e){return g(e)?JSON.parse(e):e}function H(e){return e&&e.length!==0?(e=Tn(""+e),e=e!="f"&&e!="0"&&e!="false"&&e!="no"&&e!="n"&&e!="[]"):e=!1,e}function B(e){e=kn(e).clone();try{e.html("")}catch(t){}var n=kn("<div>").append(e).html();try{return e[0].nodeType===3?Tn(n):n.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(e,t){return"<"+Tn(t)})}catch(r){return Tn(n)}}function j(e){var t={},n,i;return r((e||"").split("&"),function(e){e&&(n=e.split("="),i=decodeURIComponent(n[0]),t[i]=v(n[1])?decodeURIComponent(n[1]):!0)}),t}function F(e){var t=[];return r(e,function(e,n){t.push(q(n,!0)+(e===!0?"":"="+q(e,!0)))}),t.length?t.join("&"):""}function I(e){return q(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function q(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(t?null:/%20/g,"+")}function R(e,n){function i(e){e&&s.push(e)}var s=[e],o,u,a=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;r(a,function(n){a[n]=!0,i(t.getElementById(n)),n=n.replace(":","\\:"),e.querySelectorAll&&(r(e.querySelectorAll("."+n),i),r(e.querySelectorAll("."+n+"\\:"),i),r(e.querySelectorAll("["+n+"]"),i))}),r(s,function(e){if(!o){var t=f.exec(" "+e.className+" ");t?(o=e,u=(t[2]||"").replace(/\s+/g,",")):r(e.attributes,function(t){!o&&a[t.name]&&(o=e,u=t.value)})}}),o&&n(o,u?[u]:[])}function U(e,t){e=kn(e),t=t||[],t.unshift(["$provide",function(t){t.value("$rootElement",e)}]),t.unshift("ng");var n=dt(t);return n.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,r){e.$apply(function(){t.data("$injector",r),n(t)(e)})}]),n}function z(e,t){return t=t||"_",e.replace(Bn,function(e,n){return(n?t:"")+e.toLowerCase()})}function W(e,t,n){if(!e)throw Error("Argument '"+(t||"?")+"' is "+(n||"required"));return e}function X(e,t,n){return n&&w(e)&&(e=e[e.length-1]),W(E(e),t,"not a function, got "+(e&&typeof e=="object"?e.constructor.name||"Object":typeof e)),e}function V(e){function t(e,t,n){return e[t]||(e[t]=n())}return t(t(e,"angular",Object),"module",function(){var e={};return function(n,r,i){return r&&e.hasOwnProperty(n)&&(e[n]=null),t(e,n,function(){function e(e,n,r){return function(){return t[r||"push"]([e,n,arguments]),u}}if(!r)throw Error("No module: "+n);var t=[],s=[],o=e("$injector","invoke"),u={_invokeQueue:t,_runBlocks:s,requires:r,name:n,provider:e("$provide","provider"),factory:e("$provide","factory"),service:e("$provide","service"),value:e("$provide","value"),constant:e("$provide","constant","unshift"),filter:e("$filterProvider","register"),controller:e("$controllerProvider","register"),directive:e("$compileProvider","directive"),config:o,run:function(e){return s.push(e),this}};return i&&o(i),u})}})}function $(e){return e.replace(zn,function(e,t,n,r){return r?n.toUpperCase():n}).replace(Wn,"Moz$1")}function J(e,t){function n(){var e;for(var n=[this],i=t,s,o,u,a,f,l;n.length;){s=n.shift(),o=0;for(u=s.length;o<u;o++){a=kn(s[o]),i?a.triggerHandler("$destroy"):i=!i,f=0;for(e=(l=a.children()).length,a=e;f<a;f++)n.push(Ln(l[f]))}}return r.apply(this,arguments)}var r=Ln.fn[e],r=r.$original||r;n.$original=r,Ln.fn[e]=n}function K(e){if(e instanceof K)return e;if(!(this instanceof K)){if(g(e)&&e.charAt(0)!="<")throw Error("selectors not implemented");return new K(e)}if(g(e)){var n=t.createElement("div");n.innerHTML="<div> </div>"+e,n.removeChild(n.firstChild),st(this,n.childNodes),this.remove()}else st(this,e)}function Q(e){return e.cloneNode(!0)}function G(e){Z(e);for(var t=0,e=e.childNodes||[];t<e.length;t++)G(e[t])}function Y(e,t,n){var i=et(e,"events");et(e,"handle")&&(d(t)?r(i,function(t,n){Un(e,n,t),delete i[n]}):d(n)?(Un(e,t,i[t]),delete i[t]):k(i[t],n))}function Z(e){var t=e[In],r=Fn[t];r&&(r.handle&&(r.events.$destroy&&r.handle({},"$destroy"),Y(e)),delete Fn[t],e[In]=n)}function et(e,t,n){var r=e[In],r=Fn[r||-1];if(!v(n))return r&&r[t];r||(e[In]=r=++qn,r=Fn[r]={}),r[t]=n}function tt(e,t,n){var r=et(e,"data"),i=v(n),s=!i&&v(t),o=s&&!m(t);!r&&!o&&et(e,"data",r={});if(i)r[t]=n;else{if(!s)return r;if(o)return r&&r[t];a(r,t)}}function nt(e,t){return(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1}function rt(e,t){t&&r(t.split(" "),function(t){e.className=x((" "+e.className+" ").replace(/[\n\t]/g," ").replace(" "+x(t)+" "," "))})}function it(e,t){t&&r(t.split(" "),function(t){nt(e,t)||(e.className=x(e.className+" "+x(t)))})}function st(e,t){if(t)for(var t=!t.nodeName&&v(t.length)&&!S(t)?t:[t],n=0;n<t.length;n++)e.push(t[n])}function ot(e,t){return ut(e,"$"+(t||"ngController")+"Controller")}function ut(e,t,n){e=kn(e);for(e[0].nodeType==9&&(e=e.find("html"));e.length;){if(n=e.data(t))return n;e=e.parent()}}function at(e,t){var n=Vn[t.toLowerCase()];return n&&$n[e.nodeName]&&n}function ft(e,n){var i=function(i,s){i.preventDefault||(i.preventDefault=function(){i.returnValue=!1}),i.stopPropagation||(i.stopPropagation=function(){i.cancelBubble=!0}),i.target||(i.target=i.srcElement||t);if(d(i.defaultPrevented)){var o=i.preventDefault;i.preventDefault=function(){i.defaultPrevented=!0,o.call(i)},i.defaultPrevented=!1}i.isDefaultPrevented=function(){return i.defaultPrevented},r(n[s||i.type],function(t){t.call(e,i)}),Cn<=8?(i.preventDefault=null,i.stopPropagation=null,i.isDefaultPrevented=null):(delete i.preventDefault,delete i.stopPropagation,delete i.isDefaultPrevented)};return i.elem=e,i}function lt(e){var t=typeof e,r;return t=="object"&&e!==null?typeof (r=e.$$hashKey)=="function"?r=e.$$hashKey():r===n&&(r=e.$$hashKey=u()):r=e,t+":"+r}function ct(e){r(e,this.put,this)}function ht(){}function pt(e){var t,n;return typeof e=="function"?(t=e.$inject)||(t=[],n=e.toString().replace(Gn,""),n=n.match(Jn),r(n[1].split(Kn),function(e){e.replace(Qn,function(e,n,r){t.push(r)})}),e.$inject=t):w(e)?(n=e.length-1,X(e[n],"fn"),t=e.slice(0,n)):X(e,"fn",!0),t}function dt(e){function t(e){return function(t,n){if(!m(t))return e(t,n);r(t,o(e))}}function n(e,t){if(E(t)||w(t))t=v.instantiate(t);if(!t.$get)throw Error("Provider "+e+" must define $get factory method.");return d[e+f]=t}function i(e,t){return n(e,{$get:t})}function s(e){var t=[];return r(e,function(e){if(!h.get(e))if(h.put(e,!0),g(e)){var n=Dn(e);t=t.concat(s(n.requires)).concat(n._runBlocks);try{for(var r=n._invokeQueue,n=0,i=r.length;n<i;n++){var o=r[n],u=o[0]=="$injector"?v:v.get(o[0]);u[o[1]].apply(u,o[2])}}catch(a){throw a.message&&(a.message+=" from "+e),a}}else if(E(e))try{t.push(v.invoke(e))}catch(f){throw f.message&&(f.message+=" from "+e),f}else if(w(e))try{t.push(v.invoke(e))}catch(l){throw l.message&&(l.message+=" from "+String(e[e.length-1])),l}else X(e,"module")}),t}function u(e,t){function n(n){if(typeof n!="string")throw Error("Service name expected");if(e.hasOwnProperty(n)){if(e[n]===a)throw Error("Circular dependency: "+l.join(" <- "));return e[n]}try{return l.unshift(n),e[n]=a,e[n]=t(n)}finally{l.shift()}}function r(e,t,r){var i=[],s=pt(e),o,u,a;u=0;for(o=s.length;u<o;u++)a=s[u],i.push(r&&r.hasOwnProperty(a)?r[a]:n(a));e.$inject||(e=e[o]);switch(t?-1:i.length){case 0:return e();case 1:return e(i[0]);case 2:return e(i[0],i[1]);case 3:return e(i[0],i[1],i[2]);case 4:return e(i[0],i[1],i[2],i[3]);case 5:return e(i[0],i[1],i[2],i[3],i[4]);case 6:return e(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6]);case 8:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);case 9:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8]);case 10:return e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9]);default:return e.apply(t,i)}}return{invoke:r,instantiate:function(e,t){var n=function(){},i;return n.prototype=(w(e)?e[e.length-1]:e).prototype,n=new n,i=r(e,n,t),m(i)?i:n},get:n,annotate:pt}}var a={},f="Provider",l=[],h=new ct,d={$provide:{provider:t(n),factory:t(i),service:t(function(e,t){return i(e,["$injector",function(e){return e.instantiate(t)}])}),value:t(function(e,t){return i(e,p(t))}),constant:t(function(e,t){d[e]=t,y[e]=t}),decorator:function(e,t){var n=v.get(e+f),r=n.$get;n.$get=function(){var e=b.invoke(r,n);return b.invoke(t,null,{$delegate:e})}}}},v=u(d,function(){throw Error("Unknown provider: "+l.join(" <- "))}),y={},b=y.$injector=u(y,function(e){return e=v.get(e+f),b.invoke(e.$get,e)});return r(s(e),function(e){b.invoke(e||c)}),b}function vt(){var e=!0;this.disableAutoScrolling=function(){e=!1},this.$get=["$window","$location","$rootScope",function(t,n,i){function s(e){var t=null;return r(e,function(e){!t&&Tn(e.nodeName)==="a"&&(t=e)}),t}function o(){var e=n.hash(),r;e?(r=u.getElementById(e))?r.scrollIntoView():(r=s(u.getElementsByName(e)))?r.scrollIntoView():e==="top"&&t.scrollTo(0,0):t.scrollTo(0,0)}var u=t.document;return e&&i.$watch(function(){return n.hash()},function(){i.$evalAsync(o)}),o}]}function mt(e,t,i,s){function o(e){try{e.apply(null,An.call(arguments,1))}finally{if(b--,b===0)for(;w.length;)try{w.pop()()}catch(t){i.error(t)}}}function u(e,t){(function n(){r(E,function(e){e()}),S=t(n,e)})()}function a(){x!=f.url()&&(x=f.url(),r(N,function(e){e(f.url())}))}var f=this,l=t[0],h=e.location,p=e.history,v=e.setTimeout,m=e.clearTimeout,y={};f.isMock=!1;var b=0,w=[];f.$$completeOutstandingRequest=o,f.$$incOutstandingRequestCount=function(){b++},f.notifyWhenNoOutstandingRequests=function(e){r(E,function(e){e()}),b===0?e():w.push(e)};var E=[],S;f.addPollFn=function(e){return d(S)&&u(100,v),E.push(e),e};var x=h.href,T=t.find("base");f.url=function(e,t){if(!e)return h.href.replace(/%27/g,"'");if(x!=e)return x=e,s.history?t?p.replaceState(null,"",e):(p.pushState(null,"",e),T.attr("href",T.attr("href"))):t?h.replace(e):h.href=e,f};var N=[],C=!1;f.onUrlChange=function(t){return C||(s.history&&kn(e).bind("popstate",a),s.hashchange?kn(e).bind("hashchange",a):f.addPollFn(a),C=!0),N.push(t),t},f.baseHref=function(){var e=T.attr("href");return e?e.replace(/^https?\:\/\/[^\/]*/,""):""};var k={},L="",A=f.baseHref();f.cookies=function(e,t){var r,s,o,u;if(!e){if(l.cookie!==L){L=l.cookie,r=L.split("; "),k={};for(o=0;o<r.length;o++)s=r[o],u=s.indexOf("="),u>0&&(k[unescape(s.substring(0,u))]=unescape(s.substring(u+1)))}return k}t===n?l.cookie=escape(e)+"=;path="+A+";expires=Thu, 01 Jan 1970 00:00:00 GMT":g(t)&&(r=(l.cookie=escape(e)+"="+escape(t)+";path="+A).length+1,r>4096&&i.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+r+" > 4096 bytes)!"))},f.defer=function(e,t){var n;return b++,n=v(function(){delete y[n],o(e)},t||0),y[n]=!0,n},f.defer.cancel=function(e){return y[e]?(delete y[e],m(e),o(c),!0):!1}}function gt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,r){return new mt(e,r,t,n)}]}function yt(){this.$get=function(){function e(e,n){function r(e){e!=c&&(h?h==e&&(h=e.n):h=e,i(e.n,e.p),i(e,c),c=e,c.n=null)}function i(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in t)throw Error("cacheId "+e+" taken");var s=0,o=a({},n,{id:e}),u={},f=n&&n.capacity||Number.MAX_VALUE,l={},c=null,h=null;return t[e]={put:function(e,t){var n=l[e]||(l[e]={key:e});r(n),d(t)||(e in u||s++,u[e]=t,s>f&&this.remove(h.key))},get:function(e){var t=l[e];if(t)return r(t),u[e]},remove:function(e){var t=l[e];t&&(t==c&&(c=t.p),t==h&&(h=t.n),i(t.n,t.p),delete l[e],delete u[e],s--)},removeAll:function(){u={},s=0,l={},c=h=null},destroy:function(){l=o=u=null,delete t[e]},info:function(){return a({},o,{size:s})}}}var t={};return e.info=function(){var e={};return r(t,function(t,n){e[n]=t.info()}),e},e.get=function(e){return t[e]},e}}function bt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function wt(e){var i={},s="Directive",u=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,f=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,l="Template must have exactly one root element. was: ",c=/^\s*(https?|ftp|mailto):/;this.directive=function d(t,n){return g(t)?(W(n,"directive"),i.hasOwnProperty(t)||(i[t]=[],e.factory(t+s,["$injector","$exceptionHandler",function(e,n){var s=[];return r(i[t],function(r){try{var i=e.invoke(r);E(i)?i={compile:p(i)}:!i.compile&&i.link&&(i.compile=p(i.link)),i.priority=i.priority||0,i.name=i.name||t,i.require=i.require||i.controller&&i.name,i.restrict=i.restrict||"A",s.push(i)}catch(o){n(o)}}),s}])),i[t].push(n)):r(t,o(d)),this},this.urlSanitizationWhitelist=function(e){return v(e)?(c=e,this):c},this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(e,o,d,v,y,b,S,T,N){function C(e,t,n){e instanceof kn||(e=kn(e)),r(e,function(t,n){t.nodeType==3&&t.nodeValue.match(/\S+/)&&(e[n]=kn(t).wrap("<span></span>").parent()[0])});var i=L(e,t,e,n);return function(t,n){W(t,"scope");for(var r=n?Xn.clone.call(e):e,s=0,o=r.length;s<o;s++){var u=r[s];(u.nodeType==1||u.nodeType==9)&&r.eq(s).data("$scope",t)}return k(r,"ng-scope"),n&&n(r,t),i&&i(t,r,r),r}}function k(e,t){try{e.addClass(t)}catch(n){}}function L(e,t,r,i){function s(e,r,i,s){var u,a,f,l,c,h,p,d=[];c=0;for(h=r.length;c<h;c++)d.push(r[c]);p=c=0;for(h=o.length;c<h;p++)a=d[p],r=o[c++],u=o[c++],r?(r.scope?(f=e.$new(m(r.scope)),kn(a).data("$scope",f)):f=e,(l=r.transclude)||!s&&t?r(u,f,a,i,function(t){return function(n){var r=e.$new();return r.$$transcluded=!0,t(r,n).bind("$destroy",M(r,r.$destroy))}}(l||t)):r(u,f,a,n,s)):u&&u(e,a.childNodes,n,s)}for(var o=[],u,a,f,l=0;l<e.length;l++)a=new U,u=O(e[l],[],a,i),a=(u=u.length?_(u,e[l],a,t,r):null)&&u.terminal||!e[l].childNodes.length?null:L(e[l].childNodes,u?u.transclude:t),o.push(u),o.push(a),f=f||u||a;return f?s:null}function O(e,t,n,r){var i=n.$attr,s;switch(e.nodeType){case 1:D(t,Et(Pn(e).toLowerCase()),"E",r);var o,a,l;s=e.attributes;for(var c=0,h=s&&s.length;c<h;c++)if(o=s[c],o.specified)a=o.name,l=Et(a.toLowerCase()),i[l]=a,n[l]=o=x(Cn&&a=="href"?decodeURIComponent(e.getAttribute(a,2)):o.value),at(e,l)&&(n[l]=!0),q(e,t,o,l),D(t,l,"A",r);e=e.className;if(g(e)&&e!=="")for(;s=f.exec(e);)l=Et(s[2]),D(t,l,"C",r)&&(n[l]=x(s[3])),e=e.substr(s.index+s[0].length);break;case 3:I(t,e.nodeValue);break;case 8:try{if(s=u.exec(e.nodeValue))l=Et(s[1]),D(t,l,"M",r)&&(n[l]=x(s[2]))}catch(p){}}return t.sort(j),t}function _(e,i,s,o,u){function a(e,t){e&&(e.require=M.require,p.push(e)),t&&(t.require=M.require,v.push(t))}function f(e,t){var n,i="data",s=!1;if(g(e)){for(;(n=e.charAt(0))=="^"||n=="?";)e=e.substr(1),n=="^"&&(i="inheritedData"),s=s||n=="?";n=t[i]("$"+e+"Controller");if(!n&&!s)throw Error("No controller: "+e)}else w(e)&&(n=[],r(e,function(e){n.push(f(e,t))}));return n}function c(e,t,o,u,a){var l,c,h,m,g;l=i===o?s:A(s,new U(kn(o),s.$attr)),c=l.$$element;if(T){var y=/^\s*([@=&])\s*(\w*)\s*$/,w=t.$parent||t;r(T.scope,function(e,n){var r=e.match(y)||[],i=r[2]||n,r=r[1],s,o,u;t.$$isolateBindings[n]=r+i;switch(r){case"@":l.$observe(i,function(e){t[n]=e}),l.$$observers[i].$$scope=w;break;case"=":o=b(l[i]),u=o.assign||function(){throw s=t[n]=o(w),Error(Yn+l[i]+" (directive: "+T.name+")")},s=t[n]=o(w),t.$watch(function(){var e=o(w);return e!==t[n]&&(e!==s?s=t[n]=e:u(w,e=s=t[n])),e});break;case"&":o=b(l[i]),t[n]=function(e){return o(w,e)};break;default:throw Error("Invalid isolate scope definition for directive "+T.name+": "+e)}})}q&&r(q,function(e){var n={$scope:t,$element:c,$attrs:l,$transclude:a};g=e.controller,g=="@"&&(g=l[e.name]),c.data("$"+e.name+"Controller",S(g,n))}),u=0;for(h=p.length;u<h;u++)try{m=p[u],m(t,c,l,m.require&&f(m.require,c))}catch(E){d(E,B(c))}e&&e(t,o.childNodes,n,a),u=0;for(h=v.length;u<h;u++)try{m=v[u],m(t,c,l,m.require&&f(m.require,c))}catch(x){d(x,B(c))}}for(var h=-Number.MAX_VALUE,p=[],v=[],y=null,T=null,N=null,L=s.$$element=kn(i),M,_,D,j,I=o,q,z,W,X=0,V=e.length;X<V;X++){M=e[X],D=n;if(h>M.priority)break;if(W=M.scope)F("isolated scope",T,M,L),m(W)&&(k(L,"ng-isolate-scope"),T=M),k(L,"ng-scope"),y=y||M;_=M.name;if(W=M.controller)q=q||{},F("'"+_+"' controller",q[_],M,L),q[_]=M;if(W=M.transclude)F("transclusion",j,M,L),j=M,h=M.priority,W=="element"?(D=kn(i),L=s.$$element=kn(t.createComment(" "+_+": "+s[_]+" ")),i=L[0],R(u,kn(D[0]),i),I=C(D,o,h)):(D=kn(Q(i)).contents(),L.html(""),I=C(D,o));if(W=M.template)if(F("template",N,M,L),N=M,W=J(W),M.replace){D=kn("<div>"+x(W)+"</div>").contents(),i=D[0];if(D.length!=1||i.nodeType!==1)throw Error(l+W);R(u,L,i),_={$attr:{}},e=e.concat(O(i,e.splice(X+1,e.length-(X+1)),_)),P(s,_),V=e.length}else L.html(W);if(M.templateUrl)F("template",N,M,L),N=M,c=H(e.splice(X,e.length-X),c,L,s,u,M.replace,I),V=e.length;else if(M.compile)try{z=M.compile(L,s,I),E(z)?a(null,z):z&&a(z.pre,z.post)}catch($){d($,B(L))}M.terminal&&(c.terminal=!0,h=Math.max(h,M.priority))}return c.scope=y&&y.scope,c.transclude=j&&I,c}function D(t,r,o,u){var a=!1;if(i.hasOwnProperty(r))for(var f,r=e.get(r+s),l=0,c=r.length;l<c;l++)try{if(f=r[l],(u===n||u>f.priority)&&f.restrict.indexOf(o)!=-1)t.push(f),a=!0}catch(h){d(h)}return a}function P(e,t){var n=t.$attr,i=e.$attr,s=e.$$element;r(e,function(r,i){i.charAt(0)!="$"&&(t[i]&&(r+=(i==="style"?";":" ")+t[i]),e.$set(i,r,!0,n[i]))}),r(t,function(t,r){r=="class"?(k(s,t),e["class"]=(e["class"]?e["class"]+" ":"")+t):r=="style"?s.attr("style",s.attr("style")+";"+t):r.charAt(0)!="$"&&!e.hasOwnProperty(r)&&(e[r]=t,i[r]=n[r])})}function H(e,t,n,r,i,s,o){var u=[],f,c,h=n[0],p=e.shift(),d=a({},p,{controller:null,templateUrl:null,transclude:null,scope:null});return n.html(""),v.get(p.templateUrl,{cache:y}).success(function(a){var p,v,a=J(a);if(s){v=kn("<div>"+x(a)+"</div>").contents(),p=v[0];if(v.length!=1||p.nodeType!==1)throw Error(l+a);a={$attr:{}},R(i,n,p),O(p,e,a),P(r,a)}else p=h,n.html(a);e.unshift(d),f=_(e,p,r,o);for(c=L(n.contents(),o);u.length;){var m=u.pop(),a=u.pop();v=u.pop();var g=u.pop(),y=p;v!==h&&(y=Q(p),R(a,kn(v),y)),f(function(){t(c,g,y,i,m)},g,y,i,m)}u=null}).error(function(e,t,n,r){throw Error("Failed to load template: "+r.url)}),function(e,n,r,i,s){u?(u.push(n),u.push(r),u.push(i),u.push(s)):f(function(){t(c,n,r,i,s)},n,r,i,s)}}function j(e,t){return t.priority-e.priority}function F(e,t,n,r){if(t)throw Error("Multiple directives ["+t.name+", "+n.name+"] asking for "+e+" on: "+B(r))}function I(e,t){var n=o(t,!0);n&&e.push({priority:0,compile:p(function(e,t){var r=t.parent(),i=r.data("$binding")||[];i.push(n),k(r.data("$binding",i),"ng-binding"),e.$watch(n,function(e){t[0].nodeValue=e})})})}function q(e,t,r,i){var s=o(r,!0);s&&t.push({priority:100,compile:p(function(e,t,r){t=r.$$observers||(r.$$observers={}),i==="class"&&(s=o(r[i],!0)),r[i]=n,(t[i]||(t[i]=[])).$$inter=!0,(r.$$observers&&r.$$observers[i].$$scope||e).$watch(s,function(e){r.$set(i,e)})})})}function R(e,t,n){var r=t[0],i=r.parentNode,s,o;if(e){s=0;for(o=e.length;s<o;s++)if(e[s]==r){e[s]=n;break}}i&&i.replaceChild(n,r),n[kn.expando]=r[kn.expando],t[0]=n}var U=function(e,t){this.$$element=e,this.$attr=t||{}};U.prototype={$normalize:Et,$set:function(e,t,i,s){var o=at(this.$$element[0],e),u=this.$$observers;o&&(this.$$element.prop(e,t),s=o),this[e]=t,s?this.$attr[e]=s:(s=this.$attr[e])||(this.$attr[e]=s=z(e,"-")),Pn(this.$$element[0])==="A"&&e==="href"&&(X.setAttribute("href",t),o=X.href,o.match(c)||(this[e]=t="unsafe:"+o)),i!==!1&&(t===null||t===n?this.$$element.removeAttr(s):this.$$element.attr(s,t)),u&&r(u[e],function(e){try{e(t)}catch(n){d(n)}})},$observe:function(e,t){var n=this,r=n.$$observers||(n.$$observers={}),i=r[e]||(r[e]=[]);return i.push(t),T.$evalAsync(function(){i.$$inter||t(n[e])}),t}};var X=N[0].createElement("a"),V=o.startSymbol(),$=o.endSymbol(),J=V=="{{"||$=="}}"?h:function(e){return e.replace(/\{\{/g,V).replace(/}}/g,$)};return C}]}function Et(e){return $(e.replace(Zn,""))}function St(){var e={};this.register=function(t,n){m(t)?a(e,t):e[t]=n},this.$get=["$injector","$window",function(t,n){return function(r,i){if(g(r)){var s=r,r=e.hasOwnProperty(s)?e[s]:Rt(i.$scope,s,!0)||Rt(n,s,!0);X(r,s,!0)}return t.instantiate(r,i)}}]}function xt(){this.$get=["$window",function(e){return kn(e.document)}]}function Tt(){this.$get=["$log",function(e){return function(t,n){e.error.apply(e,arguments)}}]}function Nt(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse",function(r){function i(i,u){for(var a,f,l=0,c=[],h=i.length,p=!1,d=[];l<h;)(a=i.indexOf(e,l))!=-1&&(f=i.indexOf(t,a+s))!=-1?(l!=a&&c.push(i.substring(l,a)),c.push(l=r(p=i.substring(a+s,f))),l.exp=p,l=f+o,p=!0):(l!=h&&c.push(i.substring(l)),l=h);(h=c.length)||(c.push(""),h=1);if(!u||p)return d.length=h,l=function(e){for(var t=0,r=h,i;t<r;t++)typeof (i=c[t])=="function"&&(i=i(e),i==null||i==n?i="":typeof i!="string"&&(i=D(i))),d[t]=i;return d.join("")},l.exp=i,l.parts=c,l}var s=e.length,o=t.length;return i.startSymbol=function(){return e},i.endSymbol=function(){return t},i}]}function Ct(e){for(var e=e.split("/"),t=e.length;t--;)e[t]=I(e[t]);return e.join("/")}function kt(e,t){var n=er.exec(e),n={protocol:n[1],host:n[3],port:f(n[5])||rr[n[1]]||null,path:n[6]||"/",search:n[8],hash:n[10]};return t&&(t.$$protocol=n.protocol,t.$$host=n.host,t.$$port=n.port),n}function Lt(e,t,n){return e+"://"+t+(n==rr[e]?"":":"+n)}function At(e,t,n){var r=kt(e);return decodeURIComponent(r.path)!=t||d(r.hash)||r.hash.indexOf(n)!==0?e:Lt(r.protocol,r.host,r.port)+t.substr(0,t.lastIndexOf("/"))+r.hash.substr(n.length)}function Ot(e,t,n){var r=kt(e);if(decodeURIComponent(r.path)==t)return e;var i=r.search&&"?"+r.search||"",s=r.hash&&"#"+r.hash||"",o=t.substr(0,t.lastIndexOf("/")),u=r.path.substr(o.length);if(r.path.indexOf(o)!==0)throw Error('Invalid url "'+e+'", missing path prefix "'+o+'" !');return Lt(r.protocol,r.host,r.port)+t+"#"+n+u+i+s}function Mt(e,t,n){t=t||"",this.$$parse=function(e){var n=kt(e,this);if(n.path.indexOf(t)!==0)throw Error('Invalid url "'+e+'", missing path prefix "'+t+'" !');this.$$path=decodeURIComponent(n.path.substr(t.length)),this.$$search=j(n.search),this.$$hash=n.hash&&decodeURIComponent(n.hash)||"",this.$$compose()},this.$$compose=function(){var e=F(this.$$search),n=this.$$hash?"#"+I(this.$$hash):"";this.$$url=Ct(this.$$path)+(e?"?"+e:"")+n,this.$$absUrl=Lt(this.$$protocol,this.$$host,this.$$port)+t+this.$$url},this.$$rewriteAppUrl=function(e){if(e.indexOf(n)==0)return e},this.$$parse(e)}function _t(e,t,n){var r;this.$$parse=function(e){var n=kt(e,this);if(n.hash&&n.hash.indexOf(t)!==0)throw Error('Invalid url "'+e+'", missing hash prefix "'+t+'" !');r=n.path+(n.search?"?"+n.search:""),n=nr.exec((n.hash||"").substr(t.length)),this.$$path=n[1]?(n[1].charAt(0)=="/"?"":"/")+decodeURIComponent(n[1]):"",this.$$search=j(n[3]),this.$$hash=n[5]&&decodeURIComponent(n[5])||"",this.$$compose()},this.$$compose=function(){var e=F(this.$$search),n=this.$$hash?"#"+I(this.$$hash):"";this.$$url=Ct(this.$$path)+(e?"?"+e:"")+n,this.$$absUrl=Lt(this.$$protocol,this.$$host,this.$$port)+r+(this.$$url?"#"+t+this.$$url:"")},this.$$rewriteAppUrl=function(e){if(e.indexOf(n)==0)return e},this.$$parse(e)}function Dt(e,t,n,r){_t.apply(this,arguments),this.$$rewriteAppUrl=function(e){if(e.indexOf(n)==0)return n+r+"#"+t+e.substr(n.length)}}function Pt(e){return function(){return this[e]}}function Ht(e,t){return function(n){return d(n)?this[e]:(this[e]=t(n),this.$$compose(),this)}}function Bt(){var t="",n=!1;this.hashPrefix=function(e){return v(e)?(t=e,this):t},this.html5Mode=function(e){return v(e)?(n=e,this):n},this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(r,i,s,o){function u(e){r.$broadcast("$locationChangeSuccess",a.absUrl(),e)}var a,f,l,c=i.url(),h=kt(c);n?(f=i.baseHref()||"/",l=f.substr(0,f.lastIndexOf("/")),h=Lt(h.protocol,h.host,h.port)+l+"/",a=s.history?new Mt(At(c,f,t),l,h):new Dt(Ot(c,f,t),t,h,f.substr(l.length+1))):(h=Lt(h.protocol,h.host,h.port)+(h.path||"")+(h.search?"?"+h.search:"")+"#"+t+"/",a=new _t(c,t,h)),o.bind("click",function(t){if(!t.ctrlKey&&!t.metaKey&&t.which!=2){for(var n=kn(t.target);Tn(n[0].nodeName)!=="a";)if(n[0]===o[0]||!(n=n.parent())[0])return;var i=n.prop("href"),s=a.$$rewriteAppUrl(i);i&&!n.attr("target")&&s&&(a.$$parse(s),r.$apply(),t.preventDefault(),e.angular["ff-684208-preventDefault"]=!0)}}),a.absUrl()!=c&&i.url(a.absUrl(),!0),i.onUrlChange(function(e){a.absUrl()!=e&&(r.$evalAsync(function(){var t=a.absUrl();a.$$parse(e),u(t)}),r.$$phase||r.$digest())});var p=0;return r.$watch(function(){var e=i.url(),t=a.$$replace;if(!p||e!=a.absUrl())p++,r.$evalAsync(function(){r.$broadcast("$locationChangeStart",a.absUrl(),e).defaultPrevented?a.$$parse(e):(i.url(a.absUrl(),t),u(e))});return a.$$replace=!1,p}),a}]}function jt(){this.$get=["$window",function(e){function t(e){return e instanceof Error&&(e.stack?e=e.message&&e.stack.indexOf(e.message)===-1?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function n(n){var i=e.console||{},s=i[n]||i.log||c;return s.apply?function(){var e=[];return r(arguments,function(n){e.push(t(n))}),s.apply(i,e)}:function(e,t){s(e,t)}}return{log:n("log"),warn:n("warn"),info:n("info"),error:n("error")}}]}function Ft(e,t){function n(e){return e.indexOf(y)!=-1}function r(){return m+1<e.length?e.charAt(m+1):!1}function i(e){return"0"<=e&&e<="9"}function s(e){return e==" "||e=="\r"||e==" "||e=="\n"||e==""||e==" "}function o(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"||"_"==e||e=="$"}function u(e){return e=="-"||e=="+"||i(e)}function f(t,n,r){throw r=r||m,Error("Lexer Error: "+t+" at column"+(v(n)?"s "+n+"-"+m+" ["+e.substring(n,r)+"]":" "+r)+" in expression ["+e+"].")}function l(){for(var t="",n=m;m<e.length;){var s=Tn(e.charAt(m));if(s=="."||i(s))t+=s;else{var o=r();if(s=="e"&&u(o))t+=s;else if(u(s)&&o&&i(o)&&t.charAt(t.length-1)=="e")t+=s;else{if(!u(s)||!!o&&!!i(o)||t.charAt(t.length-1)!="e")break;f("Invalid exponent")}}m++}t*=1,p.push({index:n,text:t,json:!0,fn:function(){return t}})}function c(){for(var n="",r=m,u,f,l;m<e.length;){var c=e.charAt(m);if(c!="."&&!o(c)&&!i(c))break;c=="."&&(u=m),n+=c,m++}if(u)for(f=m;f<e.length;){c=e.charAt(f);if(c=="("){l=n.substr(u-r+1),n=n.substr(0,u-r),m=f;break}if(!s(c))break;f++}r={index:r,text:n};if(ir.hasOwnProperty(n))r.fn=r.json=ir[n];else{var h=zt(n,t);r.fn=a(function(e,t){return h(e,t)},{assign:function(e,t){return qt(e,n,t)}})}p.push(r),l&&(p.push({index:u,text:".",json:!1}),p.push({index:u+1,text:l,json:!1}))}function h(t){var n=m;m++;for(var r="",i=t,s=!1;m<e.length;){var o=e.charAt(m);i+=o;if(s)o=="u"?(o=e.substring(m+1,m+5),o.match(/[\da-f]{4}/i)||f("Invalid unicode escape [\\u"+o+"]"),m+=4,r+=String.fromCharCode(parseInt(o,16))):(s=sr[o],r+=s?s:o),s=!1;else if(o=="\\")s=!0;else{if(o==t){m++,p.push({index:n,text:i,string:r,json:!0,fn:function(){return r}});return}r+=o}m++}f("Unterminated quote",n)}for(var p=[],d,m=0,g=[],y,b=":";m<e.length;){y=e.charAt(m);if(n("\"'"))h(y);else if(i(y)||n(".")&&i(r()))l();else if(o(y)){if(c(),"{,".indexOf(b)!=-1&&g[0]=="{"&&(d=p[p.length-1]))d.json=d.text.indexOf(".")==-1}else if(n("(){}[].,;:"))p.push({index:m,text:y,json:":[,".indexOf(b)!=-1&&n("{[")||n("}]:,")}),n("{[")&&g.unshift(y),n("}]")&&g.shift(),m++;else{if(s(y)){m++;continue}var w=y+r(),E=ir[y],S=ir[w];S?(p.push({index:m,text:w,fn:S}),m+=2):E?(p.push({index:m,text:y,fn:E,json:"[,:".indexOf(b)!=-1&&n("+-")}),m+=1):f("Unexpected next character ",m,m+1)}b=y}return p}function It(e,t,r,i){function s(t,n){throw Error("Syntax Error: Token '"+n.text+"' "+t+" at column "+(n.index+1)+" of the expression ["+e+"] starting at ["+e.substring(n.index)+"].")}function o(){if(L.length===0)throw Error("Unexpected end of expression: "+e);return L[0]}function u(e,t,n,r){if(L.length>0){var i=L[0],s=i.text;if(s==e||s==t||s==n||s==r||!e&&!t&&!n&&!r)return i}return!1}function f(e,n,r,i){return(e=u(e,n,r,i))?(t&&!e.json&&s("is not valid json",e),L.shift(),e):!1}function l(e){f(e)||s("is unexpected, expecting ["+e+"]",u())}function h(e,t){return function(n,r){return e(n,r,t)}}function d(e,t,n){return function(r,i){return t(r,i,e,n)}}function v(){for(var e=[];;)if(L.length>0&&!u("}",")",";","]")&&e.push(D()),!f(";"))return e.length==1?e[0]:function(t,n){for(var r,i=0;i<e.length;i++){var s=e[i];s&&(r=s(t,n))}return r}}function m(){for(var e=f(),t=r(e.text),n=[];;){if(!(e=f(":"))){var i=function(e,r,i){for(var i=[i],s=0;s<n.length;s++)i.push(n[s](e,r));return t.apply(e,i)};return function(){return i}}n.push(A())}}function g(){for(var e=y(),t;;){if(!(t=f("||")))return e;e=d(e,t.fn,y())}}function y(){var e=b(),t;if(t=f("&&"))e=d(e,t.fn,y());return e}function b(){var e=w(),t;if(t=f("==","!="))e=d(e,t.fn,b());return e}function w(){var e;e=E();for(var t;t=f("+","-");)e=d(e,t.fn,E());if(t=f("<",">","<=",">="))e=d(e,t.fn,w());return e}function E(){for(var e=S(),t;t=f("*","/","%");)e=d(e,t.fn,S());return e}function S(){var e;return f("+")?x():(e=f("-"))?d(C,e.fn,S()):(e=f("!"))?h(e.fn,S()):x()}function x(){var e;if(f("("))e=D(),l(")");else if(f("["))e=T();else if(f("{"))e=N();else{var t=f();(e=t.fn)||s("not a primary expression",t)}for(var n;t=f("(","[",".");)t.text==="("?(e=O(e,n),n=null):t.text==="["?(n=e,e=_(e)):t.text==="."?(n=e,e=M(e)):s("IMPOSSIBLE");return e}function T(){var e=[];if(o().text!="]")do e.push(A());while(f(","));return l("]"),function(t,n){for(var r=[],i=0;i<e.length;i++)r.push(e[i](t,n));return r}}function N(){var e=[];if(o().text!="}")do{var t=f(),t=t.string||t.text;l(":");var n=A();e.push({key:t,value:n})}while(f(","));return l("}"),function(t,n){for(var r={},i=0;i<e.length;i++){var s=e[i],o=s.value(t,n);r[s.key]=o}return r}}var C=p(0),k,L=Ft(e,i),A=function(){var t=g(),n,r;return(r=f("="))?(t.assign||s("implies assignment but ["+e.substring(0,r.index)+"] can not be assigned to",r),n=g(),function(e,r){return t.assign(e,n(e,r),r)}):t},O=function(e,t){var n=[];if(o().text!=")")do n.push(A());while(f(","));return l(")"),function(r,i){for(var s=[],o=t?t(r,i):r,u=0;u<n.length;u++)s.push(n[u](r,i));return u=e(r,i)||c,u.apply?u.apply(o,s):u(s[0],s[1],s[2],s[3],s[4])}},M=function(e){var t=f().text,n=zt(t,i);return a(function(t,r){return n(e(t,r),r)},{assign:function(n,r,i){return qt(e(n,i),t,r)}})},_=function(e){var t=A();return l("]"),a(function(r,i){var s=e(r,i),o=t(r,i),u;return s?((s=s[o])&&s.then&&(u=s,"$$v"in s||(u.$$v=n,u.then(function(e){u.$$v=e})),s=s.$$v),s):n},{assign:function(n,r,i){return e(n,i)[t(n,i)]=r}})},D=function(){for(var e=A(),t;;){if(!(t=f("|")))return e;e=d(e,t.fn,m())}};return t?(A=g,O=M=_=D=function(){s("is not valid json",{text:e,index:0})},k=x()):k=v(),L.length!==0&&s("is an unexpected token",L[0]),k}function qt(e,t,n){for(var t=t.split("."),r=0;t.length>1;r++){var i=t.shift(),s=e[i];s||(s={},e[i]=s),e=s}return e[t.shift()]=n}function Rt(e,t,n){if(!t)return e;for(var t=t.split("."),r,i=e,s=t.length,o=0;o<s;o++)r=t[o],e&&(e=(i=e)[r]);return!n&&E(e)?M(i,e):e}function Ut(e,t,r,i,s){return function(o,u){var a=u&&u.hasOwnProperty(e)?u:o,f;return a===null||a===n?a:((a=a[e])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!t||a===null||a===n?a:((a=a[t])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!r||a===null||a===n?a:((a=a[r])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!i||a===null||a===n?a:((a=a[i])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!s||a===null||a===n?a:((a=a[s])&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),a)))))}}function zt(e,t){if(or.hasOwnProperty(e))return or[e];var i=e.split("."),s=i.length,o;if(t)o=s<6?Ut(i[0],i[1],i[2],i[3],i[4]):function(e,t){var r=0,o;do o=Ut(i[r++],i[r++],i[r++],i[r++],i[r++])(e,t),t=n,e=o;while(r<s);return o};else{var u="var l, fn, p;\n";r(i,function(e,t){u+="if(s === null || s === undefined) return s;\nl=s;\ns="+(t?"s":'((k&&k.hasOwnProperty("'+e+'"))?k:s)')+'["'+e+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'}),u+="return s;",o=Function("s","k",u),o.toString=function(){return u}}return or[e]=o}function Wt(){var e={};this.$get=["$filter","$sniffer",function(t,n){return function(r){switch(typeof r){case"string":return e.hasOwnProperty(r)?e[r]:e[r]=It(r,!1,t,n.csp);case"function":return r;default:return c}}}]}function Xt(){this.$get=["$rootScope","$exceptionHandler",function(e,t){return Vt(function(t){e.$evalAsync(t)},t)}]}function Vt(e,t){function i(e){return e}function s(e){return a(e)}var o=function(){var r=[],f,l;return l={resolve:function(t){if(r){var i=r;r=n,f=u(t),i.length&&e(function(){for(var e,t=0,n=i.length;t<n;t++)e=i[t],f.then(e[0],e[1])})}},reject:function(e){l.resolve(a(e))},promise:{then:function(e,n){var u=o(),a=function(n){try{u.resolve((e||i)(n))}catch(r){t(r),u.reject(r)}},l=function(e){try{u.resolve((n||s)(e))}catch(r){t(r),u.reject(r)}};return r?r.push([a,l]):f.then(a,l),u.promise}}}},u=function(t){return t&&t.then?t:{then:function(n){var r=o();return e(function(){r.resolve(n(t))}),r.promise}}},a=function(t){return{then:function(n,r){var i=o();return e(function(){i.resolve((r||s)(t))}),i.promise}}};return{defer:o,reject:a,when:function(n,r,f){var l=o(),c,h=function(e){try{return(r||i)(e)}catch(n){return t(n),a(n)}},p=function(e){try{return(f||s)(e)}catch(n){return t(n),a(n)}};return e(function(){u(n).then(function(e){c||(c=!0,l.resolve(u(e).then(h,p)))},function(e){c||(c=!0,l.resolve(p(e)))})}),l.promise},all:function(e){var t=o(),n=e.length,i=[];return n?r(e,function(e,r){u(e).then(function(e){r in i||(i[r]=e,--n||t.resolve(i))},function(e){r in i||t.reject(e)})}):t.resolve(i),t.promise}}}function $t(){var e={};this.when=function(t,n){e[t]=a({reloadOnSearch:!0},n);if(t){var r=t[t.length-1]=="/"?t.substr(0,t.length-1):t+"/";e[r]={redirectTo:t}}return this},this.otherwise=function(e){return this.when(null,e),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(t,n,i,s,o,u,f){function c(e,t){for(var t="^"+t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"$",n="",i=[],s={},o=/:(\w+)/g,u,a=0;(u=o.exec(t))!==null;)n+=t.slice(a,u.index),n+="([^\\/]*)",i.push(u[1]),a=o.lastIndex;n+=t.substr(a);var f=e.match(RegExp(n));return f&&r(i,function(e,t){s[e]=f[t+1]}),f?s:null}function h(){var e=p(),a=y.current;if(e&&a&&e.$route===a.$route&&O(e.pathParams,a.pathParams)&&!e.reloadOnSearch&&!m)a.params=e.params,L(a.params,i),t.$broadcast("$routeUpdate",a);else if(e||a)m=!1,t.$broadcast("$routeChangeStart",e,a),(y.current=e)&&e.redirectTo&&(g(e.redirectTo)?n.path(d(e.redirectTo,e.params)).search(e.params).replace():n.url(e.redirectTo(e.pathParams,n.path(),n.search())).replace()),s.when(e).then(function(){if(e){var t=[],n=[],i;return r(e.resolve||{},function(e,r){t.push(r),n.push(g(e)?o.get(e):o.invoke(e))}),v(i=e.template)||v(i=e.templateUrl)&&(i=u.get(i,{cache:f}).then(function(e){return e.data})),v(i)&&(t.push("$template"),n.push(i)),s.all(n).then(function(e){var n={};return r(e,function(e,r){n[t[r]]=e}),n})}}).then(function(n){e==y.current&&(e&&(e.locals=n,L(e.params,i)),t.$broadcast("$routeChangeSuccess",e,a))},function(n){e==y.current&&t.$broadcast("$routeChangeError",e,a,n)})}function p(){var t,i;return r(e,function(e,r){!i&&(t=c(n.path(),r))&&(i=l(e,{params:a({},n.search(),t),pathParams:t}),i.$route=e)}),i||e[null]&&l(e[null],{params:{},pathParams:{}})}function d(e,t){var n=[];return r((e||"").split(":"),function(e,r){if(r==0)n.push(e);else{var i=e.match(/(\w+)(.*)/),s=i[1];n.push(t[s]),n.push(i[2]||""),delete t[s]}}),n.join("")}var m=!1,y={routes:e,reload:function(){m=!0,t.$evalAsync(h)}};return t.$on("$locationChangeSuccess",h),y}]}function Jt(){this.$get=p({})}function Kt(){var e=10;this.digestTtl=function(t){return arguments.length&&(e=t),e},this.$get=["$injector","$exceptionHandler","$parse",function(t,n,r){function i(){this.$id=u(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this["this"]=this.$root=this,this.$$destroyed=!1,this.$$asyncQueue=[],this.$$listeners={},this.$$isolateBindings={}}function s(e){if(f.$$phase)throw Error(f.$$phase+" already in progress");f.$$phase=e}function o(e,t){var n=r(e);return X(n,t),n}function a(){}i.prototype={$new:function(e){if(E(e))throw Error("API-CHANGE: Use $controller to instantiate controllers.");return e?(e=new i,e.$root=this.$root):(e=function(){},e.prototype=this,e=new e,e.$id=u()),e["this"]=e,e.$$listeners={},e.$parent=this,e.$$asyncQueue=[],e.$$watchers=e.$$nextSibling=e.$$childHead=e.$$childTail=null,e.$$prevSibling=this.$$childTail,this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=e:this.$$childHead=this.$$childTail=e,e},$watch:function(e,t,n){var r=o(e,"watch"),i=this.$$watchers,s={fn:t,last:a,get:r,exp:e,eq:!!n};if(!E(t)){var u=o(t||c,"listener");s.fn=function(e,t,n){u(n)}}return i||(i=this.$$watchers=[]),i.unshift(s),function(){k(i,s)}},$digest:function(){var t,r,i,o,u,l,c,h=e,p,d=[],v,m;s("$digest");do{c=!1,p=this;do{for(u=p.$$asyncQueue;u.length;)try{p.$eval(u.shift())}catch(g){n(g)}if(o=p.$$watchers)for(l=o.length;l--;)try{if(t=o[l],(r=t.get(p))!==(i=t.last)&&!(t.eq?O(r,i):typeof r=="number"&&typeof i=="number"&&isNaN(r)&&isNaN(i)))c=!0,t.last=t.eq?L(r):r,t.fn(r,i===a?r:i,p),h<5&&(v=4-h,d[v]||(d[v]=[]),m=E(t.exp)?"fn: "+(t.exp.name||t.exp.toString()):t.exp,m+="; newVal: "+D(r)+"; oldVal: "+D(i),d[v].push(m))}catch(y){n(y)}if(!(o=p.$$childHead||p!==this&&p.$$nextSibling))for(;p!==this&&!(o=p.$$nextSibling);)p=p.$parent}while(p=o);if(c&&!(h--))throw f.$$phase=null,Error(e+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+D(d))}while(c||u.length);f.$$phase=null},$destroy:function(){if(f!=this&&!this.$$destroyed){var e=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,e.$$childHead==this&&(e.$$childHead=this.$$nextSibling),e.$$childTail==this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(e,t){return r(e)(this,t)},$evalAsync:function(e){this.$$asyncQueue.push(e)},$apply:function(e){try{return s("$apply"),this.$eval(e)}catch(t){n(t)}finally{f.$$phase=null;try{f.$digest()}catch(r){throw n(r),r}}},$on:function(e,t){var n=this.$$listeners[e];return n||(this.$$listeners[e]=n=[]),n.push(t),function(){n[C(n,t)]=null}},$emit:function(e,t){var r=[],i,s=this,o=!1,u={name:e,targetScope:s,stopPropagation:function(){o=!0},preventDefault:function(){u.defaultPrevented=!0},defaultPrevented:!1},a=[u].concat(An.call(arguments,1)),f,l;do{i=s.$$listeners[e]||r,u.currentScope=s,f=0;for(l=i.length;f<l;f++)if(i[f])try{if(i[f].apply(null,a),o)return u}catch(c){n(c)}else i.splice(f,1),f--,l--;s=s.$parent}while(s);return u},$broadcast:function(e,t){var r=this,i=this,s={name:e,targetScope:this,preventDefault:function(){s.defaultPrevented=!0},defaultPrevented:!1},o=[s].concat(An.call(arguments,1)),u,a;do{r=i,s.currentScope=r,i=r.$$listeners[e]||[],u=0;for(a=i.length;u<a;u++)if(i[u])try{i[u].apply(null,o)}catch(f){n(f)}else i.splice(u,1),u--,a--;if(!(i=r.$$childHead||r!==this&&r.$$nextSibling))for(;r!==this&&!(i=r.$$nextSibling);)r=r.$parent}while(r=i);return s}};var f=new i;return f}]}function Qt(){this.$get=["$window",function(e){var t={},n=f((/android (\d+)/.exec(Tn(e.navigator.userAgent))||[])[1]);return{history:!(!e.history||!e.history.pushState||n<4),hashchange:"onhashchange"in e&&(!e.document.documentMode||e.document.documentMode>7),hasEvent:function(n){if(n=="input"&&Cn==9)return!1;if(d(t[n])){var r=e.document.createElement("div");t[n]="on"+n in r}return t[n]},csp:!1}}]}function Gt(){this.$get=p(e)}function Yt(e){var t={},n,i,s;return e?(r(e.split("\n"),function(e){s=e.indexOf(":"),n=Tn(x(e.substr(0,s))),i=x(e.substr(s+1)),n&&(t[n]?t[n]+=", "+i:t[n]=i)}),t):t}function Zt(e){var t=m(e)?e:n;return function(n){return t||(t=Yt(e)),n?t[Tn(n)]||null:t}}function en(e,t,n){return E(n)?n(e,t):(r(n,function(n){e=n(e,t)}),e)}function tn(){var e=/^\s*(\[|\{[^\{])/,t=/[\}\]]\s*$/,i=/^\)\]\}',?\n/,o=this.defaults={transformResponse:[function(n){return g(n)&&(n=n.replace(i,""),e.test(n)&&t.test(n)&&(n=P(n,!0))),n}],transformRequest:[function(e){return m(e)&&Mn.apply(e)!=="[object File]"?D(e):e}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},u=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(e,t,i,f,l,c){function h(e){function n(e){var t=a({},e,{data:en(e.data,e.headers,s)});return 200<=e.status&&e.status<300?t:l.reject(t)}e.method=Nn(e.method);var i=e.transformRequest||o.transformRequest,s=e.transformResponse||o.transformResponse,u=o.headers,u=a({"X-XSRF-TOKEN":t.cookies()["XSRF-TOKEN"]},u.common,u[Tn(e.method)],e.headers),i=en(e.data,Zt(u),i),f;return d(e.data)&&delete u["Content-Type"],f=p(e,i,u),f=f.then(n,n),r(b,function(e){f=e(f)}),f.success=function(t){return f.then(function(n){t(n.data,n.status,n.headers,e)}),f},f.error=function(t){return f.then(null,function(n){t(n.data,n.status,n.headers,e)}),f},f}function p(t,n,r){function i(e,t,n){c&&(200<=e&&e<300?c.put(d,[e,t,Yt(n)]):c.remove(d)),s(t,e,n),f.$apply()}function s(e,n,r){n=Math.max(n,0),(200<=n&&n<300?u.resolve:u.reject)({data:e,status:n,headers:Zt(r),config:t})}function o(){var e=C(h.pendingRequests,t);e!==-1&&h.pendingRequests.splice(e,1)}var u=l.defer(),a=u.promise,c,p,d=v(t.url,t.params);h.pendingRequests.push(t),a.then(o,o),t.cache&&t.method=="GET"&&(c=m(t.cache)?t.cache:y);if(c)if(p=c.get(d)){if(p.then)return p.then(o,o),p;w(p)?s(p[1],p[0],L(p[2])):s(p,200,{})}else c.put(d,a);return p||e(t.method,d,n,i,r,t.timeout,t.withCredentials),a}function v(e,t){if(!t)return e;var r=[];return s(t,function(e,t){e==null||e==n||(m(e)&&(e=D(e)),r.push(encodeURIComponent(t)+"="+encodeURIComponent(e)))}),e+(e.indexOf("?")==-1?"?":"&")+r.join("&")}var y=i("$http"),b=[];return r(u,function(e){b.push(g(e)?c.get(e):c.invoke(e))}),h.pendingRequests=[],function(e){r(arguments,function(e){h[e]=function(t,n){return h(a(n||{},{method:e,url:t}))}})}("get","delete","head","jsonp"),function(e){r(arguments,function(e){h[e]=function(t,n,r){return h(a(r||{},{method:e,url:t,data:n}))}})}("post","put"),h.defaults=o,h}]}function nn(){this.$get=["$browser","$window","$document",function(e,t,n){return rn(e,ur,e.defer,t.angular.callbacks,n[0],t.location.protocol.replace(":",""))}]}function rn(e,t,n,i,s,o){function u(e,t){var n=s.createElement("script"),r=function(){s.body.removeChild(n),t&&t()};n.type="text/javascript",n.src=e,Cn?n.onreadystatechange=function(){/loaded|complete/.test(n.readyState)&&r()}:n.onload=n.onerror=r,s.body.appendChild(n)}return function(s,a,f,l,h,p,d){function v(t,n,r,i){n=(a.match(er)||["",o])[1]=="file"?r?200:404:n,t(n==1223?204:n,r,i),e.$$completeOutstandingRequest(c)}e.$$incOutstandingRequestCount(),a=a||e.url();if(Tn(s)=="jsonp"){var m="_"+(i.counter++).toString(36);i[m]=function(e){i[m].data=e},u(a.replace("JSON_CALLBACK","angular.callbacks."+m),function(){i[m].data?v(l,200,i[m].data):v(l,-2),delete i[m]})}else{var g=new t;g.open(s,a,!0),r(h,function(e,t){e&&g.setRequestHeader(t,e)});var y;g.onreadystatechange=function(){if(g.readyState==4){var e=g.getAllResponseHeaders(),t=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];e||(e="",r(t,function(t){var n=g.getResponseHeader(t);n&&(e+=t+": "+n+"\n")})),v(l,y||g.status,g.responseText,e)}},d&&(g.withCredentials=!0),g.send(f||""),p>0&&n(function(){y=-1,g.abort()},p)}}}function sn(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(e){return e===1?"one":"other"}}}}function on(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(e,t,n,r){function i(i,o,u){var a=n.defer(),f=a.promise,l=v(u)&&!u,o=t.defer(function(){try{a.resolve(i())}catch(t){a.reject(t),r(t)}l||e.$apply()},o),u=function(){delete s[f.$$timeoutId]};return f.$$timeoutId=o,s[o]=a,f.then(u,u),f}var s={};return i.cancel=function(e){return e&&e.$$timeoutId in s?(s[e.$$timeoutId].reject("canceled"),t.defer.cancel(e.$$timeoutId)):!1},i}]}function un(e){function t(t,r){return e.factory(t+n,r)}var n="Filter";this.register=t,this.$get=["$injector",function(e){return function(t){return e.get(t+n)}}],t("currency",fn),t("date",vn),t("filter",an),t("json",mn),t("limitTo",gn),t("lowercase",hr),t("number",ln),t("orderBy",yn),t("uppercase",pr)}function an(){return function(e,t){if(!w(e))return e;var n=[];n.check=function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0};var r=function(e,t){if(t.charAt(0)==="!")return!r(e,t.substr(1));switch(typeof e){case"boolean":case"number":case"string":return(""+e).toLowerCase().indexOf(t)>-1;case"object":for(var n in e)if(n.charAt(0)!=="$"&&r(e[n],t))return!0;return!1;case"array":for(n=0;n<e.length;n++)if(r(e[n],t))return!0;return!1;default:return!1}};switch(typeof t){case"boolean":case"number":case"string":t={$:t};case"object":for(var i in t)i=="$"?function(){var e=(""+t[i]).toLowerCase();e&&n.push(function(t){return r(t,e)})}():function(){var e=i,s=(""+t[i]).toLowerCase();s&&n.push(function(t){return r(Rt(t,e),s)})}();break;case"function":n.push(t);break;default:return e}for(var s=[],o=0;o<e.length;o++){var u=e[o];n.check(u)&&s.push(u)}return s}}function fn(e){var t=e.NUMBER_FORMATS;return function(e,n){return d(n)&&(n=t.CURRENCY_SYM),cn(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,2).replace(/\u00A4/g,n)}}function ln(e){var t=e.NUMBER_FORMATS;return function(e,n){return cn(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,n)}}function cn(e,t,n,r,i){if(isNaN(e)||!isFinite(e))return"";var s=e<0,e=Math.abs(e),o=e+"",u="",a=[],f=!1;if(o.indexOf("e")!==-1){var l=o.match(/([\d\.]+)e(-?)(\d+)/);l&&l[2]=="-"&&l[3]>i+1?o="0":(u=o,f=!0)}if(!f){o=(o.split(ar)[1]||"").length,d(i)&&(i=Math.min(Math.max(t.minFrac,o),t.maxFrac));var o=Math.pow(10,i),e=Math.round(e*o)/o,e=(""+e).split(ar),o=e[0],e=e[1]||"",f=0,l=t.lgSize,c=t.gSize;if(o.length>=l+c)for(var f=o.length-l,h=0;h<f;h++)(f-h)%c===0&&h!==0&&(u+=n),u+=o.charAt(h);for(h=f;h<o.length;h++)(o.length-h)%l===0&&h!==0&&(u+=n),u+=o.charAt(h);for(;e.length<i;)e+="0";i&&i!=="0"&&(u+=r+e.substr(0,i))}return a.push(s?t.negPre:t.posPre),a.push(u),a.push(s?t.negSuf:t.posSuf),a.join("")}function hn(e,t,n){var r="";e<0&&(r="-",e=-e);for(e=""+e;e.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),r+e}function pn(e,t,n,r){return function(i){i=i["get"+e]();if(n>0||i>-n)i+=n;return i===0&&n==-12&&(i=12),hn(i,t,r)}}function dn(e,t){return function(n,r){var i=n["get"+e](),s=Nn(t?"SHORT"+e:e);return r[s][i]}}function vn(e){function t(e){var t;if(t=e.match(n)){var e=new Date(0),r=0,i=0;t[9]&&(r=f(t[9]+t[10]),i=f(t[9]+t[11])),e.setUTCFullYear(f(t[1]),f(t[2])-1,f(t[3])),e.setUTCHours(f(t[4]||0)-r,f(t[5]||0)-i,f(t[6]||0),f(t[7]||0))}return e}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,i){var s="",o=[],u,a,i=i||"mediumDate",i=e.DATETIME_FORMATS[i]||i;g(n)&&(n=cr.test(n)?f(n):t(n)),y(n)&&(n=new Date(n));if(!b(n))return n;for(;i;)(a=lr.exec(i))?(o=o.concat(An.call(a,1)),i=o.pop()):(o.push(i),i=null);return r(o,function(t){u=fr[t],s+=u?u(n,e.DATETIME_FORMATS):t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),s}}function mn(){return function(e){return D(e,!0)}}function gn(){return function(e,t){if(e instanceof Array){var t=f(t),n=[],r,i;if(!!e&&e instanceof Array){t>e.length?t=e.length:t<-e.length&&(t=-e.length),t>0?(r=0,i=t):(r=e.length+t,i=e.length);for(;r<i;r++)n.push(e[r]);return n}return n}return e}}function yn(e){return function(t,n,r){function i(e,t){return H(t)?function(t,n){return e(n,t)}:e}if(!w(t))return t;if(!n)return t;for(var n=w(n)?n:[n],n=N(n,function(t){var n=!1,r=t||h;if(g(t)){if(t.charAt(0)=="+"||t.charAt(0)=="-")n=t.charAt(0)=="-",t=t.substring(1);r=e(t)}return i(function(e,t){var n;n=r(e);var i=r(t),s=typeof n,o=typeof i;return s==o?(s=="string"&&(n=n.toLowerCase()),s=="string"&&(i=i.toLowerCase()),n=n===i?0:n<i?-1:1):n=s<o?-1:1,n},n)}),s=[],o=0;o<t.length;o++)s.push(t[o]);return s.sort(i(function(e,t){for(var r=0;r<n.length;r++){var i=n[r](e,t);if(i!==0)return i}return 0},r))}}function bn(e){return E(e)&&(e={link:e}),e.restrict=e.restrict||"AC",p(e)}function wn(e,t){function n(t,n){n=n?"-"+z(n,"-"):"",e.removeClass((t?Nr:Tr)+n).addClass((t?Tr:Nr)+n)}var i=this,s=e.parent().controller("form")||mr,o=0,u=i.$error={};i.$name=t.name,i.$dirty=!1,i.$pristine=!0,i.$valid=!0,i.$invalid=!1,s.$addControl(i),e.addClass(Cr),n(!0),i.$addControl=function(e){e.$name&&!i.hasOwnProperty(e.$name)&&(i[e.$name]=e)},i.$removeControl=function(e){e.$name&&i[e.$name]===e&&delete i[e.$name],r(u,function(t,n){i.$setValidity(n,!0,e)})},i.$setValidity=function(e,t,r){var a=u[e];if(t)a&&(k(a,r),!a.length)&&(o--,o||(n(t),i.$valid=!0,i.$invalid=!1),u[e]=!1,n(!0,e),s.$setValidity(e,!0,i));else{o||n(t);if(a){if(C(a,r)!=-1)return}else u[e]=a=[],o++,n(!1,e),s.$setValidity(e,!1,i);a.push(r),i.$valid=!1,i.$invalid=!0}},i.$setDirty=function(){e.removeClass(Cr).addClass(kr),i.$dirty=!0,i.$pristine=!1,s.$setDirty()}}function En(e){return d(e)||e===""||e===null||e!==e}function Sn(e,t,r,i,s,o){var u=function(){var n=x(t.val());i.$viewValue!==n&&e.$apply(function(){i.$setViewValue(n)})};if(s.hasEvent("input"))t.bind("input",u);else{var a;t.bind("keydown",function(e){e=e.keyCode,e===91||15<e&&e<19||37<=e&&e<=40||a||(a=o.defer(function(){u(),a=null}))}),t.bind("change",u)}i.$render=function(){t.val(En(i.$viewValue)?"":i.$viewValue)};var l=r.ngPattern,c=function(e,t){return En(t)||e.test(t)?(i.$setValidity("pattern",!0),t):(i.$setValidity("pattern",!1),n)};l&&(l.match(/^\/(.*)\/$/)?(l=RegExp(l.substr(1,l.length-2)),s=function(e){return c(l,e)}):s=function(t){var n=e.$eval(l);if(!n||!n.test)throw Error("Expected "+l+" to be a RegExp but was "+n);return c(n,t)},i.$formatters.push(s),i.$parsers.push(s));if(r.ngMinlength){var h=f(r.ngMinlength),s=function(e){return!En(e)&&e.length<h?(i.$setValidity("minlength",!1),n):(i.$setValidity("minlength",!0),e)};i.$parsers.push(s),i.$formatters.push(s)}if(r.ngMaxlength){var p=f(r.ngMaxlength),r=function(e){return!En(e)&&e.length>p?(i.$setValidity("maxlength",!1),n):(i.$setValidity("maxlength",!0),e)};i.$parsers.push(r),i.$formatters.push(r)}}function xn(e,t){return e="ngClass"+e,bn(function(r,i,s){function o(e){if(t===!0||r.$index%2===t)f&&e!==f&&u(f),a(e);f=e}function u(e){m(e)&&!w(e)&&(e=N(e,function(e,t){if(e)return t})),i.removeClass(w(e)?e.join(" "):e)}function a(e){m(e)&&!w(e)&&(e=N(e,function(e,t){if(e)return t})),e&&i.addClass(w(e)?e.join(" "):e)}var f=n;r.$watch(s[e],o,!0),s.$observe("class",function(){var t=r.$eval(s[e]);o(t,t)}),e!=="ngClass"&&r.$watch("$index",function(n,i){var o=n%2;o!==i%2&&(o==t?a(r.$eval(s[e])):u(r.$eval(s[e])))})})}var Tn=function(e){return g(e)?e.toLowerCase():e},Nn=function(e){return g(e)?e.toUpperCase():e},Cn=f((/msie (\d+)/.exec(Tn(navigator.userAgent))||[])[1]),kn,Ln,An=[].slice,On=[].push,Mn=Object.prototype.toString,_n=e.angular||(e.angular={}),Dn,Pn,Hn=["0","0","0"];c.$inject=[],h.$inject=[],Pn=Cn<9?function(e){return e=e.nodeName?e:e[0],e.scopeName&&e.scopeName!="HTML"?Nn(e.scopeName+":"+e.nodeName):e.nodeName}:function(e){return e.nodeName?e.nodeName:e[0].nodeName};var Bn=/[A-Z]/g,jn={full:"1.0.5",major:1,minor:0,dot:5,codeName:"flatulent-propulsion"},Fn=K.cache={},In=K.expando="ng-"+(new Date).getTime(),qn=1,Rn=e.document.addEventListener?function(e,t,n){e.addEventListener(t,n,!1)}:function(e,t,n){e.attachEvent("on"+t,n)},Un=e.document.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent("on"+t,n)},zn=/([\:\-\_]+(.))/g,Wn=/^moz([A-Z])/,Xn=K.prototype={ready:function(t){function n(){r||(r=!0,t())}var r=!1;this.bind("DOMContentLoaded",n),K(e).bind("load",n)},toString:function(){var e=[];return r(this,function(t){e.push(""+t)}),"["+e.join(", ")+"]"},eq:function(e){return e>=0?kn(this[e]):kn(this[this.length+e])},length:0,push:On,sort:[].sort,splice:[].splice},Vn={};r("multiple,selected,checked,disabled,readOnly,required".split(","),function(e){Vn[Tn(e)]=e});var $n={};r("input,select,option,textarea,button,form".split(","),function(e){$n[Nn(e)]=!0}),r({data:tt,inheritedData:ut,scope:function(e){return ut(e,"$scope")},controller:ot,injector:function(e){return ut(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:nt,css:function(e,t,r){t=$(t);if(!v(r)){var i;return Cn<=8&&(i=e.currentStyle&&e.currentStyle[t],i===""&&(i="auto")),i=i||e.style[t],Cn<=8&&(i=i===""?n:i),i}e.style[t]=r},attr:function(e,t,r){var i=Tn(t);if(Vn[i]){if(!v(r))return e[t]||(e.attributes.getNamedItem(t)||c).specified?i:n;r?(e[t]=!0,e.setAttribute(t,i)):(e[t]=!1,e.removeAttribute(i))}else if(v(r))e.setAttribute(t,r);else if(e.getAttribute)return e=e.getAttribute(t,2),e===null?n:e},prop:function(e,t,n){if(!v(n))return e[t];e[t]=n},text:a(Cn<9?function(e,t){if(e.nodeType==1){if(d(t))return e.innerText;e.innerText=t}else{if(d(t))return e.nodeValue;e.nodeValue=t}}:function(e,t){if(d(t))return e.textContent;e.textContent=t},{$dv:""}),val:function(e,t){if(d(t))return e.value;e.value=t},html:function(e,t){if(d(t))return e.innerHTML;for(var n=0,r=e.childNodes;n<r.length;n++)G(r[n]);e.innerHTML=t}},function(e,t){K.prototype[t]=function(t,r){var i,s;if((e.length==2&&e!==nt&&e!==ot?t:r)!==n){for(i=0;i<this.length;i++)e(this[i],t,r);return this}if(m(t)){for(i=0;i<this.length;i++)if(e===tt)e(this[i],t);else for(s in t)e(this[i],s,t[s]);return this}return this.length?e(this[0],t,r):e.$dv}}),r({removeData:Z,dealoc:G,bind:function li(e,t,n){var i=et(e,"events"),s=et(e,"handle");i||et(e,"events",i={}),s||et(e,"handle",s=ft(e,i)),r(t.split(" "),function(t){var r=i[t];if(!r){if(t=="mouseenter"||t=="mouseleave"){var o=0;i.mouseenter=[],i.mouseleave=[],li(e,"mouseover",function(e){o++,o==1&&s(e,"mouseenter")}),li(e,"mouseout",function(e){o--,o==0&&s(e,"mouseleave")})}else Rn(e,t,s),i[t]=[];r=i[t]}r.push(n)})},unbind:Y,replaceWith:function(e,t){var n,i=e.parentNode;G(e),r(new K(t),function(t){n?i.insertBefore(t,n.nextSibling):i.replaceChild(t,e),n=t})},children:function(e){var t=[];return r(e.childNodes,function(e){e.nodeType===1&&t.push(e)}),t},contents:function(e){return e.childNodes||[]},append:function(e,t){r(new K(t),function(t){e.nodeType===1&&e.appendChild(t)})},prepend:function(e,t){if(e.nodeType===1){var n=e.firstChild;r(new K(t),function(t){n?e.insertBefore(t,n):(e.appendChild(t),n=t)})}},wrap:function(e,t){var t=kn(t)[0],n=e.parentNode;n&&n.replaceChild(t,e),t.appendChild(e)},remove:function(e){G(e);var t=e.parentNode;t&&t.removeChild(e)},after:function(e,t){var n=e,i=e.parentNode;r(new K(t),function(e){i.insertBefore(e,n.nextSibling),n=e})},addClass:it,removeClass:rt,toggleClass:function(e,t,n){d(n)&&(n=!nt(e,t)),(n?it:rt)(e,t)},parent:function(e){return(e=e.parentNode)&&e.nodeType!==11?e:null},next:function(e){if(e.nextElementSibling)return e.nextElementSibling;for(e=e.nextSibling;e!=null&&e.nodeType!==1;)e=e.nextSibling;return e},find:function(e,t){return e.getElementsByTagName(t)},clone:Q,triggerHandler:function(e,t){var n=(et(e,"events")||{})[t];r(n,function(t){t.call(e,null)})}},function(e,t){K.prototype[t]=function(t,r){for(var i,s=0;s<this.length;s++)i==n?(i=e(this[s],t,r),i!==n&&(i=kn(i))):st(i,e(this[s],t,r));return i==n?this:i}}),ct.prototype={put:function(e,t){this[lt(e)]=t},get:function(e){return this[lt(e)]},remove:function(e){var t=this[e=lt(e)];return delete this[e],t}},ht.prototype={push:function(e,t){var n=this[e=lt(e)];n?n.push(t):this[e]=[t]},shift:function(e){var t=this[e=lt(e)];if(t)return t.length==1?(delete this[e],t[0]):t.shift()},peek:function(e){if(e=this[lt(e)])return e[0]}};var Jn=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,Kn=/,/,Qn=/^\s*(_?)(\S+?)\1\s*$/,Gn=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Yn="Non-assignable model expression: ";wt.$inject=["$provide"];var Zn=/^(x[\:\-_]|data[\:\-_])/i,er=/^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,tr=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,nr=tr,rr={http:80,https:443,ftp:21};Mt.prototype={$$replace:!1,absUrl:Pt("$$absUrl"),url:function(e,t){if(d(e))return this.$$url;var n=tr.exec(e);return n[1]&&this.path(decodeURIComponent(n[1])),(n[2]||n[1])&&this.search(n[3]||""),this.hash(n[5]||"",t),this},protocol:Pt("$$protocol"),host:Pt("$$host"),port:Pt("$$port"),path:Ht("$$path",function(e){return e.charAt(0)=="/"?e:"/"+e}),search:function(e,t){return d(e)?this.$$search:(v(t)?t===null?delete this.$$search[e]:this.$$search[e]=t:this.$$search=g(e)?j(e):e,this.$$compose(),this)},hash:Ht("$$hash",h),replace:function(){return this.$$replace=!0,this}},_t.prototype=l(Mt.prototype),Dt.prototype=l(_t.prototype);var ir={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},"undefined":c,"+":function(e,t,r,i){return r=r(e,t),i=i(e,t),v(r)?v(i)?r+i:r:v(i)?i:n},"-":function(e,t,n,r){return n=n(e,t),r=r(e,t),(v(n)?n:0)-(v(r)?r:0)},"*":function(e,t,n,r){return n(e,t)*r(e,t)},"/":function(e,t,n,r){return n(e,t)/r(e,t)},"%":function(e,t,n,r){return n(e,t)%r(e,t)},"^":function(e,t,n,r){return n(e,t)^r(e,t)},"=":c,"==":function(e,t,n,r){return n(e,t)==r(e,t)},"!=":function(e,t,n,r){return n(e,t)!=r(e,t)},"<":function(e,t,n,r){return n(e,t)<r(e,t)},">":function(e,t,n,r){return n(e,t)>r(e,t)},"<=":function(e,t,n,r){return n(e,t)<=r(e,t)},">=":function(e,t,n,r){return n(e,t)>=r(e,t)},"&&":function(e,t,n,r){return n(e,t)&&r(e,t)},"||":function(e,t,n,r){return n(e,t)||r(e,t)},"&":function(e,t,n,r){return n(e,t)&r(e,t)},"|":function(e,t,n,r){return r(e,t)(e,t,n(e,t))},"!":function(e,t,n){return!n(e,t)}},sr={n:"\n",f:"\f",r:"\r",t:" ",v:"","'":"'",'"':'"'},or={},ur=e.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(n){}throw Error("This browser does not support XMLHttpRequest.")};un.$inject=["$provide"],fn.$inject=["$locale"],ln.$inject=["$locale"];var ar=".",fr={yyyy:pn("FullYear",4),yy:pn("FullYear",2,0,!0),y:pn("FullYear",1),MMMM:dn("Month"),MMM:dn("Month",!0),MM:pn("Month",2,1),M:pn("Month",1,1),dd:pn("Date",2),d:pn("Date",1),HH:pn("Hours",2),H:pn("Hours",1),hh:pn("Hours",2,-12),h:pn("Hours",1,-12),mm:pn("Minutes",2),m:pn("Minutes",1),ss:pn("Seconds",2),s:pn("Seconds",1),EEEE:dn("Day"),EEE:dn("Day",!0),a:function(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]},Z:function(e){var e=-1*e.getTimezoneOffset(),t=e>=0?"+":"";return t+=hn(e/60,2)+hn(Math.abs(e%60),2),t}},lr=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,cr=/^\d+$/;vn.$inject=["$locale"];var hr=p(Tn),pr=p(Nn);yn.$inject=["$parse"];var dr=p({restrict:"E",compile:function(e,n){return Cn<=8&&(!n.href&&!n.name&&n.$set("href",""),e.append(t.createComment("IE fix"))),function(e,t){t.bind("click",function(e){t.attr("href")||e.preventDefault()})}}}),vr={};r(Vn,function(e,t){var n=Et("ng-"+t);vr[n]=function(){return{priority:100,compile:function(){return function(e,r,i){e.$watch(i[n],function(e){i.$set(t,!!e)})}}}}}),r(["src","href"],function(e){var t=Et("ng-"+e);vr[t]=function(){return{priority:99,link:function(n,r,i){i.$observe(t,function(t){t&&(i.$set(e,t),Cn&&r.prop(e,i[e]))})}}}});var mr={$addControl:c,$removeControl:c,$setValidity:c,$setDirty:c};wn.$inject=["$element","$attrs","$scope"];var On=function(e){return["$timeout",function(t){var r={name:"form",restrict:"E",controller:wn,compile:function(){return{pre:function(e,r,i,s){if(!i.action){var o=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1};Rn(r[0],"submit",o),r.bind("$destroy",function(){t(function(){Un(r[0],"submit",o)},0,!1)})}var u=r.parent().controller("form"),f=i.name||i.ngForm;f&&(e[f]=s),u&&r.bind("$destroy",function(){u.$removeControl(s),f&&(e[f]=n),a(s,mr)})}}}};return e?a(L(r),{restrict:"EAC"}):r}]},gr=On(),yr=On(!0),br=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,wr=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,Er=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Sr={text:Sn,number:function(e,t,r,i,s,o){Sn(e,t,r,i,s,o),i.$parsers.push(function(e){var t=En(e);return t||Er.test(e)?(i.$setValidity("number",!0),e===""?null:t?e:parseFloat(e)):(i.$setValidity("number",!1),n)}),i.$formatters.push(function(e){return En(e)?"":""+e});if(r.min){var u=parseFloat(r.min),e=function(e){return!En(e)&&e<u?(i.$setValidity("min",!1),n):(i.$setValidity("min",!0),e)};i.$parsers.push(e),i.$formatters.push(e)}if(r.max){var a=parseFloat(r.max),r=function(e){return!En(e)&&e>a?(i.$setValidity("max",!1),n):(i.$setValidity("max",!0),e)};i.$parsers.push(r),i.$formatters.push(r)}i.$formatters.push(function(e){return En(e)||y(e)?(i.$setValidity("number",!0),e):(i.$setValidity("number",!1),n)})},url:function(e,t,r,i,s,o){Sn(e,t,r,i,s,o),e=function(e){return En(e)||br.test(e)?(i.$setValidity("url",!0),e):(i.$setValidity("url",!1),n)},i.$formatters.push(e),i.$parsers.push(e)},email:function(e,t,r,i,s,o){Sn(e,t,r,i,s,o),e=function(e){return En(e)||wr.test(e)?(i.$setValidity("email",!0),e):(i.$setValidity("email",!1),n)},i.$formatters.push(e),i.$parsers.push(e)},radio:function(e,t,n,r){d(n.name)&&t.attr("name",u()),t.bind("click",function(){t[0].checked&&e.$apply(function(){r.$setViewValue(n.value)})}),r.$render=function(){t[0].checked=n.value==r.$viewValue},n.$observe("value",r.$render)},checkbox:function(e,t,n,r){var i=n.ngTrueValue,s=n.ngFalseValue;g(i)||(i=!0),g(s)||(s=!1),t.bind("click",function(){e.$apply(function(){r.$setViewValue(t[0].checked)})}),r.$render=function(){t[0].checked=r.$viewValue},r.$formatters.push(function(e){return e===i}),r.$parsers.push(function(e){return e?i:s})},hidden:c,button:c,submit:c,reset:c},xr=["$browser","$sniffer",function(e,t){return{restrict:"E",require:"?ngModel",link:function(n,r,i,s){s&&(Sr[Tn(i.type)]||Sr.text)(n,r,i,s,t,e)}}}],Tr="ng-valid",Nr="ng-invalid",Cr="ng-pristine",kr="ng-dirty",Lr=["$scope","$exceptionHandler","$attrs","$element","$parse",function(e,t,n,i,s){function o(e,t){t=t?"-"+z(t,"-"):"",i.removeClass((e?Nr:Tr)+t).addClass((e?Tr:Nr)+t)}this.$modelValue=this.$viewValue=Number.NaN,this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$name=n.name;var u=s(n.ngModel),a=u.assign;if(!a)throw Error(Yn+n.ngModel+" ("+B(i)+")");this.$render=c;var f=i.inheritedData("$formController")||mr,l=0,h=this.$error={};i.addClass(Cr),o(!0),this.$setValidity=function(e,t){if(h[e]!==!t){if(t){if(h[e]&&l--,!l)o(!0),this.$valid=!0,this.$invalid=!1}else o(!1),this.$invalid=!0,this.$valid=!1,l++;h[e]=!t,o(t,e),f.$setValidity(e,t,this)}},this.$setViewValue=function(n){this.$viewValue=n,this.$pristine&&(this.$dirty=!0,this.$pristine=!1,i.removeClass(Cr).addClass(kr),f.$setDirty()),r(this.$parsers,function(e){n=e(n)}),this.$modelValue!==n&&(this.$modelValue=n,a(e,n),r(this.$viewChangeListeners,function(e){try{e()}catch(n){t(n)}}))};var p=this;e.$watch(function(){var t=u(e);if(p.$modelValue!==t){var n=p.$formatters,r=n.length;for(p.$modelValue=t;r--;)t=n[r](t);p.$viewValue!==t&&(p.$viewValue=t,p.$render())}})}],Ar=function(){return{require:["ngModel","^?form"],controller:Lr,link:function(e,t,n,r){var i=r[0],s=r[1]||mr;s.$addControl(i),t.bind("$destroy",function(){s.$removeControl(i)})}}},Or=p({require:"ngModel",link:function(e,t,n,r){r.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),Mr=function(){return{require:"?ngModel",link:function(e,t,n,r){if(r){n.required=!0;var i=function(e){if(!n.required||!En(e)&&e!==!1)return r.$setValidity("required",!0),e;r.$setValidity("required",!1)};r.$formatters.push(i),r.$parsers.unshift(i),n.$observe("required",function(){i(r.$viewValue)})}}}},_r=function(){return{require:"ngModel",link:function(e,t,i,s){var o=(e=/\/(.*)\//.exec(i.ngList))&&RegExp(e[1])||i.ngList||",";s.$parsers.push(function(e){var t=[];return e&&r(e.split(o),function(e){e&&t.push(x(e))}),t}),s.$formatters.push(function(e){return w(e)?e.join(", "):n})}}},Dr=/^(true|false|\d+)$/,Pr=function(){return{priority:100,compile:function(e,t){return Dr.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(e){n.$set("value",e,!1)})}}}},Hr=bn(function(e,t,r){t.addClass("ng-binding").data("$binding",r.ngBind),e.$watch(r.ngBind,function(e){t.text(e==n?"":e)})}),Br=["$interpolate",function(e){return function(t,n,r){t=e(n.attr(r.$attr.ngBindTemplate)),n.addClass("ng-binding").data("$binding",t),r.$observe("ngBindTemplate",function(e){n.text(e)})}}],jr=[function(){return function(e,t,n){t.addClass("ng-binding").data("$binding",n.ngBindHtmlUnsafe),e.$watch(n.ngBindHtmlUnsafe,function(e){t.html(e||"")})}}],Fr=xn("",!0),Ir=xn("Odd",0),qr=xn("Even",1),Rr=bn({compile:function(e,t){t.$set("ngCloak",n),e.removeClass("ng-cloak")}}),Ur=[function(){return{scope:!0,controller:"@"}}],zr=["$sniffer",function(e){return{priority:1e3,compile:function(){e.csp=!0}}}],Wr={};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(e){var t=Et("ng-"+e);Wr[t]=["$parse",function(n){return function(r,i,s){var o=n(s[t]);i.bind(Tn(e),function(e){r.$apply(function(){o(r,{$event:e})})})}}]});var Xr=bn(function(e,t,n){t.bind("submit",function(){e.$apply(n.ngSubmit)})}),Vr=["$http","$templateCache","$anchorScroll","$compile",function(e,t,n,r){return{restrict:"ECA",terminal:!0,compile:function(i,s){var o=s.ngInclude||s.src,u=s.onload||"",a=s.autoscroll;return function(i,s){var f=0,l,c=function(){l&&(l.$destroy(),l=null),s.html("")};i.$watch(o,function(o){var h=++f;o?e.get(o,{cache:t}).success(function(e){h===f&&(l&&l.$destroy(),l=i.$new(),s.html(e),r(s.contents())(l),v(a)&&(!a||i.$eval(a))&&n(),l.$emit("$includeContentLoaded"),i.$eval(u))}).error(function(){h===f&&c()}):c()})}}}}],$r=bn({compile:function(){return{pre:function(e,t,n){e.$eval(n.ngInit)}}}}),Jr=bn({terminal:!0,priority:1e3}),Kr=["$locale","$interpolate",function(e,t){var n=/{}/g;return{restrict:"EA",link:function(i,s,o){var u=o.count,a=s.attr(o.$attr.when),f=o.offset||0,l=i.$eval(a),c={},h=t.startSymbol(),p=t.endSymbol();r(l,function(e,r){c[r]=t(e.replace(n,h+u+"-"+f+p))}),i.$watch(function(){var t=parseFloat(i.$eval(u));return isNaN(t)?"":(l[t]||(t=e.pluralCat(t-f)),c[t](i,s,!0))},function(e){s.text(e)})}}}],Qr=bn({transclude:"element",priority:1e3,terminal:!0,compile:function(e,t,n){return function(e,t,r){var i=r.ngRepeat,r=i.match(/^\s*(.+)\s+in\s+(.*)\s*$/),s,o,u;if(!r)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+i+"'.");i=r[1],s=r[2],r=i.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!r)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+i+"'.");o=r[3]||r[1],u=r[2];var a=new ht;e.$watch(function(e){var r,i,f=e.$eval(s),l=t,c=new ht,h,p,d,v,m,g;if(w(f))m=f||[];else{m=[];for(d in f)f.hasOwnProperty(d)&&d.charAt(0)!="$"&&m.push(d);m.sort()}h=m.length,r=0;for(i=m.length;r<i;r++)d=f===m?r:m[r],v=f[d],(g=a.shift(v))?(p=g.scope,c.push(v,g),r!==g.index&&(g.index=r,l.after(g.element)),l=g.element):p=e.$new(),p[o]=v,u&&(p[u]=d),p.$index=r,p.$first=r===0,p.$last=r===h-1,p.$middle=!p.$first&&!p.$last,g||n(p,function(e){l.after(e),g={scope:p,element:l=e,index:r},c.push(v,g)});for(d in a)if(a.hasOwnProperty(d))for(m=a[d];m.length;)v=m.pop(),v.element.remove(),v.scope.$destroy();a=c})}}}),Gr=bn(function(e,t,n){e.$watch(n.ngShow,function(e){t.css("display",H(e)?"":"none")})}),Yr=bn(function(e,t,n){e.$watch(n.ngHide,function(e){t.css("display",H(e)?"none":"")})}),Zr=bn(function(e,t,n){e.$watch(n.ngStyle,function(e,n){n&&e!==n&&r(n,function(e,n){t.css(n,"")}),e&&t.css(e)},!0)}),ei=p({restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(e,t,n,r){var i,s,o;e.$watch(n.ngSwitch||n.on,function(u){s&&(o.$destroy(),s.remove(),s=o=null);if(i=r.cases["!"+u]||r.cases["?"])e.$eval(n.change),o=e.$new(),i(o,function(e){s=e,t.append(e)})})}}),ti=bn({transclude:"element",priority:500,require:"^ngSwitch",compile:function(e,t,n){return function(e,r,i,s){s.cases["!"+t.ngSwitchWhen]=n}}}),ni=bn({transclude:"element",priority:500,require:"^ngSwitch",compile:function(e,t,n){return function(e,t,r,i){i.cases["?"]=n}}}),ri=bn({controller:["$transclude","$element",function(e,t){e(function(e){t.append(e)})}]}),ii=["$http","$templateCache","$route","$anchorScroll","$compile","$controller",function(e,t,n,r,i,s){return{restrict:"ECA",terminal:!0,link:function(e,t,o){function u(){var o=n.current&&n.current.locals,u=o&&o.$template;if(u){t.html(u),a&&(a.$destroy(),a=null);var u=i(t.contents()),l=n.current;a=l.scope=e.$new(),l.controller&&(o.$scope=a,o=s(l.controller,o),t.children().data("$ngControllerController",o)),u(a),a.$emit("$viewContentLoaded"),a.$eval(f),r()}else t.html(""),a&&(a.$destroy(),a=null)}var a,f=o.onload||"";e.$on("$routeChangeSuccess",u),u()}}}],si=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,n){n.type=="text/ng-template"&&e.put(n.id,t[0].text)}}}],oi=p({terminal:!0}),ui=["$compile","$parse",function(e,s){var o=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,u={$setViewValue:c};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(e,t,n){var r=this,i={},s=u,o;r.databound=n.ngModel,r.init=function(e,t,n){s=e,o=n},r.addOption=function(t){i[t]=!0,s.$viewValue==t&&(e.val(t),o.parent()&&o.remove())},r.removeOption=function(e){this.hasOption(e)&&(delete i[e],s.$viewValue==e&&this.renderUnknownOption(e))},r.renderUnknownOption=function(t){t="? "+lt(t)+" ?",o.val(t),e.prepend(o),e.val(t),o.prop("selected",!0)},r.hasOption=function(e){return i.hasOwnProperty(e)},t.$on("$destroy",function(){r.renderUnknownOption=c})}],link:function(u,a,f,l){function c(e,t,n,r){n.$render=function(){var e=n.$viewValue;r.hasOption(e)?(T.parent()&&T.remove(),t.val(e),e===""&&E.prop("selected",!0)):d(e)&&E?t.val(""):r.renderUnknownOption(e)},t.bind("change",function(){e.$apply(function(){T.parent()&&T.remove(),n.$setViewValue(t.val())})})}function h(e,t,n){var i;n.$render=function(){var e=new ct(n.$viewValue);r(t.find("option"),function(t){t.selected=v(e.get(t.value))})},e.$watch(function(){O(i,n.$viewValue)||(i=L(n.$viewValue),n.$render())}),t.bind("change",function(){e.$apply(function(){var e=[];r(t.find("option"),function(t){t.selected&&e.push(t.value)}),n.$setViewValue(e)})})}function p(t,r,u){function a(){var e={"":[]},s=[""],o,a,f,g,b;f=u.$modelValue,g=v(t)||[];var E=h?i(g):g,T,N,C;N={},b=!1;var k,L;if(y)b=new ct(f);else if(f===null||w)e[""].push({selected:f===null,id:"",label:""}),b=!0;for(C=0;T=E.length,C<T;C++)N[c]=g[h?N[h]=E[C]:C],o=p(t,N)||"",(a=e[o])||(a=e[o]=[],s.push(o)),y?o=b.remove(d(t,N))!=n:(o=f===d(t,N),b=b||o),k=l(t,N),k=k===n?"":k,a.push({id:h?E[C]:C,label:k,selected:o});!y&&!b&&e[""].unshift({id:"?",label:"",selected:!0}),N=0;for(E=s.length;N<E;N++){o=s[N],a=e[o],m.length<=N?(f={element:x.clone().attr("label",o),label:a.label},g=[f],m.push(g),r.append(f.element)):(g=m[N],f=g[0],f.label!=o)&&f.element.attr("label",f.label=o),k=null,C=0;for(T=a.length;C<T;C++)(o=a[C],b=g[C+1])?(k=b.element,b.label!==o.label&&k.text(b.label=o.label),b.id!==o.id&&k.val(b.id=o.id),b.element.selected!==o.selected&&k.prop("selected",b.selected=o.selected)):(o.id===""&&w?L=w:(L=S.clone()).val(o.id).attr("selected",o.selected).text(o.label),g.push({element:L,label:o.label,id:o.id,selected:o.selected}),k?k.after(L):f.element.append(L),k=L);for(C++;g.length>C;)g.pop().element.remove()}for(;m.length>N;)m.pop()[0].element.remove()}var f;if(!(f=b.match(o)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+b+"'.");var l=s(f[2]||f[1]),c=f[4]||f[6],h=f[5],p=s(f[3]||""),d=s(f[2]?f[1]:c),v=s(f[7]),m=[[{element:r,label:""}]];w&&(e(w)(t),w.removeClass("ng-scope"),w.remove()),r.html(""),r.bind("change",function(){t.$apply(function(){var e,i=v(t)||[],s={},o,a,f,l,p,g;if(y){a=[],l=0;for(g=m.length;l<g;l++){e=m[l],f=1;for(p=e.length;f<p;f++)(o=e[f].element)[0].selected&&(o=o.val(),h&&(s[h]=o),s[c]=i[o],a.push(d(t,s)))}}else o=r.val(),o=="?"?a=n:o==""?a=null:(s[c]=i[o],h&&(s[h]=o),a=d(t,s));u.$setViewValue(a)})}),u.$render=a,t.$watch(a)}if(l[1]){for(var m=l[0],g=l[1],y=f.multiple,b=f.ngOptions,w=!1,E,S=kn(t.createElement("option")),x=kn(t.createElement("optgroup")),T=S.clone(),l=0,N=a.children(),C=N.length;l<C;l++)if(N[l].value==""){E=w=N.eq(l);break}m.init(g,w,T);if(y&&(f.required||f.ngRequired)){var k=function(e){return g.$setValidity("required",!f.required||e&&e.length),e};g.$parsers.push(k),g.$formatters.unshift(k),f.$observe("required",function(){k(g.$viewValue)})}b?p(u,a,g):y?h(u,a,g):c(u,a,g,m)}}}}],ai=["$interpolate",function(e){var t={addOption:c,removeOption:c};return{restrict:"E",priority:100,compile:function(n,r){if(d(r.value)){var i=e(n.text(),!0);i||r.$set("value",n.text())}return function(e,n,r){var s=n.parent(),o=s.data("$selectController")||s.parent().data("$selectController");o&&o.databound?n.prop("selected",!1):o=t,i?e.$watch(i,function(e,t){r.$set("value",e),e!==t&&o.removeOption(t),o.addOption(e)}):o.addOption(r.value),n.bind("$destroy",function(){o.removeOption(r.value)})}}}}],fi=p({restrict:"E",terminal:!0});(Ln=e.jQuery)?(kn=Ln,a(Ln.fn,{scope:Xn.scope,controller:Xn.controller,injector:Xn.injector,inheritedData:Xn.inheritedData}),J("remove",!0),J("empty"),J("html")):kn=K,_n.element=kn,function(t){a(t,{bootstrap:U,copy:L,extend:a,equals:O,element:kn,forEach:r,injector:dt,noop:c,bind:M,toJson:D,fromJson:P,identity:h,isUndefined:d,isDefined:v,isString:g,isFunction:E,isObject:m,isNumber:y,isElement:T,isArray:w,version:jn,isDate:b,lowercase:Tn,uppercase:Nn,callbacks:{counter:0}}),Dn=V(e);try{Dn("ngLocale")}catch(n){Dn("ngLocale",[]).provider("$locale",sn)}Dn("ng",["ngLocale"],["$provide",function(e){e.provider("$compile",wt).directive({a:dr,input:xr,textarea:xr,form:gr,script:si,select:ui,style:fi,option:ai,ngBind:Hr,ngBindHtmlUnsafe:jr,ngBindTemplate:Br,ngClass:Fr,ngClassEven:qr,ngClassOdd:Ir,ngCsp:zr,ngCloak:Rr,ngController:Ur,ngForm:yr,ngHide:Yr,ngInclude:Vr,ngInit:$r,ngNonBindable:Jr,ngPluralize:Kr,ngRepeat:Qr,ngShow:Gr,ngSubmit:Xr,ngStyle:Zr,ngSwitch:ei,ngSwitchWhen:ti,ngSwitchDefault:ni,ngOptions:oi,ngView:ii,ngTransclude:ri,ngModel:Ar,ngList:_r,ngChange:Or,required:Mr,ngRequired:Mr,ngValue:Pr}).directive(vr).directive(Wr),e.provider({$anchorScroll:vt,$browser:gt,$cacheFactory:yt,$controller:St,$document:xt,$exceptionHandler:Tt,$filter:un,$interpolate:Nt,$http:tn,$httpBackend:nn,$location:Bt,$log:jt,$parse:Wt,$route:$t,$routeParams:Jt,$rootScope:Kt,$q:Xt,$sniffer:Qt,$templateCache:bt,$timeout:on,$window:Gt})}])}(_n),kn(t).ready(function(){R(t,U)})}(window,document),angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>'),define("angular",function(e){return function(){var t,n;return t||e.angular}}(this)),function(e,t,n){t.module("ngResource",["ng"]).factory("$resource",["$http","$parse",function(e,r){function i(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(t?null:/%20/g,"+")}function s(e,t){this.template=e+="#",this.defaults=t||{};var n=this.urlParams={};f(e.split(/\W/),function(t){t&&RegExp("(^|[^\\\\]):"+t+"\\W").test(e)&&(n[t]=!0)}),this.template=e.replace(/\\:/g,":")}function o(i,m,g){function b(e,t){var n={},t=l({},m,t);return f(t,function(t,i){var s;t.charAt&&t.charAt(0)=="@"?(s=t.substr(1),s=r(s)(e)):s=t,n[i]=s}),n}function E(e){c(e||{},this)}var S=new s(i),g=l({},u,g);return f(g,function(r,i){r.method=t.uppercase(r.method);var s=r.method=="POST"||r.method=="PUT"||r.method=="PATCH";E[i]=function(t,n,i,o){var u={},d,m=a,g=null;switch(arguments.length){case 4:g=o,m=i;case 3:case 2:if(!h(n)){u=t,d=n,m=i;break}if(h(t)){m=t,g=n;break}m=n,g=i;case 1:h(t)?m=t:s?d=t:u=t;break;case 0:break;default:throw"Expected between 0-4 arguments [params, data, success, error], got "+arguments.length+" arguments."}var y=this instanceof E?this:r.isArray?[]:new E(d);return e({method:r.method,url:S.url(l({},b(d,r.params||{}),u)),data:d}).then(function(e){var t=e.data;t&&(r.isArray?(y.length=0,f(t,function(e){y.push(new E(e))})):c(t,y)),(m||a)(y,e.headers)},g),y},E.prototype["$"+i]=function(e,t,r){var o=b(this),u=a,f;switch(arguments.length){case 3:o=e,u=t,f=r;break;case 2:case 1:h(e)?(u=e,f=t):(o=e,u=t||a);case 0:break;default:throw"Expected between 1-3 arguments [params, success, error], got "+arguments.length+" arguments."}E[i].call(this,o,s?this:n,u,f)}}),E.bind=function(e){return o(i,l({},m,e),g)},E}var u={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},a=t.noop,f=t.forEach,l=t.extend,c=t.copy,h=t.isFunction;return s.prototype={url:function(e){var n=this,r=this.template,s,o,e=e||{};f(this.urlParams,function(u,a){s=e.hasOwnProperty(a)?e[a]:n.defaults[a],t.isDefined(s)&&s!==null?(o=i(s,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),r=r.replace(RegExp(":"+a+"(\\W)","g"),o+"$1")):r=r.replace(RegExp("(/?):"+a+"(\\W)","g"),function(e,t,n){return n.charAt(0)=="/"?n:t+n})});var r=r.replace(/\/?#$/,""),u=[];return f(e,function(e,t){n.urlParams[t]||u.push(i(t)+"="+i(e))}),u.sort(),r=r.replace(/\/*$/,""),r+(u.length?"?"+u.join("&"):"")}},o}])}(window,window.angular),define("angular-resource",["angular"],function(e){return function(){var t,n;return t||e.angular}}(this)),function(){define("cs!apps/urlCacheBreaker",["angular"],function(e){var t;return t=e.module("UrlCacheBreaker",[]),t.filter("randomizeUrl",function(){var t,n;return t=function(){return Math.floor(Math.random()*1000001).toString(16)},n={},function(r){var i,s,o,u,a,f,l;if(r==null)return r;if(e.isObject(r)&&r.reset){if(((f=r.urls)!=null?f.length:void 0)>0){l=r.urls;for(u=0,a=l.length;u<a;u++)s=l[u],n[s]=t()}else n={};return}return r in n||(n[r]=t()),i=n[r],o="?",(r!=null?r.indexOf("?"):void 0)>=0&&(o="&"),r+o+i}}),t})}.call(this),function(){define("cs!apps/pteApp",["angular","angular-resource","cs!apps/urlCacheBreaker"],function(e){var t;return t=e.module("pte",["ngResource","UrlCacheBreaker"]),t})}.call(this),function(){define("cs!settings",[],function(){var e,t;return e=function(e){if(!window[e])throw"PTE_EXCEPTION: Invalid window var: "+e;return window[e]},t={width:e("post_width"),height:e("post_height"),id:e("post_id"),ajaxurl:e("ajaxurl"),i18n:e("pteI18n")}})}.call(this),function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};define("cs!controllers/PteCtrl",["angular","cs!apps/pteApp","cs!settings","cs!jquery"],function(t,n,r,i){return n.controller("PteCtrl",["$scope","$resource","$log","$filter",function(n,s,o,u){var a,f,l,c,h;n.page={crop:!0,view:!1},n.changePage=function(e){var t,r,i,s;n.viewFilterValue=!1,i=n.page,s=[];for(t in i)r=i[t],t===e?s.push(n.page[t]=!0):s.push(n.page[t]=!1);return s},n.pageClass=function(e){if(n.page[e])return"nav-tab-active"},n.thumbnailResource=s(r.ajaxurl,{action:"pte_ajax","pte-action":"get-thumbnail-info"}),n.updateSelected=function(){return n.$broadcast("thumbnail_selected")},n.viewFilterValue=!1,n.view=function(e){typeof event!="undefined"&&event!==null&&typeof event.stopPropagation=="function"&&event.stopPropagation(),n.changePage("view"),n.viewFilterValue=e},n.viewFilterFunc=function(r){var i;if(n.viewFilterValue===!1)return!0;if(t.isString(n.viewFilterValue))return r.name===n.viewFilterValue?!0:!1;if(t.isArray(n.viewFilterValue))if(i=r.name,e.call(n.viewFilterValue,i)>=0)return!0;return n.viewFilterValue?r.proposed!=null:!0},n.save=function(e){var r,i,s,u,a,f;i={"pte-action":"confirm-images","pte-nonce":h["pte-nonce"],id:c},u=[];if(!e){t.forEach(n.thumbnails,function(e){e.proposed&&u.push(e)});if(u.length<1)return}else u.push(e);for(a=0,f=u.length;a<f;a++)e=u[a],s="pte-confirm["+e.name+"]",i[s]=e.proposed.file;o.log(i),r=n.thumbnailResource.get(i,function(){return n.confirmResults(r)})},n.confirmResults=function(e){var t,r,i,s,o,a,l;if(!e.thumbnails){n.setErrorMessage(n.i18n.save_crop_problem);return}i=[],t=[],a=n.thumbnails;for(s=0,o=a.length;s<o;s++)r=a[s],e.thumbnails[r.name]&&(i.push(r.name),r.current=e.thumbnails[r.name].current,t.push(r.current.url),((l=r.proposed)!=null?l.url:void 0)&&t.push(r.proposed.url),n.trash(r));e.immediate?n.view(i):f(),u("randomizeUrl")({reset:!0,urls:t})},n.trash=function(e){return typeof event!="undefined"&&event!==null&&typeof event.stopPropagation=="function"&&event.stopPropagation(),delete e.proposed,e.showProposed=!1,f()},f=function(){var e,t,r,i;i=n.thumbnails;for(t=0,r=i.length;t<r;t++){e=i[t];if(e.proposed)return}return n.viewFilterValue=!1},n.trashAll=function(){return l(),t.forEach(n.thumbnails,function(e){return n.trash(e)})},l=function(){var e;if((typeof h!=="undefined"&&h!==null?h["pte-delete-nonce"]:void 0)==null)return;e=i.ajax(r.ajaxurl,{async:!1,data:{action:"pte_ajax",id:c,"pte-action":"delete-images","pte-nonce":h["pte-delete-nonce"]}})},i(window).unload(function(e){l()}),n.aspectRatios=[],a=function(e){var t,r,i,s,o;t=e.width/e.height;if(t==null||t===Infinity)return;if(!e.crop||+e.crop<1)return;o=n.aspectRatios;for(i=0,s=o.length;i<s;i++){r=o[i];if(r.size===t){r.thumbnails.push(e.name);return}}n.aspectRatios.push({size:t,thumbnails:[e.name]})},c=r.id,c||o.error("No ID Found"),n.i18n=r.i18n,n.infoMessage=null,n.setInfoMessage=function(e){return n.infoMessage=e},n.errorMessage=null,n.setErrorMessage=function(e){return n.errorMessage=e},h=null,n.setNonces=function(e){return h=e},n.thumbnails=[],n.thumbnailObject=n.thumbnailResource.get({id:c},function(){t.forEach(n.thumbnailObject,function(e,t){e.name=t,this.thumbnails.push(e),a(e)},n),n.updateSelected()}),n.anyProposed=function(){var e,t,r,i;i=n.thumbnails;for(t=0,r=i.length;t<r;t++){e=i[t];if(e.proposed!=null)return!0}return!1}}]),n})}.call(this),function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};define("cs!controllers/TableCtrl",["angular","cs!apps/pteApp"],function(t,n){return n.controller("TableCtrl",["$scope",function(n){n.toggleSelected=function(e){e.selected=!e.selected,n.updateSelected()},n.toggleAll=function(){var e,t,r;r=n.thumbnails;for(e in r)t=r[e],t.selected=n.tableSelector;n.updateSelected()},n.selectAspectRatio=function(r){var i;typeof event!="undefined"&&event!==null&&typeof event.stopPropagation=="function"&&event.stopPropagation(),i=null,t.forEach(n.thumbnails,function(t){var n;if(n=t.name,e.call(r.thumbnails,n)>=0)i==null&&(i=t.selected!=null&&t.selected?!1:!0),t.selected=i}),n.updateSelected()}}]),n})}.call(this),function(e){e.Jcrop=function(t,n){function r(e){return Math.round(e)+"px"}function i(e){return H.baseClass+"-"+e}function s(){return e.fx.step.hasOwnProperty("backgroundColor")}function o(t){var n=e(t).offset();return[n.left,n.top]}function u(e){return[e.pageX-B[0],e.pageY-B[1]]}function f(t){typeof t!="object"&&(t={}),H=e.extend(H,t),e.each(["onChange","onSelect","onRelease","onDblClick"],function(e,t){typeof H[t]!="function"&&(H[t]=function(){})})}function l(e,t,n){B=o(W),mt.setCursor(e==="move"?e:e+"-resize");if(e==="move")return mt.activateHandlers(h(t),g,n);var r=pt.getFixed(),i=p(e),s=pt.getCorner(p(i));pt.setPressed(pt.getCorner(i)),pt.setCurrent(s),mt.activateHandlers(c(e,r),g,n)}function c(e,t){return function(n){if(!H.aspectRatio)switch(e){case"e":n[1]=t.y2;break;case"w":n[1]=t.y2;break;case"n":n[0]=t.x2;break;case"s":n[0]=t.x2}else switch(e){case"e":n[1]=t.y+1;break;case"w":n[1]=t.y+1;break;case"n":n[0]=t.x+1;break;case"s":n[0]=t.x+1}pt.setCurrent(n),vt.update()}}function h(e){var t=e;return gt.watchKeys(),function(e){pt.moveOffset([e[0]-t[0],e[1]-t[1]]),t=e,vt.update()}}function p(e){switch(e){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function d(e){return function(t){return H.disabled?!1:e==="move"&&!H.allowMove?!1:(B=o(W),ft=!0,l(e,u(t)),t.stopPropagation(),t.preventDefault(),!1)}}function v(e,t,n){var r=e.width(),i=e.height();r>t&&t>0&&(r=t,i=t/e.width()*e.height()),i>n&&n>0&&(i=n,r=n/e.height()*e.width()),ot=e.width()/r,ut=e.height()/i,e.width(r).height(i)}function m(e){return{x:e.x*ot,y:e.y*ut,x2:e.x2*ot,y2:e.y2*ut,w:e.w*ot,h:e.h*ut}}function g(e){var t=pt.getFixed();t.w>H.minSelect[0]&&t.h>H.minSelect[1]?(vt.enableHandles(),vt.done()):vt.release(),mt.setCursor(H.allowSelect?"crosshair":"default")}function y(e){if(H.disabled)return!1;if(!H.allowSelect)return!1;ft=!0,B=o(W),vt.disableHandles(),mt.setCursor("crosshair");var t=u(e);return pt.setPressed(t),vt.update(),mt.activateHandlers(b,g,e.type.substring(0,5)==="touch"),gt.watchKeys(),e.stopPropagation(),e.preventDefault(),!1}function b(e){pt.setCurrent(e),vt.update()}function w(){var t=e("<div></div>").addClass(i("tracker"));return F&&t.css({opacity:0,backgroundColor:"white"}),t}function E(e){$.removeClass().addClass(i("holder")).addClass(e)}function S(e,t){function n(){window.setTimeout(b,c)}var r=e[0]/ot,i=e[1]/ut,s=e[2]/ot,o=e[3]/ut;if(lt)return;var u=pt.flipCoords(r,i,s,o),a=pt.getFixed(),f=[a.x,a.y,a.x2,a.y2],l=f,c=H.animationDelay,h=u[0]-f[0],p=u[1]-f[1],d=u[2]-f[2],v=u[3]-f[3],m=0,g=H.swingSpeed;r=l[0],i=l[1],s=l[2],o=l[3],vt.animMode(!0);var y,b=function(){return function(){m+=(100-m)/g,l[0]=Math.round(r+m/100*h),l[1]=Math.round(i+m/100*p),l[2]=Math.round(s+m/100*d),l[3]=Math.round(o+m/100*v),m>=99.8&&(m=100),m<100?(T(l),n()):(vt.done(),vt.animMode(!1),typeof t=="function"&&t.call(yt))}}();n()}function x(e){T([e[0]/ot,e[1]/ut,e[2]/ot,e[3]/ut]),H.onSelect.call(yt,m(pt.getFixed())),vt.enableHandles()}function T(e){pt.setPressed([e[0],e[1]]),pt.setCurrent([e[2],e[3]]),vt.update()}function N(){return m(pt.getFixed())}function C(){return pt.getFixed()}function k(e){f(e),P()}function L(){H.disabled=!0,vt.disableHandles(),vt.setCursor("default"),mt.setCursor("default")}function A(){H.disabled=!1,P()}function O(){vt.done(),mt.activateHandlers(null,null)}function M(){$.remove(),R.show(),R.css("visibility","visible"),e(t).removeData("Jcrop")}function _(e,t){vt.release(),L();var n=new Image;n.onload=function(){var r=n.width,i=n.height,s=H.boxWidth,o=H.boxHeight;W.width(r).height(i),W.attr("src",e),J.attr("src",e),v(W,s,o),X=W.width(),V=W.height(),J.width(X).height(V),Z.width(X+Y*2).height(V+Y*2),$.width(X).height(V),dt.resize(X,V),A(),typeof t=="function"&&t.call(yt)},n.src=e}function D(e,t,n){var r=t||H.bgColor;H.bgFade&&s()&&H.fadeTime&&!n?e.animate({backgroundColor:r},{queue:!1,duration:H.fadeTime}):e.css("backgroundColor",r)}function P(e){H.allowResize?e?vt.enableOnly():vt.enableHandles():vt.disableHandles(),mt.setCursor(H.allowSelect?"crosshair":"default"),vt.setCursor(H.allowMove?"move":"default"),H.hasOwnProperty("trueSize")&&(ot=H.trueSize[0]/X,ut=H.trueSize[1]/V),H.hasOwnProperty("setSelect")&&(x(H.setSelect),vt.done(),delete H.setSelect),dt.refresh(),H.bgColor!=et&&(D(H.shade?dt.getShades():$,H.shade?H.shadeColor||H.bgColor:H.bgColor),et=H.bgColor),tt!=H.bgOpacity&&(tt=H.bgOpacity,H.shade?dt.refresh():vt.setBgOpacity(tt)),nt=H.maxSize[0]||0,rt=H.maxSize[1]||0,it=H.minSize[0]||0,st=H.minSize[1]||0,H.hasOwnProperty("outerImage")&&(W.attr("src",H.outerImage),delete H.outerImage),vt.refresh()}var H=e.extend({},e.Jcrop.defaults),B,j=navigator.userAgent.toLowerCase(),F=/msie/.test(j),I=/msie [1-6]\./.test(j);typeof t!="object"&&(t=e(t)[0]),typeof n!="object"&&(n={}),f(n);var q={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},R=e(t),U=!0;if(t.tagName=="IMG"){if(R[0].width!=0&&R[0].height!=0)R.width(R[0].width),R.height(R[0].height);else{var z=new Image;z.src=R[0].src,R.width(z.width),R.height(z.height)}var W=R.clone().removeAttr("id").css(q).show();W.width(R.width()),W.height(R.height()),R.after(W).hide()}else W=R.css(q).show(),U=!1,H.shade===null&&(H.shade=!0);v(W,H.boxWidth,H.boxHeight);var X=W.width(),V=W.height(),$=e("<div />").width(X).height(V).addClass(i("holder")).css({position:"relative",backgroundColor:H.bgColor}).insertAfter(R).append(W);H.addClass&&$.addClass(H.addClass);var J=e("<div />"),K=e("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),Q=e("<div />").width("100%").height("100%").css("zIndex",320),G=e("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var e=pt.getFixed();H.onDblClick.call(yt,e)}).insertBefore(W).append(K,Q);U&&(J=e("<img />").attr("src",W.attr("src")).css(q).width(X).height(V),K.append(J)),I&&G.css({overflowY:"hidden"});var Y=H.boundary,Z=w().width(X+Y*2).height(V+Y*2).css({position:"absolute",top:r(-Y),left:r(-Y),zIndex:290}).mousedown(y),et=H.bgColor,tt=H.bgOpacity,nt,rt,it,st,ot,ut,at=!0,ft,lt,ct;B=o(W);var ht=function(){function e(){var e={},t=["touchstart","touchmove","touchend"],n=document.createElement("div"),r;try{for(r=0;r<t.length;r++){var i=t[r];i="on"+i;var s=i in n;s||(n.setAttribute(i,"return;"),s=typeof n[i]=="function"),e[t[r]]=s}return e.touchstart&&e.touchend&&e.touchmove}catch(o){return!1}}function t(){return H.touchSupport===!0||H.touchSupport===!1?H.touchSupport:e()}return{createDragger:function(e){return function(t){return H.disabled?!1:e==="move"&&!H.allowMove?!1:(B=o(W),ft=!0,l(e,u(ht.cfilter(t)),!0),t.stopPropagation(),t.preventDefault(),!1)}},newSelection:function(e){return y(ht.cfilter(e))},cfilter:function(e){return e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e},isSupported:e,support:t()}}(),pt=function(){function e(e){e=o(e),h=l=e[0],p=c=e[1]}function t(e){e=o(e),d=e[0]-h,v=e[1]-p,h=e[0],p=e[1]}function n(){return[d,v]}function r(e){var t=e[0],n=e[1];0>l+t&&(t-=t+l),0>c+n&&(n-=n+c),V<p+n&&(n+=V-(p+n)),X<h+t&&(t+=X-(h+t)),l+=t,h+=t,c+=n,p+=n}function i(e){var t=s();switch(e){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function s(){if(!H.aspectRatio)return a();var e=H.aspectRatio,t=H.minSize[0]/ot,n=H.maxSize[0]/ot,r=H.maxSize[1]/ut,i=h-l,s=p-c,o=Math.abs(i),d=Math.abs(s),v=o/d,m,g,y,b;return n===0&&(n=X*10),r===0&&(r=V*10),v<e?(g=p,y=d*e,m=i<0?l-y:y+l,m<0?(m=0,b=Math.abs((m-l)/e),g=s<0?c-b:b+c):m>X&&(m=X,b=Math.abs((m-l)/e),g=s<0?c-b:b+c)):(m=h,b=o/e,g=s<0?c-b:c+b,g<0?(g=0,y=Math.abs((g-c)*e),m=i<0?l-y:y+l):g>V&&(g=V,y=Math.abs(g-c)*e,m=i<0?l-y:y+l)),m>l?(m-l<t?m=l+t:m-l>n&&(m=l+n),g>c?g=c+(m-l)/e:g=c-(m-l)/e):m<l&&(l-m<t?m=l-t:l-m>n&&(m=l-n),g>c?g=c+(l-m)/e:g=c-(l-m)/e),m<0?(l-=m,m=0):m>X&&(l-=m-X,m=X),g<0?(c-=g,g=0):g>V&&(c-=g-V,g=V),f(u(l,c,m,g))}function o(e){return e[0]<0&&(e[0]=0),e[1]<0&&(e[1]=0),e[0]>X&&(e[0]=X),e[1]>V&&(e[1]=V),[Math.round(e[0]),Math.round(e[1])]}function u(e,t,n,r){var i=e,s=n,o=t,u=r;return n<e&&(i=n,s=e),r<t&&(o=r,u=t),[i,o,s,u]}function a(){var e=h-l,t=p-c,n;return nt&&Math.abs(e)>nt&&(h=e>0?l+nt:l-nt),rt&&Math.abs(t)>rt&&(p=t>0?c+rt:c-rt),st/ut&&Math.abs(t)<st/ut&&(p=t>0?c+st/ut:c-st/ut),it/ot&&Math.abs(e)<it/ot&&(h=e>0?l+it/ot:l-it/ot),l<0&&(h-=l,l-=l),c<0&&(p-=c,c-=c),h<0&&(l-=h,h-=h),p<0&&(c-=p,p-=p),h>X&&(n=h-X,l-=n,h-=n),p>V&&(n=p-V,c-=n,p-=n),l>X&&(n=l-V,p-=n,c-=n),c>V&&(n=c-V,p-=n,c-=n),f(u(l,c,h,p))}function f(e){return{x:e[0],y:e[1],x2:e[2],y2:e[3],w:e[2]-e[0],h:e[3]-e[1]}}var l=0,c=0,h=0,p=0,d,v;return{flipCoords:u,setPressed:e,setCurrent:t,getOffset:n,moveOffset:r,getCorner:i,getFixed:s}}(),dt=function(){function t(e,t){v.left.css({height:r(t)}),v.right.css({height:r(t)})}function n(){return i(pt.getFixed())}function i(e){v.top.css({left:r(e.x),width:r(e.w),height:r(e.y)}),v.bottom.css({top:r(e.y2),left:r(e.x),width:r(e.w),height:r(V-e.y2)}),v.right.css({left:r(e.x2),width:r(X-e.x2)}),v.left.css({width:r(e.x)})}function s(){return e("<div />").css({position:"absolute",backgroundColor:H.shadeColor||H.bgColor}).appendTo(d)}function o(){p||(p=!0,d.insertBefore(W),n(),vt.setBgOpacity(1,0,1),J.hide(),u(H.shadeColor||H.bgColor,1),vt.isAwake()?l(H.bgOpacity,1):l(1,1))}function u(e,t){D(h(),e,t)}function f(){p&&(d.remove(),J.show(),p=!1,vt.isAwake()?vt.setBgOpacity(H.bgOpacity,1,1):(vt.setBgOpacity(1,1,1),vt.disableHandles()),D($,0,1))}function l(e,t){p&&(H.bgFade&&!t?d.animate({opacity:1-e},{queue:!1,duration:H.fadeTime}):d.css({opacity:1-e}))}function c(){H.shade?o():f(),vt.isAwake()&&l(H.bgOpacity)}function h(){return d.children()}var p=!1,d=e("<div />").css({position:"absolute",zIndex:240,opacity:0}),v={top:s(),left:s().height(V),right:s().height(V),bottom:s()};return{update:n,updateRaw:i,getShades:h,setBgColor:u,enable:o,disable:f,resize:t,refresh:c,opacity:l}}(),vt=function(){function t(t){var n=e("<div />").css({position:"absolute",opacity:H.borderOpacity}).addClass(i(t));return K.append(n),n}function n(t,n){var r=e("<div />").mousedown(d(t)).css({cursor:t+"-resize",position:"absolute",zIndex:n}).addClass("ord-"+t);return ht.support&&r.bind("touchstart.jcrop",ht.createDragger(t)),Q.append(r),r}function s(e){var t=H.handleSize,r=n(e,L++).css({opacity:H.handleOpacity}).addClass(i("handle"));return t&&r.width(t).height(t),r}function o(e){return n(e,L++).addClass("jcrop-dragbar")}function u(e){var t;for(t=0;t<e.length;t++)M[e[t]]=o(e[t])}function f(e){var n,r;for(r=0;r<e.length;r++){switch(e[r]){case"n":n="hline";break;case"s":n="hline bottom";break;case"e":n="vline right";break;case"w":n="vline"}A[e[r]]=t(n)}}function l(e){var t;for(t=0;t<e.length;t++)O[e[t]]=s(e[t])}function c(e,t){H.shade||J.css({top:r(-t),left:r(-e)}),G.css({top:r(t),left:r(e)})}function h(e,t){G.width(Math.round(e)).height(Math.round(t))}function p(){var e=pt.getFixed();pt.setPressed([e.x,e.y]),pt.setCurrent([e.x2,e.y2]),v()}function v(e){if(k)return g(e)}function g(e){var t=pt.getFixed();h(t.w,t.h),c(t.x,t.y),H.shade&&dt.updateRaw(t),k||b(),e?H.onSelect.call(yt,m(t)):H.onChange.call(yt,m(t))}function y(e,t,n){if(!k&&!t)return;H.bgFade&&!n?W.animate({opacity:e},{queue:!1,duration:H.fadeTime}):W.css("opacity",e)}function b(){G.show(),H.shade?dt.opacity(tt):y(tt,!0),k=!0}function E(){T(),G.hide(),H.shade?dt.opacity(1):y(1),k=!1,H.onRelease.call(yt)}function S(){_&&Q.show()}function x(){_=!0;if(H.allowResize)return Q.show(),!0}function T(){_=!1,Q.hide()}function N(e){e?(lt=!0,T()):(lt=!1,x())}function C(){N(!1),p()}var k,L=370,A={},O={},M={},_=!1;H.dragEdges&&e.isArray(H.createDragbars)&&u(H.createDragbars),e.isArray(H.createHandles)&&l(H.createHandles),H.drawBorders&&e.isArray(H.createBorders)&&f(H.createBorders),e(document).bind("touchstart.jcrop-ios",function(t){e(t.currentTarget).hasClass("jcrop-tracker")&&t.stopPropagation()});var D=w().mousedown(d("move")).css({cursor:"move",position:"absolute",zIndex:360});return ht.support&&D.bind("touchstart.jcrop",ht.createDragger("move")),K.append(D),T(),{updateVisible:v,update:g,release:E,refresh:p,isAwake:function(){return k},setCursor:function(e){D.css("cursor",e)},enableHandles:x,enableOnly:function(){_=!0},showHandles:S,disableHandles:T,animMode:N,setBgOpacity:y,done:C}}(),mt=function(){function t(t){Z.css({zIndex:450}),t?e(document).bind("touchmove.jcrop",o).bind("touchend.jcrop",f):p&&e(document).bind("mousemove.jcrop",r).bind("mouseup.jcrop",i)}function n(){Z.css({zIndex:290}),e(document).unbind(".jcrop")}function r(e){return c(u(e)),!1}function i(e){return e.preventDefault(),e.stopPropagation(),ft&&(ft=!1,h(u(e)),vt.isAwake()&&H.onSelect.call(yt,m(pt.getFixed())),n(),c=function(){},h=function(){}),!1}function s(e,n,r){return ft=!0,c=e,h=n,t(r),!1}function o(e){return c(u(ht.cfilter(e))),!1}function f(e){return i(ht.cfilter(e))}function l(e){Z.css("cursor",e)}var c=function(){},h=function(){},p=H.trackDocument;return p||Z.mousemove(r).mouseup(i).mouseout(i),W.before(Z),{activateHandlers:s,setCursor:l}}(),gt=function(){function t(){H.keySupport&&(s.show(),s.focus())}function n(e){s.hide()}function r(e,t,n){H.allowMove&&(pt.moveOffset([t,n]),vt.updateVisible(!0)),e.preventDefault(),e.stopPropagation()}function i(e){if(e.ctrlKey||e.metaKey)return!0;ct=e.shiftKey?!0:!1;var t=ct?10:1;switch(e.keyCode){case 37:r(e,-t,0);break;case 39:r(e,t,0);break;case 38:r(e,0,-t);break;case 40:r(e,0,t);break;case 27:H.allowSelect&&vt.release();break;case 9:return!0}return!1}var s=e('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),o=e("<div />").css({position:"absolute",overflow:"hidden"}).append(s);return H.keySupport&&(s.keydown(i).blur(n),I||!H.fixedSupport?(s.css({position:"absolute",left:"-20px"}),o.append(s).insertBefore(W)):s.insertBefore(W)),{watchKeys:t}}();ht.support&&Z.bind("touchstart.jcrop",ht.newSelection),Q.hide(),P(!0);var yt={setImage:_,animateTo:S,setSelect:x,setOptions:k,tellSelect:N,tellScaled:C,setClass:E,disable:L,enable:A,cancel:O,release:vt.release,destroy:M,focus:gt.watchKeys,getBounds:function(){return[X*ot,V*ut]},getWidgetSize:function(){return[X,V]},getScaleFactor:function(){return[ot,ut]},getOptions:function(){return H},ui:{holder:$,selection:G}};return F&&$.bind("selectstart",function(){return!1}),R.data("Jcrop",yt),yt},e.fn.Jcrop=function(t,n){var r;return this.each(function(){if(e(this).data("Jcrop")){if(t==="api")return e(this).data("Jcrop");e(this).data("Jcrop").setOptions(t)}else this.tagName=="IMG"?e.Jcrop.Loader(this,function(){e(this).css({display:"block",visibility:"hidden"}),r=e.Jcrop(this,t),e.isFunction(n)&&n.call(r)}):(e(this).css({display:"block",visibility:"hidden"}),r=e.Jcrop(this,t),e.isFunction(n)&&n.call(r))}),this},e.Jcrop.Loader=function(t,n,r){function i(){o.complete?(s.unbind(".jcloader"),e.isFunction(n)&&n.call(o)):window.setTimeout(i,50)}var s=e(t),o=s[0];s.bind("load.jcloader",i).bind("error.jcloader",function(t){s.unbind(".jcloader"),e.isFunction(r)&&r.call(o)}),o.complete&&e.isFunction(n)&&(s.unbind(".jcloader"),n.call(o))},e.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}}(jQuery),define("jcrop",function(){}),define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t+=1)e[t](s)}function a(){var e=o;i&&e.length&&(o=[],u(e))}function f(){i||(i=!0,n&&clearInterval(n),a())}function c(e){return i?e(s):o.push(e),c}var e,t,n,r=typeof window!="undefined"&&window.document,i=!r,s=r?document:null,o=[];if(r){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),t=document.createElement("div");try{e=window.frameElement===null}catch(l){}t.doScroll&&e&&window.external&&(n=setInterval(function(){try{t.doScroll(),f()}catch(e){}},30))}document.readyState==="complete"&&f()}return c.version="2.0.1",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),function(){define("cs!jcrop-api",["cs!jquery","cs!settings","jcrop","domReady!"],function(e,t){var n,r;return r=null,n={onChange:function(){var e,t,n,i,s,o,u,a;u=this.getOptions().cropConstraints,i=u[0],n=u[1],e=this.getOptions().bgColor,a=this.tellSelect(),o=a.w,s=a.h,r=this,t=function(t){t!==e&&r.setOptions({bgColor:t})},i&&i>o||n&&n>s?t("red"):t("green")},onRelease:function(){var e,t,n,r,i,s,o;o=this.tellSelect(),n=o.x,i=o.y,t=o.w,e=o.h,r=o.x2,s=o.y2;if(n!==0||i!==0||t!==0||e!==0||r!==0||s!==0)this.setSelect([0,0,0,0,0,0]),this.release()},trueSize:[t.width,t.height]},r=e.Jcrop("#pte-preview",n),r.release(),r})}.call(this),function(){define("cs!controllers/CropCtrl",["cs!apps/pteApp","cs!jcrop-api","cs!jquery","cs!settings"],function(e,t,n,r){return e.controller("CropCtrl",["$scope","$log",function(e,i){e.$watch("pteCropSave",function(t,n){var r,s;if(t===n)return;r={"pte-action":"change-options",pte_crop_save:e.pteCropSave?"true":"false"},i.log(r),s=e.thumbnailResource.get(r,function(){return i.log("Updated options")})}),e.$watch("aspectRatio",function(){var n;n=e.aspectRatio||null,t.setOptions({aspectRatio:n})}),e.$watch("cropConstraints",function(){var n;n=e.cropConstraints||[null,null],t.setOptions({cropConstraints:n})}),e.changeAR=function(){return e.userChanged=!0},e.toggleOptions=function(){e.cropOptions=!e.cropOptions,e.cropOptions||(e.aspectRatio=null,e.userChanged=!1,e.updateSelected())},e.updateSelected=function(){var t,n,i,s,o,u,a,f,l,c,h,p,d,v,m;e.setInfoMessage(null);if(e.userChanged)return;n=null,s=[null,null];try{l=!1,t=null,m=e.thumbnails;for(d=0,v=m.length;d<v;d++){c=m[d],i=c.crop,p=c.width,f=c.height,i=+i,p=+p,f=+f,h=p/f;if(c.selected){u=s[0],o=s[1];if(!u||0<p&&u<p)u=p;if(!o||0<f&&o<f)o=f;s=[u,o],l=!0}i>0&&(t===null?t=h:t>0&&t!==h&&(t=-1));if(c.selected&&i>0){if(n!==null&&n!==h)throw"PTE_EXCEPTION";n=h}}n===null&&l===!1&&(t!==null&&t>0?n=t:n=r.width/r.height)}catch(g){a=g,e.setInfoMessage(e.i18n.crop_problems),n=null}e.aspectRatio=n,e.cropConstraints=s},e.submitCrop=function(){var s,o,u,a,f,l,c,h,p,d;if(e.cropInProgress)return;e.cropInProgress=!0,a=n.map(e.thumbnails,function(e,t){return e.selected?e.name:null});if(a.length===0){e.setErrorMessage(e.i18n.no_t_selected),i.error(e.i18n.no_t_selected),e.cropInProgress=!1;return}d=t.tellSelect(),l=d.x,h=d.y,f=d.w,u=d.h,c=d.x2,p=d.y2;if(l===0&&h===0&&f===0&&u===0&&c===0&&p===0){e.setErrorMessage(e.i18n.no_c_selected),i.error(e.i18n.no_c_selected),e.cropInProgress=!1;return}s={"pte-action":"resize-images",id:r.id,"pte-sizes":a,w:f,h:u,x:l,y:h},e.pteCropSave&&(s.save="true"),o=e.thumbnailResource.get(s,function(){e.cropInProgress=!1;if(o!=null?o.immediate:void 0)return e.confirmResults(o);e.setNonces({"pte-nonce":o["pte-nonce"],"pte-delete-nonce":o["pte-delete-nonce"]}),n.each(e.thumbnails,function(e,t){var n;o.thumbnails[t.name]&&(n={url:o.thumbnails[t.name].url,file:o.thumbnails[t.name].file},t.proposed=n,t.showProposed=!0)}),e.view(!0)})},e.cropText=function(){return e.pteCropSave===!0?e.i18n.cropSave:e.i18n.crop},e.$on("thumbnail_selected",function(t){e.updateSelected()}),e.updateSelected()}]),e})}.call(this),function(){define("cs!controllers/ViewCtrl",["cs!apps/pteApp"],function(e){return e.controller("ViewCtrl",["$scope",function(e){e.orderBy=function(e){var t,n,r;return t=((n=e.current)!=null?n.width:void 0)*((r=e.current)!=null?r.height:void 0),t!=null&&t>0?t:e.width*e.height},e.selectThumb=function(t){t.selected=!0,e.changePage("crop"),e.updateSelected()},e.thumbnailClass=function(e){var t;return t=[],e.proposed!=null?t.push("modified"):t.push("original"),e.selected&&t.push("selected"),t}}]),e})}.call(this),function(){define("cs!csmain",["cs!jquery","angular","cs!apps/pteApp","cs!controllers/PteCtrl","cs!controllers/TableCtrl","cs!controllers/CropCtrl","cs!controllers/ViewCtrl"],function(e,t,n){t.bootstrap(e(".wrap"),[n.name])})}.call(this),require({paths:{angular:"../apps/angular/angular.min","angular-resource":"../apps/angular/angular-resource.min",cs:"../apps/requirejs/cs","coffee-script":"../apps/coffee-script",jcrop:"../apps/jcrop/js/jquery.Jcrop.min",domReady:"../apps/requirejs/domReady"},shim:{angular:{exports:"angular"},"angular-resource":{exports:"angular",deps:["angular"]},jcrop:["cs!jquery"]}},["cs!csmain"]),define("main",function(){});
|
js-build/main.js.gz
CHANGED
Binary file
|
js/controllers/CropCtrl.coffee
CHANGED
@@ -24,6 +24,13 @@ define [
|
|
24 |
aspectRatio: ar
|
25 |
return
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$scope.changeAR = ->
|
28 |
$scope.userChanged = true
|
29 |
|
@@ -64,6 +71,7 @@ define [
|
|
64 |
return
|
65 |
|
66 |
ar = null
|
|
|
67 |
try
|
68 |
selected = false
|
69 |
allCrop = null
|
@@ -76,6 +84,12 @@ define [
|
|
76 |
tmp_ar = width/height
|
77 |
|
78 |
if thumbnail.selected
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
selected = true
|
80 |
|
81 |
# Check if all the thumbnails have the same crop
|
@@ -100,10 +114,10 @@ define [
|
|
100 |
ar = settings.width/settings.height
|
101 |
catch error
|
102 |
$scope.setInfoMessage $scope.i18n.crop_problems
|
103 |
-
|
104 |
-
return
|
105 |
|
106 |
$scope.aspectRatio = ar
|
|
|
107 |
return # end updateSelected
|
108 |
|
109 |
###
|
24 |
aspectRatio: ar
|
25 |
return
|
26 |
|
27 |
+
$scope.$watch 'cropConstraints', ->
|
28 |
+
cropConstraints = $scope.cropConstraints || [null, null]
|
29 |
+
jcrop.setOptions
|
30 |
+
cropConstraints: cropConstraints
|
31 |
+
return
|
32 |
+
|
33 |
+
|
34 |
$scope.changeAR = ->
|
35 |
$scope.userChanged = true
|
36 |
|
71 |
return
|
72 |
|
73 |
ar = null
|
74 |
+
cropConstraints = [null, null]
|
75 |
try
|
76 |
selected = false
|
77 |
allCrop = null
|
84 |
tmp_ar = width/height
|
85 |
|
86 |
if thumbnail.selected
|
87 |
+
[cropW, cropH] = cropConstraints
|
88 |
+
if !cropW or (0 < width and cropW < width)
|
89 |
+
cropW = width
|
90 |
+
if !cropH or (0 < height and cropH < height)
|
91 |
+
cropH = height
|
92 |
+
cropConstraints = [cropW, cropH]
|
93 |
selected = true
|
94 |
|
95 |
# Check if all the thumbnails have the same crop
|
114 |
ar = settings.width/settings.height
|
115 |
catch error
|
116 |
$scope.setInfoMessage $scope.i18n.crop_problems
|
117 |
+
ar = null
|
|
|
118 |
|
119 |
$scope.aspectRatio = ar
|
120 |
+
$scope.cropConstraints = cropConstraints
|
121 |
return # end updateSelected
|
122 |
|
123 |
###
|
js/jcrop-api.coffee
CHANGED
@@ -8,7 +8,26 @@ define [
|
|
8 |
crop_options =
|
9 |
# TODO
|
10 |
# Make the bgColor an option (dropdown, black or transparent)
|
11 |
-
bgColor: '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
onRelease: ->
|
13 |
{x, y, w, h, x2, y2} = this.tellSelect()
|
14 |
if x isnt 0 or
|
@@ -19,8 +38,9 @@ define [
|
|
19 |
y2 isnt 0
|
20 |
this.setSelect [0,0,0,0,0,0]
|
21 |
this.release()
|
22 |
-
|
23 |
return
|
|
|
|
|
24 |
trueSize: [
|
25 |
settings.width
|
26 |
settings.height
|
8 |
crop_options =
|
9 |
# TODO
|
10 |
# Make the bgColor an option (dropdown, black or transparent)
|
11 |
+
#bgColor: 'green' # make it an option?
|
12 |
+
onChange: ->
|
13 |
+
[crop_w, crop_h] = this.getOptions().cropConstraints
|
14 |
+
{bgColor} = this.getOptions()
|
15 |
+
{w, h} = this.tellSelect()
|
16 |
+
#console.log w, h, crop_w, crop_h
|
17 |
+
jcrop = this
|
18 |
+
changeBgColor = (color) ->
|
19 |
+
if color != bgColor
|
20 |
+
jcrop.setOptions
|
21 |
+
bgColor: color
|
22 |
+
return
|
23 |
+
|
24 |
+
if (crop_w and crop_w > w) or (crop_h and crop_h > h)
|
25 |
+
changeBgColor 'red'
|
26 |
+
else
|
27 |
+
changeBgColor 'green'
|
28 |
+
return
|
29 |
+
|
30 |
+
|
31 |
onRelease: ->
|
32 |
{x, y, w, h, x2, y2} = this.tellSelect()
|
33 |
if x isnt 0 or
|
38 |
y2 isnt 0
|
39 |
this.setSelect [0,0,0,0,0,0]
|
40 |
this.release()
|
|
|
41 |
return
|
42 |
+
|
43 |
+
|
44 |
trueSize: [
|
45 |
settings.width
|
46 |
settings.height
|
js/main.js
CHANGED
@@ -5,7 +5,7 @@ require({
|
|
5 |
'cs': '../apps/requirejs/cs',
|
6 |
'coffee-script': '../apps/coffee-script',
|
7 |
'jcrop': '../apps/jcrop/js/jquery.Jcrop.min',
|
8 |
-
'domReady': '../apps/requirejs/domReady'
|
9 |
},
|
10 |
shim: {
|
11 |
'angular': {
|
5 |
'cs': '../apps/requirejs/cs',
|
6 |
'coffee-script': '../apps/coffee-script',
|
7 |
'jcrop': '../apps/jcrop/js/jquery.Jcrop.min',
|
8 |
+
'domReady': '../apps/requirejs/domReady'
|
9 |
},
|
10 |
shim: {
|
11 |
'angular': {
|
js/snippets/admin.coffee
CHANGED
@@ -24,14 +24,14 @@ do (jQuery) ->
|
|
24 |
#
|
25 |
injectPTE = ->
|
26 |
# Find and inject pte-url into size cell...
|
27 |
-
jQuery('.media-item').each (i,elem) ->
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
if imageEdit.open?
|
37 |
imageEdit.oldopen = imageEdit.open
|
@@ -59,7 +59,10 @@ do (jQuery) ->
|
|
59 |
return false
|
60 |
|
61 |
# Add convenience functions to menu
|
62 |
-
$
|
|
|
|
|
|
|
63 |
|
64 |
injectPTE()
|
65 |
|
24 |
#
|
25 |
injectPTE = ->
|
26 |
# Find and inject pte-url into size cell...
|
27 |
+
#jQuery('.media-item').each (i,elem) ->
|
28 |
+
# post_id = elem.id.replace "media-item-",""
|
29 |
+
# $getLink(post_id)
|
30 |
+
# .css
|
31 |
+
# 'font-size': '.8em'
|
32 |
+
# 'margin-left': '5px'
|
33 |
+
# .click(checkExistingThickbox)
|
34 |
+
# .appendTo jQuery 'tr.image-size th.label', elem
|
35 |
|
36 |
if imageEdit.open?
|
37 |
imageEdit.oldopen = imageEdit.open
|
59 |
return false
|
60 |
|
61 |
# Add convenience functions to menu
|
62 |
+
$link = $getLink().click checkExistingThickbox
|
63 |
+
$link.addClass "button-primary"
|
64 |
+
$link.css "margin-top", "10px"
|
65 |
+
$editmenu.append $link
|
66 |
|
67 |
injectPTE()
|
68 |
|
php/functions.php
CHANGED
@@ -131,6 +131,7 @@ function pte_get_alternate_sizes($filter=true){
|
|
131 |
$crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
|
132 |
else // For default sizes set in options
|
133 |
$crop = get_option( "{$s}_crop" );
|
|
|
134 |
$pte_gas[$s] = array(
|
135 |
'width' => $width,
|
136 |
'height' => $height,
|
@@ -194,6 +195,10 @@ function pte_get_image_data( $id, $size, $size_data ){
|
|
194 |
function pte_get_all_alternate_size_information( $id ){
|
195 |
$sizes = pte_get_alternate_sizes();
|
196 |
foreach ( $sizes as $size => &$info ){
|
|
|
|
|
|
|
|
|
197 |
$info['current'] = pte_get_image_data( $id, $size, $info );
|
198 |
}
|
199 |
return $sizes;
|
@@ -400,7 +405,7 @@ function pte_resize_images(){
|
|
400 |
// *** common-info
|
401 |
$dst_x = 0;
|
402 |
$dst_y = 0;
|
403 |
-
$original_file =
|
404 |
$original_size = @getimagesize( $original_file );
|
405 |
$uploads = wp_upload_dir();
|
406 |
$PTE_TMP_DIR = $uploads['basedir'] . DIRECTORY_SEPARATOR . "ptetmp" . DIRECTORY_SEPARATOR;
|
@@ -553,15 +558,15 @@ function pte_confirm_images($immediate = false){
|
|
553 |
}
|
554 |
|
555 |
// Delete/unlink old file
|
556 |
-
if ( isset( $old_file )
|
557 |
-
&& file_exists( $old_file ) )
|
558 |
{
|
559 |
$logger->debug( "Deleting old thumbnail: {$old_file}" );
|
560 |
-
unlink( $old_file );
|
561 |
}
|
562 |
|
563 |
// Move good image
|
564 |
$logger->debug( "Moving '{$good_file}' to '{$new_file}'" );
|
|
|
565 |
rename( $good_file, $new_file );
|
566 |
|
567 |
// Update metadata
|
131 |
$crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
|
132 |
else // For default sizes set in options
|
133 |
$crop = get_option( "{$s}_crop" );
|
134 |
+
|
135 |
$pte_gas[$s] = array(
|
136 |
'width' => $width,
|
137 |
'height' => $height,
|
195 |
function pte_get_all_alternate_size_information( $id ){
|
196 |
$sizes = pte_get_alternate_sizes();
|
197 |
foreach ( $sizes as $size => &$info ){
|
198 |
+
if ( $info['crop'] )
|
199 |
+
$info['crop'] = true;
|
200 |
+
else
|
201 |
+
$info['crop'] = false;
|
202 |
$info['current'] = pte_get_image_data( $id, $size, $info );
|
203 |
}
|
204 |
return $sizes;
|
405 |
// *** common-info
|
406 |
$dst_x = 0;
|
407 |
$dst_y = 0;
|
408 |
+
$original_file = _load_image_to_edit_path( $id );
|
409 |
$original_size = @getimagesize( $original_file );
|
410 |
$uploads = wp_upload_dir();
|
411 |
$PTE_TMP_DIR = $uploads['basedir'] . DIRECTORY_SEPARATOR . "ptetmp" . DIRECTORY_SEPARATOR;
|
558 |
}
|
559 |
|
560 |
// Delete/unlink old file
|
561 |
+
if ( isset( $old_file ) )
|
|
|
562 |
{
|
563 |
$logger->debug( "Deleting old thumbnail: {$old_file}" );
|
564 |
+
@unlink( apply_filters( 'wp_delete_file', $old_file ) );
|
565 |
}
|
566 |
|
567 |
// Move good image
|
568 |
$logger->debug( "Moving '{$good_file}' to '{$new_file}'" );
|
569 |
+
wp_mkdir_p( dirname( $new_file ) );
|
570 |
rename( $good_file, $new_file );
|
571 |
|
572 |
// Update metadata
|
php/log.php
CHANGED
@@ -56,7 +56,7 @@ class PteLogger {
|
|
56 |
|
57 |
private function __construct() {
|
58 |
$this->defaulttype = PteLogMessage::$DEBUG;
|
59 |
-
|
60 |
|
61 |
public static function singleton()
|
62 |
{
|
56 |
|
57 |
private function __construct() {
|
58 |
$this->defaulttype = PteLogMessage::$DEBUG;
|
59 |
+
}
|
60 |
|
61 |
public static function singleton()
|
62 |
{
|
php/options.php
CHANGED
@@ -3,57 +3,63 @@
|
|
3 |
//http://ottopress.com/2009/wordpress-settings-api-tutorial/
|
4 |
function pte_options_init(){
|
5 |
add_filter( 'option_page_capability_pte_options', 'pte_edit_posts_cap' );
|
6 |
-
register_setting( 'pte_options'
|
7 |
-
pte_get_option_name()
|
8 |
-
'pte_options_validate' );
|
9 |
|
10 |
add_settings_section( 'pte_main'
|
11 |
, __('User Options', PTE_DOMAIN)
|
12 |
, 'pte_noop'
|
13 |
, 'pte' );
|
14 |
-
|
15 |
-
add_settings_field( 'pte_debug'
|
16 |
-
__('Debug', PTE_DOMAIN)
|
17 |
-
'pte_debug_display'
|
18 |
-
'pte'
|
19 |
-
'pte_main' );
|
20 |
-
|
21 |
-
add_settings_field( 'pte_crop_save'
|
22 |
-
__('Crop and Save', PTE_DOMAIN)
|
23 |
-
'pte_crop_save_display'
|
24 |
-
'pte'
|
25 |
-
'pte_main' );
|
26 |
-
|
27 |
-
add_settings_field( '
|
28 |
-
__('
|
29 |
-
'
|
30 |
-
'pte'
|
31 |
-
'pte_main' );
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
// Only show for admins...//
|
34 |
if ( current_user_can( 'manage_options' ) ){
|
35 |
-
register_setting( 'pte_options'
|
36 |
-
'pte-site-options'
|
37 |
-
'pte_site_options_validate' );
|
38 |
add_settings_section( 'pte_site'
|
39 |
, __('Site Options', PTE_DOMAIN)
|
40 |
, 'pte_site_options_html'
|
41 |
, 'pte' );
|
42 |
-
add_settings_field( 'pte_sizes'
|
43 |
-
__('Thumbnails', PTE_DOMAIN)
|
44 |
-
'pte_sizes_display'
|
45 |
-
'pte'
|
46 |
-
'pte_site' );
|
47 |
-
add_settings_field( 'pte_jpeg_compression'
|
48 |
-
__('JPEG Compression', PTE_DOMAIN)
|
49 |
-
'pte_jpeg_compression_display'
|
50 |
-
'pte'
|
51 |
-
'pte_site' );
|
52 |
-
add_settings_field( 'pte_cache_buster'
|
53 |
-
__('Cache Buster', PTE_DOMAIN)
|
54 |
-
'pte_cache_buster_display'
|
55 |
-
'pte'
|
56 |
-
'pte_site' );
|
57 |
}
|
58 |
// End Admin only
|
59 |
|
@@ -61,7 +67,7 @@ function pte_options_init(){
|
|
61 |
|
62 |
function pte_options_page(){
|
63 |
/*<code><pre><?php print_r( pte_get_options() ); ?></pre></code>*/
|
64 |
-
|
65 |
<div class="wrap">
|
66 |
<h2><?php _e('Post Thumbnail Editor', PTE_DOMAIN); ?></h2>
|
67 |
<form action="options.php" method="post">
|
@@ -75,7 +81,7 @@ function pte_options_page(){
|
|
75 |
</p>
|
76 |
</form>
|
77 |
</div>
|
78 |
-
|
79 |
}
|
80 |
|
81 |
/*********** Internal to options **************************************/
|
@@ -89,15 +95,15 @@ function pte_site_options_validate( $input ){
|
|
89 |
return pte_get_site_options();
|
90 |
}
|
91 |
$sizes = get_intermediate_image_sizes();
|
92 |
-
|
93 |
$pte_hidden_sizes = array();
|
94 |
|
95 |
foreach ( $sizes as $size ){
|
96 |
// Hidden
|
97 |
if ( is_array( $input['pte_hidden_sizes'] )
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
}
|
102 |
|
103 |
$output = array( 'pte_hidden_sizes' => $pte_hidden_sizes );
|
@@ -130,46 +136,73 @@ function pte_options_validate( $input ){
|
|
130 |
}
|
131 |
$options['pte_debug'] = isset( $input['pte_debug'] );
|
132 |
$options['pte_crop_save'] = isset( $input['pte_crop_save'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
return $options;
|
134 |
}
|
135 |
|
136 |
function pte_debug_display(){
|
137 |
$options = pte_get_user_options();
|
138 |
$option_label = pte_get_option_name();
|
139 |
-
|
140 |
<span><input type="checkbox" name="<?php
|
141 |
-
|
142 |
?>[pte_debug]" <?php
|
143 |
-
|
144 |
?> id="pte_debug"/> <label for="pte_debug"><?php _e( 'Enable debugging', PTE_DOMAIN ); ?></label>
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
</span>
|
151 |
-
|
152 |
}
|
153 |
|
154 |
function pte_crop_save_display(){
|
155 |
$options = pte_get_user_options();
|
156 |
$option_label = pte_get_option_name();
|
157 |
-
|
158 |
<span><input type="checkbox" name="<?php
|
159 |
-
|
160 |
?>[pte_crop_save]" <?php
|
161 |
-
|
162 |
?> id="pte_crop_save"/> <label for="pte_crop_save"><?php _e( 'I know what I\'m doing, bypass the image verification.', PTE_DOMAIN ); ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
</span>
|
164 |
-
|
165 |
}
|
166 |
|
167 |
function pte_reset_display(){
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
}
|
174 |
|
175 |
function pte_gcd($a, $b){
|
@@ -193,11 +226,11 @@ function pte_sizes_display(){
|
|
193 |
$options = pte_get_options();
|
194 |
|
195 |
// Table Header
|
196 |
-
|
197 |
<table><tr><th><?php _e("Post Thumbnail", PTE_DOMAIN); ?></th>
|
198 |
<th><?php _e( "Hidden", PTE_DOMAIN ); ?></th>
|
199 |
</tr>
|
200 |
-
|
201 |
// End table header
|
202 |
|
203 |
$sizes = pte_get_alternate_sizes(false);
|
@@ -208,7 +241,7 @@ function pte_sizes_display(){
|
|
208 |
|
209 |
print( "<tr><td><label for='{$size}'>{$size}</label></td>"
|
210 |
. "<td><input type='checkbox' id='{$size}' name='pte-site-options[pte_hidden_sizes][]'"
|
211 |
-
|
212 |
. "</tr>"
|
213 |
);
|
214 |
}
|
@@ -226,20 +259,20 @@ function pte_jpeg_compression_display(){
|
|
226 |
<?php _e("Set the compression level for resizing jpeg images (0 to 100).", PTE_DOMAIN); ?>
|
227 |
<br/><em><?php _e("No entry defaults to using the 'jpeg_quality' filter or 90", PTE_DOMAIN); ?></em>
|
228 |
</span>
|
229 |
-
|
230 |
}
|
231 |
|
232 |
function pte_cache_buster_display(){
|
233 |
$options = pte_get_site_options();
|
234 |
-
|
235 |
<span><input type="checkbox" name="pte-site-options[pte_cache_buster]" <?php
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
</span>
|
242 |
-
|
243 |
}
|
244 |
|
245 |
// Anonymous Functions that can't be anonymous thanks to
|
3 |
//http://ottopress.com/2009/wordpress-settings-api-tutorial/
|
4 |
function pte_options_init(){
|
5 |
add_filter( 'option_page_capability_pte_options', 'pte_edit_posts_cap' );
|
6 |
+
register_setting( 'pte_options'
|
7 |
+
, pte_get_option_name() // Settings are per user
|
8 |
+
, 'pte_options_validate' );
|
9 |
|
10 |
add_settings_section( 'pte_main'
|
11 |
, __('User Options', PTE_DOMAIN)
|
12 |
, 'pte_noop'
|
13 |
, 'pte' );
|
14 |
+
|
15 |
+
add_settings_field( 'pte_debug'
|
16 |
+
, __('Debug', PTE_DOMAIN)
|
17 |
+
, 'pte_debug_display'
|
18 |
+
, 'pte'
|
19 |
+
, 'pte_main' );
|
20 |
+
|
21 |
+
add_settings_field( 'pte_crop_save'
|
22 |
+
, __('Crop and Save', PTE_DOMAIN)
|
23 |
+
, 'pte_crop_save_display'
|
24 |
+
, 'pte'
|
25 |
+
, 'pte_main' );
|
26 |
+
|
27 |
+
add_settings_field( 'pte_imgedit_max_size'
|
28 |
+
, __('Crop Picture Size', PTE_DOMAIN)
|
29 |
+
, 'pte_imgedit_size_display'
|
30 |
+
, 'pte'
|
31 |
+
, 'pte_main' );
|
32 |
+
|
33 |
+
add_settings_field( 'pte_reset'
|
34 |
+
, __('Reset to defaults', PTE_DOMAIN)
|
35 |
+
, 'pte_reset_display'
|
36 |
+
, 'pte'
|
37 |
+
, 'pte_main' );
|
38 |
|
39 |
// Only show for admins...//
|
40 |
if ( current_user_can( 'manage_options' ) ){
|
41 |
+
register_setting( 'pte_options'
|
42 |
+
, 'pte-site-options' // Settings are site-wide
|
43 |
+
, 'pte_site_options_validate' );
|
44 |
add_settings_section( 'pte_site'
|
45 |
, __('Site Options', PTE_DOMAIN)
|
46 |
, 'pte_site_options_html'
|
47 |
, 'pte' );
|
48 |
+
add_settings_field( 'pte_sizes'
|
49 |
+
, __('Thumbnails', PTE_DOMAIN)
|
50 |
+
, 'pte_sizes_display'
|
51 |
+
, 'pte'
|
52 |
+
, 'pte_site' );
|
53 |
+
add_settings_field( 'pte_jpeg_compression'
|
54 |
+
, __('JPEG Compression', PTE_DOMAIN)
|
55 |
+
, 'pte_jpeg_compression_display'
|
56 |
+
, 'pte'
|
57 |
+
, 'pte_site' );
|
58 |
+
add_settings_field( 'pte_cache_buster'
|
59 |
+
, __('Cache Buster', PTE_DOMAIN)
|
60 |
+
, 'pte_cache_buster_display'
|
61 |
+
, 'pte'
|
62 |
+
, 'pte_site' );
|
63 |
}
|
64 |
// End Admin only
|
65 |
|
67 |
|
68 |
function pte_options_page(){
|
69 |
/*<code><pre><?php print_r( pte_get_options() ); ?></pre></code>*/
|
70 |
+
?>
|
71 |
<div class="wrap">
|
72 |
<h2><?php _e('Post Thumbnail Editor', PTE_DOMAIN); ?></h2>
|
73 |
<form action="options.php" method="post">
|
81 |
</p>
|
82 |
</form>
|
83 |
</div>
|
84 |
+
<?php
|
85 |
}
|
86 |
|
87 |
/*********** Internal to options **************************************/
|
95 |
return pte_get_site_options();
|
96 |
}
|
97 |
$sizes = get_intermediate_image_sizes();
|
98 |
+
|
99 |
$pte_hidden_sizes = array();
|
100 |
|
101 |
foreach ( $sizes as $size ){
|
102 |
// Hidden
|
103 |
if ( is_array( $input['pte_hidden_sizes'] )
|
104 |
+
and in_array( $size, $input['pte_hidden_sizes'] ) ){
|
105 |
+
$pte_hidden_sizes[] = $size;
|
106 |
+
}
|
107 |
}
|
108 |
|
109 |
$output = array( 'pte_hidden_sizes' => $pte_hidden_sizes );
|
136 |
}
|
137 |
$options['pte_debug'] = isset( $input['pte_debug'] );
|
138 |
$options['pte_crop_save'] = isset( $input['pte_crop_save'] );
|
139 |
+
// Check the imgedit_max_size value
|
140 |
+
if ( $input['pte_imgedit_max_size'] != "" ){
|
141 |
+
$tmp_size = (int) preg_replace( "/[\D]/", "", $input['pte_imgedit_max_size'] );
|
142 |
+
if ( $tmp_size < 0 || $tmp_size > 10000 ) {
|
143 |
+
add_settings_error( pte_get_option_name()
|
144 |
+
, 'pte_options_error'
|
145 |
+
, __( "Crop Size must be between 0 and 10000.", PTE_DOMAIN ) );
|
146 |
+
}
|
147 |
+
$options['pte_imgedit_max_size'] = $tmp_size;
|
148 |
+
}
|
149 |
+
else{
|
150 |
+
unset( $options['pte_imgedit_max_size'] );
|
151 |
+
}
|
152 |
return $options;
|
153 |
}
|
154 |
|
155 |
function pte_debug_display(){
|
156 |
$options = pte_get_user_options();
|
157 |
$option_label = pte_get_option_name();
|
158 |
+
?>
|
159 |
<span><input type="checkbox" name="<?php
|
160 |
+
print $option_label;
|
161 |
?>[pte_debug]" <?php
|
162 |
+
if ( $options['pte_debug'] ): print "checked"; endif;
|
163 |
?> id="pte_debug"/> <label for="pte_debug"><?php _e( 'Enable debugging', PTE_DOMAIN ); ?></label>
|
164 |
+
<?php if ( WP_DEBUG ) {
|
165 |
+
print( "<br/><em>" );
|
166 |
+
_e( "WP_DEBUG is currently set to true and will override this setting." );
|
167 |
+
print( "</em>" );
|
168 |
+
}?>
|
169 |
</span>
|
170 |
+
<?php
|
171 |
}
|
172 |
|
173 |
function pte_crop_save_display(){
|
174 |
$options = pte_get_user_options();
|
175 |
$option_label = pte_get_option_name();
|
176 |
+
?>
|
177 |
<span><input type="checkbox" name="<?php
|
178 |
+
print $option_label;
|
179 |
?>[pte_crop_save]" <?php
|
180 |
+
if ( $options['pte_crop_save'] ): print "checked"; endif;
|
181 |
?> id="pte_crop_save"/> <label for="pte_crop_save"><?php _e( 'I know what I\'m doing, bypass the image verification.', PTE_DOMAIN ); ?></label>
|
182 |
+
</span>
|
183 |
+
<?php
|
184 |
+
}
|
185 |
+
|
186 |
+
function pte_imgedit_size_display(){
|
187 |
+
$options = pte_get_user_options();
|
188 |
+
$option_label = pte_get_option_name();
|
189 |
+
?>
|
190 |
+
<span><input class="small-text" type="text"
|
191 |
+
name="<?php print $option_label; ?>[pte_imgedit_max_size]"
|
192 |
+
value="<?php if ( isset( $options['pte_imgedit_max_size'] ) ){ print $options['pte_imgedit_max_size']; }?>"
|
193 |
+
id="pte_imgedit_max_size">
|
194 |
+
<?php _e("Set the max size for the crop image.", PTE_DOMAIN); ?>
|
195 |
+
<br/><em><?php _e("No entry defaults to 600", PTE_DOMAIN); ?></em>
|
196 |
</span>
|
197 |
+
<?php
|
198 |
}
|
199 |
|
200 |
function pte_reset_display(){
|
201 |
+
?>
|
202 |
+
<input class="button-secondary" name="<?php
|
203 |
+
echo( pte_get_option_name() );
|
204 |
+
?>[reset]" type="submit" value="<?php esc_attr_e('Reset User Options', PTE_DOMAIN); ?>" />
|
205 |
+
<?php
|
206 |
}
|
207 |
|
208 |
function pte_gcd($a, $b){
|
226 |
$options = pte_get_options();
|
227 |
|
228 |
// Table Header
|
229 |
+
?>
|
230 |
<table><tr><th><?php _e("Post Thumbnail", PTE_DOMAIN); ?></th>
|
231 |
<th><?php _e( "Hidden", PTE_DOMAIN ); ?></th>
|
232 |
</tr>
|
233 |
+
<?php
|
234 |
// End table header
|
235 |
|
236 |
$sizes = pte_get_alternate_sizes(false);
|
241 |
|
242 |
print( "<tr><td><label for='{$size}'>{$size}</label></td>"
|
243 |
. "<td><input type='checkbox' id='{$size}' name='pte-site-options[pte_hidden_sizes][]'"
|
244 |
+
. " value='{$size}' {$hidden}></td>"
|
245 |
. "</tr>"
|
246 |
);
|
247 |
}
|
259 |
<?php _e("Set the compression level for resizing jpeg images (0 to 100).", PTE_DOMAIN); ?>
|
260 |
<br/><em><?php _e("No entry defaults to using the 'jpeg_quality' filter or 90", PTE_DOMAIN); ?></em>
|
261 |
</span>
|
262 |
+
<?php
|
263 |
}
|
264 |
|
265 |
function pte_cache_buster_display(){
|
266 |
$options = pte_get_site_options();
|
267 |
+
?>
|
268 |
<span><input type="checkbox" name="pte-site-options[pte_cache_buster]" <?php
|
269 |
+
if ( $options['cache_buster'] ): print "checked"; endif;
|
270 |
+
?> id="pte_cache_buster"/>
|
271 |
+
<label for="pte_cache_buster"><?php
|
272 |
+
_e( 'Append timestamp to filename. Useful for solving caching problems.', PTE_DOMAIN );
|
273 |
+
?></label>
|
274 |
</span>
|
275 |
+
<?php
|
276 |
}
|
277 |
|
278 |
// Anonymous Functions that can't be anonymous thanks to
|
php/overwrite_imgedit_preview.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Kind of lame all I really need to do is change the ratio number, but in order to
|
5 |
+
* do that I have to overwrite 3 functions
|
6 |
+
*/
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
/**
|
11 |
+
* From wp-admin/admin-ajax.php
|
12 |
+
*/
|
13 |
+
function pte_wp_ajax_imgedit_preview() {
|
14 |
+
$post_id = intval($_GET['postid']);
|
15 |
+
if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
|
16 |
+
wp_die( -1 );
|
17 |
+
|
18 |
+
check_ajax_referer( "image_editor-$post_id" );
|
19 |
+
|
20 |
+
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
21 |
+
if ( ! pte_stream_preview_image($post_id) )
|
22 |
+
wp_die( -1 );
|
23 |
+
|
24 |
+
wp_die();
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* From wp-admin/includes/image-edit.php
|
29 |
+
*/
|
30 |
+
function pte_stream_preview_image( $post_id ) {
|
31 |
+
$post = get_post( $post_id );
|
32 |
+
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
|
33 |
+
|
34 |
+
$img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );
|
35 |
+
|
36 |
+
if ( is_wp_error( $img ) )
|
37 |
+
return false;
|
38 |
+
|
39 |
+
// scale the image
|
40 |
+
$size = $img->get_size();
|
41 |
+
$w = $size['width'];
|
42 |
+
$h = $size['height'];
|
43 |
+
|
44 |
+
$ratio = pte_image_get_preview_ratio( $w, $h );
|
45 |
+
$w2 = $w * $ratio;
|
46 |
+
$h2 = $h * $ratio;
|
47 |
+
|
48 |
+
if ( is_wp_error( $img->resize( $w2, $h2 ) ) )
|
49 |
+
return false;
|
50 |
+
|
51 |
+
return wp_stream_image( $img, $post->post_mime_type, $post_id );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* From wp-admin/includes/image-edit.php
|
56 |
+
*/
|
57 |
+
function pte_image_get_preview_ratio($w, $h) {
|
58 |
+
$options = pte_get_options();
|
59 |
+
$img_max_size = $options['pte_imgedit_max_size'];
|
60 |
+
$max = max($w, $h);
|
61 |
+
return $max > $img_max_size ? ($img_max_size / $max) : 1;
|
62 |
+
}
|
63 |
+
|
64 |
+
?>
|
post-thumbnail-editor.php
CHANGED
@@ -1,33 +1,32 @@
|
|
1 |
<?php
|
2 |
-
/*
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
*/
|
31 |
|
32 |
/*
|
33 |
* Useful constants
|
@@ -35,30 +34,31 @@
|
|
35 |
define( 'PTE_PLUGINURL', plugins_url(basename( dirname(__FILE__))) . "/");
|
36 |
define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/");
|
37 |
define( 'PTE_DOMAIN', "post-thumbnail-editor");
|
38 |
-
define( 'PTE_VERSION', "2.0
|
39 |
|
40 |
/*
|
41 |
* Option Functionality
|
42 |
*/
|
43 |
function pte_get_option_name(){
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
}
|
50 |
|
51 |
function pte_get_user_options(){
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
62 |
}
|
63 |
|
64 |
function pte_get_site_options(){
|
@@ -66,28 +66,28 @@ function pte_get_site_options(){
|
|
66 |
if ( !is_array( $pte_site_options ) ){
|
67 |
$pte_site_options = array();
|
68 |
}
|
69 |
-
$defaults = array( 'pte_hidden_sizes' => array()
|
70 |
-
'cache_buster' => true
|
71 |
);
|
72 |
return array_merge( $defaults, $pte_site_options );
|
73 |
}
|
74 |
|
75 |
function pte_get_options(){
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
|
81 |
-
|
82 |
|
83 |
-
|
84 |
-
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
|
90 |
-
|
91 |
}
|
92 |
|
93 |
function pte_update_user_options(){
|
@@ -95,20 +95,42 @@ function pte_update_user_options(){
|
|
95 |
$options = pte_get_user_options();
|
96 |
|
97 |
if ( isset( $_REQUEST['pte_crop_save'] )
|
98 |
-
|
99 |
$options['pte_crop_save'] = true;
|
100 |
else
|
101 |
$options['pte_crop_save'] = false;
|
102 |
|
103 |
-
//print_r $options
|
104 |
update_option( pte_get_option_name(), $options );
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
/*
|
108 |
* Put Hooks and immediate hook functions in this file
|
109 |
*/
|
110 |
|
|
|
111 |
/* Hook into the Edit Image page */
|
|
|
|
|
|
|
|
|
|
|
112 |
function pte_admin_media_scripts($post_type){
|
113 |
$options = pte_get_options();
|
114 |
wp_enqueue_script( 'pte'
|
@@ -123,33 +145,36 @@ function pte_admin_media_scripts($post_type){
|
|
123 |
)
|
124 |
);
|
125 |
if ($post_type == "attachment") {
|
126 |
-
add_action(
|
127 |
}
|
128 |
else {
|
129 |
add_action( 'admin_print_footer_scripts', 'pte_enable_media_js', 100);
|
130 |
}
|
131 |
}
|
132 |
-
// Add the PTE link to the featured image in the post screen
|
133 |
-
// Called in wp-admin/includes/post.php
|
134 |
-
add_filter( 'admin_post_thumbnail_html', 'pte_admin_post_thumbnail_html', 10, 2 );
|
135 |
|
136 |
function pte_enable_admin_js(){
|
137 |
-
|
138 |
}
|
139 |
|
140 |
function pte_enable_media_js(){
|
141 |
-
|
142 |
}
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
-
function pte_url( $id ){
|
146 |
-
$pte_url = admin_url('upload.php')
|
147 |
-
. "?page=pte-edit&pte-id="
|
148 |
-
. $id;
|
149 |
|
150 |
-
return $pte_url;
|
151 |
-
}
|
152 |
|
|
|
|
|
|
|
153 |
|
154 |
function pte_admin_post_thumbnail_html( $content, $post_id ){
|
155 |
$thumbnail_id = get_post_thumbnail_id( $post_id );
|
@@ -164,73 +189,70 @@ function pte_admin_post_thumbnail_html( $content, $post_id ){
|
|
164 |
}
|
165 |
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
//$options = json_encode( pte_get_options() );
|
170 |
-
echo <<<EOT
|
171 |
-
<script type="text/coffeescript">
|
172 |
-
$coffee
|
173 |
-
</script>
|
174 |
-
EOT;
|
175 |
-
}
|
176 |
-
|
177 |
-
// Base url/function. All pte interactions go through here
|
178 |
function pte_ajax(){
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
}
|
208 |
|
|
|
|
|
|
|
209 |
function pte_media_row_actions($actions, $post, $detached){
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
$pte_url = pte_url( $post->ID );
|
217 |
-
|
218 |
-
$actions['pte'] = "<a href='${pte_url}' title='"
|
219 |
-
. __( 'Edit Thumbnails', PTE_DOMAIN )
|
220 |
-
. "'>" . __( 'Thumbnails', PTE_DOMAIN ) . "</a>";
|
221 |
-
return $actions;
|
222 |
-
}
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
227 |
}
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
233 |
|
|
|
|
|
|
|
234 |
/**
|
235 |
* These pages are linked into the hook system of wordpress, this means
|
236 |
* that almost any wp_admin page will work as long as you append "?page=pte"
|
@@ -246,52 +268,33 @@ function pte_edit_page(){
|
|
246 |
* code is in admin-header.php.
|
247 |
*/
|
248 |
function pte_admin_menu(){
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
'pte_edit_page'
|
263 |
-
);
|
264 |
-
//print( "HOOK: $hook" );
|
265 |
}
|
266 |
|
267 |
-
function
|
268 |
-
|
269 |
-
|
270 |
}
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
function pte_edit_form_hook_redirect(){
|
278 |
-
add_action('add_meta_boxes', 'pte_admin_media_scripts');
|
279 |
}
|
280 |
|
281 |
-
/* Adds the Thumbnail option to the media library list */
|
282 |
-
add_filter('media_row_actions', 'pte_media_row_actions', 10, 3); // priority: 10, args: 3
|
283 |
-
|
284 |
-
/* For all purpose needs */
|
285 |
-
add_action('wp_ajax_pte_ajax', 'pte_ajax');
|
286 |
-
|
287 |
-
/* Add SubMenus/Pages */
|
288 |
-
add_action( 'admin_menu', 'pte_admin_menu' );
|
289 |
-
/* Add Settings Page */
|
290 |
-
add_action( 'load-settings_page_pte', 'pte_options' );
|
291 |
-
/* Add Settings Page -> Submit/Update options */
|
292 |
-
add_action( 'load-options.php', 'pte_options' );
|
293 |
-
//add_action( 'admin_init', 'pte_options' );
|
294 |
-
|
295 |
/* Admin Edit Page: setup*/
|
296 |
/**
|
297 |
* This hook (load-media_page_pte-edit)
|
@@ -302,34 +305,35 @@ add_action( 'load-options.php', 'pte_options' );
|
|
302 |
*/
|
303 |
add_action( 'load-media_page_pte-edit', 'pte_edit_setup' );
|
304 |
function pte_edit_setup() {
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
// Enqueue Scripts
|
315 |
-
// Would do jquery here, but looks to be default enqueued out of the box
|
316 |
-
wp_localize_script( 'jquery', // Called on every admin page :)
|
317 |
-
'pteI18n',
|
318 |
-
array( 'no_t_selected' => __( 'No thumbnails selected', PTE_DOMAIN )
|
319 |
-
, 'no_c_selected' => __( 'No crop selected', PTE_DOMAIN )
|
320 |
-
, 'crop_problems' => __( 'Cropping will likely result in skewed imagery', PTE_DOMAIN )
|
321 |
-
, 'save_crop_problem' => __( 'There was a problem saving the crop...', PTE_DOMAIN )
|
322 |
-
, 'cropSave' => __( 'Crop and Save', PTE_DOMAIN )
|
323 |
-
, 'crop' => __( 'Crop', PTE_DOMAIN )
|
324 |
-
)
|
325 |
-
);
|
326 |
}
|
327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
/** End Settings Hooks **/
|
329 |
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
|
334 |
|
335 |
/** Test Settings **/
|
1 |
<?php
|
2 |
+
/*
|
3 |
+
Plugin name: Post Thumbnail Editor
|
4 |
+
Plugin URI: http://wordpress.org/extend/plugins/post-thumbnail-editor/
|
5 |
+
Author: sewpafly
|
6 |
+
Author URI: http://sewpafly.github.io/post-thumbnail-editor
|
7 |
+
Version: 2.1.0
|
8 |
+
Description: Individually manage your post thumbnails
|
9 |
+
|
10 |
+
LICENSE
|
11 |
+
=======
|
12 |
+
|
13 |
+
Copyright 2013 (email : sewpafly@gmail.com)
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 2 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
28 |
+
|
29 |
+
*/
|
|
|
30 |
|
31 |
/*
|
32 |
* Useful constants
|
34 |
define( 'PTE_PLUGINURL', plugins_url(basename( dirname(__FILE__))) . "/");
|
35 |
define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/");
|
36 |
define( 'PTE_DOMAIN', "post-thumbnail-editor");
|
37 |
+
define( 'PTE_VERSION', "2.1.0");
|
38 |
|
39 |
/*
|
40 |
* Option Functionality
|
41 |
*/
|
42 |
function pte_get_option_name(){
|
43 |
+
global $current_user;
|
44 |
+
if ( ! isset( $current_user ) ){
|
45 |
+
get_currentuserinfo();
|
46 |
+
}
|
47 |
+
return "pte-option-{$current_user->ID}";
|
48 |
}
|
49 |
|
50 |
function pte_get_user_options(){
|
51 |
+
$pte_options = get_option( pte_get_option_name() );
|
52 |
+
if ( !is_array( $pte_options ) ){
|
53 |
+
$pte_options = array();
|
54 |
+
}
|
55 |
+
$defaults = array( 'pte_debug' => false
|
56 |
+
, 'pte_crop_save' => false
|
57 |
+
, 'pte_imgedit_max_size' => 600
|
58 |
+
);
|
59 |
+
|
60 |
+
// WORDPRESS DEBUG overrides user setting...
|
61 |
+
return array_merge( $defaults, $pte_options );
|
62 |
}
|
63 |
|
64 |
function pte_get_site_options(){
|
66 |
if ( !is_array( $pte_site_options ) ){
|
67 |
$pte_site_options = array();
|
68 |
}
|
69 |
+
$defaults = array( 'pte_hidden_sizes' => array()
|
70 |
+
, 'cache_buster' => true
|
71 |
);
|
72 |
return array_merge( $defaults, $pte_site_options );
|
73 |
}
|
74 |
|
75 |
function pte_get_options(){
|
76 |
+
global $pte_options, $current_user;
|
77 |
+
if ( isset( $pte_options ) ){
|
78 |
+
return $pte_options;
|
79 |
+
}
|
80 |
|
81 |
+
$pte_options = array_merge( pte_get_user_options(), pte_get_site_options() );
|
82 |
|
83 |
+
if ( WP_DEBUG )
|
84 |
+
$pte_options['pte_debug'] = true;
|
85 |
|
86 |
+
if ( !isset( $pte_options['pte_jpeg_compression'] ) ){
|
87 |
+
$pte_options['pte_jpeg_compression'] = apply_filters( 'jpeg_quality', 90, 'pte_options' );
|
88 |
+
}
|
89 |
|
90 |
+
return $pte_options;
|
91 |
}
|
92 |
|
93 |
function pte_update_user_options(){
|
95 |
$options = pte_get_user_options();
|
96 |
|
97 |
if ( isset( $_REQUEST['pte_crop_save'] )
|
98 |
+
&& strtolower( $_REQUEST['pte_crop_save'] ) === "true" )
|
99 |
$options['pte_crop_save'] = true;
|
100 |
else
|
101 |
$options['pte_crop_save'] = false;
|
102 |
|
|
|
103 |
update_option( pte_get_option_name(), $options );
|
104 |
}
|
105 |
|
106 |
+
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Get the URL for the PTE interface
|
110 |
+
*
|
111 |
+
* @param $id the post id of the attachment to modify
|
112 |
+
*/
|
113 |
+
function pte_url( $id ){
|
114 |
+
$pte_url = admin_url('upload.php')
|
115 |
+
. "?page=pte-edit&pte-id="
|
116 |
+
. $id;
|
117 |
+
|
118 |
+
return $pte_url;
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
/*
|
124 |
* Put Hooks and immediate hook functions in this file
|
125 |
*/
|
126 |
|
127 |
+
/** For the "Edit Image" stuff **/
|
128 |
/* Hook into the Edit Image page */
|
129 |
+
add_action('dbx_post_advanced', 'pte_edit_form_hook_redirect');
|
130 |
+
/* Slight redirect so this isn't called on all versions of the media upload page */
|
131 |
+
function pte_edit_form_hook_redirect(){
|
132 |
+
add_action('add_meta_boxes', 'pte_admin_media_scripts');
|
133 |
+
}
|
134 |
function pte_admin_media_scripts($post_type){
|
135 |
$options = pte_get_options();
|
136 |
wp_enqueue_script( 'pte'
|
145 |
)
|
146 |
);
|
147 |
if ($post_type == "attachment") {
|
148 |
+
add_action( 'admin_print_footer_scripts', 'pte_enable_admin_js', 100);
|
149 |
}
|
150 |
else {
|
151 |
add_action( 'admin_print_footer_scripts', 'pte_enable_media_js', 100);
|
152 |
}
|
153 |
}
|
|
|
|
|
|
|
154 |
|
155 |
function pte_enable_admin_js(){
|
156 |
+
injectCoffeeScript( PTE_PLUGINPATH . "js/snippets/admin.coffee" );
|
157 |
}
|
158 |
|
159 |
function pte_enable_media_js(){
|
160 |
+
injectCoffeeScript( PTE_PLUGINPATH . "js/snippets/media.coffee" );
|
161 |
}
|
162 |
|
163 |
+
function injectCoffeeScript($coffeeFile){
|
164 |
+
$coffee = @file_get_contents( $coffeeFile );
|
165 |
+
//$options = json_encode( pte_get_options() );
|
166 |
+
echo <<<EOT
|
167 |
+
<script type="text/coffeescript">
|
168 |
+
$coffee
|
169 |
+
</script>
|
170 |
+
EOT;
|
171 |
+
}
|
172 |
|
|
|
|
|
|
|
|
|
173 |
|
|
|
|
|
174 |
|
175 |
+
// Add the PTE link to the featured image in the post screen
|
176 |
+
// Called in wp-admin/includes/post.php
|
177 |
+
add_filter( 'admin_post_thumbnail_html', 'pte_admin_post_thumbnail_html', 10, 2 );
|
178 |
|
179 |
function pte_admin_post_thumbnail_html( $content, $post_id ){
|
180 |
$thumbnail_id = get_post_thumbnail_id( $post_id );
|
189 |
}
|
190 |
|
191 |
|
192 |
+
/* For all purpose needs */
|
193 |
+
add_action('wp_ajax_pte_ajax', 'pte_ajax');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
function pte_ajax(){
|
195 |
+
// Move all adjuntant functions to a separate file and include that here
|
196 |
+
require_once(PTE_PLUGINPATH . 'php/functions.php');
|
197 |
+
$logger = PteLogger::singleton();
|
198 |
+
$logger->debug( "PARAMETERS: " . print_r( $_REQUEST, true ) );
|
199 |
+
|
200 |
+
switch ($_GET['pte-action'])
|
201 |
+
{
|
202 |
+
case "test":
|
203 |
+
pte_test();
|
204 |
+
break;
|
205 |
+
case "resize-images":
|
206 |
+
pte_resize_images();
|
207 |
+
break;
|
208 |
+
case "confirm-images":
|
209 |
+
pte_confirm_images();
|
210 |
+
break;
|
211 |
+
case "delete-images":
|
212 |
+
pte_delete_images();
|
213 |
+
break;
|
214 |
+
case "get-thumbnail-info":
|
215 |
+
$id = pte_check_id((int) $_GET['id']);
|
216 |
+
print( json_encode( pte_get_all_alternate_size_information( $id ) ) );
|
217 |
+
break;
|
218 |
+
case "change-options":
|
219 |
+
pte_update_user_options();
|
220 |
+
break;
|
221 |
+
}
|
222 |
+
die();
|
223 |
}
|
224 |
|
225 |
+
/* Adds the Thumbnail option to the media library list */
|
226 |
+
add_filter('media_row_actions', 'pte_media_row_actions', 10, 3); // priority: 10, args: 3
|
227 |
+
|
228 |
function pte_media_row_actions($actions, $post, $detached){
|
229 |
+
// Add capability check
|
230 |
+
if ( !current_user_can( 'edit_post', $post->ID ) ){
|
231 |
+
return $actions;
|
232 |
+
}
|
233 |
+
$options = pte_get_options();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
|
235 |
+
$pte_url = pte_url( $post->ID );
|
236 |
+
|
237 |
+
$actions['pte'] = "<a href='${pte_url}' title='"
|
238 |
+
. __( 'Edit Thumbnails', PTE_DOMAIN )
|
239 |
+
. "'>" . __( 'Thumbnails', PTE_DOMAIN ) . "</a>";
|
240 |
+
return $actions;
|
241 |
}
|
242 |
+
|
243 |
+
|
244 |
+
/* Add Settings Page */
|
245 |
+
add_action( 'load-settings_page_pte', 'pte_options' );
|
246 |
+
/* Add Settings Page -> Submit/Update options */
|
247 |
+
add_action( 'load-options.php', 'pte_options' );
|
248 |
+
function pte_options(){
|
249 |
+
require_once( PTE_PLUGINPATH . 'php/options.php' );
|
250 |
+
pte_options_init();
|
251 |
}
|
252 |
|
253 |
+
/* Add SubMenus/Pages */
|
254 |
+
add_action( 'admin_menu', 'pte_admin_menu' );
|
255 |
+
|
256 |
/**
|
257 |
* These pages are linked into the hook system of wordpress, this means
|
258 |
* that almost any wp_admin page will work as long as you append "?page=pte"
|
268 |
* code is in admin-header.php.
|
269 |
*/
|
270 |
function pte_admin_menu(){
|
271 |
+
add_options_page( __('Post Thumbnail Editor', PTE_DOMAIN) . "-title",
|
272 |
+
__('Post Thumbnail Editor', PTE_DOMAIN),
|
273 |
+
'edit_posts',
|
274 |
+
'pte',
|
275 |
+
'pte_launch_options_page'
|
276 |
+
);
|
277 |
+
// The submenu page function does not put a menu item in the wordpress sidebar.
|
278 |
+
add_submenu_page(NULL, __('Post Thumbnail Editor', PTE_DOMAIN),
|
279 |
+
__('Post Thumbnail Editor', PTE_DOMAIN),
|
280 |
+
'edit_posts',
|
281 |
+
'pte-edit',
|
282 |
+
'pte_edit_page'
|
283 |
+
);
|
|
|
|
|
|
|
284 |
}
|
285 |
|
286 |
+
function pte_launch_options_page(){
|
287 |
+
require_once( PTE_PLUGINPATH . 'php/options.php' );
|
288 |
+
pte_options_page();
|
289 |
}
|
290 |
|
291 |
+
function pte_edit_page(){
|
292 |
+
// This is set via the pte_edit_setup function
|
293 |
+
global $post;
|
294 |
+
include_once( PTE_PLUGINPATH . "php/functions.php" );
|
295 |
+
pte_launch( PTE_PLUGINPATH . "html/pte.php", $post->ID );
|
|
|
|
|
296 |
}
|
297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
/* Admin Edit Page: setup*/
|
299 |
/**
|
300 |
* This hook (load-media_page_pte-edit)
|
305 |
*/
|
306 |
add_action( 'load-media_page_pte-edit', 'pte_edit_setup' );
|
307 |
function pte_edit_setup() {
|
308 |
+
global $post, $title;
|
309 |
+
$post_id = (int) $_GET['pte-id'];
|
310 |
+
if ( !isset( $post_id ) || !is_int( $post_id ) || !wp_attachment_is_image( $post_id ) ){
|
311 |
+
//die("POST: $post_id IS_INT:" . is_int( $post_id ) . " ATTACHMENT: " . wp_attachment_is_image( $post_id ));
|
312 |
+
wp_redirect( admin_url( "upload.php" ) );
|
313 |
+
exit();
|
314 |
+
}
|
315 |
+
$post = get_post( $post_id );
|
316 |
+
$title = __( "Post Thumbnail Editor", PTE_DOMAIN );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
}
|
318 |
|
319 |
+
/**
|
320 |
+
* This code creates the image used for the crop
|
321 |
+
*
|
322 |
+
* By overwriting the wordpress code (same functions), we can change the default size
|
323 |
+
* to our own option.
|
324 |
+
*/
|
325 |
+
add_action('wp_ajax_pte_imgedit_preview','pte_wp_ajax_imgedit_preview_wrapper');
|
326 |
+
function pte_wp_ajax_imgedit_preview_wrapper(){
|
327 |
+
require_once( PTE_PLUGINPATH . "php/overwrite_imgedit_preview.php" );
|
328 |
+
pte_wp_ajax_imgedit_preview();
|
329 |
+
}
|
330 |
+
|
331 |
+
|
332 |
/** End Settings Hooks **/
|
333 |
|
334 |
+
load_plugin_textdomain( PTE_DOMAIN
|
335 |
+
, false
|
336 |
+
, basename( PTE_PLUGINPATH ) . DIRECTORY_SEPARATOR . "i18n" );
|
337 |
|
338 |
|
339 |
/** Test Settings **/
|